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

int main()
{
  int input_n;
  char input_c[100];
  char ch;
  int counter_i, counter_j;

  for( ; ; )
  {
    int hyou_counter[26] = {0};
    int winner = 0;

    for(counter_i = 0 ; counter_i <= 25 ; counter_i++)
      hyou_counter[counter_i] = 0;

    scanf("%d", &input_n);
    if(input_n == 0)
      break;

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      scanf("%c", &ch);
      scanf("%c", &input_c[counter_i]);
    }

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      int hyou_nokori = input_n - counter_i - 1;
      int max_hyou = 0, second_max_hyou = 0, max_index = 0;

      hyou_counter[input_c[counter_i] - 'A'] += 1;

      for(counter_j = 0 ; counter_j <= 25 ; counter_j++)
      {
        if(hyou_counter[counter_j] >= max_hyou)
        {
          second_max_hyou = max_hyou;
          max_hyou = hyou_counter[counter_j];
          max_index = counter_j;
        }
        else if(hyou_counter[counter_j] >= second_max_hyou)
        {
          second_max_hyou = hyou_counter[counter_j];
        }
      }

      if(max_hyou > second_max_hyou + hyou_nokori)
      {
        printf("%c %d\n", 'A' + max_index, counter_i + 1);
        winner = 1;
        break;
      }
    }

    if(!winner)
    {
      printf("TIE\n");
    }
  }
  return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c"
