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<ctype.h>
#include <string.h>
 
int main(void){
    char w[10], c[1000];
    int wn=0, cn=0, i, count=0;
     
    scanf("%s", w);
    while(w[wn] != '\0') wn++;
     
    while(scanf("%s", c)){
        if(strcmp(c, "END_OF_TEXT") == 0) break;
         
        cn = 0;
        while(c[cn] != '\0') cn++;
         
        for(i=0; i<cn; i++){
            if(c[i]>='A' && c[i]<='Z')
            c[i] = tolower(c[i]);
        }
        if(wn >= cn){
            for(i=0; i<wn; i++){
                if(w[i] != c[i]) break;
                if(i==wn-1){
                    count++;
                }
            }
        }
    }
     
    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, -1036(%rbp)
	movl	$0, -1032(%rbp)
	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
	jmp	.L2
.L3:
	addl	$1, -1036(%rbp)
.L2:
	movl	-1036(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L3
	jmp	.L4
.L16:
	leaq	-1008(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L19
	movl	$0, -1032(%rbp)
	jmp	.L7
.L8:
	addl	$1, -1032(%rbp)
.L7:
	movl	-1032(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L8
	movl	$0, -1028(%rbp)
	jmp	.L9
.L11:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L10
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L10
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	tolower@PLT
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1008(%rbp,%rax)
.L10:
	addl	$1, -1028(%rbp)
.L9:
	movl	-1028(%rbp), %eax
	cmpl	-1032(%rbp), %eax
	jl	.L11
	movl	-1036(%rbp), %eax
	cmpl	-1032(%rbp), %eax
	jl	.L4
	movl	$0, -1028(%rbp)
	jmp	.L12
.L15:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %edx
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L13
	jmp	.L4
.L13:
	movl	-1036(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1028(%rbp)
	jne	.L14
	addl	$1, -1024(%rbp)
.L14:
	addl	$1, -1028(%rbp)
.L12:
	movl	-1028(%rbp), %eax
	cmpl	-1036(%rbp), %eax
	jl	.L15
.L4:
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L16
	jmp	.L6
.L19:
	nop
.L6:
	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	.L18
	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	"%s"
.LC1:
	.string	"END_OF_TEXT"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.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	22(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpb	$0, 22(%rsp)
	je	.L24
	cmpb	$0, 23(%rsp)
	je	.L25
	cmpb	$0, 24(%rsp)
	je	.L26
	cmpb	$0, 25(%rsp)
	je	.L27
	cmpb	$0, 26(%rsp)
	je	.L28
	cmpb	$0, 27(%rsp)
	je	.L29
	cmpb	$0, 28(%rsp)
	je	.L30
	cmpb	$0, 29(%rsp)
	je	.L31
	cmpb	$1, 30(%rsp)
	sbbl	%r12d, %r12d
	addl	$9, %r12d
.L2:
	leal	-1(%r12), %eax
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %rbp
	movl	%eax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L6
	movabsq	$6079655328688131653, %rax
	cmpq	%rax, 0(%rbp)
	je	.L62
.L4:
	leaq	33(%rsp), %rbx
	xorl	%r15d, %r15d
	cmpb	$0, 32(%rsp)
	movq	%rbx, %rax
	je	.L63
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rax
	movslq	%r15d, %rcx
	addl	$1, %r15d
	cmpb	$0, -1(%rax)
	jne	.L10
	movq	%rbp, %r13
	addq	%rcx, %rbx
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	0(%r13), %r14d
	leal	-65(%r14), %eax
	cmpb	$25, %al
	ja	.L11
	call	__ctype_tolower_loc@PLT
	movsbq	%r14b, %rcx
	movq	(%rax), %rax
	movl	(%rax,%rcx,4), %eax
	movb	%al, 0(%r13)
.L11:
	addq	$1, %r13
	cmpq	%rbx, %r13
	jne	.L12
	cmpl	%r12d, %r15d
	jg	.L3
.L8:
	movzbl	22(%rsp), %eax
	cmpb	%al, 32(%rsp)
	jne	.L3
	movl	8(%rsp), %eax
	testl	%eax, %eax
	je	.L60
	cmpl	$1, %r12d
	je	.L3
	movzbl	23(%rsp), %eax
	cmpb	%al, 33(%rsp)
	jne	.L3
	cmpl	$1, 8(%rsp)
	je	.L60
	cmpl	$2, %r12d
	je	.L3
	movzbl	34(%rsp), %eax
	cmpb	%al, 24(%rsp)
	jne	.L3
	cmpl	$2, 8(%rsp)
	je	.L60
	cmpl	$3, %r12d
	je	.L3
	movzbl	35(%rsp), %eax
	cmpb	%al, 25(%rsp)
	jne	.L3
	cmpl	$3, 8(%rsp)
	je	.L60
	cmpl	$4, %r12d
	je	.L3
	movzbl	36(%rsp), %eax
	cmpb	%al, 26(%rsp)
	jne	.L3
	cmpl	$4, 8(%rsp)
	je	.L60
	cmpl	$5, %r12d
	je	.L3
	movzbl	37(%rsp), %eax
	cmpb	%al, 27(%rsp)
	jne	.L3
	cmpl	$5, 8(%rsp)
	je	.L60
	cmpl	$6, %r12d
	je	.L3
	movzbl	38(%rsp), %eax
	cmpb	%al, 28(%rsp)
	jne	.L3
	cmpl	$6, 8(%rsp)
	je	.L60
	cmpl	$7, %r12d
	je	.L3
	movzbl	39(%rsp), %eax
	cmpb	%al, 29(%rsp)
	jne	.L3
	cmpl	$7, 8(%rsp)
	je	.L60
	cmpl	$9, %r12d
	jne	.L3
	movzbl	40(%rsp), %eax
	cmpb	%al, 30(%rsp)
	jne	.L3
	xorl	%eax, %eax
	cmpl	$8, 8(%rsp)
	sete	%al
	addl	%eax, 12(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	$5527621, 8(%rbp)
	jne	.L4
.L6:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	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
	.p2align 4,,10
	.p2align 3
.L60:
	.cfi_restore_state
	addl	$1, 12(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L63:
	testl	%r12d, %r12d
	jne	.L8
	jmp	.L3
.L29:
	movl	$5, %r12d
	jmp	.L2
.L24:
	xorl	%r12d, %r12d
	jmp	.L2
.L25:
	movl	$1, %r12d
	jmp	.L2
.L26:
	movl	$2, %r12d
	jmp	.L2
.L27:
	movl	$3, %r12d
	jmp	.L2
.L28:
	movl	$4, %r12d
	jmp	.L2
.L30:
	movl	$6, %r12d
	jmp	.L2
.L31:
	movl	$7, %r12d
	jmp	.L2
.L64:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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:
.LFB37:
	.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	22(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpb	$0, 22(%rsp)
	je	.L24
	cmpb	$0, 23(%rsp)
	je	.L25
	cmpb	$0, 24(%rsp)
	je	.L26
	cmpb	$0, 25(%rsp)
	je	.L27
	cmpb	$0, 26(%rsp)
	je	.L28
	cmpb	$0, 27(%rsp)
	je	.L29
	cmpb	$0, 28(%rsp)
	je	.L30
	cmpb	$0, 29(%rsp)
	je	.L31
	cmpb	$1, 30(%rsp)
	sbbl	%r12d, %r12d
	addl	$9, %r12d
.L2:
	leal	-1(%r12), %eax
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %rbp
	movl	%eax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L6
	movabsq	$6079655328688131653, %rax
	cmpq	%rax, 0(%rbp)
	je	.L62
.L4:
	leaq	33(%rsp), %rbx
	xorl	%r15d, %r15d
	cmpb	$0, 32(%rsp)
	movq	%rbx, %rax
	je	.L63
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rax
	movslq	%r15d, %rcx
	addl	$1, %r15d
	cmpb	$0, -1(%rax)
	jne	.L10
	movq	%rbp, %r13
	addq	%rcx, %rbx
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	0(%r13), %r14d
	leal	-65(%r14), %eax
	cmpb	$25, %al
	ja	.L11
	call	__ctype_tolower_loc@PLT
	movsbq	%r14b, %rcx
	movq	(%rax), %rax
	movl	(%rax,%rcx,4), %eax
	movb	%al, 0(%r13)
.L11:
	addq	$1, %r13
	cmpq	%rbx, %r13
	jne	.L12
	cmpl	%r12d, %r15d
	jg	.L3
.L8:
	movzbl	22(%rsp), %eax
	cmpb	%al, 32(%rsp)
	jne	.L3
	movl	8(%rsp), %eax
	testl	%eax, %eax
	je	.L60
	cmpl	$1, %r12d
	je	.L3
	movzbl	23(%rsp), %eax
	cmpb	%al, 33(%rsp)
	jne	.L3
	cmpl	$1, 8(%rsp)
	je	.L60
	cmpl	$2, %r12d
	je	.L3
	movzbl	34(%rsp), %eax
	cmpb	%al, 24(%rsp)
	jne	.L3
	cmpl	$2, 8(%rsp)
	je	.L60
	cmpl	$3, %r12d
	je	.L3
	movzbl	35(%rsp), %eax
	cmpb	%al, 25(%rsp)
	jne	.L3
	cmpl	$3, 8(%rsp)
	je	.L60
	cmpl	$4, %r12d
	je	.L3
	movzbl	36(%rsp), %eax
	cmpb	%al, 26(%rsp)
	jne	.L3
	cmpl	$4, 8(%rsp)
	je	.L60
	cmpl	$5, %r12d
	je	.L3
	movzbl	37(%rsp), %eax
	cmpb	%al, 27(%rsp)
	jne	.L3
	cmpl	$5, 8(%rsp)
	je	.L60
	cmpl	$6, %r12d
	je	.L3
	movzbl	38(%rsp), %eax
	cmpb	%al, 28(%rsp)
	jne	.L3
	cmpl	$6, 8(%rsp)
	je	.L60
	cmpl	$7, %r12d
	je	.L3
	movzbl	39(%rsp), %eax
	cmpb	%al, 29(%rsp)
	jne	.L3
	cmpl	$7, 8(%rsp)
	je	.L60
	cmpl	$9, %r12d
	jne	.L3
	movzbl	40(%rsp), %eax
	cmpb	%al, 30(%rsp)
	jne	.L3
	xorl	%eax, %eax
	cmpl	$8, 8(%rsp)
	sete	%al
	addl	%eax, 12(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	$5527621, 8(%rbp)
	jne	.L4
.L6:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	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
	.p2align 4,,10
	.p2align 3
.L60:
	.cfi_restore_state
	addl	$1, 12(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L63:
	testl	%r12d, %r12d
	jne	.L8
	jmp	.L3
.L29:
	movl	$5, %r12d
	jmp	.L2
.L24:
	xorl	%r12d, %r12d
	jmp	.L2
.L25:
	movl	$1, %r12d
	jmp	.L2
.L26:
	movl	$2, %r12d
	jmp	.L2
.L27:
	movl	$3, %r12d
	jmp	.L2
.L28:
	movl	$4, %r12d
	jmp	.L2
.L30:
	movl	$6, %r12d
	jmp	.L2
.L31:
	movl	$7, %r12d
	jmp	.L2
.L64:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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<ctype.h>
#include <string.h>
 
int main(void){
    char w[10], c[1000];
    int wn=0, cn=0, i, count=0;
     
    scanf("%s", w);
    while(w[wn] != '\0') wn++;
     
    while(scanf("%s", c)){
        if(strcmp(c, "END_OF_TEXT") == 0) break;
         
        cn = 0;
        while(c[cn] != '\0') cn++;
         
        for(i=0; i<cn; i++){
            if(c[i]>='A' && c[i]<='Z')
            c[i] = tolower(c[i]);
        }
        if(wn >= cn){
            for(i=0; i<wn; i++){
                if(w[i] != c[i]) break;
                if(i==wn-1){
                    count++;
                }
            }
        }
    }
     
    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<ctype.h>
#include <string.h>
 
int main(void){
    char w[10], c[1000];
    int wn=0, cn=0, i, count=0;
     
    scanf("%s", w);
    while(w[wn] != '\0') wn++;
     
    while(scanf("%s", c)){
        if(strcmp(c, "END_OF_TEXT") == 0) break;
         
        cn = 0;
        while(c[cn] != '\0') cn++;
         
        for(i=0; i<cn; i++){
            if(c[i]>='A' && c[i]<='Z')
            c[i] = tolower(c[i]);
        }
        if(wn >= cn){
            for(i=0; i<wn; i++){
                if(w[i] != c[i]) break;
                if(i==wn-1){
                    count++;
                }
            }
        }
    }
     
    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, -1036(%rbp)
	movl	$0, -1032(%rbp)
	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
	jmp	.L2
.L3:
	addl	$1, -1036(%rbp)
.L2:
	movl	-1036(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L3
	jmp	.L4
.L16:
	leaq	-1008(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L19
	movl	$0, -1032(%rbp)
	jmp	.L7
.L8:
	addl	$1, -1032(%rbp)
.L7:
	movl	-1032(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L8
	movl	$0, -1028(%rbp)
	jmp	.L9
.L11:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L10
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L10
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	tolower@PLT
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1008(%rbp,%rax)
.L10:
	addl	$1, -1028(%rbp)
.L9:
	movl	-1028(%rbp), %eax
	cmpl	-1032(%rbp), %eax
	jl	.L11
	movl	-1036(%rbp), %eax
	cmpl	-1032(%rbp), %eax
	jl	.L4
	movl	$0, -1028(%rbp)
	jmp	.L12
.L15:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %edx
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L13
	jmp	.L4
.L13:
	movl	-1036(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1028(%rbp)
	jne	.L14
	addl	$1, -1024(%rbp)
.L14:
	addl	$1, -1028(%rbp)
.L12:
	movl	-1028(%rbp), %eax
	cmpl	-1036(%rbp), %eax
	jl	.L15
.L4:
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L16
	jmp	.L6
.L19:
	nop
.L6:
	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	.L18
	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	"%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, -1036(%rbp)
	movl	$0, -1032(%rbp)
	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
	jmp	.L2
.L3:
	addl	$1, -1036(%rbp)
.L2:
	movl	-1036(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L3
	jmp	.L4
.L16:
	leaq	-1008(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L19
	movl	$0, -1032(%rbp)
	jmp	.L7
.L8:
	addl	$1, -1032(%rbp)
.L7:
	movl	-1032(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L8
	movl	$0, -1028(%rbp)
	jmp	.L9
.L11:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$64, %al
	jle	.L10
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	$90, %al
	jg	.L10
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	tolower@PLT
	movl	%eax, %edx
	movl	-1028(%rbp), %eax
	cltq
	movb	%dl, -1008(%rbp,%rax)
.L10:
	addl	$1, -1028(%rbp)
.L9:
	movl	-1028(%rbp), %eax
	cmpl	-1032(%rbp), %eax
	jl	.L11
	movl	-1036(%rbp), %eax
	cmpl	-1032(%rbp), %eax
	jl	.L4
	movl	$0, -1028(%rbp)
	jmp	.L12
.L15:
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1018(%rbp,%rax), %edx
	movl	-1028(%rbp), %eax
	cltq
	movzbl	-1008(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L13
	jmp	.L4
.L13:
	movl	-1036(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1028(%rbp)
	jne	.L14
	addl	$1, -1024(%rbp)
.L14:
	addl	$1, -1028(%rbp)
.L12:
	movl	-1028(%rbp), %eax
	cmpl	-1036(%rbp), %eax
	jl	.L15
.L4:
	leaq	-1008(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L16
	jmp	.L6
.L19:
	nop
.L6:
	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	.L18
	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:
