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 <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;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.globl	play
	.type	play, @function
play:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movb	$97, -13(%rbp)
	jmp	.L2
.L8:
	movsbl	-13(%rbp), %eax
	cmpl	$99, %eax
	je	.L3
	cmpl	$99, %eax
	jg	.L13
	cmpl	$97, %eax
	je	.L5
	cmpl	$98, %eax
	je	.L6
	jmp	.L4
.L5:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -12(%rbp)
	jmp	.L2
.L6:
	movq	-32(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -32(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -8(%rbp)
	jmp	.L2
.L3:
	movq	-40(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -40(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -4(%rbp)
	jmp	.L2
.L4:
.L13:
	nop
.L2:
	cmpl	$0, -12(%rbp)
	js	.L7
	cmpl	$0, -8(%rbp)
	js	.L7
	cmpl	$0, -4(%rbp)
	jns	.L8
.L7:
	cmpl	$-1, -12(%rbp)
	jne	.L9
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L9:
	cmpl	$-1, -8(%rbp)
	jne	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L11:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	play, .-play
	.section	.rodata
.LC3:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	play
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"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
	.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:

#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;
}
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 <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;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.globl	play
	.type	play, @function
play:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movb	$97, -13(%rbp)
	jmp	.L2
.L8:
	movsbl	-13(%rbp), %eax
	cmpl	$99, %eax
	je	.L3
	cmpl	$99, %eax
	jg	.L13
	cmpl	$97, %eax
	je	.L5
	cmpl	$98, %eax
	je	.L6
	jmp	.L4
.L5:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -12(%rbp)
	jmp	.L2
.L6:
	movq	-32(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -32(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -8(%rbp)
	jmp	.L2
.L3:
	movq	-40(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -40(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -4(%rbp)
	jmp	.L2
.L4:
.L13:
	nop
.L2:
	cmpl	$0, -12(%rbp)
	js	.L7
	cmpl	$0, -8(%rbp)
	js	.L7
	cmpl	$0, -4(%rbp)
	jns	.L8
.L7:
	cmpl	$-1, -12(%rbp)
	jne	.L9
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L9:
	cmpl	$-1, -8(%rbp)
	jne	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L11:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	play, .-play
	.section	.rodata
.LC3:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	play
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.text
	.globl	play
	.type	play, @function
play:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movb	$97, -13(%rbp)
	jmp	.L2
.L8:
	movsbl	-13(%rbp), %eax
	cmpl	$99, %eax
	je	.L3
	cmpl	$99, %eax
	jg	.L13
	cmpl	$97, %eax
	je	.L5
	cmpl	$98, %eax
	je	.L6
	jmp	.L4
.L5:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -12(%rbp)
	jmp	.L2
.L6:
	movq	-32(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -32(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -8(%rbp)
	jmp	.L2
.L3:
	movq	-40(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -40(%rbp)
	movzbl	(%rax), %eax
	movb	%al, -13(%rbp)
	subl	$1, -4(%rbp)
	jmp	.L2
.L4:
.L13:
	nop
.L2:
	cmpl	$0, -12(%rbp)
	js	.L7
	cmpl	$0, -8(%rbp)
	js	.L7
	cmpl	$0, -4(%rbp)
	jns	.L8
.L7:
	cmpl	$-1, -12(%rbp)
	jne	.L9
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L9:
	cmpl	$-1, -8(%rbp)
	jne	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L11:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	play, .-play
	.section	.rodata
.LC3:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$100, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	play
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
