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>

static int cmp_int (const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}

int main (void) {
    int i, j, k, scaned;
    int n;
    scaned = scanf("%d", &n);
    if ( scaned != 1 ) {
        fprintf(stderr, "invalid input\n");
        return EXIT_FAILURE;
    }
    int l[n];
    for ( i=0; i<n; i++ ) {
        scaned = scanf("%d", &l[i]);
        if ( scaned != 1 ) {
            fprintf(stderr, "invalid input\n");
            return EXIT_FAILURE;
        }
    }

    qsort(l, n, sizeof(int), cmp_int);

    long long ans=0;
    for ( i=0; i<n-2; i++ ) {
        for ( j=i+1; j<n-1; j++ ) {
            for ( k=j+1; k<n; k++ ) {
                if ( l[k] < l[i]+l[j] )
                    ans++;
                else
                    break;
            }
        }
    }

    printf("%lld\n", ans);
    return EXIT_SUCCESS;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	cmp_int, @function
cmp_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp_int, .-cmp_int
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"invalid input\n"
.LC2:
	.string	"%lld\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	$72, %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	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	%eax, -84(%rbp)
	cmpl	$1, -84(%rbp)
	je	.L4
	movq	stderr(%rip), %rax
	movq	%rax, %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	fwrite@PLT
	movl	$1, %eax
	jmp	.L5
.L4:
	movl	-100(%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,4), %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	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L9
.L11:
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %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
	movl	%eax, -84(%rbp)
	cmpl	$1, -84(%rbp)
	je	.L10
	movq	stderr(%rip), %rax
	movq	%rax, %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	fwrite@PLT
	movl	$1, %eax
	jmp	.L5
.L10:
	addl	$1, -96(%rbp)
.L9:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L11
	movl	-100(%rbp), %eax
	movslq	%eax, %rsi
	movq	-64(%rbp), %rax
	leaq	cmp_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -80(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L12
.L20:
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -92(%rbp)
	jmp	.L13
.L19:
	movl	-92(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -88(%rbp)
	jmp	.L14
.L18:
	movq	-64(%rbp), %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jge	.L23
	addq	$1, -80(%rbp)
	addl	$1, -88(%rbp)
.L14:
	movl	-100(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L18
	jmp	.L17
.L23:
	nop
.L17:
	addl	$1, -92(%rbp)
.L13:
	movl	-100(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -92(%rbp)
	jl	.L19
	addl	$1, -96(%rbp)
.L12:
	movl	-100(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -96(%rbp)
	jl	.L20
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L5:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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
	.type	cmp_int, @function
cmp_int:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp_int, .-cmp_int
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"invalid input\n"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.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
	cmpl	$1, %eax
	jne	.L28
	movslq	-60(%rbp), %rsi
	movq	%rsp, %rdi
	movl	%eax, %r15d
	leaq	15(,%rsi,4), %rdx
	movq	%rsi, %rax
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	andq	$-16, %rcx
	subq	%rdx, %rdi
.L6:
	cmpq	%rdi, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L8:
	movq	%rsp, %rbx
	testl	%eax, %eax
	jle	.L9
	movq	%rbx, %r12
	xorl	%r13d, %r13d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	-60(%rbp), %eax
	addl	$1, %r13d
	addq	$4, %r12
	cmpl	%r13d, %eax
	jle	.L30
.L11:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L10
	movq	stderr(%rip), %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rdi
	call	fwrite@PLT
.L3:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L31
	leaq	-40(%rbp), %rsp
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L30:
	.cfi_restore_state
	movslq	%eax, %rsi
.L9:
	leaq	cmp_int(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	-60(%rbp), %r11d
	cmpl	$2, %r11d
	jle	.L19
	leal	-3(%r11), %r12d
	leal	-1(%r11), %r9d
	movl	$1, %r10d
	xorl	%edx, %edx
	addq	$2, %r12
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r10d, %edi
	cmpl	%r10d, %r9d
	jle	.L13
	leaq	0(,%r10,4), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %edi
	cmpl	%r11d, %edi
	jge	.L14
	movl	%r9d, %eax
	movl	(%rbx,%r8), %ecx
	addl	-4(%rbx,%r10,4), %ecx
	subl	%edi, %eax
	leaq	1(%rdx,%rax), %rsi
	movq	%rdx, %rax
	negq	%rax
	leaq	(%r8,%rax,4), %rax
	addq	%rbx, %rax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$1, %rdx
	cmpq	%rsi, %rdx
	je	.L14
.L15:
	cmpl	%ecx, 4(%rax,%rdx,4)
	jl	.L32
.L14:
	addq	$4, %r8
	cmpl	%edi, %r9d
	jne	.L16
.L13:
	addq	$1, %r10
	cmpq	%r12, %r10
	jne	.L17
.L12:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	call	__printf_chk@PLT
	jmp	.L3
.L28:
	movl	$14, %edx
	movq	stderr(%rip), %rcx
	movl	$1, %esi
	leaq	.LC1(%rip), %rdi
	movl	$1, %r15d
	call	fwrite@PLT
	jmp	.L3
.L29:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L8
.L19:
	xorl	%edx, %edx
	jmp	.L12
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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
	.type	cmp_int, @function
cmp_int:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp_int, .-cmp_int
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"invalid input\n"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.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
	cmpl	$1, %eax
	jne	.L28
	movslq	-60(%rbp), %rsi
	movq	%rsp, %rdi
	movl	%eax, %r15d
	leaq	15(,%rsi,4), %rdx
	movq	%rsi, %rax
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	andq	$-16, %rcx
	subq	%rdx, %rdi
.L6:
	cmpq	%rdi, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L8:
	movq	%rsp, %rbx
	testl	%eax, %eax
	jle	.L9
	movq	%rbx, %r12
	xorl	%r13d, %r13d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	-60(%rbp), %eax
	addl	$1, %r13d
	addq	$4, %r12
	cmpl	%r13d, %eax
	jle	.L30
.L11:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L10
	movq	stderr(%rip), %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rdi
	call	fwrite@PLT
.L3:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L31
	leaq	-40(%rbp), %rsp
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L30:
	.cfi_restore_state
	movslq	%eax, %rsi
.L9:
	leaq	cmp_int(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	-60(%rbp), %r11d
	cmpl	$2, %r11d
	jle	.L19
	leal	-3(%r11), %r12d
	leal	-1(%r11), %r9d
	movl	$1, %r10d
	xorl	%edx, %edx
	addq	$2, %r12
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r10d, %edi
	cmpl	%r10d, %r9d
	jle	.L13
	leaq	0(,%r10,4), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %edi
	cmpl	%r11d, %edi
	jge	.L14
	movl	%r9d, %eax
	movl	(%rbx,%r8), %ecx
	addl	-4(%rbx,%r10,4), %ecx
	subl	%edi, %eax
	leaq	1(%rdx,%rax), %rsi
	movq	%rdx, %rax
	negq	%rax
	leaq	(%r8,%rax,4), %rax
	addq	%rbx, %rax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$1, %rdx
	cmpq	%rsi, %rdx
	je	.L14
.L15:
	cmpl	%ecx, 4(%rax,%rdx,4)
	jl	.L32
.L14:
	addq	$4, %r8
	cmpl	%edi, %r9d
	jne	.L16
.L13:
	addq	$1, %r10
	cmpq	%r12, %r10
	jne	.L17
.L12:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	call	__printf_chk@PLT
	jmp	.L3
.L28:
	movl	$14, %edx
	movq	stderr(%rip), %rcx
	movl	$1, %esi
	leaq	.LC1(%rip), %rdi
	movl	$1, %r15d
	call	fwrite@PLT
	jmp	.L3
.L29:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L8
.L19:
	xorl	%edx, %edx
	jmp	.L12
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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>

static int cmp_int (const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}

int main (void) {
    int i, j, k, scaned;
    int n;
    scaned = scanf("%d", &n);
    if ( scaned != 1 ) {
        fprintf(stderr, "invalid input\n");
        return EXIT_FAILURE;
    }
    int l[n];
    for ( i=0; i<n; i++ ) {
        scaned = scanf("%d", &l[i]);
        if ( scaned != 1 ) {
            fprintf(stderr, "invalid input\n");
            return EXIT_FAILURE;
        }
    }

    qsort(l, n, sizeof(int), cmp_int);

    long long ans=0;
    for ( i=0; i<n-2; i++ ) {
        for ( j=i+1; j<n-1; j++ ) {
            for ( k=j+1; k<n; k++ ) {
                if ( l[k] < l[i]+l[j] )
                    ans++;
                else
                    break;
            }
        }
    }

    printf("%lld\n", ans);
    return EXIT_SUCCESS;
}

4
5 4 2 1
 7
218 1140 704 233 645 728 389
 3
1 1000 2
 7
218 1140 704 233 645 890 389
 7
218 1140 1051 233 449 890 389
 7
218 1140 1051 16 636 890 389
 7
218 1140 551 40 636 890 487
 7
218 1140 551 40 660 890 487
 7
116 1499 551 40 806 890 487
 7
116 1499 551 40 297 890 487

1
 14
 0
 13
 15
 10
 11
 12
 7
 3

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>

static int cmp_int (const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}

int main (void) {
    int i, j, k, scaned;
    int n;
    scaned = scanf("%d", &n);
    if ( scaned != 1 ) {
        fprintf(stderr, "invalid input\n");
        return EXIT_FAILURE;
    }
    int l[n];
    for ( i=0; i<n; i++ ) {
        scaned = scanf("%d", &l[i]);
        if ( scaned != 1 ) {
            fprintf(stderr, "invalid input\n");
            return EXIT_FAILURE;
        }
    }

    qsort(l, n, sizeof(int), cmp_int);

    long long ans=0;
    for ( i=0; i<n-2; i++ ) {
        for ( j=i+1; j<n-1; j++ ) {
            for ( k=j+1; k<n; k++ ) {
                if ( l[k] < l[i]+l[j] )
                    ans++;
                else
                    break;
            }
        }
    }

    printf("%lld\n", ans);
    return EXIT_SUCCESS;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	cmp_int, @function
cmp_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp_int, .-cmp_int
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"invalid input\n"
.LC2:
	.string	"%lld\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	$72, %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	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	%eax, -84(%rbp)
	cmpl	$1, -84(%rbp)
	je	.L4
	movq	stderr(%rip), %rax
	movq	%rax, %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	fwrite@PLT
	movl	$1, %eax
	jmp	.L5
.L4:
	movl	-100(%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,4), %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	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L9
.L11:
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %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
	movl	%eax, -84(%rbp)
	cmpl	$1, -84(%rbp)
	je	.L10
	movq	stderr(%rip), %rax
	movq	%rax, %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	fwrite@PLT
	movl	$1, %eax
	jmp	.L5
.L10:
	addl	$1, -96(%rbp)
.L9:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L11
	movl	-100(%rbp), %eax
	movslq	%eax, %rsi
	movq	-64(%rbp), %rax
	leaq	cmp_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -80(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L12
.L20:
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -92(%rbp)
	jmp	.L13
.L19:
	movl	-92(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -88(%rbp)
	jmp	.L14
.L18:
	movq	-64(%rbp), %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jge	.L23
	addq	$1, -80(%rbp)
	addl	$1, -88(%rbp)
.L14:
	movl	-100(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L18
	jmp	.L17
.L23:
	nop
.L17:
	addl	$1, -92(%rbp)
.L13:
	movl	-100(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -92(%rbp)
	jl	.L19
	addl	$1, -96(%rbp)
.L12:
	movl	-100(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -96(%rbp)
	jl	.L20
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L5:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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
	.type	cmp_int, @function
cmp_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp_int, .-cmp_int
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"invalid input\n"
.LC2:
	.string	"%lld\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	$72, %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	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	%eax, -84(%rbp)
	cmpl	$1, -84(%rbp)
	je	.L4
	movq	stderr(%rip), %rax
	movq	%rax, %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	fwrite@PLT
	movl	$1, %eax
	jmp	.L5
.L4:
	movl	-100(%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,4), %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	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L9
.L11:
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %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
	movl	%eax, -84(%rbp)
	cmpl	$1, -84(%rbp)
	je	.L10
	movq	stderr(%rip), %rax
	movq	%rax, %rcx
	movl	$14, %edx
	movl	$1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	fwrite@PLT
	movl	$1, %eax
	jmp	.L5
.L10:
	addl	$1, -96(%rbp)
.L9:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L11
	movl	-100(%rbp), %eax
	movslq	%eax, %rsi
	movq	-64(%rbp), %rax
	leaq	cmp_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -80(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L12
.L20:
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -92(%rbp)
	jmp	.L13
.L19:
	movl	-92(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -88(%rbp)
	jmp	.L14
.L18:
	movq	-64(%rbp), %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jge	.L23
	addq	$1, -80(%rbp)
	addl	$1, -88(%rbp)
.L14:
	movl	-100(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L18
	jmp	.L17
.L23:
	nop
.L17:
	addl	$1, -92(%rbp)
.L13:
	movl	-100(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -92(%rbp)
	jl	.L19
	addl	$1, -96(%rbp)
.L12:
	movl	-100(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -96(%rbp)
	jl	.L20
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L5:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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:
