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

```c
#include<stdio.h>
#include<string.h>

int main(){
    int n,i,j,d[100],t,x[100];
    char s[100][100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s %d",s[i],&d[i]);
        for(j=i;j>0;j--){
            t=strcmp(s[i],s[x[j-1]]);
            if(t<0 || (t==0 && d[i]>d[x[j-1]])) x[j] = x[j-1];
            else break;
        }
        x[j]=i;
    }
    for(i=0;i<n;i++){
        printf("%d\n",x[i]+1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d"
.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
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2640, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10828(%rbp)
	jmp	.L2
.L7:
	leaq	-10816(%rbp), %rdx
	movl	-10828(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-10016(%rbp), %rsi
	movl	-10828(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-10828(%rbp), %eax
	movl	%eax, -10824(%rbp)
	jmp	.L3
.L6:
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	leaq	-10016(%rbp), %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-10016(%rbp), %rsi
	movl	-10828(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	movl	%eax, -10820(%rbp)
	cmpl	$0, -10820(%rbp)
	js	.L4
	cmpl	$0, -10820(%rbp)
	jne	.L5
	movl	-10828(%rbp), %eax
	cltq
	movl	-10816(%rbp,%rax,4), %edx
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	cltq
	movl	-10816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L5
.L4:
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %edx
	movl	-10824(%rbp), %eax
	cltq
	movl	%edx, -10416(%rbp,%rax,4)
	subl	$1, -10824(%rbp)
.L3:
	cmpl	$0, -10824(%rbp)
	jg	.L6
.L5:
	movl	-10824(%rbp), %eax
	cltq
	movl	-10828(%rbp), %edx
	movl	%edx, -10416(%rbp,%rax,4)
	addl	$1, -10828(%rbp)
.L2:
	movl	-10832(%rbp), %eax
	cmpl	%eax, -10828(%rbp)
	jl	.L7
	movl	$0, -10828(%rbp)
	jmp	.L8
.L9:
	movl	-10828(%rbp), %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10828(%rbp)
.L8:
	movl	-10832(%rbp), %eax
	cmpl	%eax, -10828(%rbp)
	jl	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"%s %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$2680, %rsp
	.cfi_def_cfa_offset 10928
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10856(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	848(%rsp), %rax
	leaq	48(%rsp), %rdx
	movq	%rax, (%rsp)
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	$0, 448(%rsp)
	cmpl	$1, %eax
	jle	.L10
	leaq	52(%rsp), %rax
	leaq	948(%rsp), %rbp
	movq	$1, 16(%rsp)
	movq	%rax, 8(%rsp)
	leaq	448(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	16(%rsp), %r14
	movq	8(%rsp), %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movl	%r14d, 28(%rsp)
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	-4(%rbx,%r14,4), %r12
	movq	(%rsp), %rcx
	movq	%rbp, %rdi
	movl	%r14d, %r15d
	leaq	(%r12,%r12,4), %rax
	movq	%r12, %r13
	leaq	(%rax,%rax,4), %rax
	leaq	(%rcx,%rax,4), %rsi
	call	strcmp@PLT
	testl	%eax, %eax
	js	.L3
	jne	.L4
	movq	8(%rsp), %rax
	movl	48(%rsp,%r12,4), %edx
	cmpl	%edx, (%rax)
	jle	.L4
.L3:
	movl	%r13d, (%rbx,%r14,4)
	subq	$1, %r14
	movl	%r14d, %r15d
	testl	%r14d, %r14d
	jne	.L5
.L4:
	movl	28(%rsp), %eax
	movslq	%r15d, %r9
	addq	$1, 16(%rsp)
	addq	$100, %rbp
	movq	16(%rsp), %rdi
	addq	$4, 8(%rsp)
	movl	%eax, 448(%rsp,%r9,4)
	movl	44(%rsp), %eax
	cmpl	%edi, %eax
	jg	.L6
.L10:
	testl	%eax, %eax
	jle	.L7
	xorl	%ebp, %ebp
	leaq	448(%rsp), %rbx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rbx,%rbp,4), %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	leal	1(%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L8
.L7:
	movq	10856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$10872, %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
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%s %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$2680, %rsp
	.cfi_def_cfa_offset 10928
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10856(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	848(%rsp), %rax
	leaq	48(%rsp), %rdx
	movq	%rax, (%rsp)
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	$0, 448(%rsp)
	cmpl	$1, %eax
	jle	.L10
	leaq	52(%rsp), %rax
	leaq	948(%rsp), %rbp
	movq	$1, 16(%rsp)
	movq	%rax, 8(%rsp)
	leaq	448(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	16(%rsp), %r14
	movq	8(%rsp), %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movl	%r14d, 28(%rsp)
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	-4(%rbx,%r14,4), %r12
	movq	(%rsp), %rcx
	movq	%rbp, %rdi
	movl	%r14d, %r15d
	leaq	(%r12,%r12,4), %rax
	movq	%r12, %r13
	leaq	(%rax,%rax,4), %rax
	leaq	(%rcx,%rax,4), %rsi
	call	strcmp@PLT
	testl	%eax, %eax
	js	.L3
	jne	.L4
	movq	8(%rsp), %rax
	movl	48(%rsp,%r12,4), %edx
	cmpl	%edx, (%rax)
	jle	.L4
.L3:
	movl	%r13d, (%rbx,%r14,4)
	subq	$1, %r14
	movl	%r14d, %r15d
	testl	%r14d, %r14d
	jne	.L5
.L4:
	movl	28(%rsp), %eax
	movslq	%r15d, %r9
	addq	$1, 16(%rsp)
	addq	$100, %rbp
	movq	16(%rsp), %rdi
	addq	$4, 8(%rsp)
	movl	%eax, 448(%rsp,%r9,4)
	movl	44(%rsp), %eax
	cmpl	%edi, %eax
	jg	.L6
.L10:
	testl	%eax, %eax
	jle	.L7
	xorl	%ebp, %ebp
	leaq	448(%rsp), %rbx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rbx,%rbp,4), %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	leal	1(%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L8
.L7:
	movq	10856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$10872, %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
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<string.h>

int main(){
    int n,i,j,d[100],t,x[100];
    char s[100][100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s %d",s[i],&d[i]);
        for(j=i;j>0;j--){
            t=strcmp(s[i],s[x[j-1]]);
            if(t<0 || (t==0 && d[i]>d[x[j-1]])) x[j] = x[j-1];
            else break;
        }
        x[j]=i;
    }
    for(i=0;i<n;i++){
        printf("%d\n",x[i]+1);
    }
    return 0;
}
6
khabarovsk 20
moscow 10
kazan 50
kazan 35
moscow 20
khabarovsk 40
 10
yakutsk 10
yakutsk 20
yakutsk 30
yakutsk 40
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 10
yakutsk 10
yakutsk 20
yakutsk 30
yakutsk 2
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 6
khabarovsk 20
moscow 18
kazan 50
kazan 35
moscow 14
khabarovsk 40
 10
yakutsk 10
yakutsl 20
yakutsk 30
yakutsk 2
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 6
khabarovsk 20
moscow 18
kazan 50
kazan 10
wocsom 14
khabarovsk 2
 10
yakutsk 10
yakutsl 28
yakutsk 30
y`kutsk 0
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 6
khabarovsk 20
moscow 18
kazan 50
kaz`n 10
wocsom 14
khabarovsk 2
 10
yakutsk 10
yakutsl 28
yakutsk 30
y`kutsk 0
yakutsk 18
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 10
yakutsk 10
yakutsl 28
yakutsk 30
y`kutsk 0
yakvtsk 18
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100

3
4
6
1
5
2
 8
10
9
7
6
5
4
3
2
1
 8
10
9
7
6
5
3
2
1
4
 3
4
6
1
2
5
 8
10
9
7
6
5
3
1
4
2
 3
4
1
6
2
5
 4
8
10
9
7
6
5
3
1
2
 4
3
1
6
2
5
 4
8
10
9
7
6
3
5
1
2
 4
8
10
9
7
6
3
1
2
5

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

```c
#include<stdio.h>
#include<string.h>

