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

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int

int main(){
    int n;
    scanf("%d", &n);
    lld a[n], b[n];
    rep(i, 0, n){
        scanf("%lld", &a[i]);
        b[i] = a[i];
    }
    lld sum_a = 0, sum_b = 0;
    lld cost_a = 0, cost_b = 0;
    rep(i, 0, n){
        sum_a += a[i];
        sum_b += b[i];
        if(i%2){
            if(sum_a >= 0){
                cost_a += -1*(-1 - sum_a);
                sum_a = -1;
            }
            if(sum_b <= 0){
                cost_b += 1 - sum_b;
                sum_b = 1;
            }
        }else{
            if(sum_a <= 0){
                cost_a += 1 - sum_a;
                sum_a = 1;
            }
            if(sum_b >= 0){
                cost_b += -1*(-1 - sum_b);
                sum_b = -1;
            }
        }
    }
    printf("%lld", cost_a<cost_b ? cost_a : cost_b);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %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
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	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)
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	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)
	movl	$0, -128(%rbp)
	jmp	.L8
.L9:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -128(%rbp)
.L8:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L9
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L15:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -112(%rbp)
	movl	-124(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	cmpq	$0, -120(%rbp)
	js	.L12
	movq	-120(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -104(%rbp)
	movq	$-1, -120(%rbp)
.L12:
	cmpq	$0, -112(%rbp)
	jg	.L13
	movl	$1, %eax
	subq	-112(%rbp), %rax
	addq	%rax, -96(%rbp)
	movq	$1, -112(%rbp)
	jmp	.L13
.L11:
	cmpq	$0, -120(%rbp)
	jg	.L14
	movl	$1, %eax
	subq	-120(%rbp), %rax
	addq	%rax, -104(%rbp)
	movq	$1, -120(%rbp)
.L14:
	cmpq	$0, -112(%rbp)
	js	.L13
	movq	-112(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -96(%rbp)
	movq	$-1, -112(%rbp)
.L13:
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L15
	movq	-96(%rbp), %rdx
	movq	-104(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%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	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %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
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L29:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L29
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L30
.L4:
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%rsp, %r13
	andq	$-16, %rdx
	subq	%rax, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L30:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L31
.L7:
	movq	%rsp, %r14
	leaq	.LC1(%rip), %r15
	testl	%ecx, %ecx
	jle	.L8
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$8, %r12
	call	__isoc99_scanf@PLT
	movq	-8(%r12), %rax
	movq	%rax, (%r14,%rbx,8)
	movl	-60(%rbp), %eax
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L9
	testl	%eax, %eax
	jle	.L8
	movslq	%eax, %rdi
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	movl	$1, %r10d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L32:
	testq	%rcx, %rcx
	js	.L11
	leaq	1(%rcx,%r9), %r9
	movq	$-1, %rcx
.L11:
	testq	%rsi, %rsi
	jg	.L12
	movq	%r10, %r8
	subq	%rsi, %r8
	addq	%r8, %rdx
	movl	$1, %r8d
.L12:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L15
.L14:
	movq	(%r14,%rax,8), %rsi
	addq	0(%r13,%rax,8), %rcx
	addq	%r8, %rsi
	movq	%rsi, %r8
	testb	$1, %al
	jne	.L32
	testq	%rcx, %rcx
	jg	.L13
	movq	%r10, %r11
	subq	%rcx, %r11
	movl	$1, %ecx
	addq	%r11, %r9
.L13:
	testq	%rsi, %rsi
	js	.L12
	addq	$1, %rax
	leaq	1(%rdx,%rsi), %rdx
	movq	$-1, %r8
	cmpq	%rax, %rdi
	jne	.L14
.L15:
	cmpq	%r9, %rdx
	movq	%r15, %rsi
	movl	$1, %edi
	cmovg	%r9, %rdx
	xorl	%eax, %eax
	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
.L8:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	jmp	.L15
.L31:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %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
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L29:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L29
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L30
.L4:
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%rsp, %r13
	andq	$-16, %rdx
	subq	%rax, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L30:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L31
.L7:
	movq	%rsp, %r14
	leaq	.LC1(%rip), %r15
	testl	%ecx, %ecx
	jle	.L8
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$8, %r12
	call	__isoc99_scanf@PLT
	movq	-8(%r12), %rax
	movq	%rax, (%r14,%rbx,8)
	movl	-60(%rbp), %eax
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L9
	testl	%eax, %eax
	jle	.L8
	movslq	%eax, %rdi
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	movl	$1, %r10d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L32:
	testq	%rcx, %rcx
	js	.L11
	leaq	1(%rcx,%r9), %r9
	movq	$-1, %rcx
.L11:
	testq	%rsi, %rsi
	jg	.L12
	movq	%r10, %r8
	subq	%rsi, %r8
	addq	%r8, %rdx
	movl	$1, %r8d
.L12:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L15
.L14:
	movq	(%r14,%rax,8), %rsi
	addq	0(%r13,%rax,8), %rcx
	addq	%r8, %rsi
	movq	%rsi, %r8
	testb	$1, %al
	jne	.L32
	testq	%rcx, %rcx
	jg	.L13
	movq	%r10, %r11
	subq	%rcx, %r11
	movl	$1, %ecx
	addq	%r11, %r9
.L13:
	testq	%rsi, %rsi
	js	.L12
	addq	$1, %rax
	leaq	1(%rdx,%rsi), %rdx
	movq	$-1, %r8
	cmpq	%rax, %rdi
	jne	.L14
.L15:
	cmpq	%r9, %rdx
	movq	%r15, %rsi
	movl	$1, %edi
	cmovg	%r9, %rdx
	xorl	%eax, %eax
	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
.L8:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	jmp	.L15
.L31:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int

int main(){
    int n;
    scanf("%d", &n);
    lld a[n], b[n];
    rep(i, 0, n){
        scanf("%lld", &a[i]);
        b[i] = a[i];
    }
    lld sum_a = 0, sum_b = 0;
    lld cost_a = 0, cost_b = 0;
    rep(i, 0, n){
        sum_a += a[i];
        sum_b += b[i];
        if(i%2){
            if(sum_a >= 0){
                cost_a += -1*(-1 - sum_a);
                sum_a = -1;
            }
            if(sum_b <= 0){
                cost_b += 1 - sum_b;
                sum_b = 1;
            }
        }else{
            if(sum_a <= 0){
                cost_a += 1 - sum_a;
                sum_a = 1;
            }
            if(sum_b >= 0){
                cost_b += -1*(-1 - sum_b);
                sum_b = -1;
            }
        }
    }
    printf("%lld", cost_a<cost_b ? cost_a : cost_b);

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

1 3 12 5 11 7 6 10 4 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>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int

int main(){
    int n;
    scanf("%d", &n);
    lld a[n], b[n];
    rep(i, 0, n){
        scanf("%lld", &a[i]);
        b[i] = a[i];
    }
    lld sum_a = 0, sum_b = 0;
    lld cost_a = 0, cost_b = 0;
    rep(i, 0, n){
        sum_a += a[i];
        sum_b += b[i];
        if(i%2){
            if(sum_a >= 0){
                cost_a += -1*(-1 - sum_a);
                sum_a = -1;
            }
            if(sum_b <= 0){
                cost_b += 1 - sum_b;
                sum_b = 1;
            }
        }else{
            if(sum_a <= 0){
                cost_a += 1 - sum_a;
                sum_a = 1;
            }
            if(sum_b >= 0){
                cost_b += -1*(-1 - sum_b);
                sum_b = -1;
            }
        }
    }
    printf("%lld", cost_a<cost_b ? cost_a : cost_b);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %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
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	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)
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	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)
	movl	$0, -128(%rbp)
	jmp	.L8
.L9:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -128(%rbp)
.L8:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L9
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L15:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -112(%rbp)
	movl	-124(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	cmpq	$0, -120(%rbp)
	js	.L12
	movq	-120(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -104(%rbp)
	movq	$-1, -120(%rbp)
.L12:
	cmpq	$0, -112(%rbp)
	jg	.L13
	movl	$1, %eax
	subq	-112(%rbp), %rax
	addq	%rax, -96(%rbp)
	movq	$1, -112(%rbp)
	jmp	.L13
.L11:
	cmpq	$0, -120(%rbp)
	jg	.L14
	movl	$1, %eax
	subq	-120(%rbp), %rax
	addq	%rax, -104(%rbp)
	movq	$1, -120(%rbp)
.L14:
	cmpq	$0, -112(%rbp)
	js	.L13
	movq	-112(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -96(%rbp)
	movq	$-1, -112(%rbp)
.L13:
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L15
	movq	-96(%rbp), %rdx
	movq	-104(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%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	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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"
.LC1:
	.string	"%lld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %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
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	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)
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	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)
	movl	$0, -128(%rbp)
	jmp	.L8
.L9:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -128(%rbp)
.L8:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L9
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L15:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -112(%rbp)
	movl	-124(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	cmpq	$0, -120(%rbp)
	js	.L12
	movq	-120(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -104(%rbp)
	movq	$-1, -120(%rbp)
.L12:
	cmpq	$0, -112(%rbp)
	jg	.L13
	movl	$1, %eax
	subq	-112(%rbp), %rax
	addq	%rax, -96(%rbp)
	movq	$1, -112(%rbp)
	jmp	.L13
.L11:
	cmpq	$0, -120(%rbp)
	jg	.L14
	movl	$1, %eax
	subq	-120(%rbp), %rax
	addq	%rax, -104(%rbp)
	movq	$1, -120(%rbp)
.L14:
	cmpq	$0, -112(%rbp)
	js	.L13
	movq	-112(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -96(%rbp)
	movq	$-1, -112(%rbp)
.L13:
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L15
	movq	-96(%rbp), %rdx
	movq	-104(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%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	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
