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(void) {
	long long int N,i,ans=0;
	scanf("%lld",&N);
	long long int A[N+1];
	long long int B[N];
	for(i=0;i<N+1;i++){
		scanf("%lld",&A[i]);
	}
	for(i=0;i<N;i++){
		scanf("%lld",&B[i]);
	}
	for(i=0;i<N;i++){
		if(A[i]>=B[i]){
			ans=ans+B[i];
		}else if(A[i]+A[i+1]>=B[i] && A[i]<B[i]){
			ans=ans+B[i];
			A[i+1]=A[i+1]-(B[i]-A[i]);
		}else if(A[i]+A[i+1]<=B[i]){
			ans=ans+A[i]+A[i+1];
			A[i+1]=0;
		}
	}
	printf("%lld",ans);
	
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$0, -96(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L8
.L9:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L10:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L11
	movq	$0, -104(%rbp)
	jmp	.L12
.L16:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jl	.L13
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	jmp	.L14
.L13:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jl	.L15
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jge	.L15
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	subq	%rax, %rsi
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	subq	%rsi, %rcx
	movq	-80(%rbp), %rax
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L14
.L15:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jg	.L14
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-96(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rcx, %rax
	movq	%rax, -96(%rbp)
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	$0, (%rax,%rdx,8)
.L14:
	addq	$1, -104(%rbp)
.L12:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L16
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC0(%rip), %r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	8(,%rsi,8), %rdx
	leaq	15(%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L3
.L29:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L29
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L30
.L4:
	movq	%rdx, %rax
	movq	%rsp, %rcx
	andq	$-4096, %rdx
	movq	%rsp, %rbx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L30:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L31
.L7:
	movq	%rsp, %r12
	testq	%rsi, %rsi
	js	.L8
	movq	%rbx, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r14, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jge	.L9
	testq	%rax, %rax
	jle	.L8
	movq	%r12, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r14, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rcx
	addq	$8, %r14
	cmpq	%r13, %rcx
	jg	.L12
	testq	%rcx, %rcx
	jle	.L8
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L32:
	addq	%rdx, %r8
.L14:
	cmpq	%rax, %rcx
	je	.L11
.L16:
	movq	(%rbx,%rax,8), %rsi
	movq	(%r12,%rax,8), %rdx
	addq	$1, %rax
	cmpq	%rdx, %rsi
	jge	.L32
	movq	(%rbx,%rax,8), %rdi
	leaq	(%rsi,%rdi), %r9
	cmpq	%r9, %rdx
	jg	.L15
	addq	%rdx, %r8
	subq	%rsi, %rdx
	subq	%rdx, %rdi
	movq	%rdi, (%rbx,%rax,8)
	cmpq	%rax, %rcx
	jne	.L16
.L11:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L33
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	addq	%rsi, %r8
	movq	$0, (%rbx,%rax,8)
	addq	%rdi, %r8
	jmp	.L14
.L8:
	xorl	%r8d, %r8d
	jmp	.L11
.L31:
	orq	$0, -8(%rsp,%rax)
	jmp	.L7
.L33:
	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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC0(%rip), %r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	8(,%rsi,8), %rdx
	leaq	15(%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L3
.L29:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L29
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L30
.L4:
	movq	%rdx, %rax
	movq	%rsp, %rcx
	andq	$-4096, %rdx
	movq	%rsp, %rbx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L30:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L31
.L7:
	movq	%rsp, %r12
	testq	%rsi, %rsi
	js	.L8
	movq	%rbx, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r14, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jge	.L9
	testq	%rax, %rax
	jle	.L8
	movq	%r12, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r14, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rcx
	addq	$8, %r14
	cmpq	%r13, %rcx
	jg	.L12
	testq	%rcx, %rcx
	jle	.L8
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L32:
	addq	%rdx, %r8
.L14:
	cmpq	%rax, %rcx
	je	.L11
.L16:
	movq	(%rbx,%rax,8), %rsi
	movq	(%r12,%rax,8), %rdx
	addq	$1, %rax
	cmpq	%rdx, %rsi
	jge	.L32
	movq	(%rbx,%rax,8), %rdi
	leaq	(%rsi,%rdi), %r9
	cmpq	%r9, %rdx
	jg	.L15
	addq	%rdx, %r8
	subq	%rsi, %rdx
	subq	%rdx, %rdi
	movq	%rdi, (%rbx,%rax,8)
	cmpq	%rax, %rcx
	jne	.L16
.L11:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L33
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	addq	%rsi, %r8
	movq	$0, (%rbx,%rax,8)
	addq	%rdi, %r8
	jmp	.L14
.L8:
	xorl	%r8d, %r8d
	jmp	.L11
.L31:
	orq	$0, -8(%rsp,%rax)
	jmp	.L7
.L33:
	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(void) {
	long long int N,i,ans=0;
	scanf("%lld",&N);
	long long int A[N+1];
	long long int B[N];
	for(i=0;i<N+1;i++){
		scanf("%lld",&A[i]);
	}
	for(i=0;i<N;i++){
		scanf("%lld",&B[i]);
	}
	for(i=0;i<N;i++){
		if(A[i]>=B[i]){
			ans=ans+B[i];
		}else if(A[i]+A[i+1]>=B[i] && A[i]<B[i]){
			ans=ans+B[i];
			A[i+1]=A[i+1]-(B[i]-A[i]);
		}else if(A[i]+A[i+1]<=B[i]){
			ans=ans+A[i]+A[i+1];
			A[i+1]=0;
		}
	}
	printf("%lld",ans);
	
	return 0;
}

3
5 6 3 8
2 100 8
 2
100 0 1
1 100
 2
3 5 2
7 5
 3
0 6 3 8
2 100 8
 2
100 -1 1
1 100
 2
3 5 1
7 5
 3
0 4 3 8
2 100 8
 2
000 -1 1
1 100
 2
3 5 1
0 5
 3
0 4 2 8
2 100 8

19 2 10 17 1 9 15 0 5 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(void) {
	long long int N,i,ans=0;
	scanf("%lld",&N);
	long long int A[N+1];
	long long int B[N];
	for(i=0;i<N+1;i++){
		scanf("%lld",&A[i]);
	}
	for(i=0;i<N;i++){
		scanf("%lld",&B[i]);
	}
	for(i=0;i<N;i++){
		if(A[i]>=B[i]){
			ans=ans+B[i];
		}else if(A[i]+A[i+1]>=B[i] && A[i]<B[i]){
			ans=ans+B[i];
			A[i+1]=A[i+1]-(B[i]-A[i]);
		}else if(A[i]+A[i+1]<=B[i]){
			ans=ans+A[i]+A[i+1];
			A[i+1]=0;
		}
	}
	printf("%lld",ans);
	
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$0, -96(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L8
.L9:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L10:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L11
	movq	$0, -104(%rbp)
	jmp	.L12
.L16:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jl	.L13
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	jmp	.L14
.L13:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jl	.L15
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jge	.L15
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	subq	%rax, %rsi
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	subq	%rsi, %rcx
	movq	-80(%rbp), %rax
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L14
.L15:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jg	.L14
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-96(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rcx, %rax
	movq	%rax, -96(%rbp)
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	$0, (%rax,%rdx,8)
.L14:
	addq	$1, -104(%rbp)
.L12:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L16
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%lld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$0, -96(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L8
.L9:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L10:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L11
	movq	$0, -104(%rbp)
	jmp	.L12
.L16:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jl	.L13
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	jmp	.L14
.L13:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jl	.L15
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jge	.L15
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	subq	%rax, %rsi
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	subq	%rsi, %rcx
	movq	-80(%rbp), %rax
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L14
.L15:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jg	.L14
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-96(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	%rcx, %rax
	movq	%rax, -96(%rbp)
	movq	-104(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	$0, (%rax,%rdx,8)
.L14:
	addq	$1, -104(%rbp)
.L12:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L16
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
