Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
#include<string.h>
//#include<time.h>
//#define pi acos(-1.0)
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
#define S(type,x) fscanf(stdin,"%"#type,&x)
int main() {
	int vote[26],n;
	char a,tmp;
	while (S(d, n), n) {
		getchar();
		int max, sec,i;
		max = sec = i = 0;
		tmp = 'A';
		memset(vote, 0, sizeof(vote));
		while (n--) {
			fscanf(stdin, "%c%*c", &a);
			if (max > sec + n+1)continue;
			i++;
			vote[a - 'A']++;
			if (vote[a - 'A'] >= max) {
				if(vote[tmp-'A']-1!=max) sec = max;
				max = vote[a - 'A'], tmp = a;
			}
			else if (vote[a - 'A'] > sec) sec = vote[a - 'A'];
		}
		if (max == sec) puts("TIE");
		else fprintf(stdout, "%c %d\n", tmp, i);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%c%*c"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"%d"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	28(%rsp), %r14
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	movq	%r14, %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L16
	movq	stdin(%rip), %rdi
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movl	$65, %ebx
	call	getc@PLT
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	28(%rsp), %edx
	movl	$13, %ecx
	rep stosq
	.p2align 4,,10
	.p2align 3
.L4:
	leal	-1(%rdx), %eax
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	je	.L17
.L7:
	movq	stdin(%rip), %rdi
	leaq	27(%rsp), %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %edx
	leal	1(%r15,%rdx), %eax
	cmpl	%r13d, %eax
	jl	.L4
	movsbl	27(%rsp), %eax
	addl	$1, %ebp
	movl	%eax, %edi
	subl	$65, %eax
	cltq
	movl	32(%rsp,%rax,4), %ecx
	leal	1(%rcx), %esi
	movl	%esi, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jl	.L5
	subl	$65, %ebx
	movslq	%ebx, %rbx
	movl	32(%rsp,%rbx,4), %eax
	subl	$1, %eax
	cmpl	%eax, %r13d
	je	.L12
	leal	-1(%rdx), %eax
	movl	%r13d, %r15d
	movsbl	%dil, %ebx
	movl	%esi, %r13d
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	%r15d, %r13d
	je	.L18
	movq	stdout(%rip), %rdi
	movsbl	%bl, %ecx
	movl	%ebp, %r8d
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdx
	movl	$1, %esi
	call	__fprintf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	%esi, %r15d
	cmovl	%esi, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %r13d
	movsbl	%dil, %ebx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$152, %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
.L19:
	.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:
```

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	"%c%*c"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"%d"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	28(%rsp), %r14
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	movq	%r14, %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L16
	movq	stdin(%rip), %rdi
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movl	$65, %ebx
	call	getc@PLT
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	28(%rsp), %edx
	movl	$13, %ecx
	rep stosq
	.p2align 4,,10
	.p2align 3
.L4:
	leal	-1(%rdx), %eax
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	je	.L17
.L7:
	movq	stdin(%rip), %rdi
	leaq	27(%rsp), %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %edx
	leal	1(%r15,%rdx), %eax
	cmpl	%r13d, %eax
	jl	.L4
	movsbl	27(%rsp), %eax
	addl	$1, %ebp
	movl	%eax, %edi
	subl	$65, %eax
	cltq
	movl	32(%rsp,%rax,4), %ecx
	leal	1(%rcx), %esi
	movl	%esi, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jl	.L5
	subl	$65, %ebx
	movslq	%ebx, %rbx
	movl	32(%rsp,%rbx,4), %eax
	subl	$1, %eax
	cmpl	%eax, %r13d
	je	.L12
	leal	-1(%rdx), %eax
	movl	%r13d, %r15d
	movsbl	%dil, %ebx
	movl	%esi, %r13d
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	%r15d, %r13d
	je	.L18
	movq	stdout(%rip), %rdi
	movsbl	%bl, %ecx
	movl	%ebp, %r8d
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdx
	movl	$1, %esi
	call	__fprintf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	%esi, %r15d
	cmovl	%esi, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %r13d
	movsbl	%dil, %ebx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$152, %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
.L19:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%c%*c"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"%d"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	28(%rsp), %r14
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	movq	%r14, %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L16
	movq	stdin(%rip), %rdi
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movl	$65, %ebx
	call	getc@PLT
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	28(%rsp), %edx
	movl	$13, %ecx
	rep stosq
	.p2align 4,,10
	.p2align 3
.L4:
	leal	-1(%rdx), %eax
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	je	.L17
.L7:
	movq	stdin(%rip), %rdi
	leaq	27(%rsp), %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %edx
	leal	1(%r15,%rdx), %eax
	cmpl	%r13d, %eax
	jl	.L4
	movsbl	27(%rsp), %eax
	addl	$1, %ebp
	movl	%eax, %edi
	subl	$65, %eax
	cltq
	movl	32(%rsp,%rax,4), %ecx
	leal	1(%rcx), %esi
	movl	%esi, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jl	.L5
	subl	$65, %ebx
	movslq	%ebx, %rbx
	movl	32(%rsp,%rbx,4), %eax
	subl	$1, %eax
	cmpl	%eax, %r13d
	je	.L12
	leal	-1(%rdx), %eax
	movl	%r13d, %r15d
	movsbl	%dil, %ebx
	movl	%esi, %r13d
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	%r15d, %r13d
	je	.L18
	movq	stdout(%rip), %rdi
	movsbl	%bl, %ecx
	movl	%ebp, %r8d
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdx
	movl	$1, %esi
	call	__fprintf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	%esi, %r15d
	cmovl	%esi, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %r13d
	movsbl	%dil, %ebx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$152, %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
.L19:
	.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:
```
```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
#include<string.h>
//#include<time.h>
//#define pi acos(-1.0)
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
#define S(type,x) fscanf(stdin,"%"#type,&x)
int main() {
	int vote[26],n;
	char a,tmp;
	while (S(d, n), n) {
		getchar();
		int max, sec,i;
		max = sec = i = 0;
		tmp = 'A';
		memset(vote, 0, sizeof(vote));
		while (n--) {
			fscanf(stdin, "%c%*c", &a);
			if (max > sec + n+1)continue;
			i++;
			vote[a - 'A']++;
			if (vote[a - 'A'] >= max) {
				if(vote[tmp-'A']-1!=max) sec = max;
				max = vote[a - 'A'], tmp = a;
			}
			else if (vote[a - 'A'] > sec) sec = vote[a - 'A'];
		}
		if (max == sec) puts("TIE");
		else fprintf(stdout, "%c %d\n", tmp, i);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
#include<string.h>
//#include<time.h>
//#define pi acos(-1.0)
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
#define S(type,x) fscanf(stdin,"%"#type,&x)
int main() {
	int vote[26],n;
	char a,tmp;
	while (S(d, n), n) {
		getchar();
		int max, sec,i;
		max = sec = i = 0;
		tmp = 'A';
		memset(vote, 0, sizeof(vote));
		while (n--) {
			fscanf(stdin, "%c%*c", &a);
			if (max > sec + n+1)continue;
			i++;
			vote[a - 'A']++;
			if (vote[a - 'A'] >= max) {
				if(vote[tmp-'A']-1!=max) sec = max;
				max = vote[a - 'A'], tmp = a;
			}
			else if (vote[a - 'A'] > sec) sec = vote[a - 'A'];
		}
		if (max == sec) puts("TIE");
		else fprintf(stdout, "%c %d\n", tmp, i);
	}
	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:

1
A
4
A A B B
5
L M N L N
6
K K K K K K
6
X X X Y Z X
10
A A A B A C A C C B
10
V U U U U V V W W W
0
 1
A
4
A A B B
5
L M N L N
6
K K K K K K
6
X X X Y Z X
10
A A A B A C A C C B
10
V U U U U V V W V W
0
 1
A
4
A A B B
5
L M N L N
6
K K K K K K
6
X X X Y Z X
10
B A A B A C A C C B
10
V U U U U V V W V W
0
 1
A
4
A A B B
5
L M N L N
6
K K K K K K
6
X X X Y Z X
10
B A A B A C A C C B
10
V U U U U W V W V W
0
 1
A
4
A A B B
5
L M N L N
6
K K K K K K
6
X X X Y Z X
10
B A A B A B A C C B
10
V U U U U W V W V W
0
 1
A
4
A A B B
5
L M N L N
6
K J K K K K
6
X X X Y Z X
10
A A A B A C A C C B
10
V U U U U V V W W W
0

A 1
TIE
TIE
K 4
X 5
A 7
U 10
 A 1
TIE
TIE
K 4
X 5
A 7
TIE
 A 1
TIE
TIE
K 4
X 5
A 10
TIE
 A 1
TIE
TIE
K 4
X 5
A 10
U 10
 A 1
TIE
TIE
K 4
X 5
TIE
U 10
 A 1
TIE
TIE
K 5
X 5
A 7
U 10

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
#include<string.h>
//#include<time.h>
//#define pi acos(-1.0)
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
#define S(type,x) fscanf(stdin,"%"#type,&x)
int main() {
	int vote[26],n;
	char a,tmp;
	while (S(d, n), n) {
		getchar();
		int max, sec,i;
		max = sec = i = 0;
		tmp = 'A';
		memset(vote, 0, sizeof(vote));
		while (n--) {
			fscanf(stdin, "%c%*c", &a);
			if (max > sec + n+1)continue;
			i++;
			vote[a - 'A']++;
			if (vote[a - 'A'] >= max) {
				if(vote[tmp-'A']-1!=max) sec = max;
				max = vote[a - 'A'], tmp = a;
			}
			else if (vote[a - 'A'] > sec) sec = vote[a - 'A'];
		}
		if (max == sec) puts("TIE");
		else fprintf(stdout, "%c %d\n", tmp, i);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%c%*c"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"%d"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	28(%rsp), %r14
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	movq	%r14, %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L16
	movq	stdin(%rip), %rdi
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movl	$65, %ebx
	call	getc@PLT
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	28(%rsp), %edx
	movl	$13, %ecx
	rep stosq
	.p2align 4,,10
	.p2align 3
.L4:
	leal	-1(%rdx), %eax
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	je	.L17
.L7:
	movq	stdin(%rip), %rdi
	leaq	27(%rsp), %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %edx
	leal	1(%r15,%rdx), %eax
	cmpl	%r13d, %eax
	jl	.L4
	movsbl	27(%rsp), %eax
	addl	$1, %ebp
	movl	%eax, %edi
	subl	$65, %eax
	cltq
	movl	32(%rsp,%rax,4), %ecx
	leal	1(%rcx), %esi
	movl	%esi, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jl	.L5
	subl	$65, %ebx
	movslq	%ebx, %rbx
	movl	32(%rsp,%rbx,4), %eax
	subl	$1, %eax
	cmpl	%eax, %r13d
	je	.L12
	leal	-1(%rdx), %eax
	movl	%r13d, %r15d
	movsbl	%dil, %ebx
	movl	%esi, %r13d
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	%r15d, %r13d
	je	.L18
	movq	stdout(%rip), %rdi
	movsbl	%bl, %ecx
	movl	%ebp, %r8d
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdx
	movl	$1, %esi
	call	__fprintf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	%esi, %r15d
	cmovl	%esi, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %r13d
	movsbl	%dil, %ebx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$152, %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
.L19:
	.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:
```

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	"%c%*c"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"%d"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	28(%rsp), %r14
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	movq	%r14, %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L16
	movq	stdin(%rip), %rdi
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movl	$65, %ebx
	call	getc@PLT
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	28(%rsp), %edx
	movl	$13, %ecx
	rep stosq
	.p2align 4,,10
	.p2align 3
.L4:
	leal	-1(%rdx), %eax
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	je	.L17
.L7:
	movq	stdin(%rip), %rdi
	leaq	27(%rsp), %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %edx
	leal	1(%r15,%rdx), %eax
	cmpl	%r13d, %eax
	jl	.L4
	movsbl	27(%rsp), %eax
	addl	$1, %ebp
	movl	%eax, %edi
	subl	$65, %eax
	cltq
	movl	32(%rsp,%rax,4), %ecx
	leal	1(%rcx), %esi
	movl	%esi, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jl	.L5
	subl	$65, %ebx
	movslq	%ebx, %rbx
	movl	32(%rsp,%rbx,4), %eax
	subl	$1, %eax
	cmpl	%eax, %r13d
	je	.L12
	leal	-1(%rdx), %eax
	movl	%r13d, %r15d
	movsbl	%dil, %ebx
	movl	%esi, %r13d
	movl	%eax, 28(%rsp)
	testl	%edx, %edx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	%r15d, %r13d
	je	.L18
	movq	stdout(%rip), %rdi
	movsbl	%bl, %ecx
	movl	%ebp, %r8d
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdx
	movl	$1, %esi
	call	__fprintf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	%esi, %r15d
	cmovl	%esi, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %r13d
	movsbl	%dil, %ebx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$152, %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
.L19:
	.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:
```