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(void) {

  char s[101];
  scanf("%s", s);
  int length = strlen(s);
  int alp[26];
  for (int i = 0; i < 26; i++) {
    alp[i] = 0;
  }
  int flag = 1;
  for (int i = 0; i < length; i++) {
    if (i != 0 && s[i] != s[i-1]) {
      flag = 0;
    }
    alp[s[i]-'a']++;
  }
  if (flag == 1) {
    printf("0\n");
    return 0;
  }
  char generate[length];
  int operation;
  int min = 100;
  for (int i = 0; i < 26; i++) {
    if (alp[i] == 0) {
      continue;
    }
    flag = 1;
    for (int j = 0; j < length; j++) {
      generate[j] = s[j];
    }
    operation = 0;
    while (1) {
      operation++;
      flag = 1;
      for (int j = 0; j < length-operation; j++) {
        if (generate[j] != i+'a' && generate[j+1] != i+'a') {
          flag = 0;
        } else {
          generate[j] = i+'a';
        }
      }
      if (flag == 1) {
        break;
      }
    }
    if (operation < min) {
      min = operation;
    }
  }
  printf("%d\n", min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"0"
.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %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	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -292(%rbp)
	movl	$0, -324(%rbp)
	jmp	.L2
.L3:
	movl	-324(%rbp), %eax
	cltq
	movl	$0, -272(%rbp,%rax,4)
	addl	$1, -324(%rbp)
.L2:
	cmpl	$25, -324(%rbp)
	jle	.L3
	movl	$1, -320(%rbp)
	movl	$0, -316(%rbp)
	jmp	.L4
.L6:
	cmpl	$0, -316(%rbp)
	je	.L5
	movl	-316(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %edx
	movl	-316(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-160(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	$0, -320(%rbp)
.L5:
	movl	-316(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-272(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -272(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L4:
	movl	-316(%rbp), %eax
	cmpl	-292(%rbp), %eax
	jl	.L6
	cmpl	$1, -320(%rbp)
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L8
.L7:
	movl	-292(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -288(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -280(%rbp)
	movl	$100, -308(%rbp)
	movl	$0, -304(%rbp)
	jmp	.L12
.L24:
	movl	-304(%rbp), %eax
	cltq
	movl	-272(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	$1, -320(%rbp)
	movl	$0, -300(%rbp)
	jmp	.L15
.L16:
	movl	-300(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %ecx
	movq	-280(%rbp), %rdx
	movl	-300(%rbp), %eax
	cltq
	movb	%cl, (%rdx,%rax)
	addl	$1, -300(%rbp)
.L15:
	movl	-300(%rbp), %eax
	cmpl	-292(%rbp), %eax
	jl	.L16
	movl	$0, -312(%rbp)
.L23:
	addl	$1, -312(%rbp)
	movl	$1, -320(%rbp)
	movl	$0, -296(%rbp)
	jmp	.L17
.L20:
	movq	-280(%rbp), %rdx
	movl	-296(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	-304(%rbp), %edx
	addl	$97, %edx
	cmpl	%edx, %eax
	je	.L18
	movl	-296(%rbp), %eax
	addl	$1, %eax
	movq	-280(%rbp), %rdx
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	-304(%rbp), %edx
	addl	$97, %edx
	cmpl	%edx, %eax
	je	.L18
	movl	$0, -320(%rbp)
	jmp	.L19
.L18:
	movl	-304(%rbp), %eax
	addl	$97, %eax
	movl	%eax, %ecx
	movq	-280(%rbp), %rdx
	movl	-296(%rbp), %eax
	cltq
	movb	%cl, (%rdx,%rax)
.L19:
	addl	$1, -296(%rbp)
.L17:
	movl	-292(%rbp), %eax
	subl	-312(%rbp), %eax
	cmpl	%eax, -296(%rbp)
	jl	.L20
	cmpl	$1, -320(%rbp)
	je	.L29
	jmp	.L23
.L29:
	nop
	movl	-312(%rbp), %eax
	cmpl	-308(%rbp), %eax
	jge	.L14
	movl	-312(%rbp), %eax
	movl	%eax, -308(%rbp)
	jmp	.L14
.L28:
	nop
.L14:
	addl	$1, -304(%rbp)
.L12:
	cmpl	$25, -304(%rbp)
	jle	.L24
	movl	-308(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L8:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	-160(%rbp), %r13
	pushq	%r12
	movq	%r13, %rsi
	.cfi_offset 12, -48
	leaq	-272(%rbp), %r12
	pushq	%rbx
	subq	$264, %rsp
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	movl	$13, %ecx
	movq	%r12, %rdi
	movq	%rax, -280(%rbp)
	movq	%rax, %rbx
	movl	%eax, %r10d
	xorl	%eax, %eax
	rep stosq
	testq	%rbx, %rbx
	je	.L2
	movsbl	-160(%rbp), %eax
	movl	%eax, %edx
	subl	$97, %eax
	cltq
	movl	$1, -272(%rbp,%rax,4)
	cmpl	$1, %ebx
	je	.L2
	movq	%rbx, %rax
	leaq	-159(%rbp), %rcx
	movl	%ebx, %r11d
	xorl	%esi, %esi
	subl	$2, %eax
	movl	$1, %r8d
	leaq	-158(%rbp,%rax), %rdi
.L6:
	movl	%edx, %eax
	movzbl	(%rcx), %edx
	cmpb	%dl, %al
	movsbl	%dl, %eax
	cmovne	%esi, %r8d
	subl	$97, %eax
	addq	$1, %rcx
	cltq
	addl	$1, -272(%rbp,%rax,4)
	cmpq	%rdi, %rcx
	jne	.L6
	cmpl	$1, %r8d
	je	.L2
	movq	-280(%rbp), %rax
	movq	%rsp, %rcx
	leaq	15(%rax), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L45
.L9:
	movl	-280(%rbp), %eax
	movq	%rsp, %r9
	movl	$97, %edx
	movl	$100, %r14d
	subl	$1, %r11d
	leaq	1(%rsp), %rbx
	movq	%rax, -288(%rbp)
	addq	%rsp, %rax
	movq	%rax, -296(%rbp)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %edx
	addq	$4, %r12
	cmpl	$123, %edx
	je	.L46
.L21:
	movl	(%r12), %eax
	testl	%eax, %eax
	je	.L10
	movq	-280(%rbp), %rax
	cmpl	$8, %eax
	jnb	.L11
	testb	$4, %al
	jne	.L47
	movq	%rax, %rdi
	testl	%eax, %eax
	je	.L12
	movzbl	0(%r13), %eax
	movb	%al, (%r9)
	movq	%rdi, %rax
	testb	$2, %al
	jne	.L48
.L12:
	movl	%r8d, %r15d
	.p2align 4,,10
	.p2align 3
.L20:
	addl	$1, %r15d
	cmpl	%r15d, %r10d
	je	.L19
	movl	%r11d, %esi
	movq	%r9, %rax
	movl	$1, %edi
	subl	%r15d, %esi
	addq	%rbx, %rsi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L50:
	movsbl	1(%rax), %ecx
	cmpl	%edx, %ecx
	je	.L16
	addq	$1, %rax
	movl	%r8d, %edi
	cmpq	%rax, %rsi
	je	.L49
.L18:
	movsbl	(%rax), %ecx
	cmpl	%edx, %ecx
	jne	.L50
.L16:
	movb	%dl, (%rax)
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L18
.L49:
	cmpl	$1, %edi
	jne	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%r15d, %r14d
	cmovg	%r15d, %r14d
	addl	$1, %edx
	addq	$4, %r12
	cmpl	$123, %edx
	jne	.L21
.L46:
	movl	%r14d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L4:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L51
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L11:
	.cfi_restore_state
	movq	0(%r13), %rax
	movq	%r13, %rsi
	movq	%rax, (%r9)
	movq	-288(%rbp), %rax
	movq	-296(%rbp), %rdi
	movq	-8(%r13,%rax), %rax
	movq	%rax, -8(%rdi)
	leaq	8(%r9), %rdi
	movq	%r9, %rax
	andq	$-8, %rdi
	subq	%rdi, %rax
	subq	%rax, %rsi
	addl	-280(%rbp), %eax
	shrl	$3, %eax
	movl	%eax, %ecx
	rep movsq
	jmp	.L12
.L47:
	movl	0(%r13), %eax
	movl	%eax, (%r9)
	movq	-288(%rbp), %rax
	movq	-296(%rbp), %rdi
	movl	-4(%r13,%rax), %eax
	movl	%eax, -4(%rdi)
	jmp	.L12
.L48:
	movq	-288(%rbp), %rax
	movq	-296(%rbp), %rdi
	movzwl	-2(%r13,%rax), %eax
	movw	%ax, -2(%rdi)
	jmp	.L12
.L45:
	orq	$0, -8(%rsp,%rax)
	jmp	.L9
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L4
.L51:
	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	"%s"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	-160(%rbp), %r13
	pushq	%r12
	movq	%r13, %rsi
	.cfi_offset 12, -48
	leaq	-272(%rbp), %r12
	pushq	%rbx
	subq	$264, %rsp
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	movl	$13, %ecx
	movq	%r12, %rdi
	movq	%rax, -280(%rbp)
	movq	%rax, %rbx
	movl	%eax, %r10d
	xorl	%eax, %eax
	rep stosq
	testq	%rbx, %rbx
	je	.L2
	movsbl	-160(%rbp), %eax
	movl	%eax, %edx
	subl	$97, %eax
	cltq
	movl	$1, -272(%rbp,%rax,4)
	cmpl	$1, %ebx
	je	.L2
	movq	%rbx, %rax
	leaq	-159(%rbp), %rcx
	movl	%ebx, %r11d
	xorl	%esi, %esi
	subl	$2, %eax
	movl	$1, %r8d
	leaq	-158(%rbp,%rax), %rdi
.L6:
	movl	%edx, %eax
	movzbl	(%rcx), %edx
	cmpb	%dl, %al
	movsbl	%dl, %eax
	cmovne	%esi, %r8d
	subl	$97, %eax
	addq	$1, %rcx
	cltq
	addl	$1, -272(%rbp,%rax,4)
	cmpq	%rdi, %rcx
	jne	.L6
	cmpl	$1, %r8d
	je	.L2
	movq	-280(%rbp), %rax
	movq	%rsp, %rcx
	leaq	15(%rax), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L45
.L9:
	movl	-280(%rbp), %eax
	movq	%rsp, %r9
	movl	$97, %edx
	movl	$100, %r14d
	subl	$1, %r11d
	leaq	1(%rsp), %rbx
	movq	%rax, -288(%rbp)
	addq	%rsp, %rax
	movq	%rax, -296(%rbp)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %edx
	addq	$4, %r12
	cmpl	$123, %edx
	je	.L46
.L21:
	movl	(%r12), %eax
	testl	%eax, %eax
	je	.L10
	movq	-280(%rbp), %rax
	cmpl	$8, %eax
	jnb	.L11
	testb	$4, %al
	jne	.L47
	movq	%rax, %rdi
	testl	%eax, %eax
	je	.L12
	movzbl	0(%r13), %eax
	movb	%al, (%r9)
	movq	%rdi, %rax
	testb	$2, %al
	jne	.L48
.L12:
	movl	%r8d, %r15d
	.p2align 4,,10
	.p2align 3
.L20:
	addl	$1, %r15d
	cmpl	%r15d, %r10d
	je	.L19
	movl	%r11d, %esi
	movq	%r9, %rax
	movl	$1, %edi
	subl	%r15d, %esi
	addq	%rbx, %rsi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L50:
	movsbl	1(%rax), %ecx
	cmpl	%edx, %ecx
	je	.L16
	addq	$1, %rax
	movl	%r8d, %edi
	cmpq	%rax, %rsi
	je	.L49
.L18:
	movsbl	(%rax), %ecx
	cmpl	%edx, %ecx
	jne	.L50
.L16:
	movb	%dl, (%rax)
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L18
.L49:
	cmpl	$1, %edi
	jne	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%r15d, %r14d
	cmovg	%r15d, %r14d
	addl	$1, %edx
	addq	$4, %r12
	cmpl	$123, %edx
	jne	.L21
.L46:
	movl	%r14d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L4:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L51
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L11:
	.cfi_restore_state
	movq	0(%r13), %rax
	movq	%r13, %rsi
	movq	%rax, (%r9)
	movq	-288(%rbp), %rax
	movq	-296(%rbp), %rdi
	movq	-8(%r13,%rax), %rax
	movq	%rax, -8(%rdi)
	leaq	8(%r9), %rdi
	movq	%r9, %rax
	andq	$-8, %rdi
	subq	%rdi, %rax
	subq	%rax, %rsi
	addl	-280(%rbp), %eax
	shrl	$3, %eax
	movl	%eax, %ecx
	rep movsq
	jmp	.L12
.L47:
	movl	0(%r13), %eax
	movl	%eax, (%r9)
	movq	-288(%rbp), %rax
	movq	-296(%rbp), %rdi
	movl	-4(%r13,%rax), %eax
	movl	%eax, -4(%rdi)
	jmp	.L12
.L48:
	movq	-288(%rbp), %rax
	movq	-296(%rbp), %rdi
	movzwl	-2(%r13,%rax), %eax
	movw	%ax, -2(%rdi)
	jmp	.L12
.L45:
	orq	$0, -8(%rsp,%rax)
	jmp	.L9
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L4
.L51:
	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(void) {

  char s[101];
  scanf("%s", s);
  int length = strlen(s);
  int alp[26];
  for (int i = 0; i < 26; i++) {
    alp[i] = 0;
  }
  int flag = 1;
  for (int i = 0; i < length; i++) {
    if (i != 0 && s[i] != s[i-1]) {
      flag = 0;
    }
    alp[s[i]-'a']++;
  }
  if (flag == 1) {
    printf("0\n");
    return 0;
  }
  char generate[length];
  int operation;
  int min = 100;
  for (int i = 0; i < 26; i++) {
    if (alp[i] == 0) {
      continue;
    }
    flag = 1;
    for (int j = 0; j < length; j++) {
      generate[j] = s[j];
    }
    operation = 0;
    while (1) {
      operation++;
      flag = 1;
      for (int j = 0; j < length-operation; j++) {
        if (generate[j] != i+'a' && generate[j+1] != i+'a') {
          flag = 0;
        } else {
          generate[j] = i+'a';
        }
      }
      if (flag == 1) {
        break;
      }
    }
    if (operation < min) {
      min = operation;
    }
  }
  printf("%d\n", min);

  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(void) {

  char s[101];
  scanf("%s", s);
  int length = strlen(s);
  int alp[26];
  for (int i = 0; i < 26; i++) {
    alp[i] = 0;
  }
  int flag = 1;
  for (int i = 0; i < length; i++) {
    if (i != 0 && s[i] != s[i-1]) {
      flag = 0;
    }
    alp[s[i]-'a']++;
  }
  if (flag == 1) {
    printf("0\n");
    return 0;
  }
  char generate[length];
  int operation;
  int min = 100;
  for (int i = 0; i < 26; i++) {
    if (alp[i] == 0) {
      continue;
    }
    flag = 1;
    for (int j = 0; j < length; j++) {
      generate[j] = s[j];
    }
    operation = 0;
    while (1) {
      operation++;
      flag = 1;
      for (int j = 0; j < length-operation; j++) {
        if (generate[j] != i+'a' && generate[j+1] != i+'a') {
          flag = 0;
        } else {
          generate[j] = i+'a';
        }
      }
      if (flag == 1) {
        break;
      }
    }
    if (operation < min) {
      min = operation;
    }
  }
  printf("%d\n", min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"0"
.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %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	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -292(%rbp)
	movl	$0, -324(%rbp)
	jmp	.L2
.L3:
	movl	-324(%rbp), %eax
	cltq
	movl	$0, -272(%rbp,%rax,4)
	addl	$1, -324(%rbp)
.L2:
	cmpl	$25, -324(%rbp)
	jle	.L3
	movl	$1, -320(%rbp)
	movl	$0, -316(%rbp)
	jmp	.L4
.L6:
	cmpl	$0, -316(%rbp)
	je	.L5
	movl	-316(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %edx
	movl	-316(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-160(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	$0, -320(%rbp)
.L5:
	movl	-316(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-272(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -272(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L4:
	movl	-316(%rbp), %eax
	cmpl	-292(%rbp), %eax
	jl	.L6
	cmpl	$1, -320(%rbp)
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L8
.L7:
	movl	-292(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -288(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -280(%rbp)
	movl	$100, -308(%rbp)
	movl	$0, -304(%rbp)
	jmp	.L12
.L24:
	movl	-304(%rbp), %eax
	cltq
	movl	-272(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	$1, -320(%rbp)
	movl	$0, -300(%rbp)
	jmp	.L15
.L16:
	movl	-300(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %ecx
	movq	-280(%rbp), %rdx
	movl	-300(%rbp), %eax
	cltq
	movb	%cl, (%rdx,%rax)
	addl	$1, -300(%rbp)
.L15:
	movl	-300(%rbp), %eax
	cmpl	-292(%rbp), %eax
	jl	.L16
	movl	$0, -312(%rbp)
.L23:
	addl	$1, -312(%rbp)
	movl	$1, -320(%rbp)
	movl	$0, -296(%rbp)
	jmp	.L17
.L20:
	movq	-280(%rbp), %rdx
	movl	-296(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	-304(%rbp), %edx
	addl	$97, %edx
	cmpl	%edx, %eax
	je	.L18
	movl	-296(%rbp), %eax
	addl	$1, %eax
	movq	-280(%rbp), %rdx
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	-304(%rbp), %edx
	addl	$97, %edx
	cmpl	%edx, %eax
	je	.L18
	movl	$0, -320(%rbp)
	jmp	.L19
.L18:
	movl	-304(%rbp), %eax
	addl	$97, %eax
	movl	%eax, %ecx
	movq	-280(%rbp), %rdx
	movl	-296(%rbp), %eax
	cltq
	movb	%cl, (%rdx,%rax)
.L19:
	addl	$1, -296(%rbp)
.L17:
	movl	-292(%rbp), %eax
	subl	-312(%rbp), %eax
	cmpl	%eax, -296(%rbp)
	jl	.L20
	cmpl	$1, -320(%rbp)
	je	.L29
	jmp	.L23
.L29:
	nop
	movl	-312(%rbp), %eax
	cmpl	-308(%rbp), %eax
	jge	.L14
	movl	-312(%rbp), %eax
	movl	%eax, -308(%rbp)
	jmp	.L14
.L28:
	nop
.L14:
	addl	$1, -304(%rbp)
.L12:
	cmpl	$25, -304(%rbp)
	jle	.L24
	movl	-308(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L8:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"0"
.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %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	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -292(%rbp)
	movl	$0, -324(%rbp)
	jmp	.L2
.L3:
	movl	-324(%rbp), %eax
	cltq
	movl	$0, -272(%rbp,%rax,4)
	addl	$1, -324(%rbp)
.L2:
	cmpl	$25, -324(%rbp)
	jle	.L3
	movl	$1, -320(%rbp)
	movl	$0, -316(%rbp)
	jmp	.L4
.L6:
	cmpl	$0, -316(%rbp)
	je	.L5
	movl	-316(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %edx
	movl	-316(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-160(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	$0, -320(%rbp)
.L5:
	movl	-316(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-272(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -272(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L4:
	movl	-316(%rbp), %eax
	cmpl	-292(%rbp), %eax
	jl	.L6
	cmpl	$1, -320(%rbp)
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L8
.L7:
	movl	-292(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -288(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -280(%rbp)
	movl	$100, -308(%rbp)
	movl	$0, -304(%rbp)
	jmp	.L12
.L24:
	movl	-304(%rbp), %eax
	cltq
	movl	-272(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	$1, -320(%rbp)
	movl	$0, -300(%rbp)
	jmp	.L15
.L16:
	movl	-300(%rbp), %eax
	cltq
	movzbl	-160(%rbp,%rax), %ecx
	movq	-280(%rbp), %rdx
	movl	-300(%rbp), %eax
	cltq
	movb	%cl, (%rdx,%rax)
	addl	$1, -300(%rbp)
.L15:
	movl	-300(%rbp), %eax
	cmpl	-292(%rbp), %eax
	jl	.L16
	movl	$0, -312(%rbp)
.L23:
	addl	$1, -312(%rbp)
	movl	$1, -320(%rbp)
	movl	$0, -296(%rbp)
	jmp	.L17
.L20:
	movq	-280(%rbp), %rdx
	movl	-296(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	-304(%rbp), %edx
	addl	$97, %edx
	cmpl	%edx, %eax
	je	.L18
	movl	-296(%rbp), %eax
	addl	$1, %eax
	movq	-280(%rbp), %rdx
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	-304(%rbp), %edx
	addl	$97, %edx
	cmpl	%edx, %eax
	je	.L18
	movl	$0, -320(%rbp)
	jmp	.L19
.L18:
	movl	-304(%rbp), %eax
	addl	$97, %eax
	movl	%eax, %ecx
	movq	-280(%rbp), %rdx
	movl	-296(%rbp), %eax
	cltq
	movb	%cl, (%rdx,%rax)
.L19:
	addl	$1, -296(%rbp)
.L17:
	movl	-292(%rbp), %eax
	subl	-312(%rbp), %eax
	cmpl	%eax, -296(%rbp)
	jl	.L20
	cmpl	$1, -320(%rbp)
	je	.L29
	jmp	.L23
.L29:
	nop
	movl	-312(%rbp), %eax
	cmpl	-308(%rbp), %eax
	jge	.L14
	movl	-312(%rbp), %eax
	movl	%eax, -308(%rbp)
	jmp	.L14
.L28:
	nop
.L14:
	addl	$1, -304(%rbp)
.L12:
	cmpl	$25, -304(%rbp)
	jle	.L24
	movl	-308(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L8:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
