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, i;

    scanf("%d", &n);

    long a[n], cm=0, cz=0, max=0, min=1000000000, sum=0, ans=0;

    for(i=0; i<n; i++) {
        scanf("%ld", &a[i]);
    }


    for(i=0; i<n; i++) {
        if(a[i]<0) {
            cm += 1;
            sum += -1*a[i];
            if(min >-1*a[i]) {
                min = -1*a[i];
            }
        } else if (a[i]==0) {
            cz += 1;
        } else {
            sum += a[i];
            if(min >a[i]) {
                min = a[i];
            }
        }
    }


    if (cz>0 || (cm%2)==0) {
        ans = sum;
    } else if ((cm%2)==1) {
        ans = sum - min*2;
    }

    printf("%ld \n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld \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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %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	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%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, %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, -72(%rbp)
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -64(%rbp)
	movq	$1000000000, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -88(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L5
.L6:
	movl	-124(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L5:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L6
	movl	$0, -124(%rbp)
	jmp	.L7
.L11:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L8
	addq	$1, -120(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	subq	%rax, -96(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	negq	%rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	negq	%rax
	movq	%rax, -104(%rbp)
	jmp	.L9
.L8:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L10
	addq	$1, -112(%rbp)
	jmp	.L9
.L10:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -104(%rbp)
.L9:
	addl	$1, -124(%rbp)
.L7:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L11
	cmpq	$0, -112(%rbp)
	jg	.L12
	movq	-120(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L13
.L12:
	movq	-96(%rbp), %rax
	movq	%rax, -88(%rbp)
	jmp	.L14
.L13:
	movq	-120(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L14
	movq	-104(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	-96(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -88(%rbp)
.L14:
	movq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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	"%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld \n"
	.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
	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, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L26:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L26
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L27
.L4:
	movq	%rsp, %r15
	testl	%ecx, %ecx
	jle	.L13
	movq	%r15, %rbx
	movq	%r15, %r13
	leaq	.LC1(%rip), %r14
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$8, %r13
	cmpl	%r12d, %eax
	jg	.L6
	testl	%eax, %eax
	jle	.L13
	leaq	(%r15,%rax,8), %rcx
	xorl	%r8d, %r8d
	movl	$1000000000, %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	jne	.L9
	addq	$1, %rdi
.L8:
	addq	$8, %rbx
	cmpq	%rbx, %rcx
	je	.L28
.L10:
	movq	(%rbx), %rax
	testq	%rax, %rax
	jns	.L7
	subq	%rax, %r8
	negq	%rax
	addq	$1, %rsi
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	addq	$8, %rbx
	cmpq	%rbx, %rcx
	jne	.L10
.L28:
	testq	%rdi, %rdi
	je	.L29
.L12:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	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
.L9:
	.cfi_restore_state
	addq	%rax, %r8
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	jmp	.L8
.L29:
	andb	$1, %sil
	je	.L12
	addq	%rdx, %rdx
	subq	%rdx, %r8
	jmp	.L12
.L13:
	xorl	%r8d, %r8d
	jmp	.L12
.L27:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L30:
	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"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld \n"
	.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
	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, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L26:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L26
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L27
.L4:
	movq	%rsp, %r15
	testl	%ecx, %ecx
	jle	.L13
	movq	%r15, %rbx
	movq	%r15, %r13
	leaq	.LC1(%rip), %r14
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$8, %r13
	cmpl	%r12d, %eax
	jg	.L6
	testl	%eax, %eax
	jle	.L13
	leaq	(%r15,%rax,8), %rcx
	xorl	%r8d, %r8d
	movl	$1000000000, %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	jne	.L9
	addq	$1, %rdi
.L8:
	addq	$8, %rbx
	cmpq	%rbx, %rcx
	je	.L28
.L10:
	movq	(%rbx), %rax
	testq	%rax, %rax
	jns	.L7
	subq	%rax, %r8
	negq	%rax
	addq	$1, %rsi
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	addq	$8, %rbx
	cmpq	%rbx, %rcx
	jne	.L10
.L28:
	testq	%rdi, %rdi
	je	.L29
.L12:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	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
.L9:
	.cfi_restore_state
	addq	%rax, %r8
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	jmp	.L8
.L29:
	andb	$1, %sil
	je	.L12
	addq	%rdx, %rdx
	subq	%rdx, %r8
	jmp	.L12
.L13:
	xorl	%r8d, %r8d
	jmp	.L12
.L27:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L30:
	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, i;

    scanf("%d", &n);

    long a[n], cm=0, cz=0, max=0, min=1000000000, sum=0, ans=0;

    for(i=0; i<n; i++) {
        scanf("%ld", &a[i]);
    }


    for(i=0; i<n; i++) {
        if(a[i]<0) {
            cm += 1;
            sum += -1*a[i];
            if(min >-1*a[i]) {
                min = -1*a[i];
            }
        } else if (a[i]==0) {
            cz += 1;
        } else {
            sum += a[i];
            if(min >a[i]) {
                min = a[i];
            }
        }
    }


    if (cz>0 || (cm%2)==0) {
        ans = sum;
    } else if ((cm%2)==1) {
        ans = sum - min*2;
    }

    printf("%ld \n", ans);
}
11
-1000000000 1000000000 -364513171 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000000
 5
10 -4 -8 -11 5
 3
-10 5 0
 11
-1000000000 1000000000 -364513171 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000100
 5
10 -4 -4 -11 5
 3
-14 5 0
 11
-1000000000 1000000000 -364513171 1000000000 -1000000000 0 1000000000 -1000000000 1000000100 -1000000000 1000000100
 5
10 -4 -4 -14 5
 3
-14 5 1
 11
-1000000000 1000000000 -364513171 1000000000 -1382285407 0 1000000000 -1000000000 1000000000 -1000000000 1000000100

9364513171 
 30 
 15 
 9364513271 
 26 
 19 
 9364513371 
 29 
 18 
 9746798678 

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, i;

    scanf("%d", &n);

    long a[n], cm=0, cz=0, max=0, min=1000000000, sum=0, ans=0;

    for(i=0; i<n; i++) {
        scanf("%ld", &a[i]);
    }


    for(i=0; i<n; i++) {
        if(a[i]<0) {
            cm += 1;
            sum += -1*a[i];
            if(min >-1*a[i]) {
                min = -1*a[i];
            }
        } else if (a[i]==0) {
            cz += 1;
        } else {
            sum += a[i];
            if(min >a[i]) {
                min = a[i];
            }
        }
    }


    if (cz>0 || (cm%2)==0) {
        ans = sum;
    } else if ((cm%2)==1) {
        ans = sum - min*2;
    }

    printf("%ld \n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld \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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %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	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%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, %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, -72(%rbp)
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -64(%rbp)
	movq	$1000000000, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -88(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L5
.L6:
	movl	-124(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L5:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L6
	movl	$0, -124(%rbp)
	jmp	.L7
.L11:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L8
	addq	$1, -120(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	subq	%rax, -96(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	negq	%rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	negq	%rax
	movq	%rax, -104(%rbp)
	jmp	.L9
.L8:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L10
	addq	$1, -112(%rbp)
	jmp	.L9
.L10:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -104(%rbp)
.L9:
	addl	$1, -124(%rbp)
.L7:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L11
	cmpq	$0, -112(%rbp)
	jg	.L12
	movq	-120(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L13
.L12:
	movq	-96(%rbp), %rax
	movq	%rax, -88(%rbp)
	jmp	.L14
.L13:
	movq	-120(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L14
	movq	-104(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	-96(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -88(%rbp)
.L14:
	movq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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	"%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld \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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %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	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%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, %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, -72(%rbp)
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -64(%rbp)
	movq	$1000000000, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -88(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L5
.L6:
	movl	-124(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L5:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L6
	movl	$0, -124(%rbp)
	jmp	.L7
.L11:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L8
	addq	$1, -120(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	subq	%rax, -96(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	negq	%rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	negq	%rax
	movq	%rax, -104(%rbp)
	jmp	.L9
.L8:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L10
	addq	$1, -112(%rbp)
	jmp	.L9
.L10:
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -104(%rbp)
	jle	.L9
	movq	-72(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -104(%rbp)
.L9:
	addl	$1, -124(%rbp)
.L7:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L11
	cmpq	$0, -112(%rbp)
	jg	.L12
	movq	-120(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L13
.L12:
	movq	-96(%rbp), %rax
	movq	%rax, -88(%rbp)
	jmp	.L14
.L13:
	movq	-120(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L14
	movq	-104(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	-96(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -88(%rbp)
.L14:
	movq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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:
