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

```c
#include <stdio.h>

int main()
{
	char S[51];
	scanf("%s", S);
	
	int i = 0, flag = 0;
	if (S[i] == 'A') i++;
	if (S[i] == 'K') i++;
	else flag = -1;
	if (S[i] == 'I') i++;
	else flag = -1;
	if (S[i] == 'H') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'B') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'R') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] != 0) flag = -1;
	
	if (flag == 0) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%edx, %edx
	cmpb	$65, (%rsp)
	sete	%al
	sete	%dl
	orl	$-1, %ecx
	movzbl	%al, %eax
	cmpb	$75, (%rsp,%rax)
	jne	.L2
	addl	$1, %edx
	xorl	%ecx, %ecx
	movslq	%edx, %rax
.L2:
	cmpb	$73, (%rsp,%rax)
	je	.L35
	orl	$-1, %ecx
.L3:
	cmpb	$72, (%rsp,%rax)
	je	.L36
	orl	$-1, %ecx
.L4:
	movzbl	(%rsp,%rax), %esi
	cmpb	$65, %sil
	je	.L37
	cmpb	$66, %sil
	je	.L13
	orl	$-1, %ecx
.L7:
	cmpb	$82, (%rsp,%rax)
	je	.L14
.L10:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L11:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	addl	$1, %edx
	movslq	%edx, %rax
.L6:
	cmpb	$65, (%rsp,%rax)
	jne	.L7
	addl	$1, %edx
	movslq	%edx, %rax
	movzbl	(%rsp,%rax), %eax
	cmpb	$82, %al
	je	.L14
	orl	$-1, %ecx
	cmpb	$65, %al
	jne	.L10
.L12:
	addl	$1, %edx
	movslq	%edx, %rax
.L9:
	cmpb	$0, (%rsp,%rax)
	jne	.L10
	testl	%ecx, %ecx
	jne	.L10
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L11
.L36:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L4
.L35:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L3
.L37:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$66, (%rsp,%rax)
	je	.L13
	orl	$-1, %ecx
	jmp	.L6
.L14:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$65, (%rsp,%rax)
	jne	.L9
	jmp	.L12
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%edx, %edx
	cmpb	$65, (%rsp)
	sete	%al
	sete	%dl
	orl	$-1, %ecx
	movzbl	%al, %eax
	cmpb	$75, (%rsp,%rax)
	jne	.L2
	addl	$1, %edx
	xorl	%ecx, %ecx
	movslq	%edx, %rax
.L2:
	cmpb	$73, (%rsp,%rax)
	je	.L35
	orl	$-1, %ecx
.L3:
	cmpb	$72, (%rsp,%rax)
	je	.L36
	orl	$-1, %ecx
.L4:
	movzbl	(%rsp,%rax), %esi
	cmpb	$65, %sil
	je	.L37
	cmpb	$66, %sil
	je	.L13
	orl	$-1, %ecx
.L7:
	cmpb	$82, (%rsp,%rax)
	je	.L14
.L10:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L11:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	addl	$1, %edx
	movslq	%edx, %rax
.L6:
	cmpb	$65, (%rsp,%rax)
	jne	.L7
	addl	$1, %edx
	movslq	%edx, %rax
	movzbl	(%rsp,%rax), %eax
	cmpb	$82, %al
	je	.L14
	orl	$-1, %ecx
	cmpb	$65, %al
	jne	.L10
.L12:
	addl	$1, %edx
	movslq	%edx, %rax
.L9:
	cmpb	$0, (%rsp,%rax)
	jne	.L10
	testl	%ecx, %ecx
	jne	.L10
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L11
.L36:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L4
.L35:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L3
.L37:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$66, (%rsp,%rax)
	je	.L13
	orl	$-1, %ecx
	jmp	.L6
.L14:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$65, (%rsp,%rax)
	jne	.L9
	jmp	.L12
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%edx, %edx
	cmpb	$65, (%rsp)
	sete	%al
	sete	%dl
	orl	$-1, %ecx
	movzbl	%al, %eax
	cmpb	$75, (%rsp,%rax)
	jne	.L2
	addl	$1, %edx
	xorl	%ecx, %ecx
	movslq	%edx, %rax
.L2:
	cmpb	$73, (%rsp,%rax)
	je	.L35
	orl	$-1, %ecx
.L3:
	cmpb	$72, (%rsp,%rax)
	je	.L36
	orl	$-1, %ecx
.L4:
	movzbl	(%rsp,%rax), %esi
	cmpb	$65, %sil
	je	.L37
	cmpb	$66, %sil
	je	.L13
	orl	$-1, %ecx
.L7:
	cmpb	$82, (%rsp,%rax)
	je	.L14
.L10:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L11:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	addl	$1, %edx
	movslq	%edx, %rax
.L6:
	cmpb	$65, (%rsp,%rax)
	jne	.L7
	addl	$1, %edx
	movslq	%edx, %rax
	movzbl	(%rsp,%rax), %eax
	cmpb	$82, %al
	je	.L14
	orl	$-1, %ecx
	cmpb	$65, %al
	jne	.L10
.L12:
	addl	$1, %edx
	movslq	%edx, %rax
.L9:
	cmpb	$0, (%rsp,%rax)
	jne	.L10
	testl	%ecx, %ecx
	jne	.L10
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L11
.L36:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L4
.L35:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L3
.L37:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$66, (%rsp,%rax)
	je	.L13
	orl	$-1, %ecx
	jmp	.L6
.L14:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$65, (%rsp,%rax)
	jne	.L9
	jmp	.L12
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include <stdio.h>

int main()
{
	char S[51];
	scanf("%s", S);
	
	int i = 0, flag = 0;
	if (S[i] == 'A') i++;
	if (S[i] == 'K') i++;
	else flag = -1;
	if (S[i] == 'I') i++;
	else flag = -1;
	if (S[i] == 'H') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'B') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'R') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] != 0) flag = -1;
	
	if (flag == 0) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main()
{
	char S[51];
	scanf("%s", S);
	
	int i = 0, flag = 0;
	if (S[i] == 'A') i++;
	if (S[i] == 'K') i++;
	else flag = -1;
	if (S[i] == 'I') i++;
	else flag = -1;
	if (S[i] == 'H') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'B') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'R') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] != 0) flag = -1;
	
	if (flag == 0) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main()
{
	char S[51];
	scanf("%s", S);
	
	int i = 0, flag = 0;
	if (S[i] == 'A') i++;
	if (S[i] == 'K') i++;
	else flag = -1;
	if (S[i] == 'I') i++;
	else flag = -1;
	if (S[i] == 'H') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'B') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] == 'R') i++;
	else flag = -1;
	if (S[i] == 'A') i++;
	if (S[i] != 0) flag = -1;
	
	if (flag == 0) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%edx, %edx
	cmpb	$65, (%rsp)
	sete	%al
	sete	%dl
	orl	$-1, %ecx
	movzbl	%al, %eax
	cmpb	$75, (%rsp,%rax)
	jne	.L2
	addl	$1, %edx
	xorl	%ecx, %ecx
	movslq	%edx, %rax
.L2:
	cmpb	$73, (%rsp,%rax)
	je	.L35
	orl	$-1, %ecx
.L3:
	cmpb	$72, (%rsp,%rax)
	je	.L36
	orl	$-1, %ecx
.L4:
	movzbl	(%rsp,%rax), %esi
	cmpb	$65, %sil
	je	.L37
	cmpb	$66, %sil
	je	.L13
	orl	$-1, %ecx
.L7:
	cmpb	$82, (%rsp,%rax)
	je	.L14
.L10:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L11:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	addl	$1, %edx
	movslq	%edx, %rax
.L6:
	cmpb	$65, (%rsp,%rax)
	jne	.L7
	addl	$1, %edx
	movslq	%edx, %rax
	movzbl	(%rsp,%rax), %eax
	cmpb	$82, %al
	je	.L14
	orl	$-1, %ecx
	cmpb	$65, %al
	jne	.L10
.L12:
	addl	$1, %edx
	movslq	%edx, %rax
.L9:
	cmpb	$0, (%rsp,%rax)
	jne	.L10
	testl	%ecx, %ecx
	jne	.L10
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L11
.L36:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L4
.L35:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L3
.L37:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$66, (%rsp,%rax)
	je	.L13
	orl	$-1, %ecx
	jmp	.L6
.L14:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$65, (%rsp,%rax)
	jne	.L9
	jmp	.L12
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%edx, %edx
	cmpb	$65, (%rsp)
	sete	%al
	sete	%dl
	orl	$-1, %ecx
	movzbl	%al, %eax
	cmpb	$75, (%rsp,%rax)
	jne	.L2
	addl	$1, %edx
	xorl	%ecx, %ecx
	movslq	%edx, %rax
.L2:
	cmpb	$73, (%rsp,%rax)
	je	.L35
	orl	$-1, %ecx
.L3:
	cmpb	$72, (%rsp,%rax)
	je	.L36
	orl	$-1, %ecx
.L4:
	movzbl	(%rsp,%rax), %esi
	cmpb	$65, %sil
	je	.L37
	cmpb	$66, %sil
	je	.L13
	orl	$-1, %ecx
.L7:
	cmpb	$82, (%rsp,%rax)
	je	.L14
.L10:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L11:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	addl	$1, %edx
	movslq	%edx, %rax
.L6:
	cmpb	$65, (%rsp,%rax)
	jne	.L7
	addl	$1, %edx
	movslq	%edx, %rax
	movzbl	(%rsp,%rax), %eax
	cmpb	$82, %al
	je	.L14
	orl	$-1, %ecx
	cmpb	$65, %al
	jne	.L10
.L12:
	addl	$1, %edx
	movslq	%edx, %rax
.L9:
	cmpb	$0, (%rsp,%rax)
	jne	.L10
	testl	%ecx, %ecx
	jne	.L10
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L11
.L36:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L4
.L35:
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L3
.L37:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$66, (%rsp,%rax)
	je	.L13
	orl	$-1, %ecx
	jmp	.L6
.L14:
	addl	$1, %edx
	movslq	%edx, %rax
	cmpb	$65, (%rsp,%rax)
	jne	.L9
	jmp	.L12
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```