.LC3:
	.string	"%c %d\n"
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r15
.L10:
	xorl	%eax, %eax
	movl	$13, %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %ebx
	leaq	11(%rsp), %r13
	leaq	128(%rsp), %r12
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	(%r12,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r10d
	addq	$1, %rbx
	cmpl	%ebx, %r10d
	jg	.L3
	testl	%r10d, %r10d
	jle	.L5
	leal	1(%r10), %ebx
	movl	$1, %r9d
	leaq	127(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L9:
	movsbl	(%r11,%r9), %eax
	movl	%r10d, %r12d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	subl	%r9d, %r12d
	xorl	%esi, %esi
	subl	$65, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	addq	$1, %rax
	cmpq	$26, %rax
	je	.L19
.L7:
	movl	(%r14,%rax,4), %edx
	cmpl	%esi, %edx
	jl	.L20
	movl	%eax, %edi
	addq	$1, %rax
	movl	%esi, %ecx
	movl	%edx, %esi
	cmpq	$26, %rax
	jne	.L7
.L19:
	addl	%r12d, %ecx
	cmpl	%ecx, %esi
	jg	.L21
	addq	$1, %r9
	cmpq	%r9, %rbx
	jne	.L9
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
.L21:
	leal	65(%rdi), %edx
	movl	%r9d, %ecx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L10
.L2:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$248, %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
.L22:
	.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	"%d"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c"
.LC3:
	.string	"%c %d\n"
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r15
.L10:
	xorl	%eax, %eax
	movl	$13, %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %ebx
	leaq	11(%rsp), %r13
	leaq	128(%rsp), %r12
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	(%r12,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r10d
	addq	$1, %rbx
	cmpl	%ebx, %r10d
	jg	.L3
	testl	%r10d, %r10d
	jle	.L5
	leal	1(%r10), %ebx
	movl	$1, %r9d
	leaq	127(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L9:
	movsbl	(%r11,%r9), %eax
	movl	%r10d, %r12d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	subl	%r9d, %r12d
	xorl	%esi, %esi
	subl	$65, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	addq	$1, %rax
	cmpq	$26, %rax
	je	.L19
.L7:
	movl	(%r14,%rax,4), %edx
	cmpl	%esi, %edx
	jl	.L20
	movl	%eax, %edi
	addq	$1, %rax
	movl	%esi, %ecx
	movl	%edx, %esi
	cmpq	$26, %rax
	jne	.L7
.L19:
	addl	%r12d, %ecx
	cmpl	%ecx, %esi
	jg	.L21
	addq	$1, %r9
	cmpq	%r9, %rbx
	jne	.L9
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
.L21:
	leal	65(%rdi), %edx
	movl	%r9d, %ecx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L10
.L2:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$248, %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
.L22:
	.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	"%d"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c"
.LC3:
	.string	"%c %d\n"
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r15
.L10:
	xorl	%eax, %eax
	movl	$13, %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %ebx
	leaq	11(%rsp), %r13
	leaq	128(%rsp), %r12
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	(%r12,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r10d
	addq	$1, %rbx
	cmpl	%ebx, %r10d
	jg	.L3
	testl	%r10d, %r10d
	jle	.L5
	leal	1(%r10), %ebx
	movl	$1, %r9d
	leaq	127(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L9:
	movsbl	(%r11,%r9), %eax
	movl	%r10d, %r12d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	subl	%r9d, %r12d
	xorl	%esi, %esi
	subl	$65, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	addq	$1, %rax
	cmpq	$26, %rax
	je	.L19
.L7:
	movl	(%r14,%rax,4), %edx
	cmpl	%esi, %edx
	jl	.L20
	movl	%eax, %edi
	addq	$1, %rax
	movl	%esi, %ecx
	movl	%edx, %esi
	cmpq	$26, %rax
	jne	.L7
.L19:
	addl	%r12d, %ecx
	cmpl	%ecx, %esi
	jg	.L21
	addq	$1, %r9
	cmpq	%r9, %rbx
	jne	.L9
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
.L21:
	leal	65(%rdi), %edx
	movl	%r9d, %ecx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L10
.L2:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$248, %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
.L22:
	.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
#include <stdio.h>
#include <string.h>

int main()
{
  int input_n;
  char input_c[100];
  char ch;
  int counter_i, counter_j;

  for( ; ; )
  {
    int hyou_counter[26] = {0};
    int winner = 0;

    for(counter_i = 0 ; counter_i <= 25 ; counter_i++)
      hyou_counter[counter_i] = 0;

    scanf("%d", &input_n);
    if(input_n == 0)
      break;

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      scanf("%c", &ch);
      scanf("%c", &input_c[counter_i]);
    }

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      int hyou_nokori = input_n - counter_i - 1;
      int max_hyou = 0, second_max_hyou = 0, max_index = 0;

      hyou_counter[input_c[counter_i] - 'A'] += 1;

      for(counter_j = 0 ; counter_j <= 25 ; counter_j++)
      {
        if(hyou_counter[counter_j] >= max_hyou)
        {
          second_max_hyou = max_hyou;
          max_hyou = hyou_counter[counter_j];
          max_index = counter_j;
        }
        else if(hyou_counter[counter_j] >= second_max_hyou)
        {
          second_max_hyou = hyou_counter[counter_j];
        }
      }

      if(max_hyou > second_max_hyou + hyou_nokori)
      {
        printf("%c %d\n", 'A' + max_index, counter_i + 1);
        winner = 1;
        break;
      }
    }

    if(!winner)
    {
      printf("TIE\n");
    }
  }
  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 <string.h>

int main()
{
  int input_n;
  char input_c[100];
  char ch;
  int counter_i, counter_j;

  for( ; ; )
  {
    int hyou_counter[26] = {0};
    int winner = 0;

    for(counter_i = 0 ; counter_i <= 25 ; counter_i++)
      hyou_counter[counter_i] = 0;

    scanf("%d", &input_n);
    if(input_n == 0)
      break;

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      scanf("%c", &ch);
      scanf("%c", &input_c[counter_i]);
    }

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      int hyou_nokori = input_n - counter_i - 1;
      int max_hyou = 0, second_max_hyou = 0, max_index = 0;

      hyou_counter[input_c[counter_i] - 'A'] += 1;

      for(counter_j = 0 ; counter_j <= 25 ; counter_j++)
      {
        if(hyou_counter[counter_j] >= max_hyou)
        {
          second_max_hyou = max_hyou;
          max_hyou = hyou_counter[counter_j];
          max_index = counter_j;
        }
        else if(hyou_counter[counter_j] >= second_max_hyou)
        {
          second_max_hyou = hyou_counter[counter_j];
        }
      }

      if(max_hyou > second_max_hyou + hyou_nokori)
      {
        printf("%c %d\n", 'A' + max_index, counter_i + 1);
        winner = 1;
        break;
      }
    }

    if(!winner)
    {
      printf("TIE\n");
    }
  }
  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
 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
1
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
0
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 B A C C B
10
V U U U U W W W V W
0
 1
A
4
A A B B
5
L M N L N
1
K K K K K K
0
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

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
 A 1
TIE
TIE
K 4
X 5
A 7
V 1
TIE
TIE
TIE
TIE
TIE
TIE
TIE
TIE
TIE
 A 1
TIE
TIE
K 4
 A 1
TIE
TIE
K 4
X 5
TIE
TIE
 A 1
TIE
TIE
K 1
TIE
TIE
TIE
TIE
TIE

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

int main()
{
  int input_n;
  char input_c[100];
  char ch;
  int counter_i, counter_j;

  for( ; ; )
  {
    int hyou_counter[26] = {0};
    int winner = 0;

    for(counter_i = 0 ; counter_i <= 25 ; counter_i++)
      hyou_counter[counter_i] = 0;

    scanf("%d", &input_n);
    if(input_n == 0)
      break;

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      scanf("%c", &ch);
      scanf("%c", &input_c[counter_i]);
    }

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      int hyou_nokori = input_n - counter_i - 1;
      int max_hyou = 0, second_max_hyou = 0, max_index = 0;

      hyou_counter[input_c[counter_i] - 'A'] += 1;

      for(counter_j = 0 ; counter_j <= 25 ; counter_j++)
      {
        if(hyou_counter[counter_j] >= max_hyou)
        {
          second_max_hyou = max_hyou;
          max_hyou = hyou_counter[counter_j];
          max_index = counter_j;
        }
        else if(hyou_counter[counter_j] >= second_max_hyou)
        {
          second_max_hyou = hyou_counter[counter_j];
        }
      }

      if(max_hyou > second_max_hyou + hyou_nokori)
      {
        printf("%c %d\n", 'A' + max_index, counter_i + 1);
        winner = 1;
        break;
      }
    }

    if(!winner)
    {
      printf("TIE\n");
    }
  }
  return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c"
.LC3:
	.string	"%c %d\n"
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r15
.L10:
	xorl	%eax, %eax
	movl	$13, %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %ebx
	leaq	11(%rsp), %r13
	leaq	128(%rsp), %r12
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	(%r12,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r10d
	addq	$1, %rbx
	cmpl	%ebx, %r10d
	jg	.L3
	testl	%r10d, %r10d
	jle	.L5
	leal	1(%r10), %ebx
	movl	$1, %r9d
	leaq	127(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L9:
	movsbl	(%r11,%r9), %eax
	movl	%r10d, %r12d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	subl	%r9d, %r12d
	xorl	%esi, %esi
	subl	$65, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	addq	$1, %rax
	cmpq	$26, %rax
	je	.L19
.L7:
	movl	(%r14,%rax,4), %edx
	cmpl	%esi, %edx
	jl	.L20
	movl	%eax, %edi
	addq	$1, %rax
	movl	%esi, %ecx
	movl	%edx, %esi
	cmpq	$26, %rax
	jne	.L7
.L19:
	addl	%r12d, %ecx
	cmpl	%ecx, %esi
	jg	.L21
	addq	$1, %r9
	cmpq	%r9, %rbx
	jne	.L9
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
.L21:
	leal	65(%rdi), %edx
	movl	%r9d, %ecx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L10
.L2:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$248, %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
.L22:
	.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	"%d"
.LC1:
	.string	"TIE"
.LC2:
	.string	"%c"
.LC3:
	.string	"%c %d\n"
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r15
.L10:
	xorl	%eax, %eax
	movl	$13, %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %ebx
	leaq	11(%rsp), %r13
	leaq	128(%rsp), %r12
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	(%r12,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r10d
	addq	$1, %rbx
	cmpl	%ebx, %r10d
	jg	.L3
	testl	%r10d, %r10d
	jle	.L5
	leal	1(%r10), %ebx
	movl	$1, %r9d
	leaq	127(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L9:
	movsbl	(%r11,%r9), %eax
	movl	%r10d, %r12d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	subl	%r9d, %r12d
	xorl	%esi, %esi
	subl	$65, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	addq	$1, %rax
	cmpq	$26, %rax
	je	.L19
.L7:
	movl	(%r14,%rax,4), %edx
	cmpl	%esi, %edx
	jl	.L20
	movl	%eax, %edi
	addq	$1, %rax
	movl	%esi, %ecx
	movl	%edx, %esi
	cmpq	$26, %rax
	jne	.L7
.L19:
	addl	%r12d, %ecx
	cmpl	%ecx, %esi
	jg	.L21
	addq	$1, %r9
	cmpq	%r9, %rbx
	jne	.L9
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
.L21:
	leal	65(%rdi), %edx
	movl	%r9d, %ecx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L10
.L2:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$248, %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
.L22:
	.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:
```