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>
#include <stdlib.h>
#include <string.h>

void play(char *sa, char *sb, char *sc) {
  int lena, lenb, lenc;
  lena = strlen(sa);
  lenb = strlen(sb);
  lenc = strlen(sc);
  char next = 'a';  //最初はAさんのターンから
  while (lena >= 0 && lenb >= 0 &&
         lenc >= 0) {  //一枚も持っておらず自分のターンが来た人が勝つ
    // aさんから最初のカードをみる->減らす->次の人を変更する
    switch (next) {
      case 'a':
        next = *sa++;
        lena--;
        break;
      case 'b':
        next = *sb++;
        lenb--;
        break;
      case 'c':
        next = *sc++;
        lenc--;
        break;
      default:
        break;
    }
  }
  if (lena == -1)
    printf("A\n");
  else if (lenb == -1)
    printf("B\n");
  else
    printf("C\n");
}

int main(void) {
  char *sa, *sb, *sc;  // charでポインタの時はメモリを確保する
  sa = (char *)malloc(sizeof(char) * 100);
  sb = (char *)malloc(sizeof(char) * 100);
  sc = (char *)malloc(sizeof(char) * 100);
  scanf("%s", sa);
  scanf("%s", sb);
  scanf("%s", sc);
  play(sa, sb, sc);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.p2align 4
	.globl	play
	.type	play, @function
play:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	strlen@PLT
	movq	%r13, %rdi
	movl	%eax, %ebx
	call	strlen@PLT
	movq	%r12, %rdi
	movl	%eax, %ebp
	call	strlen@PLT
	movl	$97, %ecx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%ebx, %edx
	orl	%ebp, %edx
	js	.L4
.L14:
	testl	%eax, %eax
	js	.L5
.L9:
	cmpb	$98, %cl
	je	.L6
	cmpb	$99, %cl
	je	.L7
	cmpb	$97, %cl
	jne	.L9
	subl	$1, %ebx
	movzbl	(%r14), %ecx
	addq	$1, %r14
	movl	%ebx, %edx
	orl	%ebp, %edx
	jns	.L14
.L4:
	leaq	.LC0(%rip), %rdi
	cmpl	$-1, %ebx
	je	.L12
	leaq	.LC1(%rip), %rdi
	cmpl	$-1, %ebp
	je	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
.L12:
	popq	%rbx
	.cfi_remember_state
	.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
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movzbl	(%r12), %ecx
	subl	$1, %eax
	addq	$1, %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	0(%r13), %ecx
	subl	$1, %ebp
	addq	$1, %r13
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	play, .-play
	.section	.rodata.str1.1
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$100, %edi
	leaq	.LC3(%rip), %r14
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbp, %rsi
	movq	%r14, %rdi
	movq	%rax, %r13
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	play
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.cfi_endproc
.LFE52:
	.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	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.p2align 4
	.globl	play
	.type	play, @function
play:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	strlen@PLT
	movq	%r13, %rdi
	movl	%eax, %ebx
	call	strlen@PLT
	movq	%r12, %rdi
	movl	%eax, %ebp
	call	strlen@PLT
	movl	$97, %ecx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%ebx, %edx
	orl	%ebp, %edx
	js	.L4
.L14:
	testl	%eax, %eax
	js	.L5
.L9:
	cmpb	$98, %cl
	je	.L6
	cmpb	$99, %cl
	je	.L7
	cmpb	$97, %cl
	jne	.L9
	subl	$1, %ebx
	movzbl	(%r14), %ecx
	addq	$1, %r14
	movl	%ebx, %edx
	orl	%ebp, %edx
	jns	.L14
.L4:
	leaq	.LC0(%rip), %rdi
	cmpl	$-1, %ebx
	je	.L12
	leaq	.LC1(%rip), %rdi
	cmpl	$-1, %ebp
	je	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
.L12:
	popq	%rbx
	.cfi_remember_state
	.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
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movzbl	(%r12), %ecx
	subl	$1, %eax
	addq	$1, %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	0(%r13), %ecx
	subl	$1, %ebp
	addq	$1, %r13
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	play, .-play
	.section	.rodata.str1.1
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$100, %edi
	leaq	.LC3(%rip), %r14
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbp, %rsi
	movq	%r14, %rdi
	movq	%rax, %r13
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	play
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.cfi_endproc
.LFE52:
	.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	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.p2align 4
	.globl	play
	.type	play, @function
play:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	strlen@PLT
	movq	%r13, %rdi
	movl	%eax, %ebx
	call	strlen@PLT
	movq	%r12, %rdi
	movl	%eax, %ebp
	call	strlen@PLT
	movl	$97, %ecx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%ebx, %edx
	orl	%ebp, %edx
	js	.L4
.L14:
	testl	%eax, %eax
	js	.L5
.L9:
	cmpb	$98, %cl
	je	.L6
	cmpb	$99, %cl
	je	.L7
	cmpb	$97, %cl
	jne	.L9
	subl	$1, %ebx
	movzbl	(%r14), %ecx
	addq	$1, %r14
	movl	%ebx, %edx
	orl	%ebp, %edx
	jns	.L14
.L4:
	leaq	.LC0(%rip), %rdi
	cmpl	$-1, %ebx
	je	.L12
	leaq	.LC1(%rip), %rdi
	cmpl	$-1, %ebp
	je	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
.L12:
	popq	%rbx
	.cfi_remember_state
	.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
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movzbl	(%r12), %ecx
	subl	$1, %eax
	addq	$1, %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	0(%r13), %ecx
	subl	$1, %ebp
	addq	$1, %r13
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	play, .-play
	.section	.rodata.str1.1
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$100, %edi
	leaq	.LC3(%rip), %r14
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbp, %rsi
	movq	%r14, %rdi
	movq	%rax, %r13
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	play
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.cfi_endproc
.LFE52:
	.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>
#include <stdlib.h>
#include <string.h>

void play(char *sa, char *sb, char *sc) {
  int lena, lenb, lenc;
  lena = strlen(sa);
  lenb = strlen(sb);
  lenc = strlen(sc);
  char next = 'a';  //最初はAさんのターンから
  while (lena >= 0 && lenb >= 0 &&
         lenc >= 0) {  //一枚も持っておらず自分のターンが来た人が勝つ
    // aさんから最初のカードをみる->減らす->次の人を変更する
    switch (next) {
      case 'a':
        next = *sa++;
        lena--;
        break;
      case 'b':
        next = *sb++;
        lenb--;
        break;
      case 'c':
        next = *sc++;
        lenc--;
        break;
      default:
        break;
    }
  }
  if (lena == -1)
    printf("A\n");
  else if (lenb == -1)
    printf("B\n");
  else
    printf("C\n");
}

int main(void) {
  char *sa, *sb, *sc;  // charでポインタの時はメモリを確保する
  sa = (char *)malloc(sizeof(char) * 100);
  sb = (char *)malloc(sizeof(char) * 100);
  sc = (char *)malloc(sizeof(char) * 100);
  scanf("%s", sa);
  scanf("%s", sb);
  scanf("%s", sc);
  play(sa, sb, sc);
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void play(char *sa, char *sb, char *sc) {
  int lena, lenb, lenc;
  lena = strlen(sa);
  lenb = strlen(sb);
  lenc = strlen(sc);
  char next = 'a';  //最初はAさんのターンから
  while (lena >= 0 && lenb >= 0 &&
         lenc >= 0) {  //一枚も持っておらず自分のターンが来た人が勝つ
    // aさんから最初のカードをみる->減らす->次の人を変更する
    switch (next) {
      case 'a':
        next = *sa++;
        lena--;
        break;
      case 'b':
        next = *sb++;
        lenb--;
        break;
      case 'c':
        next = *sc++;
        lenc--;
        break;
      default:
        break;
    }
  }
  if (lena == -1)
    printf("A\n");
  else if (lenb == -1)
    printf("B\n");
  else
    printf("C\n");
}

int main(void) {
  char *sa, *sb, *sc;  // charでポインタの時はメモリを確保する
  sa = (char *)malloc(sizeof(char) * 100);
  sb = (char *)malloc(sizeof(char) * 100);
  sc = (char *)malloc(sizeof(char) * 100);
  scanf("%s", sa);
  scanf("%s", sb);
  scanf("%s", sc);
  play(sa, sb, sc);
  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:

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void play(char *sa, char *sb, char *sc) {
  int lena, lenb, lenc;
  lena = strlen(sa);
  lenb = strlen(sb);
  lenc = strlen(sc);
  char next = 'a';  //最初はAさんのターンから
  while (lena >= 0 && lenb >= 0 &&
         lenc >= 0) {  //一枚も持っておらず自分のターンが来た人が勝つ
    // aさんから最初のカードをみる->減らす->次の人を変更する
    switch (next) {
      case 'a':
        next = *sa++;
        lena--;
        break;
      case 'b':
        next = *sb++;
        lenb--;
        break;
      case 'c':
        next = *sc++;
        lenc--;
        break;
      default:
        break;
    }
  }
  if (lena == -1)
    printf("A\n");
  else if (lenb == -1)
    printf("B\n");
  else
    printf("C\n");
}

int main(void) {
  char *sa, *sb, *sc;  // charでポインタの時はメモリを確保する
  sa = (char *)malloc(sizeof(char) * 100);
  sb = (char *)malloc(sizeof(char) * 100);
  sc = (char *)malloc(sizeof(char) * 100);
  scanf("%s", sa);
  scanf("%s", sb);
  scanf("%s", sc);
  play(sa, sb, sc);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.p2align 4
	.globl	play
	.type	play, @function
play:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	strlen@PLT
	movq	%r13, %rdi
	movl	%eax, %ebx
	call	strlen@PLT
	movq	%r12, %rdi
	movl	%eax, %ebp
	call	strlen@PLT
	movl	$97, %ecx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%ebx, %edx
	orl	%ebp, %edx
	js	.L4
.L14:
	testl	%eax, %eax
	js	.L5
.L9:
	cmpb	$98, %cl
	je	.L6
	cmpb	$99, %cl
	je	.L7
	cmpb	$97, %cl
	jne	.L9
	subl	$1, %ebx
	movzbl	(%r14), %ecx
	addq	$1, %r14
	movl	%ebx, %edx
	orl	%ebp, %edx
	jns	.L14
.L4:
	leaq	.LC0(%rip), %rdi
	cmpl	$-1, %ebx
	je	.L12
	leaq	.LC1(%rip), %rdi
	cmpl	$-1, %ebp
	je	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
.L12:
	popq	%rbx
	.cfi_remember_state
	.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
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movzbl	(%r12), %ecx
	subl	$1, %eax
	addq	$1, %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	0(%r13), %ecx
	subl	$1, %ebp
	addq	$1, %r13
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	play, .-play
	.section	.rodata.str1.1
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$100, %edi
	leaq	.LC3(%rip), %r14
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbp, %rsi
	movq	%r14, %rdi
	movq	%rax, %r13
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	play
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.cfi_endproc
.LFE52:
	.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	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.p2align 4
	.globl	play
	.type	play, @function
play:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	strlen@PLT
	movq	%r13, %rdi
	movl	%eax, %ebx
	call	strlen@PLT
	movq	%r12, %rdi
	movl	%eax, %ebp
	call	strlen@PLT
	movl	$97, %ecx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%ebx, %edx
	orl	%ebp, %edx
	js	.L4
.L14:
	testl	%eax, %eax
	js	.L5
.L9:
	cmpb	$98, %cl
	je	.L6
	cmpb	$99, %cl
	je	.L7
	cmpb	$97, %cl
	jne	.L9
	subl	$1, %ebx
	movzbl	(%r14), %ecx
	addq	$1, %r14
	movl	%ebx, %edx
	orl	%ebp, %edx
	jns	.L14
.L4:
	leaq	.LC0(%rip), %rdi
	cmpl	$-1, %ebx
	je	.L12
	leaq	.LC1(%rip), %rdi
	cmpl	$-1, %ebp
	je	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
.L12:
	popq	%rbx
	.cfi_remember_state
	.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
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movzbl	(%r12), %ecx
	subl	$1, %eax
	addq	$1, %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	0(%r13), %ecx
	subl	$1, %ebp
	addq	$1, %r13
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	play, .-play
	.section	.rodata.str1.1
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$100, %edi
	leaq	.LC3(%rip), %r14
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbp, %rsi
	movq	%r14, %rdi
	movq	%rax, %r13
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	play
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.cfi_endproc
.LFE52:
	.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:
```