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 <ctype.h>

int main(void) {
	int case_num,now_case;
	char cards[10][2];
	int i;
	int score,aces;
	scanf("%d",&case_num);
	for(now_case=0;now_case<case_num;now_case++) {
		for(i=0;i<10;i++)scanf("%s",cards[i]);
		score=aces=0;
		for(i=0;i<2;i++) {
			if(isdigit(cards[i][0])) {
				score+=cards[i][0]-'0';
			} else if(cards[i][0]=='A') {
				score+=11;
				aces++;
			} else {
				score+=10;
			}
			for(;aces>0 && score>21;aces--)score-=10;
		}
		if(score==21){puts("blackjack");continue;}
		for(i=2;i<10;i++) {
			if(score>17 || (score==17 && aces!=1))break;
			if(isdigit(cards[i][0])) {
				score+=cards[i][0]-'0';
			} else if(cards[i][0]=='A') {
				score+=11;
				aces++;
			} else {
				score+=10;
			}
			for(;aces>0 && score>21;aces--)score-=10;
		}
		if(score>21)puts("bust"); else printf("%d\n",score);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"blackjack"
.LC3:
	.string	"bust"
.LC4:
	.string	"%d\n"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L2
.L26:
	movl	$0, -44(%rbp)
	jmp	.L3
.L4:
	leaq	-32(%rbp), %rdx
	movl	-44(%rbp), %eax
	cltq
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L3:
	cmpl	$9, -44(%rbp)
	jle	.L4
	movl	$0, -36(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L5
.L12:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L6
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -40(%rbp)
	jmp	.L9
.L6:
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	cmpb	$65, %al
	jne	.L8
	addl	$11, -40(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L9
.L8:
	addl	$10, -40(%rbp)
	jmp	.L9
.L11:
	subl	$10, -40(%rbp)
	subl	$1, -36(%rbp)
.L9:
	cmpl	$0, -36(%rbp)
	jle	.L10
	cmpl	$21, -40(%rbp)
	jg	.L11
.L10:
	addl	$1, -44(%rbp)
.L5:
	cmpl	$1, -44(%rbp)
	jle	.L12
	cmpl	$21, -40(%rbp)
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
.L13:
	movl	$2, -44(%rbp)
	jmp	.L15
.L24:
	cmpl	$17, -40(%rbp)
	jg	.L16
	cmpl	$17, -40(%rbp)
	jne	.L17
	cmpl	$1, -36(%rbp)
	jne	.L16
.L17:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L18
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -40(%rbp)
	jmp	.L21
.L18:
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	cmpb	$65, %al
	jne	.L20
	addl	$11, -40(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L21
.L20:
	addl	$10, -40(%rbp)
	jmp	.L21
.L23:
	subl	$10, -40(%rbp)
	subl	$1, -36(%rbp)
.L21:
	cmpl	$0, -36(%rbp)
	jle	.L22
	cmpl	$21, -40(%rbp)
	jg	.L23
.L22:
	addl	$1, -44(%rbp)
.L15:
	cmpl	$9, -44(%rbp)
	jle	.L24
.L16:
	cmpl	$21, -40(%rbp)
	jle	.L25
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
.L25:
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	addl	$1, -48(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"blackjack"
.LC3:
	.string	"bust"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L25
	call	__ctype_b_loc@PLT
	xorl	%r13d, %r13d
	leaq	32(%rsp), %r15
	leaq	52(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	36(%rsp), %rax
	leaq	.LC1(%rip), %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r15, %r12
	movq	%r15, %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$2, %r14
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r14
	jne	.L3
	movq	8(%rsp), %rax
	xorl	%edx, %edx
	movq	(%rax), %rdi
	xorl	%eax, %eax
.L10:
	movsbq	(%r12), %rsi
	testb	$8, 1(%rdi,%rsi,2)
	je	.L4
	leal	-48(%rdx,%rsi), %edx
.L5:
	cmpl	$21, %edx
	jle	.L7
	testl	%eax, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	subl	$1, %eax
	subl	$10, %edx
	testl	%eax, %eax
	jle	.L7
	cmpl	$21, %edx
	jg	.L8
.L7:
	addq	$2, %r12
	cmpq	%r12, (%rsp)
	jne	.L10
	leaq	36(%rsp), %rsi
	cmpl	$21, %edx
	jne	.L23
	jmp	.L108
	.p2align 4,,10
	.p2align 3
.L109:
	leal	-48(%rdx,%r8), %ecx
	testl	%eax, %eax
	jle	.L38
	cmpl	$21, %ecx
	jle	.L38
	leal	-10(%rcx), %edx
	leal	-1(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-20(%rcx), %edx
	leal	-2(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-30(%rcx), %edx
	leal	-3(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-40(%rcx), %edx
	leal	-4(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-50(%rcx), %edx
	leal	-5(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-60(%rcx), %edx
	leal	-6(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-70(%rcx), %edx
	leal	-7(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-80(%rcx), %edx
	subl	$8, %eax
.L19:
	addq	$2, %rsi
	cmpq	%rsi, %rbx
	je	.L13
.L23:
	cmpl	$17, %edx
	jg	.L13
	jne	.L37
	cmpl	$1, %eax
	jne	.L29
.L37:
	movsbq	(%rsi), %r8
	testb	$8, 1(%rdi,%r8,2)
	jne	.L109
	cmpb	$65, %r8b
	je	.L110
	addl	$10, %edx
.L21:
	testl	%eax, %eax
	jle	.L19
	cmpl	$21, %edx
	jle	.L19
	addq	$2, %rsi
	subl	$10, %edx
	subl	$1, %eax
	cmpq	%rsi, %rbx
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	$21, %edx
	jle	.L14
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L12:
	addl	$1, %r13d
	cmpl	%r13d, 28(%rsp)
	jg	.L24
.L25:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L111
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	movl	%r8d, %eax
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$65, %sil
	je	.L112
	addl	$10, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L110:
	addl	$11, %edx
	addl	$1, %eax
	jmp	.L21
.L29:
	movl	$17, %edx
.L14:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L112:
	addl	$11, %edx
	addl	$1, %eax
	jmp	.L5
.L108:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L12
.L38:
	movl	%ecx, %edx
	jmp	.L19
.L111:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"blackjack"
.LC3:
	.string	"bust"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L25
	call	__ctype_b_loc@PLT
	xorl	%r13d, %r13d
	leaq	32(%rsp), %r15
	leaq	52(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	36(%rsp), %rax
	leaq	.LC1(%rip), %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r15, %r12
	movq	%r15, %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$2, %r14
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r14
	jne	.L3
	movq	8(%rsp), %rax
	xorl	%edx, %edx
	movq	(%rax), %rdi
	xorl	%eax, %eax
.L10:
	movsbq	(%r12), %rsi
	testb	$8, 1(%rdi,%rsi,2)
	je	.L4
	leal	-48(%rdx,%rsi), %edx
.L5:
	cmpl	$21, %edx
	jle	.L7
	testl	%eax, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	subl	$1, %eax
	subl	$10, %edx
	testl	%eax, %eax
	jle	.L7
	cmpl	$21, %edx
	jg	.L8
.L7:
	addq	$2, %r12
	cmpq	%r12, (%rsp)
	jne	.L10
	leaq	36(%rsp), %rsi
	cmpl	$21, %edx
	jne	.L23
	jmp	.L108
	.p2align 4,,10
	.p2align 3
.L109:
	leal	-48(%rdx,%r8), %ecx
	testl	%eax, %eax
	jle	.L38
	cmpl	$21, %ecx
	jle	.L38
	leal	-10(%rcx), %edx
	leal	-1(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-20(%rcx), %edx
	leal	-2(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-30(%rcx), %edx
	leal	-3(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-40(%rcx), %edx
	leal	-4(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-50(%rcx), %edx
	leal	-5(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-60(%rcx), %edx
	leal	-6(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-70(%rcx), %edx
	leal	-7(%rax), %r8d
	cmpl	$21, %edx
	jle	.L36
	testl	%r8d, %r8d
	jle	.L36
	leal	-80(%rcx), %edx
	subl	$8, %eax
.L19:
	addq	$2, %rsi
	cmpq	%rsi, %rbx
	je	.L13
.L23:
	cmpl	$17, %edx
	jg	.L13
	jne	.L37
	cmpl	$1, %eax
	jne	.L29
.L37:
	movsbq	(%rsi), %r8
	testb	$8, 1(%rdi,%r8,2)
	jne	.L109
	cmpb	$65, %r8b
	je	.L110
	addl	$10, %edx
.L21:
	testl	%eax, %eax
	jle	.L19
	cmpl	$21, %edx
	jle	.L19
	addq	$2, %rsi
	subl	$10, %edx
	subl	$1, %eax
	cmpq	%rsi, %rbx
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	$21, %edx
	jle	.L14
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L12:
	addl	$1, %r13d
	cmpl	%r13d, 28(%rsp)
	jg	.L24
.L25:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L111
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	movl	%r8d, %eax
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$65, %sil
	je	.L112
	addl	$10, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L110:
	addl	$11, %edx
	addl	$1, %eax
	jmp	.L21
.L29:
	movl	$17, %edx
.L14:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L112:
	addl	$11, %edx
	addl	$1, %eax
	jmp	.L5
.L108:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L12
.L38:
	movl	%ecx, %edx
	jmp	.L19
.L111:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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 <ctype.h>

int main(void) {
	int case_num,now_case;
	char cards[10][2];
	int i;
	int score,aces;
	scanf("%d",&case_num);
	for(now_case=0;now_case<case_num;now_case++) {
		for(i=0;i<10;i++)scanf("%s",cards[i]);
		score=aces=0;
		for(i=0;i<2;i++) {
			if(isdigit(cards[i][0])) {
				score+=cards[i][0]-'0';
			} else if(cards[i][0]=='A') {
				score+=11;
				aces++;
			} else {
				score+=10;
			}
			for(;aces>0 && score>21;aces--)score-=10;
		}
		if(score==21){puts("blackjack");continue;}
		for(i=2;i<10;i++) {
			if(score>17 || (score==17 && aces!=1))break;
			if(isdigit(cards[i][0])) {
				score+=cards[i][0]-'0';
			} else if(cards[i][0]=='A') {
				score+=11;
				aces++;
			} else {
				score+=10;
			}
			for(;aces>0 && score>21;aces--)score-=10;
		}
		if(score>21)puts("bust"); else printf("%d\n",score);
	}
	return 0;
}
4
5 4
9 2 8 3 9 4 6 5
A J
K Q J T 9 8 7 6
T 4
7 J A 6 Q T K 7
2 2
2 3 4 K 2 3 4 K
 4
5 4
9 2 3 3 9 4 9 5
A J
K Q J T 9 8 8 6
T 7
7 J A 6 Q T K 7
2 2
2 3 4 K 2 3 4 K
 4
5 4
9 2 8 3 7 4 6 5
A J
K Q J T 9 8 7 6
T 5
7 J A 6 Q T K 7
2 2
2 3 4 K 2 3 4 K
 4
5 4
9 2 8 3 7 4 6 5
A J
K Q J T 9 8 7 6
T 9
7 J A 6 Q T K 7
2 2
2 3 4 K 2 3 4 K
 4
5 4
9 2 8 3 7 4 6 5
A J
K Q J T 9 7 7 6
T 8
7 J A 6 Q T K 7
2 3
2 3 4 K 2 3 4 K
 4
0 4
9 2 8 3 7 8 6 2
A J
K Q J T 9 7 7 6
T 4
7 J A 6 Q T K 5
2 2
2 2 4 J 3 3 4 K
 4
5 5
9 2 3 3 9 4 9 5
A J
K Q K T 9 8 8 6
T 7
7 J A 6 Q T K 7
2 2
2 3 4 K 2 3 4 K
 4
9 4
9 2 6 3 7 4 6 5
A J
K Q J T 9 8 7 6
T 5
7 J A 6 Q T K 7
2 2
2 3 4 K 2 3 4 K
 4
5 8
9 2 8 4 7 4 6 6
A J
K Q J T 9 7 7 6
T 8
7 J A 6 Q T K 7
2 3
2 3 4 K 2 3 4 K
 4
7 4
9 2 8 1 8 5 6 5
A J
K Q J T 9 7 7 6
T 4
7 J A 6 Q T K 5
2 2
2 3 4 J 2 5 0 K

18
blackjack
21
bust
 18
blackjack
17
bust
 18
blackjack
bust
bust
 18
blackjack
19
bust
 18
blackjack
18
bust
 bust
blackjack
21
bust
 19
blackjack
17
bust
 bust
blackjack
bust
bust
 bust
blackjack
18
bust
 20
blackjack
21
bust

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 <ctype.h>

int main(void) {
	int case_num,now_case;
	char cards[10][2];
	int i;
	int score,aces;
	scanf("%d",&case_num);
	for(now_case=0;now_case<case_num;now_case++) {
		for(i=0;i<10;i++)scanf("%s",cards[i]);
		score=aces=0;
		for(i=0;i<2;i++) {
			if(isdigit(cards[i][0])) {
				score+=cards[i][0]-'0';
			} else if(cards[i][0]=='A') {
				score+=11;
				aces++;
			} else {
				score+=10;
			}
			for(;aces>0 && score>21;aces--)score-=10;
		}
		if(score==21){puts("blackjack");continue;}
		for(i=2;i<10;i++) {
			if(score>17 || (score==17 && aces!=1))break;
			if(isdigit(cards[i][0])) {
				score+=cards[i][0]-'0';
			} else if(cards[i][0]=='A') {
				score+=11;
				aces++;
			} else {
				score+=10;
			}
			for(;aces>0 && score>21;aces--)score-=10;
		}
		if(score>21)puts("bust"); else printf("%d\n",score);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"blackjack"
.LC3:
	.string	"bust"
.LC4:
	.string	"%d\n"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L2
.L26:
	movl	$0, -44(%rbp)
	jmp	.L3
.L4:
	leaq	-32(%rbp), %rdx
	movl	-44(%rbp), %eax
	cltq
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L3:
	cmpl	$9, -44(%rbp)
	jle	.L4
	movl	$0, -36(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L5
.L12:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L6
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -40(%rbp)
	jmp	.L9
.L6:
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	cmpb	$65, %al
	jne	.L8
	addl	$11, -40(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L9
.L8:
	addl	$10, -40(%rbp)
	jmp	.L9
.L11:
	subl	$10, -40(%rbp)
	subl	$1, -36(%rbp)
.L9:
	cmpl	$0, -36(%rbp)
	jle	.L10
	cmpl	$21, -40(%rbp)
	jg	.L11
.L10:
	addl	$1, -44(%rbp)
.L5:
	cmpl	$1, -44(%rbp)
	jle	.L12
	cmpl	$21, -40(%rbp)
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
.L13:
	movl	$2, -44(%rbp)
	jmp	.L15
.L24:
	cmpl	$17, -40(%rbp)
	jg	.L16
	cmpl	$17, -40(%rbp)
	jne	.L17
	cmpl	$1, -36(%rbp)
	jne	.L16
.L17:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L18
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -40(%rbp)
	jmp	.L21
.L18:
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	cmpb	$65, %al
	jne	.L20
	addl	$11, -40(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L21
.L20:
	addl	$10, -40(%rbp)
	jmp	.L21
.L23:
	subl	$10, -40(%rbp)
	subl	$1, -36(%rbp)
.L21:
	cmpl	$0, -36(%rbp)
	jle	.L22
	cmpl	$21, -40(%rbp)
	jg	.L23
.L22:
	addl	$1, -44(%rbp)
.L15:
	cmpl	$9, -44(%rbp)
	jle	.L24
.L16:
	cmpl	$21, -40(%rbp)
	jle	.L25
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
.L25:
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	addl	$1, -48(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"blackjack"
.LC3:
	.string	"bust"
.LC4:
	.string	"%d\n"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L2
.L26:
	movl	$0, -44(%rbp)
	jmp	.L3
.L4:
	leaq	-32(%rbp), %rdx
	movl	-44(%rbp), %eax
	cltq
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L3:
	cmpl	$9, -44(%rbp)
	jle	.L4
	movl	$0, -36(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L5
.L12:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L6
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -40(%rbp)
	jmp	.L9
.L6:
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	cmpb	$65, %al
	jne	.L8
	addl	$11, -40(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L9
.L8:
	addl	$10, -40(%rbp)
	jmp	.L9
.L11:
	subl	$10, -40(%rbp)
	subl	$1, -36(%rbp)
.L9:
	cmpl	$0, -36(%rbp)
	jle	.L10
	cmpl	$21, -40(%rbp)
	jg	.L11
.L10:
	addl	$1, -44(%rbp)
.L5:
	cmpl	$1, -44(%rbp)
	jle	.L12
	cmpl	$21, -40(%rbp)
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
.L13:
	movl	$2, -44(%rbp)
	jmp	.L15
.L24:
	cmpl	$17, -40(%rbp)
	jg	.L16
	cmpl	$17, -40(%rbp)
	jne	.L17
	cmpl	$1, -36(%rbp)
	jne	.L16
.L17:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L18
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -40(%rbp)
	jmp	.L21
.L18:
	movl	-44(%rbp), %eax
	cltq
	movzbl	-32(%rbp,%rax,2), %eax
	cmpb	$65, %al
	jne	.L20
	addl	$11, -40(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L21
.L20:
	addl	$10, -40(%rbp)
	jmp	.L21
.L23:
	subl	$10, -40(%rbp)
	subl	$1, -36(%rbp)
.L21:
	cmpl	$0, -36(%rbp)
	jle	.L22
	cmpl	$21, -40(%rbp)
	jg	.L23
.L22:
	addl	$1, -44(%rbp)
.L15:
	cmpl	$9, -44(%rbp)
	jle	.L24
.L16:
	cmpl	$21, -40(%rbp)
	jle	.L25
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
.L25:
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	addl	$1, -48(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	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:
