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()
{
	char s[102];
	scanf("%s", s);
	int count[30];
	int i;
	for (i = 0; i < 30; i++)
		count[i] = 0;
	int n = strlen(s);
	for (i = 0; i < n; i++)
		count[s[i] - 'a']++;
	int ans = 100005;
	char t[102], c;
	int m, countt[30], x, y;
	for (c = 'a'; c <= 'z'; c++)
	{
		if (count[c - 'a'] > 0)
		{
			strcpy(t, s);
			m = n;
			x = 0;
			y = 0;
			for (i = 0; i < 30; i++)
				countt[i] = 0;
			for (i = 0; i < m; i++)
				countt[t[i] - 'a']++;
			for (i = 0; i < 30; i++)
				if (countt[i] > 0)
					y++;
			while (y > 1)
			{
				for (i = 0; i < m - 1; i++)
					if (t[i + 1] == c)
						t[i] = c;
				m--;
				y = 0;
				for (i = 0; i < 30; i++)
					countt[i] = 0;
				for (i = 0; i < m; i++)
					countt[t[i] - 'a']++;
				for (i = 0; i < 30; i++)
					if (countt[i] > 0)
						y++;
				x++;
			}
			if (ans > x)
				ans = x;
		}
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.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	$512, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-224(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -504(%rbp)
	jmp	.L2
.L3:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -480(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L2:
	cmpl	$29, -504(%rbp)
	jle	.L3
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -484(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L4
.L5:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-480(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -480(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L4:
	movl	-504(%rbp), %eax
	cmpl	-484(%rbp), %eax
	jl	.L5
	movl	$100005, -500(%rbp)
	movb	$97, -505(%rbp)
	jmp	.L6
.L27:
	movsbl	-505(%rbp), %eax
	subl	$97, %eax
	cltq
	movl	-480(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	-224(%rbp), %rdx
	leaq	-112(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	movl	-484(%rbp), %eax
	movl	%eax, -496(%rbp)
	movl	$0, -492(%rbp)
	movl	$0, -488(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L8
.L9:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L8:
	cmpl	$29, -504(%rbp)
	jle	.L9
	movl	$0, -504(%rbp)
	jmp	.L10
.L11:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-352(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L10:
	movl	-504(%rbp), %eax
	cmpl	-496(%rbp), %eax
	jl	.L11
	movl	$0, -504(%rbp)
	jmp	.L12
.L14:
	movl	-504(%rbp), %eax
	cltq
	movl	-352(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L13
	addl	$1, -488(%rbp)
.L13:
	addl	$1, -504(%rbp)
.L12:
	cmpl	$29, -504(%rbp)
	jle	.L14
	jmp	.L15
.L26:
	movl	$0, -504(%rbp)
	jmp	.L16
.L18:
	movl	-504(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, -505(%rbp)
	jne	.L17
	movl	-504(%rbp), %eax
	cltq
	movzbl	-505(%rbp), %edx
	movb	%dl, -112(%rbp,%rax)
.L17:
	addl	$1, -504(%rbp)
.L16:
	movl	-496(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -504(%rbp)
	jl	.L18
	subl	$1, -496(%rbp)
	movl	$0, -488(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L19
.L20:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L19:
	cmpl	$29, -504(%rbp)
	jle	.L20
	movl	$0, -504(%rbp)
	jmp	.L21
.L22:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-352(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L21:
	movl	-504(%rbp), %eax
	cmpl	-496(%rbp), %eax
	jl	.L22
	movl	$0, -504(%rbp)
	jmp	.L23
.L25:
	movl	-504(%rbp), %eax
	cltq
	movl	-352(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L24
	addl	$1, -488(%rbp)
.L24:
	addl	$1, -504(%rbp)
.L23:
	cmpl	$29, -504(%rbp)
	jle	.L25
	addl	$1, -492(%rbp)
.L15:
	cmpl	$1, -488(%rbp)
	jg	.L26
	movl	-500(%rbp), %eax
	cmpl	-492(%rbp), %eax
	jle	.L7
	movl	-492(%rbp), %eax
	movl	%eax, -500(%rbp)
.L7:
	movzbl	-505(%rbp), %eax
	addl	$1, %eax
	movb	%al, -505(%rbp)
.L6:
	cmpb	$122, -505(%rbp)
	jle	.L27
	movl	-500(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	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	"%s"
.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
	leaq	.LC0(%rip), %rdi
	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	$520, %rsp
	.cfi_def_cfa_offset 576
	movq	%fs:40, %rax
	movq	%rax, 504(%rsp)
	xorl	%eax, %eax
	leaq	288(%rsp), %r12
	leaq	32(%rsp), %r15
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$15, %ecx
	movq	%r15, %rdi
	rep stosq
	movq	%r12, %rdi
	call	strlen@PLT
	movl	%eax, 20(%rsp)
	movq	%rax, %r13
	testq	%rax, %rax
	je	.L2
	leal	-1(%rax), %eax
	movq	%r12, %rdx
	leaq	289(%rsp,%rax), %rcx
.L3:
	movsbl	(%rdx), %eax
	addq	$1, %rdx
	subl	$97, %eax
	cltq
	addl	$1, 32(%rsp,%rax,4)
	cmpq	%rdx, %rcx
	jne	.L3
.L2:
	leaq	1(%r13), %rax
	movl	$100005, %r9d
	movl	$97, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 24(%rsp)
	movq	%r12, %rax
	movl	%r9d, %r12d
	movq	%rax, %r9
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	addq	$1, %rbx
	cmpq	$123, %rbx
	je	.L45
.L21:
	movl	-388(%r15,%rbx,4), %esi
	movl	%ebx, %ebp
	testl	%esi, %esi
	jle	.L4
	leaq	400(%rsp), %r10
	movq	24(%rsp), %rdx
	movl	$102, %ecx
	movq	%r9, %rsi
	movq	%r10, %rdi
	movq	%r9, 8(%rsp)
	call	__memcpy_chk@PLT
	leaq	160(%rsp), %r8
	movl	$15, %ecx
	testq	%r13, %r13
	movq	%rax, %r10
	movq	%r8, %rdi
	movq	%r14, %rax
	movq	8(%rsp), %r9
	rep stosq
	movdqa	.LC1(%rip), %xmm3
	je	.L5
	leal	-1(%r13), %eax
	movq	%r10, %rdx
	leaq	401(%rsp,%rax), %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%rdx), %eax
	addq	$1, %rdx
	subl	$97, %eax
	cltq
	addl	$1, 160(%rsp,%rax,4)
	cmpq	%rdx, %rcx
	jne	.L6
.L5:
	movdqa	176(%rsp), %xmm0
	pxor	%xmm1, %xmm1
	movdqa	160(%rsp), %xmm2
	xorl	%edx, %edx
	movl	272(%rsp), %r11d
	movl	276(%rsp), %ecx
	pcmpgtd	%xmm1, %xmm0
	pcmpgtd	%xmm1, %xmm2
	movl	20(%rsp), %esi
	testl	%r11d, %r11d
	leaq	401(%rsp), %r11
	setg	%dl
	pand	%xmm3, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	192(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	208(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	224(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	240(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	256(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	movd	%xmm0, %eax
	addl	%edx, %eax
	xorl	%edx, %edx
	testl	%ecx, %ecx
	setg	%dl
	addl	%edx, %eax
	xorl	%edx, %edx
	cmpl	$1, %eax
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%esi, %edx
	subl	$1, %esi
	testl	%esi, %esi
	jle	.L46
	leal	-2(%rdx), %ecx
	movq	%r10, %rax
	movq	%rcx, %rdx
	addq	%r11, %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	%bl, 1(%rax)
	jne	.L12
	movb	%bpl, (%rax)
.L12:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L13
	movl	$15, %ecx
	movq	%r8, %rdi
	movq	%r14, %rax
	addq	%r11, %rdx
	rep stosq
	movq	%r10, %rcx
	.p2align 4,,10
	.p2align 3
.L15:
	movsbl	(%rcx), %eax
	addq	$1, %rcx
	subl	$97, %eax
	cltq
	addl	$1, 160(%rsp,%rax,4)
	cmpq	%rdx, %rcx
	jne	.L15
.L22:
	movl	272(%rsp), %ecx
	xorl	%edx, %edx
	movl	276(%rsp), %edi
	movdqa	160(%rsp), %xmm0
	movdqa	176(%rsp), %xmm2
	testl	%ecx, %ecx
	pcmpgtd	%xmm1, %xmm0
	pcmpgtd	%xmm1, %xmm2
	setg	%dl
	pand	%xmm3, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	192(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	208(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	224(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	240(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	256(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$8, %xmm2
	paddd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	paddd	%xmm2, %xmm0
	movd	%xmm0, %eax
	addl	%edx, %eax
	xorl	%edx, %edx
	testl	%edi, %edi
	setg	%dl
	addl	%edx, %eax
	movl	%r13d, %edx
	subl	%esi, %edx
	cmpl	$1, %eax
	jg	.L9
.L10:
	cmpl	%edx, %r12d
	cmovg	%edx, %r12d
	addq	$1, %rbx
	cmpq	$123, %rbx
	jne	.L21
.L45:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	504(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$520, %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
.L46:
	.cfi_restore_state
	movl	$15, %ecx
	movq	%r8, %rdi
	movq	%r14, %rax
	rep stosq
	jmp	.L22
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	"%s"
.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
	leaq	.LC0(%rip), %rdi
	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	$520, %rsp
	.cfi_def_cfa_offset 576
	movq	%fs:40, %rax
	movq	%rax, 504(%rsp)
	xorl	%eax, %eax
	leaq	288(%rsp), %r12
	leaq	32(%rsp), %r15
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$15, %ecx
	movq	%r15, %rdi
	rep stosq
	movq	%r12, %rdi
	call	strlen@PLT
	movl	%eax, 20(%rsp)
	movq	%rax, %r13
	testq	%rax, %rax
	je	.L2
	leal	-1(%rax), %eax
	movq	%r12, %rdx
	leaq	289(%rsp,%rax), %rcx
.L3:
	movsbl	(%rdx), %eax
	addq	$1, %rdx
	subl	$97, %eax
	cltq
	addl	$1, 32(%rsp,%rax,4)
	cmpq	%rdx, %rcx
	jne	.L3
.L2:
	leaq	1(%r13), %rax
	movl	$100005, %r9d
	movl	$97, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 24(%rsp)
	movq	%r12, %rax
	movl	%r9d, %r12d
	movq	%rax, %r9
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	addq	$1, %rbx
	cmpq	$123, %rbx
	je	.L45
.L21:
	movl	-388(%r15,%rbx,4), %esi
	movl	%ebx, %ebp
	testl	%esi, %esi
	jle	.L4
	leaq	400(%rsp), %r10
	movq	24(%rsp), %rdx
	movl	$102, %ecx
	movq	%r9, %rsi
	movq	%r10, %rdi
	movq	%r9, 8(%rsp)
	call	__memcpy_chk@PLT
	leaq	160(%rsp), %r8
	movl	$15, %ecx
	testq	%r13, %r13
	movq	%rax, %r10
	movq	%r8, %rdi
	movq	%r14, %rax
	movq	8(%rsp), %r9
	rep stosq
	movdqa	.LC1(%rip), %xmm3
	je	.L5
	leal	-1(%r13), %eax
	movq	%r10, %rdx
	leaq	401(%rsp,%rax), %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%rdx), %eax
	addq	$1, %rdx
	subl	$97, %eax
	cltq
	addl	$1, 160(%rsp,%rax,4)
	cmpq	%rdx, %rcx
	jne	.L6
.L5:
	movdqa	176(%rsp), %xmm0
	pxor	%xmm1, %xmm1
	movdqa	160(%rsp), %xmm2
	xorl	%edx, %edx
	movl	272(%rsp), %r11d
	movl	276(%rsp), %ecx
	pcmpgtd	%xmm1, %xmm0
	pcmpgtd	%xmm1, %xmm2
	movl	20(%rsp), %esi
	testl	%r11d, %r11d
	leaq	401(%rsp), %r11
	setg	%dl
	pand	%xmm3, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	192(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	208(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	224(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	240(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	256(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	movd	%xmm0, %eax
	addl	%edx, %eax
	xorl	%edx, %edx
	testl	%ecx, %ecx
	setg	%dl
	addl	%edx, %eax
	xorl	%edx, %edx
	cmpl	$1, %eax
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%esi, %edx
	subl	$1, %esi
	testl	%esi, %esi
	jle	.L46
	leal	-2(%rdx), %ecx
	movq	%r10, %rax
	movq	%rcx, %rdx
	addq	%r11, %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	%bl, 1(%rax)
	jne	.L12
	movb	%bpl, (%rax)
.L12:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L13
	movl	$15, %ecx
	movq	%r8, %rdi
	movq	%r14, %rax
	addq	%r11, %rdx
	rep stosq
	movq	%r10, %rcx
	.p2align 4,,10
	.p2align 3
.L15:
	movsbl	(%rcx), %eax
	addq	$1, %rcx
	subl	$97, %eax
	cltq
	addl	$1, 160(%rsp,%rax,4)
	cmpq	%rdx, %rcx
	jne	.L15
.L22:
	movl	272(%rsp), %ecx
	xorl	%edx, %edx
	movl	276(%rsp), %edi
	movdqa	160(%rsp), %xmm0
	movdqa	176(%rsp), %xmm2
	testl	%ecx, %ecx
	pcmpgtd	%xmm1, %xmm0
	pcmpgtd	%xmm1, %xmm2
	setg	%dl
	pand	%xmm3, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	192(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	208(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	224(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	240(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	256(%rsp), %xmm2
	pcmpgtd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$8, %xmm2
	paddd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	paddd	%xmm2, %xmm0
	movd	%xmm0, %eax
	addl	%edx, %eax
	xorl	%edx, %edx
	testl	%edi, %edi
	setg	%dl
	addl	%edx, %eax
	movl	%r13d, %edx
	subl	%esi, %edx
	cmpl	$1, %eax
	jg	.L9
.L10:
	cmpl	%edx, %r12d
	cmovg	%edx, %r12d
	addq	$1, %rbx
	cmpq	$123, %rbx
	jne	.L21
.L45:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	504(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$520, %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
.L46:
	.cfi_restore_state
	movl	$15, %ecx
	movq	%r8, %rdi
	movq	%r14, %rax
	rep stosq
	jmp	.L22
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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()
{
	char s[102];
	scanf("%s", s);
	int count[30];
	int i;
	for (i = 0; i < 30; i++)
		count[i] = 0;
	int n = strlen(s);
	for (i = 0; i < n; i++)
		count[s[i] - 'a']++;
	int ans = 100005;
	char t[102], c;
	int m, countt[30], x, y;
	for (c = 'a'; c <= 'z'; c++)
	{
		if (count[c - 'a'] > 0)
		{
			strcpy(t, s);
			m = n;
			x = 0;
			y = 0;
			for (i = 0; i < 30; i++)
				countt[i] = 0;
			for (i = 0; i < m; i++)
				countt[t[i] - 'a']++;
			for (i = 0; i < 30; i++)
				if (countt[i] > 0)
					y++;
			while (y > 1)
			{
				for (i = 0; i < m - 1; i++)
					if (t[i + 1] == c)
						t[i] = c;
				m--;
				y = 0;
				for (i = 0; i < 30; i++)
					countt[i] = 0;
				for (i = 0; i < m; i++)
					countt[t[i] - 'a']++;
				for (i = 0; i < 30; i++)
					if (countt[i] > 0)
						y++;
				x++;
			}
			if (ans > x)
				ans = x;
		}
	}
	printf("%d\n", ans);
	return 0;
}
resval
 whbrjpjyhsrywlqjxcbrbaomnw
 zzy
 lakjac
 xmboabrbnxjrlwyrthyjpjrchv
 whcrjpbyhtxywkrlxnbrbaojmr
 smjoabjdoxmrjwypugydyqrchv
 whdrpxdwhuozxkrmxodjaaojkt
 xwwwnajdrxmrqwzpugnhlojced
 wyeoqidphazibqrnvxibngzwpx

3
 8
 1
 2
 6
 10
 11
 9
 12
 7

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()
{
	char s[102];
	scanf("%s", s);
	int count[30];
	int i;
	for (i = 0; i < 30; i++)
		count[i] = 0;
	int n = strlen(s);
	for (i = 0; i < n; i++)
		count[s[i] - 'a']++;
	int ans = 100005;
	char t[102], c;
	int m, countt[30], x, y;
	for (c = 'a'; c <= 'z'; c++)
	{
		if (count[c - 'a'] > 0)
		{
			strcpy(t, s);
			m = n;
			x = 0;
			y = 0;
			for (i = 0; i < 30; i++)
				countt[i] = 0;
			for (i = 0; i < m; i++)
				countt[t[i] - 'a']++;
			for (i = 0; i < 30; i++)
				if (countt[i] > 0)
					y++;
			while (y > 1)
			{
				for (i = 0; i < m - 1; i++)
					if (t[i + 1] == c)
						t[i] = c;
				m--;
				y = 0;
				for (i = 0; i < 30; i++)
					countt[i] = 0;
				for (i = 0; i < m; i++)
					countt[t[i] - 'a']++;
				for (i = 0; i < 30; i++)
					if (countt[i] > 0)
						y++;
				x++;
			}
			if (ans > x)
				ans = x;
		}
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.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	$512, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-224(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -504(%rbp)
	jmp	.L2
.L3:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -480(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L2:
	cmpl	$29, -504(%rbp)
	jle	.L3
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -484(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L4
.L5:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-480(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -480(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L4:
	movl	-504(%rbp), %eax
	cmpl	-484(%rbp), %eax
	jl	.L5
	movl	$100005, -500(%rbp)
	movb	$97, -505(%rbp)
	jmp	.L6
.L27:
	movsbl	-505(%rbp), %eax
	subl	$97, %eax
	cltq
	movl	-480(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	-224(%rbp), %rdx
	leaq	-112(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	movl	-484(%rbp), %eax
	movl	%eax, -496(%rbp)
	movl	$0, -492(%rbp)
	movl	$0, -488(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L8
.L9:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L8:
	cmpl	$29, -504(%rbp)
	jle	.L9
	movl	$0, -504(%rbp)
	jmp	.L10
.L11:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-352(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L10:
	movl	-504(%rbp), %eax
	cmpl	-496(%rbp), %eax
	jl	.L11
	movl	$0, -504(%rbp)
	jmp	.L12
.L14:
	movl	-504(%rbp), %eax
	cltq
	movl	-352(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L13
	addl	$1, -488(%rbp)
.L13:
	addl	$1, -504(%rbp)
.L12:
	cmpl	$29, -504(%rbp)
	jle	.L14
	jmp	.L15
.L26:
	movl	$0, -504(%rbp)
	jmp	.L16
.L18:
	movl	-504(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, -505(%rbp)
	jne	.L17
	movl	-504(%rbp), %eax
	cltq
	movzbl	-505(%rbp), %edx
	movb	%dl, -112(%rbp,%rax)
.L17:
	addl	$1, -504(%rbp)
.L16:
	movl	-496(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -504(%rbp)
	jl	.L18
	subl	$1, -496(%rbp)
	movl	$0, -488(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L19
.L20:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L19:
	cmpl	$29, -504(%rbp)
	jle	.L20
	movl	$0, -504(%rbp)
	jmp	.L21
.L22:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-352(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L21:
	movl	-504(%rbp), %eax
	cmpl	-496(%rbp), %eax
	jl	.L22
	movl	$0, -504(%rbp)
	jmp	.L23
.L25:
	movl	-504(%rbp), %eax
	cltq
	movl	-352(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L24
	addl	$1, -488(%rbp)
.L24:
	addl	$1, -504(%rbp)
.L23:
	cmpl	$29, -504(%rbp)
	jle	.L25
	addl	$1, -492(%rbp)
.L15:
	cmpl	$1, -488(%rbp)
	jg	.L26
	movl	-500(%rbp), %eax
	cmpl	-492(%rbp), %eax
	jle	.L7
	movl	-492(%rbp), %eax
	movl	%eax, -500(%rbp)
.L7:
	movzbl	-505(%rbp), %eax
	addl	$1, %eax
	movb	%al, -505(%rbp)
.L6:
	cmpb	$122, -505(%rbp)
	jle	.L27
	movl	-500(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	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	"%s"
.LC1:
	.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	$512, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-224(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -504(%rbp)
	jmp	.L2
.L3:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -480(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L2:
	cmpl	$29, -504(%rbp)
	jle	.L3
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -484(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L4
.L5:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-480(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -480(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L4:
	movl	-504(%rbp), %eax
	cmpl	-484(%rbp), %eax
	jl	.L5
	movl	$100005, -500(%rbp)
	movb	$97, -505(%rbp)
	jmp	.L6
.L27:
	movsbl	-505(%rbp), %eax
	subl	$97, %eax
	cltq
	movl	-480(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	-224(%rbp), %rdx
	leaq	-112(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	movl	-484(%rbp), %eax
	movl	%eax, -496(%rbp)
	movl	$0, -492(%rbp)
	movl	$0, -488(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L8
.L9:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L8:
	cmpl	$29, -504(%rbp)
	jle	.L9
	movl	$0, -504(%rbp)
	jmp	.L10
.L11:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-352(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L10:
	movl	-504(%rbp), %eax
	cmpl	-496(%rbp), %eax
	jl	.L11
	movl	$0, -504(%rbp)
	jmp	.L12
.L14:
	movl	-504(%rbp), %eax
	cltq
	movl	-352(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L13
	addl	$1, -488(%rbp)
.L13:
	addl	$1, -504(%rbp)
.L12:
	cmpl	$29, -504(%rbp)
	jle	.L14
	jmp	.L15
.L26:
	movl	$0, -504(%rbp)
	jmp	.L16
.L18:
	movl	-504(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, -505(%rbp)
	jne	.L17
	movl	-504(%rbp), %eax
	cltq
	movzbl	-505(%rbp), %edx
	movb	%dl, -112(%rbp,%rax)
.L17:
	addl	$1, -504(%rbp)
.L16:
	movl	-496(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -504(%rbp)
	jl	.L18
	subl	$1, -496(%rbp)
	movl	$0, -488(%rbp)
	movl	$0, -504(%rbp)
	jmp	.L19
.L20:
	movl	-504(%rbp), %eax
	cltq
	movl	$0, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L19:
	cmpl	$29, -504(%rbp)
	jle	.L20
	movl	$0, -504(%rbp)
	jmp	.L21
.L22:
	movl	-504(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-352(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -352(%rbp,%rax,4)
	addl	$1, -504(%rbp)
.L21:
	movl	-504(%rbp), %eax
	cmpl	-496(%rbp), %eax
	jl	.L22
	movl	$0, -504(%rbp)
	jmp	.L23
.L25:
	movl	-504(%rbp), %eax
	cltq
	movl	-352(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L24
	addl	$1, -488(%rbp)
.L24:
	addl	$1, -504(%rbp)
.L23:
	cmpl	$29, -504(%rbp)
	jle	.L25
	addl	$1, -492(%rbp)
.L15:
	cmpl	$1, -488(%rbp)
	jg	.L26
	movl	-500(%rbp), %eax
	cmpl	-492(%rbp), %eax
	jle	.L7
	movl	-492(%rbp), %eax
	movl	%eax, -500(%rbp)
.L7:
	movzbl	-505(%rbp), %eax
	addl	$1, %eax
	movb	%al, -505(%rbp)
.L6:
	cmpb	$122, -505(%rbp)
	jle	.L27
	movl	-500(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	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:
