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>
#include <stdlib.h>

int main()
{
	int N;
	int *p, *q;
	int i, j, k;
	int sum=0;
	int min=0;

	scanf("%d", &N);

	p = (int *)malloc(sizeof(int) * N);
	q = (int *)malloc(sizeof(int) * N);

	for(i=0; i<N; i++){
		scanf("%d", p+i);
	}

	for(i=0; i<N; i++){
		scanf("%d", q+i);
	}

	for(i=0; i<N; i++){
		for(j=0; j<=i; j++){
			sum = sum + *(p+j);
		}
		for(k=j-1; k<N; k++){
			sum = sum + *(q+k);
		}
		if(min < sum){
			min = sum;
		}
		sum = 0;
	}

	printf("%d", min);

	free(p);
	free(q);

return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L3
	movl	$0, -44(%rbp)
	jmp	.L4
.L5:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L5
	movl	$0, -44(%rbp)
	jmp	.L6
.L12:
	movl	$0, -40(%rbp)
	jmp	.L7
.L8:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -32(%rbp)
	addl	$1, -40(%rbp)
.L7:
	movl	-40(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L8
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L9
.L10:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -32(%rbp)
	addl	$1, -36(%rbp)
.L9:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L10
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L11
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
.L11:
	movl	$0, -32(%rbp)
	addl	$1, -44(%rbp)
.L6:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
.LFB39:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %r12
	movq	%r12, %rbx
	salq	$2, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L5
	movq	%rbp, %r14
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r14
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L5
	movq	%r12, %rbx
	movq	%r12, %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %esi
	addq	$4, %r15
	cmpl	%r14d, %esi
	jg	.L4
	testl	%esi, %esi
	jle	.L5
	movl	%esi, %r8d
	movl	$1, %edi
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	leaq	16(%rbp), %r10
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$2, %ecx
	jle	.L17
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	movq	%rbp, %rax
	salq	$4, %rdx
	addq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L7
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %dil
	je	.L8
.L6:
	movslq	%eax, %r11
	leaq	0(,%r11,4), %r14
	addl	0(%rbp,%r11,4), %edx
	leal	1(%rax), %r11d
	cmpl	%r11d, %ecx
	jl	.L8
	addl	$2, %eax
	addl	4(%rbp,%r14), %edx
	cmpl	%eax, %ecx
	jl	.L8
	addl	8(%rbp,%r14), %edx
.L8:
	cmpl	%ecx, %esi
	jle	.L9
	movl	%esi, %eax
	subl	%edi, %eax
	cmpl	$2, %eax
	jbe	.L18
	movl	%r8d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbx,%rax), %r11
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	paddd	%xmm3, %xmm0
	cmpq	%r11, %rax
	jne	.L11
	movdqa	%xmm0, %xmm1
	movl	%r8d, %r11d
	psrldq	$8, %xmm1
	andl	$-4, %r11d
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, %edx
	leal	(%r11,%rcx), %eax
	cmpl	%r8d, %r11d
	je	.L9
.L10:
	movslq	%eax, %r11
	leaq	0(,%r11,4), %r14
	addl	(%r12,%r11,4), %edx
	leal	1(%rax), %r11d
	cmpl	%r11d, %esi
	jle	.L9
	addl	$2, %eax
	addl	4(%r12,%r14), %edx
	cmpl	%eax, %esi
	jle	.L9
	addl	8(%r12,%r14), %edx
.L9:
	cmpl	%edx, %r9d
	cmovl	%edx, %r9d
	addl	$1, %ecx
	addl	$1, %edi
	subl	$1, %r8d
	addq	$4, %rbx
	cmpl	%ecx, %esi
	jne	.L14
.L15:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L6
.L18:
	movl	%ecx, %eax
	jmp	.L10
.L5:
	xorl	%r9d, %r9d
	jmp	.L15
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
.LFB39:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %r12
	movq	%r12, %rbx
	salq	$2, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L5
	movq	%rbp, %r14
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r14
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L5
	movq	%r12, %rbx
	movq	%r12, %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %esi
	addq	$4, %r15
	cmpl	%r14d, %esi
	jg	.L4
	testl	%esi, %esi
	jle	.L5
	movl	%esi, %r8d
	movl	$1, %edi
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	leaq	16(%rbp), %r10
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$2, %ecx
	jle	.L17
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	movq	%rbp, %rax
	salq	$4, %rdx
	addq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L7
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %dil
	je	.L8
.L6:
	movslq	%eax, %r11
	leaq	0(,%r11,4), %r14
	addl	0(%rbp,%r11,4), %edx
	leal	1(%rax), %r11d
	cmpl	%r11d, %ecx
	jl	.L8
	addl	$2, %eax
	addl	4(%rbp,%r14), %edx
	cmpl	%eax, %ecx
	jl	.L8
	addl	8(%rbp,%r14), %edx
.L8:
	cmpl	%ecx, %esi
	jle	.L9
	movl	%esi, %eax
	subl	%edi, %eax
	cmpl	$2, %eax
	jbe	.L18
	movl	%r8d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbx,%rax), %r11
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	paddd	%xmm3, %xmm0
	cmpq	%r11, %rax
	jne	.L11
	movdqa	%xmm0, %xmm1
	movl	%r8d, %r11d
	psrldq	$8, %xmm1
	andl	$-4, %r11d
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, %edx
	leal	(%r11,%rcx), %eax
	cmpl	%r8d, %r11d
	je	.L9