int main(){
    int n,i,j,d[100],t,x[100];
    char s[100][100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s %d",s[i],&d[i]);
        for(j=i;j>0;j--){
            t=strcmp(s[i],s[x[j-1]]);
            if(t<0 || (t==0 && d[i]>d[x[j-1]])) x[j] = x[j-1];
            else break;
        }
        x[j]=i;
    }
    for(i=0;i<n;i++){
        printf("%d\n",x[i]+1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d"
.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
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2640, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10828(%rbp)
	jmp	.L2
.L7:
	leaq	-10816(%rbp), %rdx
	movl	-10828(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-10016(%rbp), %rsi
	movl	-10828(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-10828(%rbp), %eax
	movl	%eax, -10824(%rbp)
	jmp	.L3
.L6:
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	leaq	-10016(%rbp), %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-10016(%rbp), %rsi
	movl	-10828(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	movl	%eax, -10820(%rbp)
	cmpl	$0, -10820(%rbp)
	js	.L4
	cmpl	$0, -10820(%rbp)
	jne	.L5
	movl	-10828(%rbp), %eax
	cltq
	movl	-10816(%rbp,%rax,4), %edx
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	cltq
	movl	-10816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L5
.L4:
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %edx
	movl	-10824(%rbp), %eax
	cltq
	movl	%edx, -10416(%rbp,%rax,4)
	subl	$1, -10824(%rbp)
.L3:
	cmpl	$0, -10824(%rbp)
	jg	.L6
.L5:
	movl	-10824(%rbp), %eax
	cltq
	movl	-10828(%rbp), %edx
	movl	%edx, -10416(%rbp,%rax,4)
	addl	$1, -10828(%rbp)
.L2:
	movl	-10832(%rbp), %eax
	cmpl	%eax, -10828(%rbp)
	jl	.L7
	movl	$0, -10828(%rbp)
	jmp	.L8
.L9:
	movl	-10828(%rbp), %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10828(%rbp)
.L8:
	movl	-10832(%rbp), %eax
	cmpl	%eax, -10828(%rbp)
	jl	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"%s %d"
.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
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2640, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10828(%rbp)
	jmp	.L2
.L7:
	leaq	-10816(%rbp), %rdx
	movl	-10828(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-10016(%rbp), %rsi
	movl	-10828(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-10828(%rbp), %eax
	movl	%eax, -10824(%rbp)
	jmp	.L3
.L6:
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	leaq	-10016(%rbp), %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-10016(%rbp), %rsi
	movl	-10828(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	movl	%eax, -10820(%rbp)
	cmpl	$0, -10820(%rbp)
	js	.L4
	cmpl	$0, -10820(%rbp)
	jne	.L5
	movl	-10828(%rbp), %eax
	cltq
	movl	-10816(%rbp,%rax,4), %edx
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	cltq
	movl	-10816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L5
.L4:
	movl	-10824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-10416(%rbp,%rax,4), %edx
	movl	-10824(%rbp), %eax
	cltq
	movl	%edx, -10416(%rbp,%rax,4)
	subl	$1, -10824(%rbp)
.L3:
	cmpl	$0, -10824(%rbp)
	jg	.L6
.L5:
	movl	-10824(%rbp), %eax
	cltq
	movl	-10828(%rbp), %edx
	movl	%edx, -10416(%rbp,%rax,4)
	addl	$1, -10828(%rbp)
.L2:
	movl	-10832(%rbp), %eax
	cmpl	%eax, -10828(%rbp)
	jl	.L7
	movl	$0, -10828(%rbp)
	jmp	.L8
.L9:
	movl	-10828(%rbp), %eax
	cltq
	movl	-10416(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10828(%rbp)
.L8:
	movl	-10832(%rbp), %eax
	cmpl	%eax, -10828(%rbp)
	jl	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
