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 A[100] = { 0 };
	char B[100] = { 0 };
	char C[100] = { 0 };
	int i;
	int count_a = 0;
	int count_b = 0;
	int count_c = 0;
	int turn = 0;
	int n_a = 0;
	int n_b = 0;
	int n_c = 0;

	scanf("%s\n%s\n%s", A, B, C);
	n_a = strlen(A);
	n_b = strlen(B);
	n_c = strlen(C);

	for (i = 0;i < 300;i++)
	{
		if (turn == 0 && (n_a != count_a))
		{
			turn = A[count_a] - 'a';
			count_a = count_a + 1;
		}
		else if (turn == 0 && (n_a == count_a))
		{
			printf("A");
			break;
		}
		else if (turn == 1 && (n_b != count_b))
		{
			turn = B[count_b] - 'a';
			count_b = count_b + 1;
		}
		else if (turn == 1 && (n_b == count_b))
		{
			printf("B");
			break;
		}
		else if (turn == 2 && (n_c != count_c))
		{
			turn = C[count_c] - 'a';
			count_c = count_c + 1;
		}
		else if (turn == 2 && (n_c == count_c))
		{
			printf("C");
			break;
		}
	}

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s\n%s\n%s"
	.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	$368, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	$0, -320(%rbp)
	movq	$0, -312(%rbp)
	movq	$0, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	$0, -288(%rbp)
	movq	$0, -280(%rbp)
	movq	$0, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	$0, -256(%rbp)
	movq	$0, -248(%rbp)
	movl	$0, -240(%rbp)
	movq	$0, -224(%rbp)
	movq	$0, -216(%rbp)
	movq	$0, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	$0, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -128(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -88(%rbp)
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -364(%rbp)
	movl	$0, -360(%rbp)
	movl	$0, -356(%rbp)
	movl	$0, -352(%rbp)
	movl	$0, -348(%rbp)
	movl	$0, -344(%rbp)
	movl	$0, -340(%rbp)
	leaq	-112(%rbp), %rcx
	leaq	-224(%rbp), %rdx
	leaq	-336(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-336(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -348(%rbp)
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -344(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -340(%rbp)
	movl	$0, -368(%rbp)
	jmp	.L2
.L10:
	cmpl	$0, -352(%rbp)
	jne	.L3
	movl	-348(%rbp), %eax
	cmpl	-364(%rbp), %eax
	je	.L3
	movl	-364(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -364(%rbp)
	jmp	.L4
.L3:
	cmpl	$0, -352(%rbp)
	jne	.L5
	movl	-348(%rbp), %eax
	cmpl	-364(%rbp), %eax
	jne	.L5
	movl	$65, %edi
	call	putchar@PLT
	jmp	.L6
.L5:
	cmpl	$1, -352(%rbp)
	jne	.L7
	movl	-344(%rbp), %eax
	cmpl	-360(%rbp), %eax
	je	.L7
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -360(%rbp)
	jmp	.L4
.L7:
	cmpl	$1, -352(%rbp)
	jne	.L8
	movl	-344(%rbp), %eax
	cmpl	-360(%rbp), %eax
	jne	.L8
	movl	$66, %edi
	call	putchar@PLT
	jmp	.L6
.L8:
	cmpl	$2, -352(%rbp)
	jne	.L9
	movl	-340(%rbp), %eax
	cmpl	-356(%rbp), %eax
	je	.L9
	movl	-356(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -356(%rbp)
	jmp	.L4
.L9:
	cmpl	$2, -352(%rbp)
	jne	.L4
	movl	-340(%rbp), %eax
	cmpl	-356(%rbp), %eax
	jne	.L4
	movl	$67, %edi
	call	putchar@PLT
	jmp	.L6
.L4:
	addl	$1, -368(%rbp)
.L2:
	cmpl	$299, -368(%rbp)
	jle	.L10
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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\n%s\n%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pxor	%xmm0, %xmm0
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$344, %rsp
	.cfi_def_cfa_offset 384
	movq	%fs:40, %rax
	movq	%rax, 328(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rbp
	movq	%rsp, %r13
	movaps	%xmm0, (%rsp)
	leaq	224(%rsp), %r12
	movq	%rbp, %rdx
	movq	%r13, %rsi
	movaps	%xmm0, 16(%rsp)
	movq	%r12, %rcx
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 112(%rsp)
	movaps	%xmm0, 128(%rsp)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm0, 160(%rsp)
	movaps	%xmm0, 176(%rsp)
	movaps	%xmm0, 192(%rsp)
	movaps	%xmm0, 224(%rsp)
	movaps	%xmm0, 240(%rsp)
	movaps	%xmm0, 256(%rsp)
	movaps	%xmm0, 272(%rsp)
	movaps	%xmm0, 288(%rsp)
	movaps	%xmm0, 304(%rsp)
	movl	$0, 96(%rsp)
	movl	$0, 208(%rsp)
	movl	$0, 320(%rsp)
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movl	%eax, %ebx
	call	strlen@PLT
	movq	%r12, %rdi
	movl	%eax, %ebp
	call	strlen@PLT
	movl	$300, %edx
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	movl	%eax, %r9d
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L53:
	movslq	%ecx, %rax
	addl	$1, %ecx
	movsbl	(%rsp,%rax), %eax
	subl	$97, %eax
.L3:
	subl	$1, %edx
	je	.L5
.L9:
	testl	%eax, %eax
	sete	%sil
	cmpl	%ecx, %ebx
	je	.L48
	testb	%sil, %sil
	jne	.L53
	cmpl	%ecx, %ebx
	je	.L48
.L4:
	cmpl	$1, %eax
	sete	%sil
	cmpl	%edi, %ebp
	je	.L49
	testb	%sil, %sil
	je	.L6
	movslq	%edi, %rax
	addl	$1, %edi
	movsbl	112(%rsp,%rax), %eax
	subl	$97, %eax
	subl	$1, %edx
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movq	328(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	addq	$344, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	testb	%sil, %sil
	je	.L4
	movl	$65, %edi
	call	putchar@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%edi, %ebp
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L49:
	testb	%sil, %sil
	jne	.L55
.L7:
	cmpl	$2, %eax
	sete	%sil
	cmpl	%r8d, %r9d
	je	.L50
	testb	%sil, %sil
	je	.L8
	movslq	%r8d, %rax
	addl	$1, %r8d
	movsbl	224(%rsp,%rax), %eax
	subl	$97, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%r8d, %r9d
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L50:
	testb	%sil, %sil
	je	.L3
	movl	$67, %edi
	call	putchar@PLT
	jmp	.L5
.L55:
	movl	$66, %edi
	call	putchar@PLT
	jmp	.L5
.L54:
	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\n%s\n%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pxor	%xmm0, %xmm0
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$344, %rsp
	.cfi_def_cfa_offset 384
	movq	%fs:40, %rax
	movq	%rax, 328(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rbp
	movq	%rsp, %r13
	movaps	%xmm0, (%rsp)
	leaq	224(%rsp), %r12
	movq	%rbp, %rdx
	movq	%r13, %rsi
	movaps	%xmm0, 16(%rsp)
	movq	%r12, %rcx
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 112(%rsp)
	movaps	%xmm0, 128(%rsp)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm0, 160(%rsp)
	movaps	%xmm0, 176(%rsp)
	movaps	%xmm0, 192(%rsp)
	movaps	%xmm0, 224(%rsp)
	movaps	%xmm0, 240(%rsp)
	movaps	%xmm0, 256(%rsp)
	movaps	%xmm0, 272(%rsp)
	movaps	%xmm0, 288(%rsp)
	movaps	%xmm0, 304(%rsp)
	movl	$0, 96(%rsp)
	movl	$0, 208(%rsp)
	movl	$0, 320(%rsp)
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movl	%eax, %ebx
	call	strlen@PLT
	movq	%r12, %rdi
	movl	%eax, %ebp
	call	strlen@PLT
	movl	$300, %edx
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	movl	%eax, %r9d
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L53:
	movslq	%ecx, %rax
	addl	$1, %ecx
	movsbl	(%rsp,%rax), %eax
	subl	$97, %eax
.L3:
	subl	$1, %edx
	je	.L5
.L9:
	testl	%eax, %eax
	sete	%sil
	cmpl	%ecx, %ebx
	je	.L48
	testb	%sil, %sil
	jne	.L53
	cmpl	%ecx, %ebx
	je	.L48
.L4:
	cmpl	$1, %eax
	sete	%sil
	cmpl	%edi, %ebp
	je	.L49
	testb	%sil, %sil
	je	.L6
	movslq	%edi, %rax
	addl	$1, %edi
	movsbl	112(%rsp,%rax), %eax
	subl	$97, %eax
	subl	$1, %edx
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movq	328(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	addq	$344, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	testb	%sil, %sil
	je	.L4
	movl	$65, %edi
	call	putchar@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%edi, %ebp
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L49:
	testb	%sil, %sil
	jne	.L55
.L7:
	cmpl	$2, %eax
	sete	%sil
	cmpl	%r8d, %r9d
	je	.L50
	testb	%sil, %sil
	je	.L8
	movslq	%r8d, %rax
	addl	$1, %r8d
	movsbl	224(%rsp,%rax), %eax
	subl	$97, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%r8d, %r9d
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L50:
	testb	%sil, %sil
	je	.L3
	movl	$67, %edi
	call	putchar@PLT
	jmp	.L5
.L55:
	movl	$66, %edi
	call	putchar@PLT
	jmp	.L5
.L54:
	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 A[100] = { 0 };
	char B[100] = { 0 };
	char C[100] = { 0 };
	int i;
	int count_a = 0;
	int count_b = 0;
	int count_c = 0;
	int turn = 0;
	int n_a = 0;
	int n_b = 0;
	int n_c = 0;

	scanf("%s\n%s\n%s", A, B, C);
	n_a = strlen(A);
	n_b = strlen(B);
	n_c = strlen(C);

	for (i = 0;i < 300;i++)
	{
		if (turn == 0 && (n_a != count_a))
		{
			turn = A[count_a] - 'a';
			count_a = count_a + 1;
		}
		else if (turn == 0 && (n_a == count_a))
		{
			printf("A");
			break;
		}
		else if (turn == 1 && (n_b != count_b))
		{
			turn = B[count_b] - 'a';
			count_b = count_b + 1;
		}
		else if (turn == 1 && (n_b == count_b))
		{
			printf("B");
			break;
		}
		else if (turn == 2 && (n_c != count_c))
		{
			turn = C[count_c] - 'a';
			count_c = count_c + 1;
		}
		else if (turn == 2 && (n_c == count_c))
		{
			printf("C");
			break;
		}
	}

}
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(void)
{
	char A[100] = { 0 };
	char B[100] = { 0 };
	char C[100] = { 0 };
	int i;
	int count_a = 0;
	int count_b = 0;
	int count_c = 0;
	int turn = 0;
	int n_a = 0;
	int n_b = 0;
	int n_c = 0;

	scanf("%s\n%s\n%s", A, B, C);
	n_a = strlen(A);
	n_b = strlen(B);
	n_c = strlen(C);

	for (i = 0;i < 300;i++)
	{
		if (turn == 0 && (n_a != count_a))
		{
			turn = A[count_a] - 'a';
			count_a = count_a + 1;
		}
		else if (turn == 0 && (n_a == count_a))
		{
			printf("A");
			break;
		}
		else if (turn == 1 && (n_b != count_b))
		{
			turn = B[count_b] - 'a';
			count_b = count_b + 1;
		}
		else if (turn == 1 && (n_b == count_b))
		{
			printf("B");
			break;
		}
		else if (turn == 2 && (n_c != count_c))
		{
			turn = C[count_c] - 'a';
			count_c = count_c + 1;
		}
		else if (turn == 2 && (n_c == count_c))
		{
			printf("C");
			break;
		}
	}

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s\n%s\n%s"
	.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	$368, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	$0, -320(%rbp)
	movq	$0, -312(%rbp)
	movq	$0, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	$0, -288(%rbp)
	movq	$0, -280(%rbp)
	movq	$0, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	$0, -256(%rbp)
	movq	$0, -248(%rbp)
	movl	$0, -240(%rbp)
	movq	$0, -224(%rbp)
	movq	$0, -216(%rbp)
	movq	$0, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	$0, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -128(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -88(%rbp)
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -364(%rbp)
	movl	$0, -360(%rbp)
	movl	$0, -356(%rbp)
	movl	$0, -352(%rbp)
	movl	$0, -348(%rbp)
	movl	$0, -344(%rbp)
	movl	$0, -340(%rbp)
	leaq	-112(%rbp), %rcx
	leaq	-224(%rbp), %rdx
	leaq	-336(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-336(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -348(%rbp)
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -344(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -340(%rbp)
	movl	$0, -368(%rbp)
	jmp	.L2
.L10:
	cmpl	$0, -352(%rbp)
	jne	.L3
	movl	-348(%rbp), %eax
	cmpl	-364(%rbp), %eax
	je	.L3
	movl	-364(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -364(%rbp)
	jmp	.L4
.L3:
	cmpl	$0, -352(%rbp)
	jne	.L5
	movl	-348(%rbp), %eax
	cmpl	-364(%rbp), %eax
	jne	.L5
	movl	$65, %edi
	call	putchar@PLT
	jmp	.L6
.L5:
	cmpl	$1, -352(%rbp)
	jne	.L7
	movl	-344(%rbp), %eax
	cmpl	-360(%rbp), %eax
	je	.L7
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -360(%rbp)
	jmp	.L4
.L7:
	cmpl	$1, -352(%rbp)
	jne	.L8
	movl	-344(%rbp), %eax
	cmpl	-360(%rbp), %eax
	jne	.L8
	movl	$66, %edi
	call	putchar@PLT
	jmp	.L6
.L8:
	cmpl	$2, -352(%rbp)
	jne	.L9
	movl	-340(%rbp), %eax
	cmpl	-356(%rbp), %eax
	je	.L9
	movl	-356(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -356(%rbp)
	jmp	.L4
.L9:
	cmpl	$2, -352(%rbp)
	jne	.L4
	movl	-340(%rbp), %eax
	cmpl	-356(%rbp), %eax
	jne	.L4
	movl	$67, %edi
	call	putchar@PLT
	jmp	.L6
.L4:
	addl	$1, -368(%rbp)
.L2:
	cmpl	$299, -368(%rbp)
	jle	.L10
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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\n%s\n%s"
	.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	$368, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	$0, -320(%rbp)
	movq	$0, -312(%rbp)
	movq	$0, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	$0, -288(%rbp)
	movq	$0, -280(%rbp)
	movq	$0, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	$0, -256(%rbp)
	movq	$0, -248(%rbp)
	movl	$0, -240(%rbp)
	movq	$0, -224(%rbp)
	movq	$0, -216(%rbp)
	movq	$0, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	$0, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -128(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -88(%rbp)
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -364(%rbp)
	movl	$0, -360(%rbp)
	movl	$0, -356(%rbp)
	movl	$0, -352(%rbp)
	movl	$0, -348(%rbp)
	movl	$0, -344(%rbp)
	movl	$0, -340(%rbp)
	leaq	-112(%rbp), %rcx
	leaq	-224(%rbp), %rdx
	leaq	-336(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-336(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -348(%rbp)
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -344(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -340(%rbp)
	movl	$0, -368(%rbp)
	jmp	.L2
.L10:
	cmpl	$0, -352(%rbp)
	jne	.L3
	movl	-348(%rbp), %eax
	cmpl	-364(%rbp), %eax
	je	.L3
	movl	-364(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -364(%rbp)
	jmp	.L4
.L3:
	cmpl	$0, -352(%rbp)
	jne	.L5
	movl	-348(%rbp), %eax
	cmpl	-364(%rbp), %eax
	jne	.L5
	movl	$65, %edi
	call	putchar@PLT
	jmp	.L6
.L5:
	cmpl	$1, -352(%rbp)
	jne	.L7
	movl	-344(%rbp), %eax
	cmpl	-360(%rbp), %eax
	je	.L7
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -360(%rbp)
	jmp	.L4
.L7:
	cmpl	$1, -352(%rbp)
	jne	.L8
	movl	-344(%rbp), %eax
	cmpl	-360(%rbp), %eax
	jne	.L8
	movl	$66, %edi
	call	putchar@PLT
	jmp	.L6
.L8:
	cmpl	$2, -352(%rbp)
	jne	.L9
	movl	-340(%rbp), %eax
	cmpl	-356(%rbp), %eax
	je	.L9
	movl	-356(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -352(%rbp)
	addl	$1, -356(%rbp)
	jmp	.L4
.L9:
	cmpl	$2, -352(%rbp)
	jne	.L4
	movl	-340(%rbp), %eax
	cmpl	-356(%rbp), %eax
	jne	.L4
	movl	$67, %edi
	call	putchar@PLT
	jmp	.L6
.L4:
	addl	$1, -368(%rbp)
.L2:
	cmpl	$299, -368(%rbp)
	jle	.L10
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
