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>
int main()
{
    int N,x,i,j,k,A[100][100],temp,half1[100],half2[100],sum[100];
    scanf("%d",&N);
    for(x=0;x<N;x++)
        scanf("%d",&A[x][0]);
    for(x=0;x<N;x++)
        scanf("%d",&A[x][1]);
    for(i=0;i<N;i++)
    {
        for(k=0;k<i+1;k++)
        {
         half1[i]=half1[i]+A[k][0];
        }
        for(j=i;j<N;j++)
        {
         half2[i]=half2[i]+A[j][1];
        }
        sum[i]=half1[i]+half2[i];
    }
    for(i=0; i<N; i++)
    {
        for(k=i+1; k<N; k++)
        {
            if(sum[i] < sum[k])
            {
                temp = sum[i];
                sum[i] = sum[k];
                sum[k] = temp;
            }
        }
    }
    printf("%d",sum[0]);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-41240(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -41236(%rbp)
	jmp	.L2
.L3:
	leaq	-40016(%rbp), %rcx
	movl	-41236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -41236(%rbp)
.L2:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41236(%rbp)
	jl	.L3
	movl	$0, -41236(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rcx
	movl	-41236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -41236(%rbp)
.L4:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41236(%rbp)
	jl	.L5
	movl	$0, -41232(%rbp)
	jmp	.L6
.L11:
	movl	$0, -41224(%rbp)
	jmp	.L7
.L8:
	movl	-41232(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %ecx
	movl	-41224(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$40016, %rax
	movl	(%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -41216(%rbp,%rax,4)
	addl	$1, -41224(%rbp)
.L7:
	movl	-41232(%rbp), %eax
	cmpl	-41224(%rbp), %eax
	jge	.L8
	movl	-41232(%rbp), %eax
	movl	%eax, -41228(%rbp)
	jmp	.L9
.L10:
	movl	-41232(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %ecx
	movl	-41228(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$40012, %rax
	movl	(%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40816(%rbp,%rax,4)
	addl	$1, -41228(%rbp)
.L9:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41228(%rbp)
	jl	.L10
	movl	-41232(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -41232(%rbp)
.L6:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41232(%rbp)
	jl	.L11
	movl	$0, -41232(%rbp)
	jmp	.L12
.L16:
	movl	-41232(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -41224(%rbp)
	jmp	.L13
.L15:
	movl	-41232(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %edx
	movl	-41224(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	-41232(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	movl	%eax, -41220(%rbp)
	movl	-41224(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	movl	-41224(%rbp), %eax
	cltq
	movl	-41220(%rbp), %edx
	movl	%edx, -40416(%rbp,%rax,4)
.L14:
	addl	$1, -41224(%rbp)
.L13:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41224(%rbp)
	jl	.L15
	addl	$1, -41232(%rbp)
.L12:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41232(%rbp)
	jl	.L16
	movl	-40416(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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"
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41000
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$280, %rsp
	.cfi_def_cfa_offset 41280
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 41224(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	1216(%rsp), %rbx
	xorl	%r12d, %r12d
	movq	%rbx, %r13
	.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	$400, %r13
	cmpl	%r12d, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L14
	leaq	1220(%rsp), %r13
	xorl	%r12d, %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), %edi
	addq	$400, %r13
	cmpl	%r12d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L14
	leaq	400(%rbx), %r8
	movslq	%edi, %r13
	leaq	16(%rsp), %r11
	xorl	%r9d, %r9d
	leaq	416(%rsp), %r10
	leaq	816(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r11,%r9,4), %esi
	movl	%r9d, %edx
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rax), %ecx
	addq	$400, %rax
	addl	%esi, %ecx
	movl	%ecx, %esi
	cmpq	%rax, %r8
	jne	.L6
	movl	%ecx, (%r11,%r9,4)
	movl	(%r10,%r9,4), %esi
	leaq	-396(%r8), %rax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %edx
	addl	(%rax), %esi
	addq	$400, %rax
	cmpl	%edx, %edi
	jg	.L7
	addl	%esi, %ecx
	movl	%esi, (%r10,%r9,4)
	addq	$400, %r8
	movl	%ecx, (%r12,%r9,4)
	addq	$1, %r9
	cmpq	%r13, %r9
	jne	.L8
	cmpl	$1, %edi
	je	.L14
	leaq	820(%rsp), %r8
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r8, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	-4(%r8), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	.L11
	movl	%esi, -4(%r8)
	movl	%ecx, (%rax)
.L11:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %edi
	jg	.L12
	addl	$1, %r9d
	addq	$4, %r8
	cmpl	%r9d, %edi
	jne	.L10
.L14:
	movl	816(%rsp), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	41224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$41240, %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
.L28:
	.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"
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41000
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$280, %rsp
	.cfi_def_cfa_offset 41280
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 41224(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	1216(%rsp), %rbx
	xorl	%r12d, %r12d
	movq	%rbx, %r13
	.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	$400, %r13
	cmpl	%r12d, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L14
	leaq	1220(%rsp), %r13
	xorl	%r12d, %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), %edi
	addq	$400, %r13
	cmpl	%r12d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L14
	leaq	400(%rbx), %r8
	movslq	%edi, %r13
	leaq	16(%rsp), %r11
	xorl	%r9d, %r9d
	leaq	416(%rsp), %r10
	leaq	816(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r11,%r9,4), %esi
	movl	%r9d, %edx
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rax), %ecx
	addq	$400, %rax
	addl	%esi, %ecx
	movl	%ecx, %esi
	cmpq	%rax, %r8
	jne	.L6
	movl	%ecx, (%r11,%r9,4)
	movl	(%r10,%r9,4), %esi
	leaq	-396(%r8), %rax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %edx
	addl	(%rax), %esi
	addq	$400, %rax
	cmpl	%edx, %edi
	jg	.L7
	addl	%esi, %ecx
	movl	%esi, (%r10,%r9,4)
	addq	$400, %r8
	movl	%ecx, (%r12,%r9,4)
	addq	$1, %r9
	cmpq	%r13, %r9
	jne	.L8
	cmpl	$1, %edi
	je	.L14
	leaq	820(%rsp), %r8
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r8, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	-4(%r8), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	.L11
	movl	%esi, -4(%r8)
	movl	%ecx, (%rax)
.L11:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %edi
	jg	.L12
	addl	$1, %r9d
	addq	$4, %r8
	cmpl	%r9d, %edi
	jne	.L10
.L14:
	movl	816(%rsp), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	41224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$41240, %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
.L28:
	.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>
int main()
{
    int N,x,i,j,k,A[100][100],temp,half1[100],half2[100],sum[100];
    scanf("%d",&N);
    for(x=0;x<N;x++)
        scanf("%d",&A[x][0]);
    for(x=0;x<N;x++)
        scanf("%d",&A[x][1]);
    for(i=0;i<N;i++)
    {
        for(k=0;k<i+1;k++)
        {
         half1[i]=half1[i]+A[k][0];
        }
        for(j=i;j<N;j++)
        {
         half2[i]=half2[i]+A[j][1];
        }
        sum[i]=half1[i]+half2[i];
    }
    for(i=0; i<N; i++)
    {
        for(k=i+1; k<N; k++)
        {
            if(sum[i] < sum[k])
            {
                temp = sum[i];
                sum[i] = sum[k];
                sum[k] = temp;
            }
        }
    }
    printf("%d",sum[0]);
}

5
3 2 2 4 1
1 2 2 2 1

14
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>
int main()
{
    int N,x,i,j,k,A[100][100],temp,half1[100],half2[100],sum[100];
    scanf("%d",&N);
    for(x=0;x<N;x++)
        scanf("%d",&A[x][0]);
    for(x=0;x<N;x++)
        scanf("%d",&A[x][1]);
    for(i=0;i<N;i++)
    {
        for(k=0;k<i+1;k++)
        {
         half1[i]=half1[i]+A[k][0];
        }
        for(j=i;j<N;j++)
        {
         half2[i]=half2[i]+A[j][1];
        }
        sum[i]=half1[i]+half2[i];
    }
    for(i=0; i<N; i++)
    {
        for(k=i+1; k<N; k++)
        {
            if(sum[i] < sum[k])
            {
                temp = sum[i];
                sum[i] = sum[k];
                sum[k] = temp;
            }
        }
    }
    printf("%d",sum[0]);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-41240(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -41236(%rbp)
	jmp	.L2
.L3:
	leaq	-40016(%rbp), %rcx
	movl	-41236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -41236(%rbp)
.L2:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41236(%rbp)
	jl	.L3
	movl	$0, -41236(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rcx
	movl	-41236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -41236(%rbp)
.L4:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41236(%rbp)
	jl	.L5
	movl	$0, -41232(%rbp)
	jmp	.L6
.L11:
	movl	$0, -41224(%rbp)
	jmp	.L7
.L8:
	movl	-41232(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %ecx
	movl	-41224(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$40016, %rax
	movl	(%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -41216(%rbp,%rax,4)
	addl	$1, -41224(%rbp)
.L7:
	movl	-41232(%rbp), %eax
	cmpl	-41224(%rbp), %eax
	jge	.L8
	movl	-41232(%rbp), %eax
	movl	%eax, -41228(%rbp)
	jmp	.L9
.L10:
	movl	-41232(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %ecx
	movl	-41228(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$40012, %rax
	movl	(%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40816(%rbp,%rax,4)
	addl	$1, -41228(%rbp)
.L9:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41228(%rbp)
	jl	.L10
	movl	-41232(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -41232(%rbp)
.L6:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41232(%rbp)
	jl	.L11
	movl	$0, -41232(%rbp)
	jmp	.L12
.L16:
	movl	-41232(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -41224(%rbp)
	jmp	.L13
.L15:
	movl	-41232(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %edx
	movl	-41224(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	-41232(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	movl	%eax, -41220(%rbp)
	movl	-41224(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	movl	-41224(%rbp), %eax
	cltq
	movl	-41220(%rbp), %edx
	movl	%edx, -40416(%rbp,%rax,4)
.L14:
	addl	$1, -41224(%rbp)
.L13:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41224(%rbp)
	jl	.L15
	addl	$1, -41232(%rbp)
.L12:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41232(%rbp)
	jl	.L16
	movl	-40416(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-41240(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -41236(%rbp)
	jmp	.L2
.L3:
	leaq	-40016(%rbp), %rcx
	movl	-41236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -41236(%rbp)
.L2:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41236(%rbp)
	jl	.L3
	movl	$0, -41236(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rcx
	movl	-41236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -41236(%rbp)
.L4:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41236(%rbp)
	jl	.L5
	movl	$0, -41232(%rbp)
	jmp	.L6
.L11:
	movl	$0, -41224(%rbp)
	jmp	.L7
.L8:
	movl	-41232(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %ecx
	movl	-41224(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$40016, %rax
	movl	(%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -41216(%rbp,%rax,4)
	addl	$1, -41224(%rbp)
.L7:
	movl	-41232(%rbp), %eax
	cmpl	-41224(%rbp), %eax
	jge	.L8
	movl	-41232(%rbp), %eax
	movl	%eax, -41228(%rbp)
	jmp	.L9
.L10:
	movl	-41232(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %ecx
	movl	-41228(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$40012, %rax
	movl	(%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40816(%rbp,%rax,4)
	addl	$1, -41228(%rbp)
.L9:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41228(%rbp)
	jl	.L10
	movl	-41232(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -41232(%rbp)
.L6:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41232(%rbp)
	jl	.L11
	movl	$0, -41232(%rbp)
	jmp	.L12
.L16:
	movl	-41232(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -41224(%rbp)
	jmp	.L13
.L15:
	movl	-41232(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %edx
	movl	-41224(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	-41232(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	movl	%eax, -41220(%rbp)
	movl	-41224(%rbp), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %edx
	movl	-41232(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	movl	-41224(%rbp), %eax
	cltq
	movl	-41220(%rbp), %edx
	movl	%edx, -40416(%rbp,%rax,4)
.L14:
	addl	$1, -41224(%rbp)
.L13:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41224(%rbp)
	jl	.L15
	addl	$1, -41232(%rbp)
.L12:
	movl	-41240(%rbp), %eax
	cmpl	%eax, -41232(%rbp)
	jl	.L16
	movl	-40416(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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:
