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>
 
int main(){
	int N, AC=0,WA=0,TLE=0,RE=0;
	scanf("%d", &N);
	for(int i=0;i<N;i++){
		char S[100];
		scanf("%s", &S);
		if (S[0]=='A'){
			AC+=1;
			continue;
		}
		else if (S[0]=='W'){
			WA++;
			continue;
		}
		else if (S[0]=='T'){
			TLE++;
			continue;
		}
		else if (S[0]=='R'){
			RE++;
			continue;
		}	
	}
	printf("\nAC x %d\nWA x %d\nTLE x %d\nRE x %d\n", AC,WA,TLE,RE);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.align 8
.LC2:
	.string	"\nAC x %d\nWA x %d\nTLE x %d\nRE x %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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -116(%rbp)
	jmp	.L2
.L9:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-112(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	addl	$1, -132(%rbp)
	jmp	.L8
.L3:
	movzbl	-112(%rbp), %eax
	cmpb	$87, %al
	jne	.L5
	addl	$1, -128(%rbp)
	jmp	.L8
.L5:
	movzbl	-112(%rbp), %eax
	cmpb	$84, %al
	jne	.L6
	addl	$1, -124(%rbp)
	jmp	.L8
.L6:
	movzbl	-112(%rbp), %eax
	cmpb	$82, %al
	jne	.L8
	addl	$1, -120(%rbp)
	nop
.L8:
	addl	$1, -116(%rbp)
.L2:
	movl	-136(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L9
	movl	-120(%rbp), %esi
	movl	-124(%rbp), %ecx
	movl	-128(%rbp), %edx
	movl	-132(%rbp), %eax
	movl	%esi, %r8d
	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	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"%s"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"\nAC x %d\nWA x %d\nTLE x %d\nRE x %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	movl	$0, 12(%rsp)
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	32(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$87, %al
	je	.L14
	cmpb	$84, %al
	je	.L15
	cmpb	$82, %al
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %ebx
.L7:
	addl	$1, %r15d
	cmpl	%r15d, 28(%rsp)
	jle	.L2
.L8:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %eax
	cmpb	$65, %al
	jne	.L3
	addl	$1, %r13d
	addl	$1, %r15d
	cmpl	%r15d, 28(%rsp)
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L2:
	movl	12(%rsp), %r8d
	xorl	%eax, %eax
	movl	%ebx, %r9d
	movl	%r14d, %ecx
	movl	%r13d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	addl	$1, %r14d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, 12(%rsp)
	jmp	.L7
.L10:
	movl	$0, 12(%rsp)
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%s"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"\nAC x %d\nWA x %d\nTLE x %d\nRE x %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	movl	$0, 12(%rsp)
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	32(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$87, %al
	je	.L14
	cmpb	$84, %al
	je	.L15
	cmpb	$82, %al
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %ebx
.L7:
	addl	$1, %r15d
	cmpl	%r15d, 28(%rsp)
	jle	.L2
.L8:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %eax
	cmpb	$65, %al
	jne	.L3
	addl	$1, %r13d
	addl	$1, %r15d
	cmpl	%r15d, 28(%rsp)
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L2:
	movl	12(%rsp), %r8d
	xorl	%eax, %eax
	movl	%ebx, %r9d
	movl	%r14d, %ecx
	movl	%r13d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	addl	$1, %r14d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, 12(%rsp)
	jmp	.L7
.L10:
	movl	$0, 12(%rsp)
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
 
int main(){
	int N, AC=0,WA=0,TLE=0,RE=0;
	scanf("%d", &N);
	for(int i=0;i<N;i++){
		char S[100];
		scanf("%s", &S);
		if (S[0]=='A'){
			AC+=1;
			continue;
		}
		else if (S[0]=='W'){
			WA++;
			continue;
		}
		else if (S[0]=='T'){
			TLE++;
			continue;
		}
		else if (S[0]=='R'){
			RE++;
			continue;
		}	
	}
	printf("\nAC x %d\nWA x %d\nTLE x %d\nRE x %d\n", AC,WA,TLE,RE);
	return 0;
}
6
AC
TLE
AC
AC
WA
TLE
 6
AC
TLE
AC
AC
WA
TLE
 10
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC


AC x 3
WA x 1
TLE x 2
RE x 0
 
AC x 3
WA x 1
TLE x 2
RE x 0
 
AC x 10
WA x 0
TLE x 0
RE x 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>
 
int main(){
	int N, AC=0,WA=0,TLE=0,RE=0;
	scanf("%d", &N);
	for(int i=0;i<N;i++){
		char S[100];
		scanf("%s", &S);
		if (S[0]=='A'){
			AC+=1;
			continue;
		}
		else if (S[0]=='W'){
			WA++;
			continue;
		}
		else if (S[0]=='T'){
			TLE++;
			continue;
		}
		else if (S[0]=='R'){
			RE++;
			continue;
		}	
	}
	printf("\nAC x %d\nWA x %d\nTLE x %d\nRE x %d\n", AC,WA,TLE,RE);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.align 8
.LC2:
	.string	"\nAC x %d\nWA x %d\nTLE x %d\nRE x %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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -116(%rbp)
	jmp	.L2
.L9:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-112(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	addl	$1, -132(%rbp)
	jmp	.L8
.L3:
	movzbl	-112(%rbp), %eax
	cmpb	$87, %al
	jne	.L5
	addl	$1, -128(%rbp)
	jmp	.L8
.L5:
	movzbl	-112(%rbp), %eax
	cmpb	$84, %al
	jne	.L6
	addl	$1, -124(%rbp)
	jmp	.L8
.L6:
	movzbl	-112(%rbp), %eax
	cmpb	$82, %al
	jne	.L8
	addl	$1, -120(%rbp)
	nop
.L8:
	addl	$1, -116(%rbp)
.L2:
	movl	-136(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L9
	movl	-120(%rbp), %esi
	movl	-124(%rbp), %ecx
	movl	-128(%rbp), %edx
	movl	-132(%rbp), %eax
	movl	%esi, %r8d
	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	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"%s"
	.align 8
.LC2:
	.string	"\nAC x %d\nWA x %d\nTLE x %d\nRE x %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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -116(%rbp)
	jmp	.L2
.L9:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-112(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	addl	$1, -132(%rbp)
	jmp	.L8
.L3:
	movzbl	-112(%rbp), %eax
	cmpb	$87, %al
	jne	.L5
	addl	$1, -128(%rbp)
	jmp	.L8
.L5:
	movzbl	-112(%rbp), %eax
	cmpb	$84, %al
	jne	.L6
	addl	$1, -124(%rbp)
	jmp	.L8
.L6:
	movzbl	-112(%rbp), %eax
	cmpb	$82, %al
	jne	.L8
	addl	$1, -120(%rbp)
	nop
.L8:
	addl	$1, -116(%rbp)
.L2:
	movl	-136(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L9
	movl	-120(%rbp), %esi
	movl	-124(%rbp), %ecx
	movl	-128(%rbp), %edx
	movl	-132(%rbp), %eax
	movl	%esi, %r8d
	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	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