.L10:
	movslq	%eax, %r11
	leaq	0(,%r11,4), %r14
	addl	(%r12,%r11,4), %edx
	leal	1(%rax), %r11d
	cmpl	%r11d, %esi
	jle	.L9
	addl	$2, %eax
	addl	4(%r12,%r14), %edx
	cmpl	%eax, %esi
	jle	.L9
	addl	8(%r12,%r14), %edx
.L9:
	cmpl	%edx, %r9d
	cmovl	%edx, %r9d
	addl	$1, %ecx
	addl	$1, %edi
	subl	$1, %r8d
	addq	$4, %rbx
	cmpl	%ecx, %esi
	jne	.L14
.L15:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L6
.L18:
	movl	%ecx, %eax
	jmp	.L10
.L5:
	xorl	%r9d, %r9d
	jmp	.L15
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>
#include <stdlib.h>

int main()
{
	int N;
	int *p, *q;
	int i, j, k;
	int sum=0;
	int min=0;

	scanf("%d", &N);

	p = (int *)malloc(sizeof(int) * N);
	q = (int *)malloc(sizeof(int) * N);

	for(i=0; i<N; i++){
		scanf("%d", p+i);
	}

	for(i=0; i<N; i++){
		scanf("%d", q+i);
	}

	for(i=0; i<N; i++){
		for(j=0; j<=i; j++){
			sum = sum + *(p+j);
		}
		for(k=j-1; k<N; k++){
			sum = sum + *(q+k);
		}
		if(min < sum){
			min = sum;
		}
		sum = 0;
	}

	printf("%d", min);

	free(p);
	free(q);

return 0;
}
7
3 3 4 5 4 5 3
5 3 8 4 2 3 2
 1
2
6
 5
3 2 2 4 1
0 2 2 2 1
 4
1 1 0 1
1 1 1 1
 7
3 3 4 5 4 5 3
5 3 8 4 2 5 2
 4
1 1 0 1
1 1 0 1
 7
3 3 4 5 4 5 3
5 3 8 4 0 5 2
 1
2
7
 5
3 2 0 4 1
0 2 1 2 1
 7
3 3 4 5 4 5 3
5 3 15 4 0 5 2

30 8 14 5 32 4 31 9 12 37
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>
#include <stdlib.h>

int main()
{
	int N;
	int *p, *q;
	int i, j, k;
	int sum=0;
	int min=0;

	scanf("%d", &N);

	p = (int *)malloc(sizeof(int) * N);
	q = (int *)malloc(sizeof(int) * N);

	for(i=0; i<N; i++){
		scanf("%d", p+i);
	}

	for(i=0; i<N; i++){
		scanf("%d", q+i);
	}

	for(i=0; i<N; i++){
		for(j=0; j<=i; j++){
			sum = sum + *(p+j);
		}
		for(k=j-1; k<N; k++){
			sum = sum + *(q+k);
		}
		if(min < sum){
			min = sum;
		}
		sum = 0;
	}

	printf("%d", min);

	free(p);
	free(q);

return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L3
	movl	$0, -44(%rbp)
	jmp	.L4
.L5:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L5
	movl	$0, -44(%rbp)
	jmp	.L6
.L12:
	movl	$0, -40(%rbp)
	jmp	.L7
.L8:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -32(%rbp)
	addl	$1, -40(%rbp)
.L7:
	movl	-40(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L8
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L9
.L10:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -32(%rbp)
	addl	$1, -36(%rbp)
.L9:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L10
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L11
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
.L11:
	movl	$0, -32(%rbp)
	addl	$1, -44(%rbp)
.L6:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L3
	movl	$0, -44(%rbp)
	jmp	.L4
.L5:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L5
	movl	$0, -44(%rbp)
	jmp	.L6
.L12:
	movl	$0, -40(%rbp)
	jmp	.L7
.L8:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -32(%rbp)
	addl	$1, -40(%rbp)
.L7:
	movl	-40(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L8
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L9
.L10:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -32(%rbp)
	addl	$1, -36(%rbp)
.L9:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L10
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L11
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
.L11:
	movl	$0, -32(%rbp)
	addl	$1, -44(%rbp)
.L6:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
