Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
 * ID: 3001
 * Proble: GPA janken, combination
 */

#include <stdio.h>

int main(void)
{
    int a[500000];
    int c[4001] = {};
    int s[4001] = {};

    int n;
    scanf("%d", &n);

    int i;
    for (i = 0; i < n; i++) {
        int d, e, f, g;
        scanf("%1d %*1c %1d %1d %1d", &d, &e, &f, &g);
        a[i] = ((d * 10 + e) * 10 + f) * 10 + g;
    }

    for (i = 0; i < n; i++) 
        c[a[i]]++;

    int k = n - 1;
    for (i = 4000; i >= 0 && k > 0; i--) {
        if (c[i] == 0)
            continue;
        s[i] = k * 3 - (c[i] - 1) * 2;
        k -= c[i];
    }

    for (i = 0; i < n; i++)
        printf("%d\n", s[a[i]]);

    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%1d %*1c %1d %1d %1d"
.LC2:
	.string	"%d\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
	leaq	-2031616(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2032048(%rbp), %rax
	movl	$16004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-2016032(%rbp), %rax
	movl	$16004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-2032076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2032056(%rbp)
	jmp	.L2
.L3:
	leaq	-2032060(%rbp), %rsi
	leaq	-2032064(%rbp), %rcx
	leaq	-2032068(%rbp), %rdx
	leaq	-2032072(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2032072(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032068(%rbp), %eax
	addl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032064(%rbp), %eax
	addl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032060(%rbp), %eax
	addl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	%edx, -2000016(%rbp,%rax,4)
	addl	$1, -2032056(%rbp)
.L2:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L3
	movl	$0, -2032056(%rbp)
	jmp	.L4
.L5:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2000016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-2032048(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -2032048(%rbp,%rax,4)
	addl	$1, -2032056(%rbp)
.L4:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L5
	movl	-2032076(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -2032052(%rbp)
	movl	$4000, -2032056(%rbp)
	jmp	.L6
.L10:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	movl	-2032052(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	subl	$1, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	%edx, -2016032(%rbp,%rax,4)
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	subl	%eax, -2032052(%rbp)
	jmp	.L8
.L15:
	nop
.L8:
	subl	$1, -2032056(%rbp)
.L6:
	cmpl	$0, -2032056(%rbp)
	js	.L9
	cmpl	$0, -2032052(%rbp)
	jg	.L10
.L9:
	movl	$0, -2032056(%rbp)
	jmp	.L11
.L12:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2000016(%rbp,%rax,4), %eax
	cltq
	movl	-2016032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2032056(%rbp)
.L11:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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	"%1d %*1c %1d %1d %1d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-2031616(%rsp), %r11
	.cfi_def_cfa 11, 2031672
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$504, %rsp
	.cfi_def_cfa_offset 2032176
	movl	$16004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 2032104(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	call	memset@PLT
	leaq	16080(%rsp), %rax
	movl	$16004, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	memset@PLT
	leaq	44(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%ebp, %ebp
	leaq	60(%rsp), %r8
	leaq	56(%rsp), %r15
	leaq	52(%rsp), %r14
	leaq	48(%rsp), %r13
	leaq	.LC1(%rip), %r12
	leaq	32096(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rdx
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%r8, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	movq	8(%rsp), %r8
	leal	(%rax,%rax,4), %edx
	movl	52(%rsp), %eax
	leal	(%rax,%rdx,2), %eax
	leal	(%rax,%rax,4), %edx
	movl	56(%rsp), %eax
	leal	(%rax,%rdx,2), %eax
	leal	(%rax,%rax,4), %edx
	movl	60(%rsp), %eax
	leal	(%rax,%rdx,2), %eax
	movl	%eax, (%rbx,%rbp,4)
	movl	44(%rsp), %eax
	addq	$1, %rbp
	cmpl	%ebp, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L10
	leal	-1(%rax), %ecx
	movq	%rbx, %rdx
	movq	%rcx, %rax
	leaq	32100(%rsp,%rcx,4), %rsi
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	(%rdx), %rcx
	addq	$4, %rdx
	addl	$1, 64(%rsp,%rcx,4)
	cmpq	%rdx, %rsi
	jne	.L4
	movl	$3999, %edx
	testl	%eax, %eax
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	movq	16(%rsp), %rdi
	movl	4(%rdi,%rdx,4), %ecx
	testl	%ecx, %ecx
	je	.L6
	leal	(%rax,%rax,2), %esi
	leal	-2(%rcx,%rcx), %edi
	subl	%ecx, %eax
	subl	%edi, %esi
	movq	24(%rsp), %rdi
	movl	%esi, 4(%rdi,%rdx,4)
.L6:
	movl	%edx, %ecx
	notl	%ecx
	shrl	$31, %ecx
	testl	%eax, %eax
	setg	%sil
	subq	$1, %rdx
	testb	%cl, %sil
	jne	.L7
.L8:
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	(%rbx,%rbp,4), %rax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	movl	16080(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L9
.L10:
	movq	2032104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$2032120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L25:
	.cfi_restore_state
	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	"%1d %*1c %1d %1d %1d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-2031616(%rsp), %r11
	.cfi_def_cfa 11, 2031672
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$504, %rsp
	.cfi_def_cfa_offset 2032176
	movl	$16004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 2032104(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	call	memset@PLT
	leaq	16080(%rsp), %rax
	movl	$16004, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	memset@PLT
	leaq	44(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%ebp, %ebp
	leaq	60(%rsp), %r8
	leaq	56(%rsp), %r15
	leaq	52(%rsp), %r14
	leaq	48(%rsp), %r13
	leaq	.LC1(%rip), %r12
	leaq	32096(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rdx
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%r8, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	movq	8(%rsp), %r8
	leal	(%rax,%rax,4), %edx
	movl	52(%rsp), %eax
	leal	(%rax,%rdx,2), %eax
	leal	(%rax,%rax,4), %edx
	movl	56(%rsp), %eax
	leal	(%rax,%rdx,2), %eax
	leal	(%rax,%rax,4), %edx
	movl	60(%rsp), %eax
	leal	(%rax,%rdx,2), %eax
	movl	%eax, (%rbx,%rbp,4)
	movl	44(%rsp), %eax
	addq	$1, %rbp
	cmpl	%ebp, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L10
	leal	-1(%rax), %ecx
	movq	%rbx, %rdx
	movq	%rcx, %rax
	leaq	32100(%rsp,%rcx,4), %rsi
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	(%rdx), %rcx
	addq	$4, %rdx
	addl	$1, 64(%rsp,%rcx,4)
	cmpq	%rdx, %rsi
	jne	.L4
	movl	$3999, %edx
	testl	%eax, %eax
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	movq	16(%rsp), %rdi
	movl	4(%rdi,%rdx,4), %ecx
	testl	%ecx, %ecx
	je	.L6
	leal	(%rax,%rax,2), %esi
	leal	-2(%rcx,%rcx), %edi
	subl	%ecx, %eax
	subl	%edi, %esi
	movq	24(%rsp), %rdi
	movl	%esi, 4(%rdi,%rdx,4)
.L6:
	movl	%edx, %ecx
	notl	%ecx
	shrl	$31, %ecx
	testl	%eax, %eax
	setg	%sil
	subq	$1, %rdx
	testb	%cl, %sil
	jne	.L7
.L8:
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	(%rbx,%rbp,4), %rax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	movl	16080(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L9
.L10:
	movq	2032104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$2032120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L25:
	.cfi_restore_state
	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:

/*
 * ID: 3001
 * Proble: GPA janken, combination
 */

#include <stdio.h>

int main(void)
{
    int a[500000];
    int c[4001] = {};
    int s[4001] = {};

    int n;
    scanf("%d", &n);

    int i;
    for (i = 0; i < n; i++) {
        int d, e, f, g;
        scanf("%1d %*1c %1d %1d %1d", &d, &e, &f, &g);
        a[i] = ((d * 10 + e) * 10 + f) * 10 + g;
    }

    for (i = 0; i < n; i++) 
        c[a[i]]++;

    int k = n - 1;
    for (i = 4000; i >= 0 && k > 0; i--) {
        if (c[i] == 0)
            continue;
        s[i] = k * 3 - (c[i] - 1) * 2;
        k -= c[i];
    }

    for (i = 0; i < n; i++)
        printf("%d\n", s[a[i]]);

    return 0;
}


3
1.000
2.000
3.4274102096399073
 3
1.3153899733914476
3.000
3.000
 3
1.000
3.512063887057689
3.1230319554116766
 3
3.0191870253634328
3.000
3.1230319554116766
 3
3.577786126306406
3.000
3.1230319554116766
 3
3.777463945799447
3.960832526665802
3.576511293983621
 3
3.777463945799447
3.700810051155423
3.576511293983621
 3
1.000
3.000
3.1230319554116766
 3
1.000
2.000
3.9759367558439593
 3
1.1411047932981444
3.000
3.1230319554116766

0
3
6
 0
6
3
 3
6
0
 6
3
0
 6
0
0
 6
0
0
 6
0
0
 0
3
6
 0
3
6
 0
3
6

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
 * ID: 3001
 * Proble: GPA janken, combination
 */

#include <stdio.h>

int main(void)
{
    int a[500000];
    int c[4001] = {};
    int s[4001] = {};

    int n;
    scanf("%d", &n);

    int i;
    for (i = 0; i < n; i++) {
        int d, e, f, g;
        scanf("%1d %*1c %1d %1d %1d", &d, &e, &f, &g);
        a[i] = ((d * 10 + e) * 10 + f) * 10 + g;
    }

    for (i = 0; i < n; i++) 
        c[a[i]]++;

    int k = n - 1;
    for (i = 4000; i >= 0 && k > 0; i--) {
        if (c[i] == 0)
            continue;
        s[i] = k * 3 - (c[i] - 1) * 2;
        k -= c[i];
    }

    for (i = 0; i < n; i++)
        printf("%d\n", s[a[i]]);

    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%1d %*1c %1d %1d %1d"
.LC2:
	.string	"%d\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
	leaq	-2031616(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2032048(%rbp), %rax
	movl	$16004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-2016032(%rbp), %rax
	movl	$16004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-2032076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2032056(%rbp)
	jmp	.L2
.L3:
	leaq	-2032060(%rbp), %rsi
	leaq	-2032064(%rbp), %rcx
	leaq	-2032068(%rbp), %rdx
	leaq	-2032072(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2032072(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032068(%rbp), %eax
	addl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032064(%rbp), %eax
	addl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032060(%rbp), %eax
	addl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	%edx, -2000016(%rbp,%rax,4)
	addl	$1, -2032056(%rbp)
.L2:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L3
	movl	$0, -2032056(%rbp)
	jmp	.L4
.L5:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2000016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-2032048(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -2032048(%rbp,%rax,4)
	addl	$1, -2032056(%rbp)
.L4:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L5
	movl	-2032076(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -2032052(%rbp)
	movl	$4000, -2032056(%rbp)
	jmp	.L6
.L10:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	movl	-2032052(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	subl	$1, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	%edx, -2016032(%rbp,%rax,4)
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	subl	%eax, -2032052(%rbp)
	jmp	.L8
.L15:
	nop
.L8:
	subl	$1, -2032056(%rbp)
.L6:
	cmpl	$0, -2032056(%rbp)
	js	.L9
	cmpl	$0, -2032052(%rbp)
	jg	.L10
.L9:
	movl	$0, -2032056(%rbp)
	jmp	.L11
.L12:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2000016(%rbp,%rax,4), %eax
	cltq
	movl	-2016032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2032056(%rbp)
.L11:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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	"%1d %*1c %1d %1d %1d"
.LC2:
	.string	"%d\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
	leaq	-2031616(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2032048(%rbp), %rax
	movl	$16004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-2016032(%rbp), %rax
	movl	$16004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-2032076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2032056(%rbp)
	jmp	.L2
.L3:
	leaq	-2032060(%rbp), %rsi
	leaq	-2032064(%rbp), %rcx
	leaq	-2032068(%rbp), %rdx
	leaq	-2032072(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2032072(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032068(%rbp), %eax
	addl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032064(%rbp), %eax
	addl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-2032060(%rbp), %eax
	addl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	%edx, -2000016(%rbp,%rax,4)
	addl	$1, -2032056(%rbp)
.L2:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L3
	movl	$0, -2032056(%rbp)
	jmp	.L4
.L5:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2000016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-2032048(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -2032048(%rbp,%rax,4)
	addl	$1, -2032056(%rbp)
.L4:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L5
	movl	-2032076(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -2032052(%rbp)
	movl	$4000, -2032056(%rbp)
	jmp	.L6
.L10:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	movl	-2032052(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	subl	$1, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	-2032056(%rbp), %eax
	cltq
	movl	%edx, -2016032(%rbp,%rax,4)
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2032048(%rbp,%rax,4), %eax
	subl	%eax, -2032052(%rbp)
	jmp	.L8
.L15:
	nop
.L8:
	subl	$1, -2032056(%rbp)
.L6:
	cmpl	$0, -2032056(%rbp)
	js	.L9
	cmpl	$0, -2032052(%rbp)
	jg	.L10
.L9:
	movl	$0, -2032056(%rbp)
	jmp	.L11
.L12:
	movl	-2032056(%rbp), %eax
	cltq
	movl	-2000016(%rbp,%rax,4), %eax
	cltq
	movl	-2016032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2032056(%rbp)
.L11:
	movl	-2032076(%rbp), %eax
	cmpl	%eax, -2032056(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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:
