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>
#define Max(a, b) ((a) > (b) ? (a) : (b))

int
main(int argc, char *argv[])
{
  char s[51];
  scanf("%s", s);
  int n = strlen(s);
  if(n > 9 || n < 5) printf("NO\n");
  else{
    char t[20];
    int k = 0; int l = 0;
    while(k < n){
      if(s[k] == 'K' && s[Max(k - 1, 0)] != 'A'){
	t[l++] = 'A';
	t[l++] = 'K';
      }
      else if(s[k] == 'H' && s[k + 1] != 'A'){
	t[l++] = 'H';
	t[l++] = 'A';
      }
      else if(s[k] == 'B' && s[k + 1] != 'A'){
	t[l++] = 'B';
	t[l++] = 'A';
      }
      else if(s[k] == 'R' && s[k + 1] != 'A'){
	t[l++] = 'R';
	t[l++] = 'A';
      }
      else t[l++] = s[k];
      k++;
    }
    t[l] = 0;
    //printf("%s\n", t);
    char x[] = "AKIHABARA\0\0\0\0\0\0\0\0\0\0";
    int cnt = 0;
    for(int i = 0; i < l; i++){
      if(t[i] == x[i])cnt++;
      else break;
    }
    if(cnt == 9) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.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	$176, %rsp
	movl	%edi, -164(%rbp)
	movq	%rsi, -176(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-64(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -132(%rbp)
	cmpl	$9, -132(%rbp)
	jg	.L2
	cmpl	$4, -132(%rbp)
	jg	.L3
.L2:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L3:
	movl	$0, -148(%rbp)
	movl	$0, -144(%rbp)
	jmp	.L5
.L11:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$75, %al
	jne	.L6
	movl	-148(%rbp), %eax
	movl	$1, %edx
	testl	%eax, %eax
	cmovle	%edx, %eax
	subl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L6
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$75, -128(%rbp,%rax)
	jmp	.L7
.L6:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$72, %al
	jne	.L8
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L8
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$72, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L8:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L9
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L9
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$66, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L9:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L10
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$82, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L10:
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-64(%rbp,%rdx), %edx
	cltq
	movb	%dl, -128(%rbp,%rax)
.L7:
	addl	$1, -148(%rbp)
.L5:
	movl	-148(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jl	.L11
	movl	-144(%rbp), %eax
	cltq
	movb	$0, -128(%rbp,%rax)
	movabsq	$5927091432749353793, %rax
	movl	$65, %edx
	movq	%rax, -96(%rbp)
	movq	%rdx, -88(%rbp)
	movl	$0, -80(%rbp)
	movl	$0, -140(%rbp)
	movl	$0, -136(%rbp)
	jmp	.L12
.L16:
	movl	-136(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-136(%rbp), %eax
	cltq
	movzbl	-96(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L21
	addl	$1, -140(%rbp)
	addl	$1, -136(%rbp)
.L12:
	movl	-136(%rbp), %eax
	cmpl	-144(%rbp), %eax
	jl	.L16
	jmp	.L15
.L21:
	nop
.L15:
	cmpl	$9, -140(%rbp)
	jne	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L17:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	movl	$0, %eax
	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
.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	"NO"
.LC2:
	.string	"YES"
	.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
	addq	$-128, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	leal	-5(%rax), %edx
	cmpl	$4, %edx
	ja	.L4
	movl	%eax, %r10d
	leaq	65(%rsp), %r8
	xorl	%edx, %edx
	xorl	%edi, %edi
	testq	%rax, %rax
	jne	.L11
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$72, %cl
	je	.L21
	cmpb	$66, %cl
	jne	.L10
	cmpb	$65, (%r8)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	movb	$66, (%rsp,%rax)
	movb	$65, (%rsp,%rsi)
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %r8
	cmpl	%edi, %r10d
	je	.L22
.L11:
	movzbl	-1(%r8), %ecx
	movl	%edi, %eax
	leal	1(%rdx), %esi
	addl	$1, %edi
	cmpb	$75, %cl
	jne	.L6
	testl	%eax, %eax
	movl	$1, %r9d
	cmovle	%r9d, %eax
	subl	$1, %eax
	cltq
	cmpb	$65, 64(%rsp,%rax)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	addq	$1, %r8
	movb	$65, (%rsp,%rax)
	movb	$75, (%rsp,%rsi)
	cmpl	%edi, %r10d
	jne	.L11
.L22:
	movdqa	.LC3(%rip), %xmm0
	movslq	%edx, %rdx
	xorl	%eax, %eax
	movq	%rsp, %rdi
	movb	$0, (%rsp,%rdx)
	leaq	32(%rsp), %rsi
	movl	$0, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L23:
	leal	1(%rax), %ecx
	addq	$1, %rax
	cmpq	%rax, %rdx
	je	.L12
.L13:
	movzbl	(%rsi,%rax), %r11d
	movl	%eax, %ecx
	cmpb	%r11b, (%rdi,%rax)
	je	.L23
.L12:
	cmpl	$9, %ecx
	je	.L24
.L4:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	subq	$-128, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movslq	%edx, %rdx
	movb	%cl, (%rsp,%rdx)
	movl	%esi, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	cmpb	$65, (%r8)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	movb	$72, (%rsp,%rax)
	movb	$65, (%rsp,%rsi)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$82, %cl
	jne	.L7
	cmpb	$65, (%r8)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	movb	$82, (%rsp,%rax)
	movb	$65, (%rsp,%rsi)
	jmp	.L8
.L24:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC3:
	.quad	5927091432749353793
	.quad	65
	.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	"NO"
.LC2:
	.string	"YES"
	.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
	addq	$-128, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	leal	-5(%rax), %edx
	cmpl	$4, %edx
	ja	.L4
	movl	%eax, %r10d
	leaq	65(%rsp), %r8
	xorl	%edx, %edx
	xorl	%edi, %edi
	testq	%rax, %rax
	jne	.L11
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$72, %cl
	je	.L21
	cmpb	$66, %cl
	jne	.L10
	cmpb	$65, (%r8)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	movb	$66, (%rsp,%rax)
	movb	$65, (%rsp,%rsi)
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %r8
	cmpl	%edi, %r10d
	je	.L22
.L11:
	movzbl	-1(%r8), %ecx
	movl	%edi, %eax
	leal	1(%rdx), %esi
	addl	$1, %edi
	cmpb	$75, %cl
	jne	.L6
	testl	%eax, %eax
	movl	$1, %r9d
	cmovle	%r9d, %eax
	subl	$1, %eax
	cltq
	cmpb	$65, 64(%rsp,%rax)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	addq	$1, %r8
	movb	$65, (%rsp,%rax)
	movb	$75, (%rsp,%rsi)
	cmpl	%edi, %r10d
	jne	.L11
.L22:
	movdqa	.LC3(%rip), %xmm0
	movslq	%edx, %rdx
	xorl	%eax, %eax
	movq	%rsp, %rdi
	movb	$0, (%rsp,%rdx)
	leaq	32(%rsp), %rsi
	movl	$0, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L23:
	leal	1(%rax), %ecx
	addq	$1, %rax
	cmpq	%rax, %rdx
	je	.L12
.L13:
	movzbl	(%rsi,%rax), %r11d
	movl	%eax, %ecx
	cmpb	%r11b, (%rdi,%rax)
	je	.L23
.L12:
	cmpl	$9, %ecx
	je	.L24
.L4:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	subq	$-128, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movslq	%edx, %rdx
	movb	%cl, (%rsp,%rdx)
	movl	%esi, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	cmpb	$65, (%r8)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	movb	$72, (%rsp,%rax)
	movb	$65, (%rsp,%rsi)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$82, %cl
	jne	.L7
	cmpb	$65, (%r8)
	je	.L7
	movslq	%edx, %rax
	movslq	%esi, %rsi
	addl	$2, %edx
	movb	$82, (%rsp,%rax)
	movb	$65, (%rsp,%rsi)
	jmp	.L8
.L24:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC3:
	.quad	5927091432749353793
	.quad	65
	.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>
#define Max(a, b) ((a) > (b) ? (a) : (b))

int
main(int argc, char *argv[])
{
  char s[51];
  scanf("%s", s);
  int n = strlen(s);
  if(n > 9 || n < 5) printf("NO\n");
  else{
    char t[20];
    int k = 0; int l = 0;
    while(k < n){
      if(s[k] == 'K' && s[Max(k - 1, 0)] != 'A'){
	t[l++] = 'A';
	t[l++] = 'K';
      }
      else if(s[k] == 'H' && s[k + 1] != 'A'){
	t[l++] = 'H';
	t[l++] = 'A';
      }
      else if(s[k] == 'B' && s[k + 1] != 'A'){
	t[l++] = 'B';
	t[l++] = 'A';
      }
      else if(s[k] == 'R' && s[k + 1] != 'A'){
	t[l++] = 'R';
	t[l++] = 'A';
      }
      else t[l++] = s[k];
      k++;
    }
    t[l] = 0;
    //printf("%s\n", t);
    char x[] = "AKIHABARA\0\0\0\0\0\0\0\0\0\0";
    int cnt = 0;
    for(int i = 0; i < l; i++){
      if(t[i] == x[i])cnt++;
      else break;
    }
    if(cnt == 9) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}

AKIBAAARH
 JIHBR
 ARAABHAIKAA
 HRAAABIKA
 RBHIJ
 AR@ABHAIKAA
 HRAAABHKA
 QBHIJ
 AR@ABHAIJAA
 AKHBAAARH

NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO

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>
#define Max(a, b) ((a) > (b) ? (a) : (b))

int
main(int argc, char *argv[])
{
  char s[51];
  scanf("%s", s);
  int n = strlen(s);
  if(n > 9 || n < 5) printf("NO\n");
  else{
    char t[20];
    int k = 0; int l = 0;
    while(k < n){
      if(s[k] == 'K' && s[Max(k - 1, 0)] != 'A'){
	t[l++] = 'A';
	t[l++] = 'K';
      }
      else if(s[k] == 'H' && s[k + 1] != 'A'){
	t[l++] = 'H';
	t[l++] = 'A';
      }
      else if(s[k] == 'B' && s[k + 1] != 'A'){
	t[l++] = 'B';
	t[l++] = 'A';
      }
      else if(s[k] == 'R' && s[k + 1] != 'A'){
	t[l++] = 'R';
	t[l++] = 'A';
      }
      else t[l++] = s[k];
      k++;
    }
    t[l] = 0;
    //printf("%s\n", t);
    char x[] = "AKIHABARA\0\0\0\0\0\0\0\0\0\0";
    int cnt = 0;
    for(int i = 0; i < l; i++){
      if(t[i] == x[i])cnt++;
      else break;
    }
    if(cnt == 9) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.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	$176, %rsp
	movl	%edi, -164(%rbp)
	movq	%rsi, -176(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-64(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -132(%rbp)
	cmpl	$9, -132(%rbp)
	jg	.L2
	cmpl	$4, -132(%rbp)
	jg	.L3
.L2:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L3:
	movl	$0, -148(%rbp)
	movl	$0, -144(%rbp)
	jmp	.L5
.L11:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$75, %al
	jne	.L6
	movl	-148(%rbp), %eax
	movl	$1, %edx
	testl	%eax, %eax
	cmovle	%edx, %eax
	subl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L6
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$75, -128(%rbp,%rax)
	jmp	.L7
.L6:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$72, %al
	jne	.L8
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L8
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$72, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L8:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L9
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L9
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$66, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L9:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L10
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$82, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L10:
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-64(%rbp,%rdx), %edx
	cltq
	movb	%dl, -128(%rbp,%rax)
.L7:
	addl	$1, -148(%rbp)
.L5:
	movl	-148(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jl	.L11
	movl	-144(%rbp), %eax
	cltq
	movb	$0, -128(%rbp,%rax)
	movabsq	$5927091432749353793, %rax
	movl	$65, %edx
	movq	%rax, -96(%rbp)
	movq	%rdx, -88(%rbp)
	movl	$0, -80(%rbp)
	movl	$0, -140(%rbp)
	movl	$0, -136(%rbp)
	jmp	.L12
.L16:
	movl	-136(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-136(%rbp), %eax
	cltq
	movzbl	-96(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L21
	addl	$1, -140(%rbp)
	addl	$1, -136(%rbp)
.L12:
	movl	-136(%rbp), %eax
	cmpl	-144(%rbp), %eax
	jl	.L16
	jmp	.L15
.L21:
	nop
.L15:
	cmpl	$9, -140(%rbp)
	jne	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L17:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	movl	$0, %eax
	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
.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	"NO"
.LC2:
	.string	"YES"
	.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	$176, %rsp
	movl	%edi, -164(%rbp)
	movq	%rsi, -176(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-64(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -132(%rbp)
	cmpl	$9, -132(%rbp)
	jg	.L2
	cmpl	$4, -132(%rbp)
	jg	.L3
.L2:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L3:
	movl	$0, -148(%rbp)
	movl	$0, -144(%rbp)
	jmp	.L5
.L11:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$75, %al
	jne	.L6
	movl	-148(%rbp), %eax
	movl	$1, %edx
	testl	%eax, %eax
	cmovle	%edx, %eax
	subl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L6
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$75, -128(%rbp,%rax)
	jmp	.L7
.L6:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$72, %al
	jne	.L8
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L8
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$72, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L8:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L9
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L9
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$66, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L9:
	movl	-148(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-148(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	cmpb	$65, %al
	je	.L10
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$82, -128(%rbp,%rax)
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	cltq
	movb	$65, -128(%rbp,%rax)
	jmp	.L7
.L10:
	movl	-144(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -144(%rbp)
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-64(%rbp,%rdx), %edx
	cltq
	movb	%dl, -128(%rbp,%rax)
.L7:
	addl	$1, -148(%rbp)
.L5:
	movl	-148(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jl	.L11
	movl	-144(%rbp), %eax
	cltq
	movb	$0, -128(%rbp,%rax)
	movabsq	$5927091432749353793, %rax
	movl	$65, %edx
	movq	%rax, -96(%rbp)
	movq	%rdx, -88(%rbp)
	movl	$0, -80(%rbp)
	movl	$0, -140(%rbp)
	movl	$0, -136(%rbp)
	jmp	.L12
.L16:
	movl	-136(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-136(%rbp), %eax
	cltq
	movzbl	-96(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L21
	addl	$1, -140(%rbp)
	addl	$1, -136(%rbp)
.L12:
	movl	-136(%rbp), %eax
	cmpl	-144(%rbp), %eax
	jl	.L16
	jmp	.L15
.L21:
	nop
.L15:
	cmpl	$9, -140(%rbp)
	jne	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L4
.L17:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	movl	$0, %eax
	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
.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:
