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>

char ss[25000][6];

int compare(const void *arg1, const void *arg2){
	return(strcmp(ss[*(int*)arg1], ss[*(int*)arg2]));
}

int main(){
	char s[5001];
	int k,g=0,i,j,c=0,l;
	scanf("%s%d",s,&k);
	while(s[g]!=0)g++;
	int num[25000];
	for(i=0;i<25000;i++)num[i]=i;
	for(i=0;i<g;i++){
		for(j=0;j<5&&i+j<g;j++){
			for(l=0;l<=j;l++)ss[c][l]=s[i+l];
			ss[c][5]='\0';
			c++;
		}
	}
//	for(i=0;i<c;i++)printf("%s\n",ss[i]);
	qsort(num,c,sizeof(int),compare);
/*	for(i=0;i<c;i++){
		for(j=0;j<i;j++){
			if(strcmp(ss[num[i]],ss[num[j]])<0){
*//*				char tmp[7]={0};
				strcpy(tmp,ss[i]);
				for(l=0;l<5;l++)ss[i][l]='\0';
				strcpy(ss[i],ss[j]);
				for(l=0;l<5;l++)ss[j][l]='\0';
				strcpy(ss[j],tmp);
*//*			
			int tmp=num[i];
			num[i]=num[j];
			num[j]=tmp;
			}
		}
	}*/
//	for(i=0;i<c;i++)printf("%s\n",ss[i]);
	int count=0;
	for(i=0;i<c;i++){
		if(count==k-1){
			printf("%s\n",ss[num[i]]);
			return 0;
		}
		if(strcmp(ss[num[i]],ss[num[i+1]])<0)count++;
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ss
	.bss
	.align 32
	.type	ss, @object
	.size	ss, 150000
ss:
	.zero	150000
	.text
	.globl	compare
	.type	compare, @function
compare:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%s%d"
	.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
	leaq	-102400(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2656, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -105048(%rbp)
	movl	$0, -105036(%rbp)
	leaq	-105052(%rbp), %rdx
	leaq	-5024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L4
.L5:
	addl	$1, -105048(%rbp)
.L4:
	movl	-105048(%rbp), %eax
	cltq
	movzbl	-5024(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$0, -105044(%rbp)
	jmp	.L6
.L7:
	movl	-105044(%rbp), %eax
	cltq
	movl	-105044(%rbp), %edx
	movl	%edx, -105024(%rbp,%rax,4)
	addl	$1, -105044(%rbp)
.L6:
	cmpl	$24999, -105044(%rbp)
	jle	.L7
	movl	$0, -105044(%rbp)
	jmp	.L8
.L14:
	movl	$0, -105040(%rbp)
	jmp	.L9
.L13:
	movl	$0, -105032(%rbp)
	jmp	.L10
.L11:
	movl	-105044(%rbp), %edx
	movl	-105032(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-5024(%rbp,%rax), %edx
	movl	-105032(%rbp), %eax
	movslq	%eax, %rsi
	movl	-105036(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	ss(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -105032(%rbp)
.L10:
	movl	-105032(%rbp), %eax
	cmpl	-105040(%rbp), %eax
	jle	.L11
	movl	-105036(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	leaq	5+ss(%rip), %rax
	movb	$0, (%rdx,%rax)
	addl	$1, -105036(%rbp)
	addl	$1, -105040(%rbp)
.L9:
	cmpl	$4, -105040(%rbp)
	jg	.L12
	movl	-105044(%rbp), %edx
	movl	-105040(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -105048(%rbp)
	jg	.L13
.L12:
	addl	$1, -105044(%rbp)
.L8:
	movl	-105044(%rbp), %eax
	cmpl	-105048(%rbp), %eax
	jl	.L14
	movl	-105036(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-105024(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -105028(%rbp)
	movl	$0, -105044(%rbp)
	jmp	.L15
.L19:
	movl	-105052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -105028(%rbp)
	jne	.L16
	movl	-105044(%rbp), %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L16:
	movl	-105044(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rax, %rdx
	movl	-105044(%rbp), %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L18
	addl	$1, -105028(%rbp)
.L18:
	addl	$1, -105044(%rbp)
.L15:
	movl	-105044(%rbp), %eax
	cmpl	-105036(%rbp), %eax
	jl	.L19
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.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	compare
	.type	compare, @function
compare:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	(%rsi), %rax
	leaq	(%rax,%rax,2), %rdx
	leaq	ss(%rip), %rax
	leaq	(%rax,%rdx,2), %rsi
	movslq	(%rdi), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rax,%rdx,2), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE51:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%s%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	-102400(%rsp), %r11
	.cfi_def_cfa 11, 102456
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2648, %rsp
	.cfi_def_cfa_offset 105104
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 105032(%rsp)
	xorl	%eax, %eax
	leaq	100016(%rsp), %rbx
	leaq	12(%rsp), %rdx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	cmpb	$0, 100016(%rsp)
	je	.L21
	movl	$1, %eax
	leaq	100015(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %r11d
	addq	$1, %rax
	cmpb	$0, (%rdx,%rax)
	jne	.L5
.L4:
	leaq	16(%rsp), %r12
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC2(%rip), %xmm2
	movq	%r12, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rbx, %rax
	jne	.L6
	testl	%r11d, %r11d
	je	.L7
	movq	%rax, %rcx
	xorl	%ebx, %ebx
	leaq	ss(%rip), %rbp
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%ebx, %rax
	xorl	%esi, %esi
	leaq	(%rax,%rax,2), %rax
	leaq	0(%rbp,%rax,2), %r8
.L14:
	leal	(%r10,%rsi), %eax
	cmpl	%eax, %r11d
	jle	.L11
	addq	$1, %rsi
	movl	%esi, %r9d
	testl	%esi, %esi
	je	.L10
	xorl	%eax, %eax
.L9:
	movl	%eax, %edx
	addl	$1, %eax
	movzbl	(%rcx,%rdx), %edi
	movb	%dil, (%r8,%rdx)
	cmpl	%r9d, %eax
	jb	.L9
.L10:
	movb	$0, 5(%r8)
	addl	$1, %ebx
	addq	$6, %r8
	cmpq	$5, %rsi
	jne	.L14
.L11:
	addl	$1, %r10d
	addq	$1, %rcx
	cmpl	%r10d, %r11d
	jne	.L8
	movslq	%ebx, %rsi
	leaq	compare(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	testl	%ebx, %ebx
	je	.L17
	movl	12(%rsp), %eax
	leaq	20(%rsp), %r13
	leal	-1(%rax), %r14d
	leal	-1(%rbx), %eax
	movslq	16(%rsp), %rbx
	leaq	8(%r12,%rax,4), %r15
	xorl	%r12d, %r12d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	0(%r13), %rbx
	leaq	(%rbx,%rbx,2), %rax
	leaq	0(%rbp,%rax,2), %rsi
	call	strcmp@PLT
	cmpl	$-2147483648, %eax
	sbbl	$-1, %r12d
	addq	$4, %r13
	cmpq	%r13, %r15
	je	.L17
.L19:
	leaq	(%rbx,%rbx,2), %rax
	leaq	0(%rbp,%rax,2), %rdi
	cmpl	%r12d, %r14d
	jne	.L16
	call	puts@PLT
.L17:
	movq	105032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$105048, %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
.L7:
	.cfi_restore_state
	leaq	compare(%rip), %rcx
	movl	$4, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	qsort@PLT
	jmp	.L17
.L21:
	xorl	%r11d, %r11d
	jmp	.L4
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	ss
	.bss
	.align 32
	.type	ss, @object
	.size	ss, 150000
ss:
	.zero	150000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.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	compare
	.type	compare, @function
compare:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	(%rsi), %rax
	leaq	(%rax,%rax,2), %rdx
	leaq	ss(%rip), %rax
	leaq	(%rax,%rdx,2), %rsi
	movslq	(%rdi), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rax,%rdx,2), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE51:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%s%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	-102400(%rsp), %r11
	.cfi_def_cfa 11, 102456
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2648, %rsp
	.cfi_def_cfa_offset 105104
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 105032(%rsp)
	xorl	%eax, %eax
	leaq	100016(%rsp), %rbx
	leaq	12(%rsp), %rdx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	cmpb	$0, 100016(%rsp)
	je	.L21
	movl	$1, %eax
	leaq	100015(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %r11d
	addq	$1, %rax
	cmpb	$0, (%rdx,%rax)
	jne	.L5
.L4:
	leaq	16(%rsp), %r12
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC2(%rip), %xmm2
	movq	%r12, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rbx, %rax
	jne	.L6
	testl	%r11d, %r11d
	je	.L7
	movq	%rax, %rcx
	xorl	%ebx, %ebx
	leaq	ss(%rip), %rbp
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%ebx, %rax
	xorl	%esi, %esi
	leaq	(%rax,%rax,2), %rax
	leaq	0(%rbp,%rax,2), %r8
.L14:
	leal	(%r10,%rsi), %eax
	cmpl	%eax, %r11d
	jle	.L11
	addq	$1, %rsi
	movl	%esi, %r9d
	testl	%esi, %esi
	je	.L10
	xorl	%eax, %eax
.L9:
	movl	%eax, %edx
	addl	$1, %eax
	movzbl	(%rcx,%rdx), %edi
	movb	%dil, (%r8,%rdx)
	cmpl	%r9d, %eax
	jb	.L9
.L10:
	movb	$0, 5(%r8)
	addl	$1, %ebx
	addq	$6, %r8
	cmpq	$5, %rsi
	jne	.L14
.L11:
	addl	$1, %r10d
	addq	$1, %rcx
	cmpl	%r10d, %r11d
	jne	.L8
	movslq	%ebx, %rsi
	leaq	compare(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	testl	%ebx, %ebx
	je	.L17
	movl	12(%rsp), %eax
	leaq	20(%rsp), %r13
	leal	-1(%rax), %r14d
	leal	-1(%rbx), %eax
	movslq	16(%rsp), %rbx
	leaq	8(%r12,%rax,4), %r15
	xorl	%r12d, %r12d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	0(%r13), %rbx
	leaq	(%rbx,%rbx,2), %rax
	leaq	0(%rbp,%rax,2), %rsi
	call	strcmp@PLT
	cmpl	$-2147483648, %eax
	sbbl	$-1, %r12d
	addq	$4, %r13
	cmpq	%r13, %r15
	je	.L17
.L19:
	leaq	(%rbx,%rbx,2), %rax
	leaq	0(%rbp,%rax,2), %rdi
	cmpl	%r12d, %r14d
	jne	.L16
	call	puts@PLT
.L17:
	movq	105032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$105048, %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
.L7:
	.cfi_restore_state
	leaq	compare(%rip), %rcx
	movl	$4, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	qsort@PLT
	jmp	.L17
.L21:
	xorl	%r11d, %r11d
	jmp	.L4
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	ss
	.bss
	.align 32
	.type	ss, @object
	.size	ss, 150000
ss:
	.zero	150000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.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>

char ss[25000][6];

int compare(const void *arg1, const void *arg2){
	return(strcmp(ss[*(int*)arg1], ss[*(int*)arg2]));
}

int main(){
	char s[5001];
	int k,g=0,i,j,c=0,l;
	scanf("%s%d",s,&k);
	while(s[g]!=0)g++;
	int num[25000];
	for(i=0;i<25000;i++)num[i]=i;
	for(i=0;i<g;i++){
		for(j=0;j<5&&i+j<g;j++){
			for(l=0;l<=j;l++)ss[c][l]=s[i+l];
			ss[c][5]='\0';
			c++;
		}
	}
//	for(i=0;i<c;i++)printf("%s\n",ss[i]);
	qsort(num,c,sizeof(int),compare);
/*	for(i=0;i<c;i++){
		for(j=0;j<i;j++){
			if(strcmp(ss[num[i]],ss[num[j]])<0){
*//*				char tmp[7]={0};
				strcpy(tmp,ss[i]);
				for(l=0;l<5;l++)ss[i][l]='\0';
				strcpy(ss[i],ss[j]);
				for(l=0;l<5;l++)ss[j][l]='\0';
				strcpy(ss[j],tmp);
*//*			
			int tmp=num[i];
			num[i]=num[j];
			num[j]=tmp;
			}
		}
	}*/
//	for(i=0;i<c;i++)printf("%s\n",ss[i]);
	int count=0;
	for(i=0;i<c;i++){
		if(count==k-1){
			printf("%s\n",ss[num[i]]);
			return 0;
		}
		if(strcmp(ss[num[i]],ss[num[i+1]])<0)count++;
	}
}
aba
5
 y
1
 aba
1
 {
1
 |
1
 bba
4
 atcoderandatcodeer
2
 aab
5
 cba
4
 atcoderandatcodeer
4

ba
 y
 a
 {
 |
 bb
 an
 b
 c
 anda

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>

char ss[25000][6];

int compare(const void *arg1, const void *arg2){
	return(strcmp(ss[*(int*)arg1], ss[*(int*)arg2]));
}

int main(){
	char s[5001];
	int k,g=0,i,j,c=0,l;
	scanf("%s%d",s,&k);
	while(s[g]!=0)g++;
	int num[25000];
	for(i=0;i<25000;i++)num[i]=i;
	for(i=0;i<g;i++){
		for(j=0;j<5&&i+j<g;j++){
			for(l=0;l<=j;l++)ss[c][l]=s[i+l];
			ss[c][5]='\0';
			c++;
		}
	}
//	for(i=0;i<c;i++)printf("%s\n",ss[i]);
	qsort(num,c,sizeof(int),compare);
/*	for(i=0;i<c;i++){
		for(j=0;j<i;j++){
			if(strcmp(ss[num[i]],ss[num[j]])<0){
*//*				char tmp[7]={0};
				strcpy(tmp,ss[i]);
				for(l=0;l<5;l++)ss[i][l]='\0';
				strcpy(ss[i],ss[j]);
				for(l=0;l<5;l++)ss[j][l]='\0';
				strcpy(ss[j],tmp);
*//*			
			int tmp=num[i];
			num[i]=num[j];
			num[j]=tmp;
			}
		}
	}*/
//	for(i=0;i<c;i++)printf("%s\n",ss[i]);
	int count=0;
	for(i=0;i<c;i++){
		if(count==k-1){
			printf("%s\n",ss[num[i]]);
			return 0;
		}
		if(strcmp(ss[num[i]],ss[num[i+1]])<0)count++;
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ss
	.bss
	.align 32
	.type	ss, @object
	.size	ss, 150000
ss:
	.zero	150000
	.text
	.globl	compare
	.type	compare, @function
compare:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%s%d"
	.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
	leaq	-102400(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2656, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -105048(%rbp)
	movl	$0, -105036(%rbp)
	leaq	-105052(%rbp), %rdx
	leaq	-5024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L4
.L5:
	addl	$1, -105048(%rbp)
.L4:
	movl	-105048(%rbp), %eax
	cltq
	movzbl	-5024(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$0, -105044(%rbp)
	jmp	.L6
.L7:
	movl	-105044(%rbp), %eax
	cltq
	movl	-105044(%rbp), %edx
	movl	%edx, -105024(%rbp,%rax,4)
	addl	$1, -105044(%rbp)
.L6:
	cmpl	$24999, -105044(%rbp)
	jle	.L7
	movl	$0, -105044(%rbp)
	jmp	.L8
.L14:
	movl	$0, -105040(%rbp)
	jmp	.L9
.L13:
	movl	$0, -105032(%rbp)
	jmp	.L10
.L11:
	movl	-105044(%rbp), %edx
	movl	-105032(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-5024(%rbp,%rax), %edx
	movl	-105032(%rbp), %eax
	movslq	%eax, %rsi
	movl	-105036(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	ss(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -105032(%rbp)
.L10:
	movl	-105032(%rbp), %eax
	cmpl	-105040(%rbp), %eax
	jle	.L11
	movl	-105036(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	leaq	5+ss(%rip), %rax
	movb	$0, (%rdx,%rax)
	addl	$1, -105036(%rbp)
	addl	$1, -105040(%rbp)
.L9:
	cmpl	$4, -105040(%rbp)
	jg	.L12
	movl	-105044(%rbp), %edx
	movl	-105040(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -105048(%rbp)
	jg	.L13
.L12:
	addl	$1, -105044(%rbp)
.L8:
	movl	-105044(%rbp), %eax
	cmpl	-105048(%rbp), %eax
	jl	.L14
	movl	-105036(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-105024(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -105028(%rbp)
	movl	$0, -105044(%rbp)
	jmp	.L15
.L19:
	movl	-105052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -105028(%rbp)
	jne	.L16
	movl	-105044(%rbp), %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L16:
	movl	-105044(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rax, %rdx
	movl	-105044(%rbp), %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L18
	addl	$1, -105028(%rbp)
.L18:
	addl	$1, -105044(%rbp)
.L15:
	movl	-105044(%rbp), %eax
	cmpl	-105036(%rbp), %eax
	jl	.L19
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.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	ss
	.bss
	.align 32
	.type	ss, @object
	.size	ss, 150000
ss:
	.zero	150000
	.text
	.globl	compare
	.type	compare, @function
compare:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%s%d"
	.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
	leaq	-102400(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2656, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -105048(%rbp)
	movl	$0, -105036(%rbp)
	leaq	-105052(%rbp), %rdx
	leaq	-5024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L4
.L5:
	addl	$1, -105048(%rbp)
.L4:
	movl	-105048(%rbp), %eax
	cltq
	movzbl	-5024(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$0, -105044(%rbp)
	jmp	.L6
.L7:
	movl	-105044(%rbp), %eax
	cltq
	movl	-105044(%rbp), %edx
	movl	%edx, -105024(%rbp,%rax,4)
	addl	$1, -105044(%rbp)
.L6:
	cmpl	$24999, -105044(%rbp)
	jle	.L7
	movl	$0, -105044(%rbp)
	jmp	.L8
.L14:
	movl	$0, -105040(%rbp)
	jmp	.L9
.L13:
	movl	$0, -105032(%rbp)
	jmp	.L10
.L11:
	movl	-105044(%rbp), %edx
	movl	-105032(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-5024(%rbp,%rax), %edx
	movl	-105032(%rbp), %eax
	movslq	%eax, %rsi
	movl	-105036(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	ss(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -105032(%rbp)
.L10:
	movl	-105032(%rbp), %eax
	cmpl	-105040(%rbp), %eax
	jle	.L11
	movl	-105036(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	leaq	5+ss(%rip), %rax
	movb	$0, (%rdx,%rax)
	addl	$1, -105036(%rbp)
	addl	$1, -105040(%rbp)
.L9:
	cmpl	$4, -105040(%rbp)
	jg	.L12
	movl	-105044(%rbp), %edx
	movl	-105040(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -105048(%rbp)
	jg	.L13
.L12:
	addl	$1, -105044(%rbp)
.L8:
	movl	-105044(%rbp), %eax
	cmpl	-105048(%rbp), %eax
	jl	.L14
	movl	-105036(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-105024(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -105028(%rbp)
	movl	$0, -105044(%rbp)
	jmp	.L15
.L19:
	movl	-105052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -105028(%rbp)
	jne	.L16
	movl	-105044(%rbp), %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L16:
	movl	-105044(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rdx
	addq	%rax, %rdx
	movl	-105044(%rbp), %eax
	cltq
	movl	-105024(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	leaq	ss(%rip), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L18
	addl	$1, -105028(%rbp)
.L18:
	addl	$1, -105044(%rbp)
.L15:
	movl	-105044(%rbp), %eax
	cmpl	-105036(%rbp), %eax
	jl	.L19
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.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:
