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

```c
#include <stdio.h>
#define N 100
int main(void){
    int n,m;
    int i;
    int ans;
    int max[N];
    int diff;
    int temp;
    while(1)
    {
        scanf("%d%d",&n,&m);
        if(n==0&&m==0) break;
        for(i=0;i<m;i++) max[i]=0;
        for(i=0;i<n;i++)
        {
            scanf("%d%d",&diff,&temp);
            if(max[diff-1]<temp) max[diff-1]=temp;
        }
        ans=0;
        for(i=0;i<m;i++) ans+=max[i];
        printf("%d\n",ans);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	leaq	-436(%rbp), %rdx
	leaq	-440(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-440(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-436(%rbp), %eax
	testl	%eax, %eax
	je	.L15
.L2:
	movl	$0, -424(%rbp)
	jmp	.L4
.L5:
	movl	-424(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	addl	$1, -424(%rbp)
.L4:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L5
	movl	$0, -424(%rbp)
	jmp	.L6
.L8:
	leaq	-428(%rbp), %rdx
	leaq	-432(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-432(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-432(%rbp), %eax
	subl	$1, %eax
	movl	-428(%rbp), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L7:
	addl	$1, -424(%rbp)
.L6:
	movl	-440(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L8
	movl	$0, -420(%rbp)
	movl	$0, -424(%rbp)
	jmp	.L9
.L10:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -420(%rbp)
	addl	$1, -424(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L10
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r14
	movq	%rsp, %r13
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r12d
	movl	4(%rsp), %ebp
	movl	%r12d, %eax
	orl	%ebp, %eax
	je	.L2
	testl	%ebp, %ebp
	jle	.L3
	movslq	%ebp, %rdx
	xorl	%esi, %esi
	leaq	16(%rsp), %rdi
	salq	$2, %rdx
	call	memset@PLT
	testl	%r12d, %r12d
	jle	.L4
.L11:
	xorl	%r15d, %r15d
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	movl	12(%rsp), %esi
	subl	$1, %eax
	cltq
	movl	16(%rsp,%rax,4), %edx
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	addl	$1, %r15d
	movl	%edx, 16(%rsp,%rax,4)
	cmpl	%r15d, (%rsp)
	jg	.L5
	movl	4(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L12
.L4:
	testl	%ebp, %ebp
	movl	$1, %ecx
	cmovg	%ebp, %ecx
	cmpl	$3, %ebp
	jle	.L14
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%ecx, %edx
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L8
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L6
.L7:
	movslq	%eax, %rcx
	addl	16(%rsp,%rcx,4), %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %ebp
	jle	.L6
	movslq	%ecx, %rcx
	addl	$2, %eax
	addl	16(%rsp,%rcx,4), %edx
	cmpl	%eax, %ebp
	jle	.L6
	cltq
	addl	16(%rsp,%rax,4), %edx
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	testl	%r12d, %r12d
	jg	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%edx, %edx
	jmp	.L6
.L14:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r14
	movq	%rsp, %r13
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r12d
	movl	4(%rsp), %ebp
	movl	%r12d, %eax
	orl	%ebp, %eax
	je	.L2
	testl	%ebp, %ebp
	jle	.L3
	movslq	%ebp, %rdx
	xorl	%esi, %esi
	leaq	16(%rsp), %rdi
	salq	$2, %rdx
	call	memset@PLT
	testl	%r12d, %r12d
	jle	.L4
.L11:
	xorl	%r15d, %r15d
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	movl	12(%rsp), %esi
	subl	$1, %eax
	cltq
	movl	16(%rsp,%rax,4), %edx
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	addl	$1, %r15d
	movl	%edx, 16(%rsp,%rax,4)
	cmpl	%r15d, (%rsp)
	jg	.L5
	movl	4(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L12
.L4:
	testl	%ebp, %ebp
	movl	$1, %ecx
	cmovg	%ebp, %ecx
	cmpl	$3, %ebp
	jle	.L14
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%ecx, %edx
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L8
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L6
.L7:
	movslq	%eax, %rcx
	addl	16(%rsp,%rcx,4), %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %ebp
	jle	.L6
	movslq	%ecx, %rcx
	addl	$2, %eax
	addl	16(%rsp,%rcx,4), %edx
	cmpl	%eax, %ebp
	jle	.L6
	cltq
	addl	16(%rsp,%rax,4), %edx
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	testl	%r12d, %r12d
	jg	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%edx, %edx
	jmp	.L6
.L14:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	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:

#include <stdio.h>
#define N 100
int main(void){
    int n,m;
    int i;
    int ans;
    int max[N];
    int diff;
    int temp;
    while(1)
    {
        scanf("%d%d",&n,&m);
        if(n==0&&m==0) break;
        for(i=0;i<m;i++) max[i]=0;
        for(i=0;i<n;i++)
        {
            scanf("%d%d",&diff,&temp);
            if(max[diff-1]<temp) max[diff-1]=temp;
        }
        ans=0;
        for(i=0;i<m;i++) ans+=max[i];
        printf("%d\n",ans);
    }
    return 0;
}

5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 9
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
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
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0

9
10
8
71
51
 9
8
8
71
51
 9
10
8
71
60
 9
8
8
73
51
 9
10
8
72
60
 13
8
8
73
51
 13
8
8
73
47
 13
8
8
75
47
 13
8
8
77
47
 8
8
8
71
51

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

```c
#include <stdio.h>
#define N 100
int main(void){
    int n,m;
    int i;
    int ans;
    int max[N];
    int diff;
    int temp;
    while(1)
    {
        scanf("%d%d",&n,&m);
        if(n==0&&m==0) break;
        for(i=0;i<m;i++) max[i]=0;
        for(i=0;i<n;i++)
        {
            scanf("%d%d",&diff,&temp);
            if(max[diff-1]<temp) max[diff-1]=temp;
        }
        ans=0;
        for(i=0;i<m;i++) ans+=max[i];
        printf("%d\n",ans);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	leaq	-436(%rbp), %rdx
	leaq	-440(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-440(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-436(%rbp), %eax
	testl	%eax, %eax
	je	.L15
.L2:
	movl	$0, -424(%rbp)
	jmp	.L4
.L5:
	movl	-424(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	addl	$1, -424(%rbp)
.L4:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L5
	movl	$0, -424(%rbp)
	jmp	.L6
.L8:
	leaq	-428(%rbp), %rdx
	leaq	-432(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-432(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-432(%rbp), %eax
	subl	$1, %eax
	movl	-428(%rbp), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L7:
	addl	$1, -424(%rbp)
.L6:
	movl	-440(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L8
	movl	$0, -420(%rbp)
	movl	$0, -424(%rbp)
	jmp	.L9
.L10:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -420(%rbp)
	addl	$1, -424(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L10
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	leaq	-436(%rbp), %rdx
	leaq	-440(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-440(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-436(%rbp), %eax
	testl	%eax, %eax
	je	.L15
.L2:
	movl	$0, -424(%rbp)
	jmp	.L4
.L5:
	movl	-424(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	addl	$1, -424(%rbp)
.L4:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L5
	movl	$0, -424(%rbp)
	jmp	.L6
.L8:
	leaq	-428(%rbp), %rdx
	leaq	-432(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-432(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-432(%rbp), %eax
	subl	$1, %eax
	movl	-428(%rbp), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L7:
	addl	$1, -424(%rbp)
.L6:
	movl	-440(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L8
	movl	$0, -420(%rbp)
	movl	$0, -424(%rbp)
	jmp	.L9
.L10:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -420(%rbp)
	addl	$1, -424(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L10
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
