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[3][101];
  scanf("%s%*c%s%*c%s",s[0],s[1],s[2]);
  int salen,sblen,sclen;
  salen=strlen(s[0]);
  sblen=strlen(s[1]);
  sclen=strlen(s[2]);
  int anum=0,bnum=0,cnum=0,num=0;
  while(1){
    if(num==0){
      if(anum==salen){
        puts("A");
        return 0;
      }
      if(s[num][anum]=='b')
        num=1;
      else if(s[num][anum]=='c')
        num=2;
      anum++;
    }
    else if(num==1){
      if(bnum==sblen){
        puts("B");
        return 0;
      }
      if(s[num][bnum]=='a')
        num=0;
      else if(s[num][bnum]=='c')
        num=2;
      bnum++;
    }
    else{
      if(cnum==sclen){
        puts("C");
        return 0;
      }
      if(s[num][cnum]=='a')
        num=0;
      else if(s[num][cnum]=='b')
        num=1;
      cnum++;
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%*c%s%*c%s"
.LC1:
	.string	"A"
.LC2:
	.string	"B"
.LC3:
	.string	"C"
	.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	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-320(%rbp), %rax
	leaq	202(%rax), %rcx
	leaq	-320(%rbp), %rax
	leaq	101(%rax), %rdx
	leaq	-320(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-320(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -332(%rbp)
	leaq	-320(%rbp), %rax
	addq	$101, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -328(%rbp)
	leaq	-320(%rbp), %rax
	addq	$202, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -324(%rbp)
	movl	$0, -348(%rbp)
	movl	$0, -344(%rbp)
	movl	$0, -340(%rbp)
	movl	$0, -336(%rbp)
.L15:
	cmpl	$0, -336(%rbp)
	jne	.L2
	movl	-348(%rbp), %eax
	cmpl	-332(%rbp), %eax
	jne	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L3:
	movl	-348(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$98, %al
	jne	.L5
	movl	$1, -336(%rbp)
	jmp	.L6
.L5:
	movl	-348(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L6
	movl	$2, -336(%rbp)
.L6:
	addl	$1, -348(%rbp)
	jmp	.L15
.L2:
	cmpl	$1, -336(%rbp)
	jne	.L8
	movl	-344(%rbp), %eax
	cmpl	-328(%rbp), %eax
	jne	.L9
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L9:
	movl	-344(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$97, %al
	jne	.L10
	movl	$0, -336(%rbp)
	jmp	.L11
.L10:
	movl	-344(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L11
	movl	$2, -336(%rbp)
.L11:
	addl	$1, -344(%rbp)
	jmp	.L15
.L8:
	movl	-340(%rbp), %eax
	cmpl	-324(%rbp), %eax
	jne	.L12
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L12:
	movl	-340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$97, %al
	jne	.L13
	movl	$0, -336(%rbp)
	jmp	.L14
.L13:
	movl	-340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$98, %al
	jne	.L14
	movl	$1, -336(%rbp)
.L14:
	addl	$1, -340(%rbp)
	jmp	.L15
.L16:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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%*c%s%*c%s"
.LC1:
	.string	"A"
.LC2:
	.string	"B"
.LC3:
	.string	"C"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$320, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 312(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	101(%rsp), %r13
	leaq	202(%rsp), %r12
	movq	%r12, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%r13, %rdi
	movq	%rax, %r14
	movl	%eax, %ebp
	call	strlen@PLT
	movq	%r12, %rdi
	movq	%rax, %r13
	movl	%eax, %ebx
	call	strlen@PLT
	leal	-1(%r13), %r9d
	xorl	%edi, %edi
	xorl	%edx, %edx
	movq	%rax, %r12
	leal	-1(%r14), %r10d
	leaq	-1(%rsp), %r8
	xorl	%ecx, %ecx
	leaq	201(%rsp), %r11
	leaq	100(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%ecx, %ebp
	je	.L8
	movl	%r10d, %esi
	leal	1(%rcx), %eax
	subl	%ecx, %esi
	cltq
	leaq	2(%rsi,%rcx), %r14
.L9:
	movzbl	(%r8,%rax), %esi
	movslq	%eax, %rcx
	cmpb	$98, %sil
	je	.L13
	cmpb	$99, %sil
	je	.L7
	addq	$1, %rax
	cmpq	%r14, %rax
	jne	.L9
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L3:
	movq	312(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$320, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movl	%r12d, %esi
	leal	1(%rdi), %eax
	subl	%edi, %esi
	cltq
	leaq	1(%rsi,%rdi), %r14
.L14:
	cmpq	%rax, %r14
	je	.L37
	movzbl	(%r11,%rax), %esi
	movslq	%eax, %rdi
	cmpb	$97, %sil
	je	.L2
	addq	$1, %rax
	cmpb	$98, %sil
	jne	.L14
.L13:
	cmpl	%edx, %ebx
	je	.L5
	movl	%r9d, %esi
	leal	1(%rdx), %eax
	subl	%edx, %esi
	cltq
	leaq	2(%rsi,%rdx), %r14
.L11:
	movzbl	0(%r13,%rax), %esi
	movslq	%eax, %rdx
	cmpb	$97, %sil
	je	.L2
	cmpb	$99, %sil
	je	.L7
	addq	$1, %rax
	cmpq	%rax, %r14
	jne	.L11
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L37:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L36:
	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%*c%s%*c%s"
.LC1:
	.string	"A"
.LC2:
	.string	"B"
.LC3:
	.string	"C"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$320, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 312(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	101(%rsp), %r13
	leaq	202(%rsp), %r12
	movq	%r12, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%r13, %rdi
	movq	%rax, %r14
	movl	%eax, %ebp
	call	strlen@PLT
	movq	%r12, %rdi
	movq	%rax, %r13
	movl	%eax, %ebx
	call	strlen@PLT
	leal	-1(%r13), %r9d
	xorl	%edi, %edi
	xorl	%edx, %edx
	movq	%rax, %r12
	leal	-1(%r14), %r10d
	leaq	-1(%rsp), %r8
	xorl	%ecx, %ecx
	leaq	201(%rsp), %r11
	leaq	100(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%ecx, %ebp
	je	.L8
	movl	%r10d, %esi
	leal	1(%rcx), %eax
	subl	%ecx, %esi
	cltq
	leaq	2(%rsi,%rcx), %r14
.L9:
	movzbl	(%r8,%rax), %esi
	movslq	%eax, %rcx
	cmpb	$98, %sil
	je	.L13
	cmpb	$99, %sil
	je	.L7
	addq	$1, %rax
	cmpq	%r14, %rax
	jne	.L9
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L3:
	movq	312(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$320, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movl	%r12d, %esi
	leal	1(%rdi), %eax
	subl	%edi, %esi
	cltq
	leaq	1(%rsi,%rdi), %r14
.L14:
	cmpq	%rax, %r14
	je	.L37
	movzbl	(%r11,%rax), %esi
	movslq	%eax, %rdi
	cmpb	$97, %sil
	je	.L2
	addq	$1, %rax
	cmpb	$98, %sil
	jne	.L14
.L13:
	cmpl	%edx, %ebx
	je	.L5
	movl	%r9d, %esi
	leal	1(%rdx), %eax
	subl	%edx, %esi
	cltq
	leaq	2(%rsi,%rdx), %r14
.L11:
	movzbl	0(%r13,%rax), %esi
	movslq	%eax, %rdx
	cmpb	$97, %sil
	je	.L2
	cmpb	$99, %sil
	je	.L7
	addq	$1, %rax
	cmpq	%rax, %r14
	jne	.L11
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L37:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L36:
	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(){
  char s[3][101];
  scanf("%s%*c%s%*c%s",s[0],s[1],s[2]);
  int salen,sblen,sclen;
  salen=strlen(s[0]);
  sblen=strlen(s[1]);
  sclen=strlen(s[2]);
  int anum=0,bnum=0,cnum=0,num=0;
  while(1){
    if(num==0){
      if(anum==salen){
        puts("A");
        return 0;
      }
      if(s[num][anum]=='b')
        num=1;
      else if(s[num][anum]=='c')
        num=2;
      anum++;
    }
    else if(num==1){
      if(bnum==sblen){
        puts("B");
        return 0;
      }
      if(s[num][bnum]=='a')
        num=0;
      else if(s[num][bnum]=='c')
        num=2;
      bnum++;
    }
    else{
      if(cnum==sclen){
        puts("C");
        return 0;
      }
      if(s[num][cnum]=='a')
        num=0;
      else if(s[num][cnum]=='b')
        num=1;
      cnum++;
    }
  }
  return 0;
}
abcb
aabb
bccc
 caa
accc
ca
 aaca
aabb
cccc
 abcb
bbaa
bccc
 aacb
bbaa
bccc
 aacb
bbaa
cccb
 aaca
bbaa
cccb
 aaca
aabb
cccb
 acaa
aabb
cccc
 acaa
abab
cccc

B
 A
 C
 B
 A
 A
 A
 A
 C
 C

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[3][101];
  scanf("%s%*c%s%*c%s",s[0],s[1],s[2]);
  int salen,sblen,sclen;
  salen=strlen(s[0]);
  sblen=strlen(s[1]);
  sclen=strlen(s[2]);
  int anum=0,bnum=0,cnum=0,num=0;
  while(1){
    if(num==0){
      if(anum==salen){
        puts("A");
        return 0;
      }
      if(s[num][anum]=='b')
        num=1;
      else if(s[num][anum]=='c')
        num=2;
      anum++;
    }
    else if(num==1){
      if(bnum==sblen){
        puts("B");
        return 0;
      }
      if(s[num][bnum]=='a')
        num=0;
      else if(s[num][bnum]=='c')
        num=2;
      bnum++;
    }
    else{
      if(cnum==sclen){
        puts("C");
        return 0;
      }
      if(s[num][cnum]=='a')
        num=0;
      else if(s[num][cnum]=='b')
        num=1;
      cnum++;
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%*c%s%*c%s"
.LC1:
	.string	"A"
.LC2:
	.string	"B"
.LC3:
	.string	"C"
	.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	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-320(%rbp), %rax
	leaq	202(%rax), %rcx
	leaq	-320(%rbp), %rax
	leaq	101(%rax), %rdx
	leaq	-320(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-320(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -332(%rbp)
	leaq	-320(%rbp), %rax
	addq	$101, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -328(%rbp)
	leaq	-320(%rbp), %rax
	addq	$202, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -324(%rbp)
	movl	$0, -348(%rbp)
	movl	$0, -344(%rbp)
	movl	$0, -340(%rbp)
	movl	$0, -336(%rbp)
.L15:
	cmpl	$0, -336(%rbp)
	jne	.L2
	movl	-348(%rbp), %eax
	cmpl	-332(%rbp), %eax
	jne	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L3:
	movl	-348(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$98, %al
	jne	.L5
	movl	$1, -336(%rbp)
	jmp	.L6
.L5:
	movl	-348(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L6
	movl	$2, -336(%rbp)
.L6:
	addl	$1, -348(%rbp)
	jmp	.L15
.L2:
	cmpl	$1, -336(%rbp)
	jne	.L8
	movl	-344(%rbp), %eax
	cmpl	-328(%rbp), %eax
	jne	.L9
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L9:
	movl	-344(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$97, %al
	jne	.L10
	movl	$0, -336(%rbp)
	jmp	.L11
.L10:
	movl	-344(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L11
	movl	$2, -336(%rbp)
.L11:
	addl	$1, -344(%rbp)
	jmp	.L15
.L8:
	movl	-340(%rbp), %eax
	cmpl	-324(%rbp), %eax
	jne	.L12
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L12:
	movl	-340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$97, %al
	jne	.L13
	movl	$0, -336(%rbp)
	jmp	.L14
.L13:
	movl	-340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$98, %al
	jne	.L14
	movl	$1, -336(%rbp)
.L14:
	addl	$1, -340(%rbp)
	jmp	.L15
.L16:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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%*c%s%*c%s"
.LC1:
	.string	"A"
.LC2:
	.string	"B"
.LC3:
	.string	"C"
	.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	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-320(%rbp), %rax
	leaq	202(%rax), %rcx
	leaq	-320(%rbp), %rax
	leaq	101(%rax), %rdx
	leaq	-320(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-320(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -332(%rbp)
	leaq	-320(%rbp), %rax
	addq	$101, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -328(%rbp)
	leaq	-320(%rbp), %rax
	addq	$202, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -324(%rbp)
	movl	$0, -348(%rbp)
	movl	$0, -344(%rbp)
	movl	$0, -340(%rbp)
	movl	$0, -336(%rbp)
.L15:
	cmpl	$0, -336(%rbp)
	jne	.L2
	movl	-348(%rbp), %eax
	cmpl	-332(%rbp), %eax
	jne	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L3:
	movl	-348(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$98, %al
	jne	.L5
	movl	$1, -336(%rbp)
	jmp	.L6
.L5:
	movl	-348(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L6
	movl	$2, -336(%rbp)
.L6:
	addl	$1, -348(%rbp)
	jmp	.L15
.L2:
	cmpl	$1, -336(%rbp)
	jne	.L8
	movl	-344(%rbp), %eax
	cmpl	-328(%rbp), %eax
	jne	.L9
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L9:
	movl	-344(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$97, %al
	jne	.L10
	movl	$0, -336(%rbp)
	jmp	.L11
.L10:
	movl	-344(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L11
	movl	$2, -336(%rbp)
.L11:
	addl	$1, -344(%rbp)
	jmp	.L15
.L8:
	movl	-340(%rbp), %eax
	cmpl	-324(%rbp), %eax
	jne	.L12
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L12:
	movl	-340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$97, %al
	jne	.L13
	movl	$0, -336(%rbp)
	jmp	.L14
.L13:
	movl	-340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-336(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$320, %rax
	movzbl	(%rax), %eax
	cmpb	$98, %al
	jne	.L14
	movl	$1, -336(%rbp)
.L14:
	addl	$1, -340(%rbp)
	jmp	.L15
.L16:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
