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

#define FOR(i, a, b) for(i = a; i < b; ++i)
#define REP(i, n) FOR(i, 0, n)
#define comp(a, b) int comp(const void *a, const void *b)
#define MOD  1000000007

typedef unsigned int uint;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;

void TF_print(char boolean, char T[], char F[]){
    if(boolean){
        printf("%s\n", T);
    }else{
        printf("%s\n", F);
    }
}

int main(){
    uint N, i;
    ul lim;

    scanf("%u %lu", &N, &lim);
    ul C[N], D[N], LEFT = 0, RIGHT = 0;

    REP(i, N){
        scanf("%lu", &C[i]);
        D[i] = C[i];
    }

    if(C[0] > lim){
        LEFT = C[0] - lim;
        C[0] = lim;
    }

    FOR(i, 1, N){
        if(C[i - 1] + C[i] > lim){
            LEFT += (C[i - 1] + C[i] - lim);
            C[i] = lim - C[i - 1];
        }
    }

    if(D[N - 1] > lim){
        RIGHT = D[N - 1] - lim;
        D[N - 1] = lim;
    }

    FOR(i, 1, N){
        if(D[N - i] + D[N - i - 1] > lim){
            RIGHT += (D[N - i] + D[N - i - 1] - lim);
            D[N - i - 1] = lim - D[N - i];
        }
    }

    if(LEFT < RIGHT){
        printf("%lu\n", LEFT);
    }else{
        printf("%lu\n", RIGHT);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	TF_print
	.type	TF_print, @function
TF_print:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, %eax
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movb	%al, -4(%rbp)
	cmpb	$0, -4(%rbp)
	je	.L2
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L2:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	TF_print, .-TF_print
	.section	.rodata
.LC0:
	.string	"%u %lu"
.LC1:
	.string	"%lu"
.LC2:
	.string	"%lu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$120, %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	-112(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movl	%eax, %edx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movl	%eax, %edx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	%eax, %edx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movl	%eax, %eax
	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
.L6:
	cmpq	%rdx, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L8
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L8:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, %edx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movl	%eax, %edx
	movq	%rdx, %r14
	movl	$0, %r15d
	movl	%eax, %edx
	movq	%rdx, %r12
	movl	$0, %r13d
	movl	%eax, %eax
	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
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L12
.L13:
	movl	-116(%rbp), %eax
	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	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -116(%rbp)
.L12:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L13
	movq	-80(%rbp), %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L14
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	movq	%rax, -104(%rbp)
	movq	-112(%rbp), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, (%rax)
.L14:
	movl	$1, -116(%rbp)
	jmp	.L15
.L17:
	movl	-116(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-80(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L16
	movl	-116(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-80(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rax
	addq	%rcx, %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	addq	%rax, -104(%rbp)
	movq	-112(%rbp), %rdx
	movl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-80(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	%rcx, (%rax,%rdx,8)
.L16:
	addl	$1, -116(%rbp)
.L15:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L17
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L18
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	movq	%rax, -96(%rbp)
	movl	-120(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-112(%rbp), %rdx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	%rdx, (%rax,%rcx,8)
.L18:
	movl	$1, -116(%rbp)
	jmp	.L19
.L21:
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	addq	%rax, %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L20
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	addq	%rdx, %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	addq	%rax, -96(%rbp)
	movq	-112(%rbp), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rcx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %esi
	subq	%rcx, %rdx
	movq	-64(%rbp), %rax
	movl	%esi, %ecx
	movq	%rdx, (%rax,%rcx,8)
.L20:
	addl	$1, -116(%rbp)
.L19:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L21
	movq	-104(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jnb	.L22
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L22:
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L23:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.p2align 4
	.globl	TF_print
	.type	TF_print, @function
TF_print:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	movq	%rdx, %rdi
	testb	%r8b, %r8b
	je	.L2
	movq	%rsi, %rdi
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	jmp	puts@PLT
	.cfi_endproc
.LFE51:
	.size	TF_print, .-TF_print
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%u %lu"
.LC1:
	.string	"%lu"
.LC2:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	-64(%rbp), %rdx
	leaq	-68(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %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
	movl	-68(%rbp), %eax
	movq	%rsp, %rdx
	leaq	15(,%rax,8), %rcx
	movq	%rax, %rsi
	movq	%rcx, %rax
	shrq	$4, %rax
	salq	$4, %rax
	movq	%rax, %rdi
	andq	$-4096, %rdi
	subq	%rdi, %rdx
	cmpq	%rdx, %rsp
	je	.L6
.L43:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L43
.L6:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L44
.L7:
	leaq	7(%rsp), %rdx
	shrq	$4, %rcx
	movq	%rdx, %rax
	salq	$4, %rcx
	andq	$-8, %rdx
	shrq	$3, %rax
	movq	%rcx, %rdi
	movq	%rdx, %r13
	movq	%rax, -88(%rbp)
	andq	$-4096, %rdi
	movq	%rsp, %rax
	subq	%rdi, %rax
.L8:
	cmpq	%rax, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L44:
	orq	$0, -8(%rsp,%rax)
	jmp	.L7
.L9:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L45
.L10:
	movq	%rsp, %r15
	testl	%esi, %esi
	je	.L11
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebx, %r12d
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	leaq	0(%r13,%r12,8), %rsi
	call	__isoc99_scanf@PLT
	movq	0(%r13,%r12,8), %rax
	movl	-68(%rbp), %esi
	movq	%rax, (%r15,%r12,8)
	cmpl	%ebx, %esi
	ja	.L12
.L11:
	movq	-88(%rbp), %rbx
	movq	-64(%rbp), %rcx
	xorl	%r10d, %r10d
	movq	0(,%rbx,8), %rax
	cmpq	%rcx, %rax
	jbe	.L13
	movq	%rcx, 0(,%rbx,8)
	subq	%rcx, %rax
	movq	%rax, %r10
.L13:
	cmpl	$1, %esi
	jbe	.L14
	leal	-2(%rsi), %edi
	leaq	8(%r13), %rax
	leaq	16(%r13,%rdi,8), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	-8(%rax), %rdx
	movq	(%rax), %rdi
	addq	%rdx, %rdi
	cmpq	%rdi, %rcx
	jnb	.L15
	subq	%rcx, %r10
	addq	%rdi, %r10
	movq	%rcx, %rdi
	subq	%rdx, %rdi
	movq	%rdi, (%rax)
.L15:
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L16
	leal	-1(%rsi), %eax
	movq	(%r15,%rax,8), %rdx
	movq	%rax, %r11
	cmpq	%rdx, %rcx
	jb	.L25
	xorl	%edx, %edx
.L24:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%esi, %edi
	subl	%eax, %edi
	movq	(%r15,%rdi,8), %r8
	movl	%r11d, %edi
	subl	%eax, %edi
	movq	(%r15,%rdi,8), %r9
	addq	%r8, %r9
	cmpq	%r9, %rcx
	jnb	.L18
	subq	%rcx, %rdx
	addq	%r9, %rdx
	movq	%rcx, %r9
	subq	%r8, %r9
	movq	%r9, (%r15,%rdi,8)
.L18:
	addl	$1, %eax
	cmpl	%esi, %eax
	jb	.L19
.L22:
	cmpq	%rdx, %r10
	jnb	.L20
	movq	%r10, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L21:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L46
	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
.L14:
	.cfi_restore_state
	leal	-1(%rsi), %eax
	movq	(%r15,%rax,8), %rdx
	cmpq	%rdx, %rcx
	jb	.L23
	xorl	%edx, %edx
.L20:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L21
.L25:
	movq	%rcx, (%r15,%rax,8)
	subq	%rcx, %rdx
	jmp	.L24
.L23:
	movq	%rcx, (%r15,%rax,8)
	subq	%rcx, %rdx
	jmp	.L22
.L45:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L10
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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
	.p2align 4
	.globl	TF_print
	.type	TF_print, @function
TF_print:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	movq	%rdx, %rdi
	testb	%r8b, %r8b
	je	.L2
	movq	%rsi, %rdi
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	jmp	puts@PLT
	.cfi_endproc
.LFE51:
	.size	TF_print, .-TF_print
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%u %lu"
.LC1:
	.string	"%lu"
.LC2:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	-64(%rbp), %rdx
	leaq	-68(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %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
	movl	-68(%rbp), %eax
	movq	%rsp, %rdx
	leaq	15(,%rax,8), %rcx
	movq	%rax, %rsi
	movq	%rcx, %rax
	shrq	$4, %rax
	salq	$4, %rax
	movq	%rax, %rdi
	andq	$-4096, %rdi
	subq	%rdi, %rdx
	cmpq	%rdx, %rsp
	je	.L6
.L43:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L43
.L6:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L44
.L7:
	leaq	7(%rsp), %rdx
	shrq	$4, %rcx
	movq	%rdx, %rax
	salq	$4, %rcx
	andq	$-8, %rdx
	shrq	$3, %rax
	movq	%rcx, %rdi
	movq	%rdx, %r13
	movq	%rax, -88(%rbp)
	andq	$-4096, %rdi
	movq	%rsp, %rax
	subq	%rdi, %rax
.L8:
	cmpq	%rax, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L44:
	orq	$0, -8(%rsp,%rax)
	jmp	.L7
.L9:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L45
.L10:
	movq	%rsp, %r15
	testl	%esi, %esi
	je	.L11
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebx, %r12d
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	leaq	0(%r13,%r12,8), %rsi
	call	__isoc99_scanf@PLT
	movq	0(%r13,%r12,8), %rax
	movl	-68(%rbp), %esi
	movq	%rax, (%r15,%r12,8)
	cmpl	%ebx, %esi
	ja	.L12
.L11:
	movq	-88(%rbp), %rbx
	movq	-64(%rbp), %rcx
	xorl	%r10d, %r10d
	movq	0(,%rbx,8), %rax
	cmpq	%rcx, %rax
	jbe	.L13
	movq	%rcx, 0(,%rbx,8)
	subq	%rcx, %rax
	movq	%rax, %r10
.L13:
	cmpl	$1, %esi
	jbe	.L14
	leal	-2(%rsi), %edi
	leaq	8(%r13), %rax
	leaq	16(%r13,%rdi,8), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	-8(%rax), %rdx
	movq	(%rax), %rdi
	addq	%rdx, %rdi
	cmpq	%rdi, %rcx
	jnb	.L15
	subq	%rcx, %r10
	addq	%rdi, %r10
	movq	%rcx, %rdi
	subq	%rdx, %rdi
	movq	%rdi, (%rax)
.L15:
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L16
	leal	-1(%rsi), %eax
	movq	(%r15,%rax,8), %rdx
	movq	%rax, %r11
	cmpq	%rdx, %rcx
	jb	.L25
	xorl	%edx, %edx
.L24:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%esi, %edi
	subl	%eax, %edi
	movq	(%r15,%rdi,8), %r8
	movl	%r11d, %edi
	subl	%eax, %edi
	movq	(%r15,%rdi,8), %r9
	addq	%r8, %r9
	cmpq	%r9, %rcx
	jnb	.L18
	subq	%rcx, %rdx
	addq	%r9, %rdx
	movq	%rcx, %r9
	subq	%r8, %r9
	movq	%r9, (%r15,%rdi,8)
.L18:
	addl	$1, %eax
	cmpl	%esi, %eax
	jb	.L19
.L22:
	cmpq	%rdx, %r10
	jnb	.L20
	movq	%r10, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L21:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L46
	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
.L14:
	.cfi_restore_state
	leal	-1(%rsi), %eax
	movq	(%r15,%rax,8), %rdx
	cmpq	%rdx, %rcx
	jb	.L23
	xorl	%edx, %edx
.L20:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L21
.L25:
	movq	%rcx, (%r15,%rax,8)
	subq	%rcx, %rdx
	jmp	.L24
.L23:
	movq	%rcx, (%r15,%rax,8)
	subq	%rcx, %rdx
	jmp	.L22
.L45:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L10
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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>
#include <string.h>

#define FOR(i, a, b) for(i = a; i < b; ++i)
#define REP(i, n) FOR(i, 0, n)
#define comp(a, b) int comp(const void *a, const void *b)
#define MOD  1000000007

typedef unsigned int uint;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;

void TF_print(char boolean, char T[], char F[]){
    if(boolean){
        printf("%s\n", T);
    }else{
        printf("%s\n", F);
    }
}

int main(){
    uint N, i;
    ul lim;

    scanf("%u %lu", &N, &lim);
    ul C[N], D[N], LEFT = 0, RIGHT = 0;

    REP(i, N){
        scanf("%lu", &C[i]);
        D[i] = C[i];
    }

    if(C[0] > lim){
        LEFT = C[0] - lim;
        C[0] = lim;
    }

    FOR(i, 1, N){
        if(C[i - 1] + C[i] > lim){
            LEFT += (C[i - 1] + C[i] - lim);
            C[i] = lim - C[i - 1];
        }
    }

    if(D[N - 1] > lim){
        RIGHT = D[N - 1] - lim;
        D[N - 1] = lim;
    }

    FOR(i, 1, N){
        if(D[N - i] + D[N - i - 1] > lim){
            RIGHT += (D[N - i] + D[N - i - 1] - lim);
            D[N - i - 1] = lim - D[N - i];
        }
    }

    if(LEFT < RIGHT){
        printf("%lu\n", LEFT);
    }else{
        printf("%lu\n", RIGHT);
    }

    return 0;
}
3 3
2 2 2

1

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

#define FOR(i, a, b) for(i = a; i < b; ++i)
#define REP(i, n) FOR(i, 0, n)
#define comp(a, b) int comp(const void *a, const void *b)
#define MOD  1000000007

typedef unsigned int uint;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;

void TF_print(char boolean, char T[], char F[]){
    if(boolean){
        printf("%s\n", T);
    }else{
        printf("%s\n", F);
    }
}

int main(){
    uint N, i;
    ul lim;

    scanf("%u %lu", &N, &lim);
    ul C[N], D[N], LEFT = 0, RIGHT = 0;

    REP(i, N){
        scanf("%lu", &C[i]);
        D[i] = C[i];
    }

    if(C[0] > lim){
        LEFT = C[0] - lim;
        C[0] = lim;
    }

    FOR(i, 1, N){
        if(C[i - 1] + C[i] > lim){
            LEFT += (C[i - 1] + C[i] - lim);
            C[i] = lim - C[i - 1];
        }
    }

    if(D[N - 1] > lim){
        RIGHT = D[N - 1] - lim;
        D[N - 1] = lim;
    }

    FOR(i, 1, N){
        if(D[N - i] + D[N - i - 1] > lim){
            RIGHT += (D[N - i] + D[N - i - 1] - lim);
            D[N - i - 1] = lim - D[N - i];
        }
    }

    if(LEFT < RIGHT){
        printf("%lu\n", LEFT);
    }else{
        printf("%lu\n", RIGHT);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	TF_print
	.type	TF_print, @function
TF_print:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, %eax
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movb	%al, -4(%rbp)
	cmpb	$0, -4(%rbp)
	je	.L2
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L2:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	TF_print, .-TF_print
	.section	.rodata
.LC0:
	.string	"%u %lu"
.LC1:
	.string	"%lu"
.LC2:
	.string	"%lu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$120, %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	-112(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movl	%eax, %edx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movl	%eax, %edx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	%eax, %edx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movl	%eax, %eax
	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
.L6:
	cmpq	%rdx, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L8
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L8:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, %edx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movl	%eax, %edx
	movq	%rdx, %r14
	movl	$0, %r15d
	movl	%eax, %edx
	movq	%rdx, %r12
	movl	$0, %r13d
	movl	%eax, %eax
	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
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L12
.L13:
	movl	-116(%rbp), %eax
	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	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -116(%rbp)
.L12:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L13
	movq	-80(%rbp), %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L14
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	movq	%rax, -104(%rbp)
	movq	-112(%rbp), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, (%rax)
.L14:
	movl	$1, -116(%rbp)
	jmp	.L15
.L17:
	movl	-116(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-80(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L16
	movl	-116(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-80(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rax
	addq	%rcx, %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	addq	%rax, -104(%rbp)
	movq	-112(%rbp), %rdx
	movl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-80(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	%rcx, (%rax,%rdx,8)
.L16:
	addl	$1, -116(%rbp)
.L15:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L17
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L18
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	movq	%rax, -96(%rbp)
	movl	-120(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-112(%rbp), %rdx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	%rdx, (%rax,%rcx,8)
.L18:
	movl	$1, -116(%rbp)
	jmp	.L19
.L21:
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	addq	%rax, %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L20
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	addq	%rdx, %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	addq	%rax, -96(%rbp)
	movq	-112(%rbp), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rcx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %esi
	subq	%rcx, %rdx
	movq	-64(%rbp), %rax
	movl	%esi, %ecx
	movq	%rdx, (%rax,%rcx,8)
.L20:
	addl	$1, -116(%rbp)
.L19:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L21
	movq	-104(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jnb	.L22
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L22:
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L23:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.globl	TF_print
	.type	TF_print, @function
TF_print:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, %eax
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movb	%al, -4(%rbp)
	cmpb	$0, -4(%rbp)
	je	.L2
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L2:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	TF_print, .-TF_print
	.section	.rodata
.LC0:
	.string	"%u %lu"
.LC1:
	.string	"%lu"
.LC2:
	.string	"%lu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$120, %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	-112(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movl	%eax, %edx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movl	%eax, %edx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	%eax, %edx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movl	%eax, %eax
	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
.L6:
	cmpq	%rdx, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L8
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L8:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, %edx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movl	%eax, %edx
	movq	%rdx, %r14
	movl	$0, %r15d
	movl	%eax, %edx
	movq	%rdx, %r12
	movl	$0, %r13d
	movl	%eax, %eax
	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
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L12
.L13:
	movl	-116(%rbp), %eax
	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	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -116(%rbp)
.L12:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L13
	movq	-80(%rbp), %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L14
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	movq	%rax, -104(%rbp)
	movq	-112(%rbp), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, (%rax)
.L14:
	movl	$1, -116(%rbp)
	jmp	.L15
.L17:
	movl	-116(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-80(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L16
	movl	-116(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-80(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	(%rax,%rdx,8), %rax
	addq	%rcx, %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	addq	%rax, -104(%rbp)
	movq	-112(%rbp), %rdx
	movl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-80(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movq	%rcx, (%rax,%rdx,8)
.L16:
	addl	$1, -116(%rbp)
.L15:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L17
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L18
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	movq	%rax, -96(%rbp)
	movl	-120(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-112(%rbp), %rdx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	%rdx, (%rax,%rcx,8)
.L18:
	movl	$1, -116(%rbp)
	jmp	.L19
.L21:
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	addq	%rax, %rdx
	movq	-112(%rbp), %rax
	cmpq	%rax, %rdx
	jbe	.L20
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rax
	addq	%rdx, %rax
	movq	-112(%rbp), %rdx
	subq	%rdx, %rax
	addq	%rax, -96(%rbp)
	movq	-112(%rbp), %rdx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %ecx
	movq	(%rax,%rcx,8), %rcx
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	leal	-1(%rax), %esi
	subq	%rcx, %rdx
	movq	-64(%rbp), %rax
	movl	%esi, %ecx
	movq	%rdx, (%rax,%rcx,8)
.L20:
	addl	$1, -116(%rbp)
.L19:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jb	.L21
	movq	-104(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jnb	.L22
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L22:
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L23:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
