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 i, count=0;
  char a[10];
  char f[1000];

  scanf("%s", a);
  for(i=0;i<10;i++){
    if(64 <a[i] && a[i] < 91) a[i] += 32;
  }
  scanf("%s", f);
  while(strcmp(f, "END_OF_TEXT")){
    for(i=0;i<1000;i++){
      if(f[i] == 0) break;
      if(64 <f[i] && f[i] < 91) f[i] += 32;
    }
    if(strcmp(f, a) == 0) count++;
//    printf("%s\n", f);
    scanf("%s", f);
  }
  printf("%d\n", count);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"END_OF_TEXT"
.LC2:
	.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	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1024(%rbp)
	leaq	-1018(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1028(%rbp)
	jmp	.L2
.L4:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L3
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L3
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	addl	$32, %eax
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1018(%rbp,%rax)
.L3:
	addl	$1, -1028(%rbp)
.L2:
	cmpl	$9, -1028(%rbp)
	jle	.L4
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L5
.L12:
	movl	$0, -1028(%rbp)
	jmp	.L6
.L10:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	testb	%al, %al
	je	.L15
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L9
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L9
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	addl	$32, %eax
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1008(%rbp,%rax)
.L9:
	addl	$1, -1028(%rbp)
.L6:
	cmpl	$999, -1028(%rbp)
	jle	.L10
	jmp	.L8
.L15:
	nop
.L8:
	leaq	-1018(%rbp), %rdx
	leaq	-1008(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L11
	addl	$1, -1024(%rbp)
.L11:
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L5:
	leaq	-1008(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	-1024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"%s"
.LC1:
	.string	"END_OF_TEXT"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$1024, %rsp
	.cfi_def_cfa_offset 1072
	movq	%fs:40, %rax
	movq	%rax, 1016(%rsp)
	xorl	%eax, %eax
	leaq	6(%rsp), %r13
	movq	%r13, %rsi
	call	__isoc99_scanf@PLT
	movzbl	6(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L2
	addl	$32, %eax
	movb	%al, 6(%rsp)
.L2:
	movzbl	7(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L3
	addl	$32, %eax
	movb	%al, 7(%rsp)
.L3:
	movzbl	8(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L4
	addl	$32, %eax
	movb	%al, 8(%rsp)
.L4:
	movzbl	9(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L5
	addl	$32, %eax
	movb	%al, 9(%rsp)
.L5:
	movzbl	10(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L6
	addl	$32, %eax
	movb	%al, 10(%rsp)
.L6:
	movzbl	11(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L7
	addl	$32, %eax
	movb	%al, 11(%rsp)
.L7:
	movzbl	12(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L8
	addl	$32, %eax
	movb	%al, 12(%rsp)
.L8:
	movzbl	13(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L9
	addl	$32, %eax
	movb	%al, 13(%rsp)
.L9:
	movzbl	14(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L10
	addl	$32, %eax
	movb	%al, 14(%rsp)
.L10:
	movzbl	15(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L11
	addl	$32, %eax
	movb	%al, 15(%rsp)
.L11:
	leaq	16(%rsp), %r14
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	movabsq	$6079655328688131653, %rbp
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	cmpq	%rbp, (%r14)
	je	.L28
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r14, %rax
	leaq	1016(%rsp), %rsi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L29:
	leal	-65(%rdx), %ecx
	cmpb	$25, %cl
	ja	.L14
	addl	$32, %edx
	movb	%dl, (%rax)
.L14:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L13
.L15:
	movzbl	(%rax), %edx
	testb	%dl, %dl
	jne	.L29
.L13:
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	strcmp@PLT
	movq	%r14, %rsi
	movq	%rbx, %rdi
	cmpl	$1, %eax
	adcl	$0, %r12d
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpq	%rbp, (%r14)
	jne	.L17
.L28:
	cmpl	$5527621, 8(%r14)
	jne	.L17
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$1024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L30:
	.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	"%s"
.LC1:
	.string	"END_OF_TEXT"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$1024, %rsp
	.cfi_def_cfa_offset 1072
	movq	%fs:40, %rax
	movq	%rax, 1016(%rsp)
	xorl	%eax, %eax
	leaq	6(%rsp), %r13
	movq	%r13, %rsi
	call	__isoc99_scanf@PLT
	movzbl	6(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L2
	addl	$32, %eax
	movb	%al, 6(%rsp)
.L2:
	movzbl	7(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L3
	addl	$32, %eax
	movb	%al, 7(%rsp)
.L3:
	movzbl	8(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L4
	addl	$32, %eax
	movb	%al, 8(%rsp)
.L4:
	movzbl	9(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L5
	addl	$32, %eax
	movb	%al, 9(%rsp)
.L5:
	movzbl	10(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L6
	addl	$32, %eax
	movb	%al, 10(%rsp)
.L6:
	movzbl	11(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L7
	addl	$32, %eax
	movb	%al, 11(%rsp)
.L7:
	movzbl	12(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L8
	addl	$32, %eax
	movb	%al, 12(%rsp)
.L8:
	movzbl	13(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L9
	addl	$32, %eax
	movb	%al, 13(%rsp)
.L9:
	movzbl	14(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L10
	addl	$32, %eax
	movb	%al, 14(%rsp)
.L10:
	movzbl	15(%rsp), %eax
	leal	-65(%rax), %edx
	cmpb	$25, %dl
	ja	.L11
	addl	$32, %eax
	movb	%al, 15(%rsp)
.L11:
	leaq	16(%rsp), %r14
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	movabsq	$6079655328688131653, %rbp
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	cmpq	%rbp, (%r14)
	je	.L28
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r14, %rax
	leaq	1016(%rsp), %rsi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L29:
	leal	-65(%rdx), %ecx
	cmpb	$25, %cl
	ja	.L14
	addl	$32, %edx
	movb	%dl, (%rax)
.L14:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L13
.L15:
	movzbl	(%rax), %edx
	testb	%dl, %dl
	jne	.L29
.L13:
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	strcmp@PLT
	movq	%r14, %rsi
	movq	%rbx, %rdi
	cmpl	$1, %eax
	adcl	$0, %r12d
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpq	%rbp, (%r14)
	jne	.L17
.L28:
	cmpl	$5527621, 8(%r14)
	jne	.L17
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$1024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L30:
	.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 i, count=0;
  char a[10];
  char f[1000];

  scanf("%s", a);
  for(i=0;i<10;i++){
    if(64 <a[i] && a[i] < 91) a[i] += 32;
  }
  scanf("%s", f);
  while(strcmp(f, "END_OF_TEXT")){
    for(i=0;i<1000;i++){
      if(f[i] == 0) break;
      if(64 <f[i] && f[i] < 91) f[i] += 32;
    }
    if(strcmp(f, a) == 0) count++;
//    printf("%s\n", f);
    scanf("%s", f);
  }
  printf("%d\n", count);
  return 0;
}


computer
Nurtures computer scientists and highly-skilled computer engineers
who will create and exploit "knowledge" for the enw era.
Provides an outstanding computer environment.
END_OF_TEXT
 comquter
Nurtures computer scientists and highly-skilled computer engineers
who will create and tiolpxe "knowledge" for the enw era.
Provides an outstanding computer environment.
END_OF_TEXT
 computer
Nurtures computer scientists and highly-skilled computes engineers
who will create and exploit "knowledge" for the enw era.
Provides an outstanding computer environment.
END_OF_TEXT
 comquter
Nurtures computer stsitneics and highly-skilked computer engineers
who wilk create and tiolpxe "knowledge" for the enw era.
Provides an sutotanding comquter environment.
END_OF_TEXT
 computer
Nurtures computer scientists and highly-skilled computer engineers
who will create and tiolpxe "knowledge" for the enw era.
Provides an outstanding computer environment.
END_OF_TEXT
 comquter
Nurtures computer scientists and highly-skilled computer engineers
who will create and tiolpxe "knowledge" for the enw era.
Provides an sutotanding computer environment.
END_OF_TEXT
 comquter
Nurtures computer scientists and highlx-skilled computer engineers
who will create and tiolpxe "knowledge" for the enw era.
Provides an sutotanding computer environment.
END_OF_TEXT
 comquter
Nurtures computer scientists and highlx-skilled computer engineers
who will create and tiolpxe "knowledge" for the enw era.
Provides an sutotanding ctmpuoer environment.
END_OF_TEXT
 comquter
serutruN computer scientists and highlx-skilled computer engineers
who will create and tiolpxe "knowledge" for the enw era.
Provides an sutotanding ctmpuoer environment.
END_OF_TEXT
 comquter
serutruN computer scientists aod highlx-skilled computer engineers
who will create and tiolpxe "knowledge" for the enw era.
Provides an sutotanding ctmpuoer environment.
END_OF_TEXT

3
 0
 2
 1
 3
 0
 0
 0
 0
 0

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 i, count=0;
  char a[10];
  char f[1000];

  scanf("%s", a);
  for(i=0;i<10;i++){
    if(64 <a[i] && a[i] < 91) a[i] += 32;
  }
  scanf("%s", f);
  while(strcmp(f, "END_OF_TEXT")){
    for(i=0;i<1000;i++){
      if(f[i] == 0) break;
      if(64 <f[i] && f[i] < 91) f[i] += 32;
    }
    if(strcmp(f, a) == 0) count++;
//    printf("%s\n", f);
    scanf("%s", f);
  }
  printf("%d\n", count);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"END_OF_TEXT"
.LC2:
	.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	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1024(%rbp)
	leaq	-1018(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1028(%rbp)
	jmp	.L2
.L4:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L3
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L3
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	addl	$32, %eax
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1018(%rbp,%rax)
.L3:
	addl	$1, -1028(%rbp)
.L2:
	cmpl	$9, -1028(%rbp)
	jle	.L4
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L5
.L12:
	movl	$0, -1028(%rbp)
	jmp	.L6
.L10:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	testb	%al, %al
	je	.L15
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L9
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L9
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	addl	$32, %eax
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1008(%rbp,%rax)
.L9:
	addl	$1, -1028(%rbp)
.L6:
	cmpl	$999, -1028(%rbp)
	jle	.L10
	jmp	.L8
.L15:
	nop
.L8:
	leaq	-1018(%rbp), %rdx
	leaq	-1008(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L11
	addl	$1, -1024(%rbp)
.L11:
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L5:
	leaq	-1008(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	-1024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"%s"
.LC1:
	.string	"END_OF_TEXT"
.LC2:
	.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	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1024(%rbp)
	leaq	-1018(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1028(%rbp)
	jmp	.L2
.L4:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L3
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L3
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	addl	$32, %eax
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1018(%rbp,%rax)
.L3:
	addl	$1, -1028(%rbp)
.L2:
	cmpl	$9, -1028(%rbp)
	jle	.L4
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L5
.L12:
	movl	$0, -1028(%rbp)
	jmp	.L6
.L10:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	testb	%al, %al
	je	.L15
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L9
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L9
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	addl	$32, %eax
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1008(%rbp,%rax)
.L9:
	addl	$1, -1028(%rbp)
.L6:
	cmpl	$999, -1028(%rbp)
	jle	.L10
	jmp	.L8
.L15:
	nop
.L8:
	leaq	-1018(%rbp), %rdx
	leaq	-1008(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L11
	addl	$1, -1024(%rbp)
.L11:
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L5:
	leaq	-1008(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	-1024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
