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()
{
  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;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%c"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"TIE"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L17:
	leaq	-224(%rbp), %rdx
	movl	$0, %eax
	movl	$13, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -244(%rbp)
	movl	$0, -252(%rbp)
	jmp	.L2
.L3:
	movl	-252(%rbp), %eax
	cltq
	movl	$0, -224(%rbp,%rax,4)
	addl	$1, -252(%rbp)
.L2:
	cmpl	$25, -252(%rbp)
	jle	.L3
	leaq	-256(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-256(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L4:
	movl	$0, -252(%rbp)
	jmp	.L6
.L7:
	leaq	-257(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -252(%rbp)
.L6:
	movl	-256(%rbp), %eax
	cmpl	%eax, -252(%rbp)
	jl	.L7
	movl	$0, -252(%rbp)
	jmp	.L8
.L15:
	movl	-256(%rbp), %eax
	subl	-252(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -228(%rbp)
	movl	$0, -240(%rbp)
	movl	$0, -236(%rbp)
	movl	$0, -232(%rbp)
	movl	-252(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$65, %eax
	cltq
	movl	-224(%rbp,%rax,4), %edx
	movl	-252(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$65, %eax
	addl	$1, %edx
	cltq
	movl	%edx, -224(%rbp,%rax,4)
	movl	$0, -248(%rbp)
	jmp	.L9
.L12:
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	cmpl	%eax, -240(%rbp)
	jg	.L10
	movl	-240(%rbp), %eax
	movl	%eax, -236(%rbp)
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -240(%rbp)
	movl	-248(%rbp), %eax
	movl	%eax, -232(%rbp)
	jmp	.L11
.L10:
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	cmpl	%eax, -236(%rbp)
	jg	.L11
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -236(%rbp)
.L11:
	addl	$1, -248(%rbp)
.L9:
	cmpl	$25, -248(%rbp)
	jle	.L12
	movl	-236(%rbp), %edx
	movl	-228(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -240(%rbp)
	jle	.L13
	movl	-252(%rbp), %eax
	leal	1(%rax), %edx
	movl	-232(%rbp), %eax
	addl	$65, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -244(%rbp)
	jmp	.L14
.L13:
	addl	$1, -252(%rbp)
.L8:
	movl	-256(%rbp), %eax
	cmpl	%eax, -252(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -244(%rbp)
	jne	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	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	"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
	.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:

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


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 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()
{
  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;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%c"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"TIE"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L17:
	leaq	-224(%rbp), %rdx
	movl	$0, %eax
	movl	$13, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -244(%rbp)
	movl	$0, -252(%rbp)
	jmp	.L2
.L3:
	movl	-252(%rbp), %eax
	cltq
	movl	$0, -224(%rbp,%rax,4)
	addl	$1, -252(%rbp)
.L2:
	cmpl	$25, -252(%rbp)
	jle	.L3
	leaq	-256(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-256(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L4:
	movl	$0, -252(%rbp)
	jmp	.L6
.L7:
	leaq	-257(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -252(%rbp)
.L6:
	movl	-256(%rbp), %eax
	cmpl	%eax, -252(%rbp)
	jl	.L7
	movl	$0, -252(%rbp)
	jmp	.L8
.L15:
	movl	-256(%rbp), %eax
	subl	-252(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -228(%rbp)
	movl	$0, -240(%rbp)
	movl	$0, -236(%rbp)
	movl	$0, -232(%rbp)
	movl	-252(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$65, %eax
	cltq
	movl	-224(%rbp,%rax,4), %edx
	movl	-252(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$65, %eax
	addl	$1, %edx
	cltq
	movl	%edx, -224(%rbp,%rax,4)
	movl	$0, -248(%rbp)
	jmp	.L9
.L12:
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	cmpl	%eax, -240(%rbp)
	jg	.L10
	movl	-240(%rbp), %eax
	movl	%eax, -236(%rbp)
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -240(%rbp)
	movl	-248(%rbp), %eax
	movl	%eax, -232(%rbp)
	jmp	.L11
.L10:
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	cmpl	%eax, -236(%rbp)
	jg	.L11
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -236(%rbp)
.L11:
	addl	$1, -248(%rbp)
.L9:
	cmpl	$25, -248(%rbp)
	jle	.L12
	movl	-236(%rbp), %edx
	movl	-228(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -240(%rbp)
	jle	.L13
	movl	-252(%rbp), %eax
	leal	1(%rax), %edx
	movl	-232(%rbp), %eax
	addl	$65, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -244(%rbp)
	jmp	.L14
.L13:
	addl	$1, -252(%rbp)
.L8:
	movl	-256(%rbp), %eax
	cmpl	%eax, -252(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -244(%rbp)
	jne	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	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	"%c"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"TIE"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L17:
	leaq	-224(%rbp), %rdx
	movl	$0, %eax
	movl	$13, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -244(%rbp)
	movl	$0, -252(%rbp)
	jmp	.L2
.L3:
	movl	-252(%rbp), %eax
	cltq
	movl	$0, -224(%rbp,%rax,4)
	addl	$1, -252(%rbp)
.L2:
	cmpl	$25, -252(%rbp)
	jle	.L3
	leaq	-256(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-256(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L4:
	movl	$0, -252(%rbp)
	jmp	.L6
.L7:
	leaq	-257(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -252(%rbp)
.L6:
	movl	-256(%rbp), %eax
	cmpl	%eax, -252(%rbp)
	jl	.L7
	movl	$0, -252(%rbp)
	jmp	.L8
.L15:
	movl	-256(%rbp), %eax
	subl	-252(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -228(%rbp)
	movl	$0, -240(%rbp)
	movl	$0, -236(%rbp)
	movl	$0, -232(%rbp)
	movl	-252(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$65, %eax
	cltq
	movl	-224(%rbp,%rax,4), %edx
	movl	-252(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$65, %eax
	addl	$1, %edx
	cltq
	movl	%edx, -224(%rbp,%rax,4)
	movl	$0, -248(%rbp)
	jmp	.L9
.L12:
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	cmpl	%eax, -240(%rbp)
	jg	.L10
	movl	-240(%rbp), %eax
	movl	%eax, -236(%rbp)
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -240(%rbp)
	movl	-248(%rbp), %eax
	movl	%eax, -232(%rbp)
	jmp	.L11
.L10:
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	cmpl	%eax, -236(%rbp)
	jg	.L11
	movl	-248(%rbp), %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -236(%rbp)
.L11:
	addl	$1, -248(%rbp)
.L9:
	cmpl	$25, -248(%rbp)
	jle	.L12
	movl	-236(%rbp), %edx
	movl	-228(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -240(%rbp)
	jle	.L13
	movl	-252(%rbp), %eax
	leal	1(%rax), %edx
	movl	-232(%rbp), %eax
	addl	$65, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -244(%rbp)
	jmp	.L14
.L13:
	addl	$1, -252(%rbp)
.L8:
	movl	-256(%rbp), %eax
	cmpl	%eax, -252(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -244(%rbp)
	jne	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	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:
