Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
  int N,S=0;
  int A[30],B[30],C[30];
  scanf("%d",&N);
  for(int i=1;i<=N;i++)
    scanf("%d",A+i);
  for(int i=1;i<=N;i++)
    scanf("%d",B+i);
  for(int i=1;i<=N;i++)
    scanf("%d",C+i);
  for(int i=1;i<=N;i++)
    S+=B[A[i]];
  for(int i=1;i<N;i++)
    if(A[i]+1==A[i+1])
      S+=C[A[i]];
  printf("%d\n",S);
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$408, %rsp
	.cfi_def_cfa_offset 448
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rbx
	movq	%rbx, %r13
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L5
	leaq	148(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	276(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L6
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	(%rbx), %rdx
	addq	$4, %rbx
	addl	144(%rsp,%rdx,4), %r8d
	cmpq	%rbx, %rcx
	jne	.L8
.L11:
	cmpl	$1, %eax
	jle	.L7
	subl	$2, %eax
	movl	20(%rsp), %ecx
	leaq	24(%rsp), %rdx
	leaq	28(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L10:
	leal	1(%rcx), %esi
	movslq	%ecx, %rax
	movl	(%rdx), %ecx
	cmpl	%ecx, %esi
	jne	.L9
	addl	272(%rsp,%rax,4), %r8d
.L9:
	addq	$4, %rdx
	cmpq	%rdx, %rdi
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$408, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movl	12(%rsp), %eax
.L5:
	xorl	%r8d, %r8d
	jmp	.L11
.L13:
	xorl	%r8d, %r8d
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$408, %rsp
	.cfi_def_cfa_offset 448
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rbx
	movq	%rbx, %r13
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L5
	leaq	148(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	276(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L6
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	(%rbx), %rdx
	addq	$4, %rbx
	addl	144(%rsp,%rdx,4), %r8d
	cmpq	%rbx, %rcx
	jne	.L8
.L11:
	cmpl	$1, %eax
	jle	.L7
	subl	$2, %eax
	movl	20(%rsp), %ecx
	leaq	24(%rsp), %rdx
	leaq	28(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L10:
	leal	1(%rcx), %esi
	movslq	%ecx, %rax
	movl	(%rdx), %ecx
	cmpl	%ecx, %esi
	jne	.L9
	addl	272(%rsp,%rax,4), %r8d
.L9:
	addq	$4, %rdx
	cmpq	%rdx, %rdi
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$408, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movl	12(%rsp), %eax
.L5:
	xorl	%r8d, %r8d
	jmp	.L11
.L13:
	xorl	%r8d, %r8d
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$408, %rsp
	.cfi_def_cfa_offset 448
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rbx
	movq	%rbx, %r13
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L5
	leaq	148(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	276(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L6
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	(%rbx), %rdx
	addq	$4, %rbx
	addl	144(%rsp,%rdx,4), %r8d
	cmpq	%rbx, %rcx
	jne	.L8
.L11:
	cmpl	$1, %eax
	jle	.L7
	subl	$2, %eax
	movl	20(%rsp), %ecx
	leaq	24(%rsp), %rdx
	leaq	28(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L10:
	leal	1(%rcx), %esi
	movslq	%ecx, %rax
	movl	(%rdx), %ecx
	cmpl	%ecx, %esi
	jne	.L9
	addl	272(%rsp,%rax,4), %r8d
.L9:
	addq	$4, %rdx
	cmpq	%rdx, %rdi
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$408, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movl	12(%rsp), %eax
.L5:
	xorl	%r8d, %r8d
	jmp	.L11
.L13:
	xorl	%r8d, %r8d
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include <stdio.h>

int main(){
  int N,S=0;
  int A[30],B[30],C[30];
  scanf("%d",&N);
  for(int i=1;i<=N;i++)
    scanf("%d",A+i);
  for(int i=1;i<=N;i++)
    scanf("%d",B+i);
  for(int i=1;i<=N;i++)
    scanf("%d",C+i);
  for(int i=1;i<=N;i++)
    S+=B[A[i]];
  for(int i=1;i<N;i++)
    if(A[i]+1==A[i+1])
      S+=C[A[i]];
  printf("%d\n",S);
  return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
  int N,S=0;
  int A[30],B[30],C[30];
  scanf("%d",&N);
  for(int i=1;i<=N;i++)
    scanf("%d",A+i);
  for(int i=1;i<=N;i++)
    scanf("%d",B+i);
  for(int i=1;i<=N;i++)
    scanf("%d",C+i);
  for(int i=1;i<=N;i++)
    S+=B[A[i]];
  for(int i=1;i<N;i++)
    if(A[i]+1==A[i+1])
      S+=C[A[i]];
  printf("%d\n",S);
  return 0;
}
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

2
1 0
50 50
50
 4
2 3 4 1
13 5 1 24
45 9 15
 4
2 3 4 1
13 5 1 24
45 9 16
 4
2 3 4 1
14 5 1 24
45 9 16
 4
2 3 4 1
7 5 1 24
45 9 16
 3
3 1 2
2 5 3
3 6
 4
2 3 4 1
20 5 1 24
45 9 16
 3
3 1 2
2 1 3
3 6
 4
2 3 4 1
14 5 1 24
4 6 16
 4
2 3 4 1
7 5 1 24
45 9 8

114
 67
 68
 69
 62
 13
 75
 9
 66
 54

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
  int N,S=0;
  int A[30],B[30],C[30];
  scanf("%d",&N);
  for(int i=1;i<=N;i++)
    scanf("%d",A+i);
  for(int i=1;i<=N;i++)
    scanf("%d",B+i);
  for(int i=1;i<=N;i++)
    scanf("%d",C+i);
  for(int i=1;i<=N;i++)
    S+=B[A[i]];
  for(int i=1;i<N;i++)
    if(A[i]+1==A[i+1])
      S+=C[A[i]];
  printf("%d\n",S);
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$408, %rsp
	.cfi_def_cfa_offset 448
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rbx
	movq	%rbx, %r13
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L5
	leaq	148(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	276(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L6
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	(%rbx), %rdx
	addq	$4, %rbx
	addl	144(%rsp,%rdx,4), %r8d
	cmpq	%rbx, %rcx
	jne	.L8
.L11:
	cmpl	$1, %eax
	jle	.L7
	subl	$2, %eax
	movl	20(%rsp), %ecx
	leaq	24(%rsp), %rdx
	leaq	28(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L10:
	leal	1(%rcx), %esi
	movslq	%ecx, %rax
	movl	(%rdx), %ecx
	cmpl	%ecx, %esi
	jne	.L9
	addl	272(%rsp,%rax,4), %r8d
.L9:
	addq	$4, %rdx
	cmpq	%rdx, %rdi
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$408, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movl	12(%rsp), %eax
.L5:
	xorl	%r8d, %r8d
	jmp	.L11
.L13:
	xorl	%r8d, %r8d
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$408, %rsp
	.cfi_def_cfa_offset 448
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rbx
	movq	%rbx, %r13
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L5
	leaq	148(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	276(%rsp), %r13
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jge	.L6
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	(%rbx), %rdx
	addq	$4, %rbx
	addl	144(%rsp,%rdx,4), %r8d
	cmpq	%rbx, %rcx
	jne	.L8
.L11:
	cmpl	$1, %eax
	jle	.L7
	subl	$2, %eax
	movl	20(%rsp), %ecx
	leaq	24(%rsp), %rdx
	leaq	28(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L10:
	leal	1(%rcx), %esi
	movslq	%ecx, %rax
	movl	(%rdx), %ecx
	cmpl	%ecx, %esi
	jne	.L9
	addl	272(%rsp,%rax,4), %r8d
.L9:
	addq	$4, %rdx
	cmpq	%rdx, %rdi
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$408, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movl	12(%rsp), %eax
.L5:
	xorl	%r8d, %r8d
	jmp	.L11
.L13:
	xorl	%r8d, %r8d
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```