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){
	int n;
	int flg;
	int len,left,right;
	char s[1004];

	scanf("%d",&n);

	while(n--){
		scanf("%s",s);

		for(flg = 1; strlen(s) != 1; flg = !flg){
			len = strlen(s);
			right = s[len-1] - '0';
			left = s[len-2] - '0';

			s[len-2] = 0;

			sprintf(s, "%s%d", s, left+right);
		}

		printf("%s wins.\n", flg ? "Audrey" : "Fabre");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%d"
.LC3:
	.string	"Audrey"
.LC4:
	.string	"Fabre"
.LC5:
	.string	"%s wins.\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	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L7:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -1040(%rbp)
	jmp	.L3
.L4:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1036(%rbp)
	movl	-1036(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1032(%rbp)
	movl	-1036(%rbp), %eax
	subl	$2, %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1028(%rbp)
	movl	-1036(%rbp), %eax
	subl	$2, %eax
	cltq
	movb	$0, -1024(%rbp,%rax)
	movl	-1028(%rbp), %edx
	movl	-1032(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	leaq	-1024(%rbp), %rdx
	leaq	-1024(%rbp), %rax
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	cmpl	$0, -1040(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	%eax, -1040(%rbp)
.L3:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	$1, %rax
	jne	.L4
	cmpl	$0, -1040(%rbp)
	je	.L5
	leaq	.LC3(%rip), %rax
	jmp	.L6
.L5:
	leaq	.LC4(%rip), %rax
.L6:
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	movl	-1044(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -1044(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"%s%d"
.LC3:
	.string	"Audrey"
.LC4:
	.string	"%s wins.\n"
.LC5:
	.string	"Fabre"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	$1048, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	16(%rsp), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC4(%rip), %r12
	leaq	.LC2(%rip), %rbp
	leaq	.LC5(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	movl	$1, %ebx
	call	__isoc99_scanf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	leal	-1(%rax), %edx
	subl	$2, %eax
	movq	%r14, %r8
	movl	$1, %esi
	cltq
	movslq	%edx, %rdx
	movq	%r14, %rdi
	xorl	$1, %ebx
	movsbl	16(%rsp,%rdx), %ecx
	movsbl	16(%rsp,%rax), %edx
	movb	$0, 16(%rsp,%rax)
	xorl	%eax, %eax
	leal	-96(%rcx,%rdx), %r9d
	movq	%rbp, %rcx
	movl	$1004, %edx
	call	__sprintf_chk@PLT
.L3:
	movq	%r14, %rdi
	call	strlen@PLT
	cmpq	$1, %rax
	jne	.L4
	leaq	.LC3(%rip), %rdx
	testl	%ebx, %ebx
	jne	.L16
	movq	%r15, %rdx
.L16:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L7
.L2:
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$1048, %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
.L18:
	.cfi_restore_state
	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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%d"
.LC3:
	.string	"Audrey"
.LC4:
	.string	"%s wins.\n"
.LC5:
	.string	"Fabre"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	$1048, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	16(%rsp), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC4(%rip), %r12
	leaq	.LC2(%rip), %rbp
	leaq	.LC5(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	movl	$1, %ebx
	call	__isoc99_scanf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	leal	-1(%rax), %edx
	subl	$2, %eax
	movq	%r14, %r8
	movl	$1, %esi
	cltq
	movslq	%edx, %rdx
	movq	%r14, %rdi
	xorl	$1, %ebx
	movsbl	16(%rsp,%rdx), %ecx
	movsbl	16(%rsp,%rax), %edx
	movb	$0, 16(%rsp,%rax)
	xorl	%eax, %eax
	leal	-96(%rcx,%rdx), %r9d
	movq	%rbp, %rcx
	movl	$1004, %edx
	call	__sprintf_chk@PLT
.L3:
	movq	%r14, %rdi
	call	strlen@PLT
	cmpq	$1, %rax
	jne	.L4
	leaq	.LC3(%rip), %rdx
	testl	%ebx, %ebx
	jne	.L16
	movq	%r15, %rdx
.L16:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L7
.L2:
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$1048, %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
.L18:
	.cfi_restore_state
	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){
	int n;
	int flg;
	int len,left,right;
	char s[1004];

	scanf("%d",&n);

	while(n--){
		scanf("%s",s);

		for(flg = 1; strlen(s) != 1; flg = !flg){
			len = strlen(s);
			right = s[len-1] - '0';
			left = s[len-2] - '0';

			s[len-2] = 0;

			sprintf(s, "%s%d", s, left+right);
		}

		printf("%s wins.\n", flg ? "Audrey" : "Fabre");
	}

	return 0;
}
3
1234
8371
9
 3
1234
1292
9
 3
2133
1292
9
 3
1687
10
7
 3
1656
10
11
 3
3178
10
11
 3
1499
29
11
 3
49
2
14
 3
2133
261
9
 3
2133
261
7

Audrey wins.
Fabre wins.
Audrey wins.
 Audrey wins.
Audrey wins.
Audrey wins.
 Fabre wins.
Audrey wins.
Audrey wins.
 Fabre wins.
Fabre wins.
Audrey wins.
 Audrey wins.
Fabre wins.
Fabre wins.
 Fabre wins.
Fabre wins.
Fabre wins.
 Fabre wins.
Audrey wins.
Fabre wins.
 Audrey wins.
Audrey wins.
Fabre wins.
 Fabre wins.
Audrey wins.
Audrey wins.
 Fabre wins.
Audrey wins.
Audrey wins.

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){
	int n;
	int flg;
	int len,left,right;
	char s[1004];

	scanf("%d",&n);

	while(n--){
		scanf("%s",s);

		for(flg = 1; strlen(s) != 1; flg = !flg){
			len = strlen(s);
			right = s[len-1] - '0';
			left = s[len-2] - '0';

			s[len-2] = 0;

			sprintf(s, "%s%d", s, left+right);
		}

		printf("%s wins.\n", flg ? "Audrey" : "Fabre");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%d"
.LC3:
	.string	"Audrey"
.LC4:
	.string	"Fabre"
.LC5:
	.string	"%s wins.\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	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L7:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -1040(%rbp)
	jmp	.L3
.L4:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1036(%rbp)
	movl	-1036(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1032(%rbp)
	movl	-1036(%rbp), %eax
	subl	$2, %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1028(%rbp)
	movl	-1036(%rbp), %eax
	subl	$2, %eax
	cltq
	movb	$0, -1024(%rbp,%rax)
	movl	-1028(%rbp), %edx
	movl	-1032(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	leaq	-1024(%rbp), %rdx
	leaq	-1024(%rbp), %rax
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	cmpl	$0, -1040(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	%eax, -1040(%rbp)
.L3:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	$1, %rax
	jne	.L4
	cmpl	$0, -1040(%rbp)
	je	.L5
	leaq	.LC3(%rip), %rax
	jmp	.L6
.L5:
	leaq	.LC4(%rip), %rax
.L6:
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	movl	-1044(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -1044(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"%s%d"
.LC3:
	.string	"Audrey"
.LC4:
	.string	"Fabre"
.LC5:
	.string	"%s wins.\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	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L7:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -1040(%rbp)
	jmp	.L3
.L4:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1036(%rbp)
	movl	-1036(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1032(%rbp)
	movl	-1036(%rbp), %eax
	subl	$2, %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1028(%rbp)
	movl	-1036(%rbp), %eax
	subl	$2, %eax
	cltq
	movb	$0, -1024(%rbp,%rax)
	movl	-1028(%rbp), %edx
	movl	-1032(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	leaq	-1024(%rbp), %rdx
	leaq	-1024(%rbp), %rax
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	cmpl	$0, -1040(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	%eax, -1040(%rbp)
.L3:
	leaq	-1024(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	$1, %rax
	jne	.L4
	cmpl	$0, -1040(%rbp)
	je	.L5
	leaq	.LC3(%rip), %rax
	jmp	.L6
.L5:
	leaq	.LC4(%rip), %rax
.L6:
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	movl	-1044(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -1044(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
