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>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>
int main(){
    int n,m,i,ans=0,penal=0,pen[100010]={},flag[100010]={},p[100010]={};
    char s[100010][2]={{}};
    scanf("%d %d",&n,&m);
    for(i=0; i<m; i++){
        scanf("%d %s",&p[i],s[i]);
        if(s[i][0]=='A'){
            if(flag[p[i]]==0)ans++;
            flag[p[i]]=1;
        }
        if(flag[p[i]]==0 && s[i][0]=='W')pen[p[i]]++;
    }
    for(i=0; i<=n; i++){
        if(flag[i]==0)pen[i]=0;
        penal+=pen[i];
    }
    printf("%d %d",ans,penal);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-1396736(%rsp), %r11
	.cfi_def_cfa 11, 1396792
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3480, %rsp
	.cfi_def_cfa_offset 1400272
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%r14d, %r14d
	movq	%fs:40, %rax
	movq	%rax, 1400200(%rsp)
	xorl	%eax, %eax
	leaq	200064(%rsp), %rax
	leaq	1000160(%rsp), %r12
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	call	memset@PLT
	leaq	600112(%rsp), %rax
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	$200020, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	28(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L2
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r15
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	(%r12), %rdx
	movl	600112(%rsp,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L5
	cmpb	$87, %al
	jne	.L5
	addl	$1, 200064(%rsp,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %ebx
	addq	$4, %r12
	addq	$2, %rbp
	cmpl	%ebx, 28(%rsp)
	jle	.L2
.L6:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	0(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	movslq	(%r12), %rax
	cmpl	$1, 600112(%rsp,%rax,4)
	movl	$1, 600112(%rsp,%rax,4)
	adcl	$0, %r14d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	24(%rsp), %rdx
	testl	%edx, %edx
	js	.L13
	movq	8(%rsp), %rax
	movq	(%rsp), %r12
	leaq	600116(%rsp,%rdx,4), %rdx
	xorl	%ecx, %ecx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$4, %rax
	addl	(%r12), %ecx
	addq	$4, %r12
	cmpq	%rdx, %rax
	je	.L7
.L10:
	movl	(%rax), %esi
	testl	%esi, %esi
	jne	.L24
	addq	$4, %rax
	movl	$0, (%r12)
	addq	$4, %r12
	cmpq	%rdx, %rax
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1400200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1400216, %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
.L13:
	.cfi_restore_state
	xorl	%ecx, %ecx
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 %d"
.LC1:
	.string	"%d %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-1396736(%rsp), %r11
	.cfi_def_cfa 11, 1396792
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3480, %rsp
	.cfi_def_cfa_offset 1400272
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%r14d, %r14d
	movq	%fs:40, %rax
	movq	%rax, 1400200(%rsp)
	xorl	%eax, %eax
	leaq	200064(%rsp), %rax
	leaq	1000160(%rsp), %r12
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	call	memset@PLT
	leaq	600112(%rsp), %rax
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	$200020, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	28(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L2
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r15
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	(%r12), %rdx
	movl	600112(%rsp,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L5
	cmpb	$87, %al
	jne	.L5
	addl	$1, 200064(%rsp,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %ebx
	addq	$4, %r12
	addq	$2, %rbp
	cmpl	%ebx, 28(%rsp)
	jle	.L2
.L6:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	0(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	movslq	(%r12), %rax
	cmpl	$1, 600112(%rsp,%rax,4)
	movl	$1, 600112(%rsp,%rax,4)
	adcl	$0, %r14d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	24(%rsp), %rdx
	testl	%edx, %edx
	js	.L13
	movq	8(%rsp), %rax
	movq	(%rsp), %r12
	leaq	600116(%rsp,%rdx,4), %rdx
	xorl	%ecx, %ecx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$4, %rax
	addl	(%r12), %ecx
	addq	$4, %r12
	cmpq	%rdx, %rax
	je	.L7
.L10:
	movl	(%rax), %esi
	testl	%esi, %esi
	jne	.L24
	addq	$4, %rax
	movl	$0, (%r12)
	addq	$4, %r12
	cmpq	%rdx, %rax
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1400200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1400216, %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
.L13:
	.cfi_restore_state
	xorl	%ecx, %ecx
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 %d"
.LC1:
	.string	"%d %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-1396736(%rsp), %r11
	.cfi_def_cfa 11, 1396792
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3480, %rsp
	.cfi_def_cfa_offset 1400272
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%r14d, %r14d
	movq	%fs:40, %rax
	movq	%rax, 1400200(%rsp)
	xorl	%eax, %eax
	leaq	200064(%rsp), %rax
	leaq	1000160(%rsp), %r12
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	call	memset@PLT
	leaq	600112(%rsp), %rax
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	$200020, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	28(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L2
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r15
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	(%r12), %rdx
	movl	600112(%rsp,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L5
	cmpb	$87, %al
	jne	.L5
	addl	$1, 200064(%rsp,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %ebx
	addq	$4, %r12
	addq	$2, %rbp
	cmpl	%ebx, 28(%rsp)
	jle	.L2
.L6:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	0(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	movslq	(%r12), %rax
	cmpl	$1, 600112(%rsp,%rax,4)
	movl	$1, 600112(%rsp,%rax,4)
	adcl	$0, %r14d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	24(%rsp), %rdx
	testl	%edx, %edx
	js	.L13
	movq	8(%rsp), %rax
	movq	(%rsp), %r12
	leaq	600116(%rsp,%rdx,4), %rdx
	xorl	%ecx, %ecx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$4, %rax
	addl	(%r12), %ecx
	addq	$4, %r12
	cmpq	%rdx, %rax
	je	.L7
.L10:
	movl	(%rax), %esi
	testl	%esi, %esi
	jne	.L24
	addq	$4, %rax
	movl	$0, (%r12)
	addq	$4, %r12
	cmpq	%rdx, %rax
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1400200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1400216, %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
.L13:
	.cfi_restore_state
	xorl	%ecx, %ecx
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>
int main(){
    int n,m,i,ans=0,penal=0,pen[100010]={},flag[100010]={},p[100010]={};
    char s[100010][2]={{}};
    scanf("%d %d",&n,&m);
    for(i=0; i<m; i++){
        scanf("%d %s",&p[i],s[i]);
        if(s[i][0]=='A'){
            if(flag[p[i]]==0)ans++;
            flag[p[i]]=1;
        }
        if(flag[p[i]]==0 && s[i][0]=='W')pen[p[i]]++;
    }
    for(i=0; i<=n; i++){
        if(flag[i]==0)pen[i]=0;
        penal+=pen[i];
    }
    printf("%d %d",ans,penal);
    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>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>
int main(){
    int n,m,i,ans=0,penal=0,pen[100010]={},flag[100010]={},p[100010]={};
    char s[100010][2]={{}};
    scanf("%d %d",&n,&m);
    for(i=0; i<m; i++){
        scanf("%d %s",&p[i],s[i]);
        if(s[i][0]=='A'){
            if(flag[p[i]]==0)ans++;
            flag[p[i]]=1;
        }
        if(flag[p[i]]==0 && s[i][0]=='W')pen[p[i]]++;
    }
    for(i=0; i<=n; i++){
        if(flag[i]==0)pen[i]=0;
        penal+=pen[i];
    }
    printf("%d %d",ans,penal);
    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:

100000 3
7777 AC
7777 AC
7777 CA
 100000 3
12676 AC
7777 AC
7777 CA
 1 0
 4 5
1 WA
1 AC
2 WA
2 AC
2 WA
 4 5
1 WA
1 AC
0 WA
2 AC
2 WA
 100000 3
6234 AC
7777 AC
7777 AC
 2 0
 2 -1
 2 -2
 2 -4

1 0 2 0 0 0 2 2 2 1 2 0 0 0 0 0 0 0 0 0
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>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>
int main(){
    int n,m,i,ans=0,penal=0,pen[100010]={},flag[100010]={},p[100010]={};
    char s[100010][2]={{}};
    scanf("%d %d",&n,&m);
    for(i=0; i<m; i++){
        scanf("%d %s",&p[i],s[i]);
        if(s[i][0]=='A'){
            if(flag[p[i]]==0)ans++;
            flag[p[i]]=1;
        }
        if(flag[p[i]]==0 && s[i][0]=='W')pen[p[i]]++;
    }
    for(i=0; i<=n; i++){
        if(flag[i]==0)pen[i]=0;
        penal+=pen[i];
    }
    printf("%d %d",ans,penal);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-1396736(%rsp), %r11
	.cfi_def_cfa 11, 1396792
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3480, %rsp
	.cfi_def_cfa_offset 1400272
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%r14d, %r14d
	movq	%fs:40, %rax
	movq	%rax, 1400200(%rsp)
	xorl	%eax, %eax
	leaq	200064(%rsp), %rax
	leaq	1000160(%rsp), %r12
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	call	memset@PLT
	leaq	600112(%rsp), %rax
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	$200020, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	28(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L2
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r15
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	(%r12), %rdx
	movl	600112(%rsp,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L5
	cmpb	$87, %al
	jne	.L5
	addl	$1, 200064(%rsp,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %ebx
	addq	$4, %r12
	addq	$2, %rbp
	cmpl	%ebx, 28(%rsp)
	jle	.L2
.L6:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	0(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	movslq	(%r12), %rax
	cmpl	$1, 600112(%rsp,%rax,4)
	movl	$1, 600112(%rsp,%rax,4)
	adcl	$0, %r14d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	24(%rsp), %rdx
	testl	%edx, %edx
	js	.L13
	movq	8(%rsp), %rax
	movq	(%rsp), %r12
	leaq	600116(%rsp,%rdx,4), %rdx
	xorl	%ecx, %ecx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$4, %rax
	addl	(%r12), %ecx
	addq	$4, %r12
	cmpq	%rdx, %rax
	je	.L7
.L10:
	movl	(%rax), %esi
	testl	%esi, %esi
	jne	.L24
	addq	$4, %rax
	movl	$0, (%r12)
	addq	$4, %r12
	cmpq	%rdx, %rax
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1400200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1400216, %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
.L13:
	.cfi_restore_state
	xorl	%ecx, %ecx
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 %d"
.LC1:
	.string	"%d %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-1396736(%rsp), %r11
	.cfi_def_cfa 11, 1396792
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3480, %rsp
	.cfi_def_cfa_offset 1400272
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%r14d, %r14d
	movq	%fs:40, %rax
	movq	%rax, 1400200(%rsp)
	xorl	%eax, %eax
	leaq	200064(%rsp), %rax
	leaq	1000160(%rsp), %r12
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	call	memset@PLT
	leaq	600112(%rsp), %rax
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	movl	$400040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	$200020, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	28(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L2
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r15
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	(%r12), %rdx
	movl	600112(%rsp,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L5
	cmpb	$87, %al
	jne	.L5
	addl	$1, 200064(%rsp,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %ebx
	addq	$4, %r12
	addq	$2, %rbp
	cmpl	%ebx, 28(%rsp)
	jle	.L2
.L6:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	0(%rbp), %eax
	cmpb	$65, %al
	jne	.L3
	movslq	(%r12), %rax
	cmpl	$1, 600112(%rsp,%rax,4)
	movl	$1, 600112(%rsp,%rax,4)
	adcl	$0, %r14d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	24(%rsp), %rdx
	testl	%edx, %edx
	js	.L13
	movq	8(%rsp), %rax
	movq	(%rsp), %r12
	leaq	600116(%rsp,%rdx,4), %rdx
	xorl	%ecx, %ecx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$4, %rax
	addl	(%r12), %ecx
	addq	$4, %r12
	cmpq	%rdx, %rax
	je	.L7
.L10:
	movl	(%rax), %esi
	testl	%esi, %esi
	jne	.L24
	addq	$4, %rax
	movl	$0, (%r12)
	addq	$4, %r12
	cmpq	%rdx, %rax
	jne	.L10
.L7:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1400200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1400216, %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
.L13:
	.cfi_restore_state
	xorl	%ecx, %ecx
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```