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 <stdlib.h>
 
typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
 
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
 
 
SINT32 main() {
    SINT32 n,q;
    scanf("%d%d",&n,&q);
 
 
    SINT32 kazu[200001] = {0};
    SINT8 s[200001] = {'0'};
 
    SINT8 t[200001] = {'0'};
    SINT8 d[200001] = {'0'};
 
    scanf("%s",s);
 
    for (SINT32 i = 0; i < q; i++) {
        scanf("%s%s",&t[i],&d[i]);
    }



    SINT32 count = 0;
    SINT32 count2 = 0;
    SINT32 r = n - 1;

    for (SINT32 i = q-1; i >= 0; i--) {
        if (d[i] == 'R') {
            if (s[count-1] == t[i]) {
                count--;
            }
            if (s[r] == t[i]) {
                r--;
            }

        } else {
            if (s[r+1] == t[i]) {
                r++;
            }
            if (s[count] == t[i]) {
                count++;
            }
        }
 //       printf("%d %d\n",count,r);
    }





    if (r < 1) {count2 = 0;}
    else {count2 = r-count+1;}
 
    printf("%d\n",count2);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%s"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1396736(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1400088(%rbp), %rdx
	leaq	-1400092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1400064(%rbp), %rax
	movl	$800004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -600048(%rbp)
	movq	$0, -600040(%rbp)
	leaq	-600032(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -400032(%rbp)
	movq	$0, -400024(%rbp)
	leaq	-400016(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -200016(%rbp)
	movq	$0, -200008(%rbp)
	leaq	-200000(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1400084(%rbp)
	jmp	.L2
.L3:
	leaq	-200016(%rbp), %rdx
	movl	-1400084(%rbp), %eax
	cltq
	addq	%rax, %rdx
	leaq	-400032(%rbp), %rcx
	movl	-1400084(%rbp), %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1400084(%rbp)
.L2:
	movl	-1400088(%rbp), %eax
	cmpl	%eax, -1400084(%rbp)
	jl	.L3
	movl	$0, -1400080(%rbp)
	movl	$0, -1400076(%rbp)
	movl	-1400092(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1400072(%rbp)
	movl	-1400088(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1400068(%rbp)
	jmp	.L4
.L9:
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L5
	movl	-1400080(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L6
	subl	$1, -1400080(%rbp)
.L6:
	movl	-1400072(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	subl	$1, -1400072(%rbp)
	jmp	.L7
.L5:
	movl	-1400072(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L8
	addl	$1, -1400072(%rbp)
.L8:
	movl	-1400080(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	addl	$1, -1400080(%rbp)
.L7:
	subl	$1, -1400068(%rbp)
.L4:
	cmpl	$0, -1400068(%rbp)
	jns	.L9
	cmpl	$0, -1400072(%rbp)
	jg	.L10
	movl	$0, -1400076(%rbp)
	jmp	.L11
.L10:
	movl	-1400072(%rbp), %eax
	subl	-1400080(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1400076(%rbp)
.L11:
	movl	-1400076(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%s"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-598016(%rsp), %r11
	.cfi_def_cfa 11, 598056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2056, %rsp
	.cfi_def_cfa_offset 600112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 600056(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rdi
	movl	$199985, %edx
	xorl	%esi, %esi
	movq	$48, 16(%rsp)
	movq	$0, 24(%rsp)
	call	memset@PLT
	leaq	200048(%rsp), %rdi
	movl	$199985, %edx
	xorl	%esi, %esi
	movq	$48, 200032(%rsp)
	movq	$0, 200040(%rsp)
	call	memset@PLT
	leaq	400064(%rsp), %rdi
	movl	$199985, %edx
	xorl	%esi, %esi
	movq	$48, 400048(%rsp)
	movq	$0, 400056(%rsp)
	call	memset@PLT
	leaq	16(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	400048(%rsp), %r12
	leaq	200032(%rsp), %rbp
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx), %rdx
	leaq	0(%rbp,%rbx), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	8(%rsp), %ecx
	subl	$1, %ecx
	subl	$1, %eax
	js	.L12
	cltq
	xorl	%esi, %esi
	leaq	400048(%rsp), %r12
	leaq	200032(%rsp), %rbp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	leal	1(%rcx), %edi
	movslq	%edi, %r8
	cmpb	%dl, 16(%rsp,%r8)
	cmove	%edi, %ecx
	movslq	%esi, %rdi
	cmpb	%dl, 16(%rsp,%rdi)
	jne	.L7
	addl	$1, %esi
.L7:
	subq	$1, %rax
	testl	%eax, %eax
	js	.L4
.L9:
	cmpb	$82, (%r12,%rax)
	movzbl	0(%rbp,%rax), %edx
	jne	.L5
	leal	-1(%rsi), %edi
	movslq	%edi, %r8
	cmpb	%dl, 16(%rsp,%r8)
	cmove	%edi, %esi
	movslq	%ecx, %rdi
	cmpb	%dl, 16(%rsp,%rdi)
	jne	.L7
	subq	$1, %rax
	subl	$1, %ecx
	testl	%eax, %eax
	jns	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	subl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	addl	$1, %edx
	testl	%ecx, %ecx
	cmovle	%eax, %edx
	call	__printf_chk@PLT
	movq	600056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$600072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%esi, %esi
	jmp	.L4
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%s"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-598016(%rsp), %r11
	.cfi_def_cfa 11, 598056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2056, %rsp
	.cfi_def_cfa_offset 600112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 600056(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rdi
	movl	$199985, %edx
	xorl	%esi, %esi
	movq	$48, 16(%rsp)
	movq	$0, 24(%rsp)
	call	memset@PLT
	leaq	200048(%rsp), %rdi
	movl	$199985, %edx
	xorl	%esi, %esi
	movq	$48, 200032(%rsp)
	movq	$0, 200040(%rsp)
	call	memset@PLT
	leaq	400064(%rsp), %rdi
	movl	$199985, %edx
	xorl	%esi, %esi
	movq	$48, 400048(%rsp)
	movq	$0, 400056(%rsp)
	call	memset@PLT
	leaq	16(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	400048(%rsp), %r12
	leaq	200032(%rsp), %rbp
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx), %rdx
	leaq	0(%rbp,%rbx), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	8(%rsp), %ecx
	subl	$1, %ecx
	subl	$1, %eax
	js	.L12
	cltq
	xorl	%esi, %esi
	leaq	400048(%rsp), %r12
	leaq	200032(%rsp), %rbp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	leal	1(%rcx), %edi
	movslq	%edi, %r8
	cmpb	%dl, 16(%rsp,%r8)
	cmove	%edi, %ecx
	movslq	%esi, %rdi
	cmpb	%dl, 16(%rsp,%rdi)
	jne	.L7
	addl	$1, %esi
.L7:
	subq	$1, %rax
	testl	%eax, %eax
	js	.L4
.L9:
	cmpb	$82, (%r12,%rax)
	movzbl	0(%rbp,%rax), %edx
	jne	.L5
	leal	-1(%rsi), %edi
	movslq	%edi, %r8
	cmpb	%dl, 16(%rsp,%r8)
	cmove	%edi, %esi
	movslq	%ecx, %rdi
	cmpb	%dl, 16(%rsp,%rdi)
	jne	.L7
	subq	$1, %rax
	subl	$1, %ecx
	testl	%eax, %eax
	jns	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	subl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	addl	$1, %edx
	testl	%ecx, %ecx
	cmovle	%eax, %edx
	call	__printf_chk@PLT
	movq	600056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$600072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%esi, %esi
	jmp	.L4
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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 <stdlib.h>
 
typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
 
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
 
 
SINT32 main() {
    SINT32 n,q;
    scanf("%d%d",&n,&q);
 
 
    SINT32 kazu[200001] = {0};
    SINT8 s[200001] = {'0'};
 
    SINT8 t[200001] = {'0'};
    SINT8 d[200001] = {'0'};
 
    scanf("%s",s);
 
    for (SINT32 i = 0; i < q; i++) {
        scanf("%s%s",&t[i],&d[i]);
    }



    SINT32 count = 0;
    SINT32 count2 = 0;
    SINT32 r = n - 1;

    for (SINT32 i = q-1; i >= 0; i--) {
        if (d[i] == 'R') {
            if (s[count-1] == t[i]) {
                count--;
            }
            if (s[r] == t[i]) {
                r--;
            }

        } else {
            if (s[r+1] == t[i]) {
                r++;
            }
            if (s[count] == t[i]) {
                count++;
            }
        }
 //       printf("%d %d\n",count,r);
    }





    if (r < 1) {count2 = 0;}
    else {count2 = r-count+1;}
 
    printf("%d\n",count2);
	return 0;
}

10 15
SNCZWRCEWB
B R
R R
E R
W R
Z L
S R
Q L
W L
B R
C L
A L
N L
E R
Z L
R L
 3 4
ACB
A L
B L
B R
A R
 8 3
AABBBDBA
A L
B R
A R
 3 3
ACB
B L
B L
A R
@ S
 3 3
BCA
B L
B L
A R
@ S
 8 0
AABCBDBA
A L
B R
@ S
 8 3
AABCBDBA
C L
B R
A R
 10 15
BWECRWZCNS
B R
R R
E R
W R
Z L
S R
Q L
W L
B R
C L
A L
N L
E R
Z L
R L
 10 0
SNCZWRCEWB
B R
R R
E R
X R
Z L
S R
Q L
W L
B R
C L
B L
N L
E R
Z L
S L
 3 4
CBB
A L
C L
B R
B R

7
 2
 5
 3
 1
 8
 6
 9
 10
 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 <stdlib.h>
 
typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
 
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
 
 
SINT32 main() {
    SINT32 n,q;
    scanf("%d%d",&n,&q);
 
 
    SINT32 kazu[200001] = {0};
    SINT8 s[200001] = {'0'};
 
    SINT8 t[200001] = {'0'};
    SINT8 d[200001] = {'0'};
 
    scanf("%s",s);
 
    for (SINT32 i = 0; i < q; i++) {
        scanf("%s%s",&t[i],&d[i]);
    }



    SINT32 count = 0;
    SINT32 count2 = 0;
    SINT32 r = n - 1;

    for (SINT32 i = q-1; i >= 0; i--) {
        if (d[i] == 'R') {
            if (s[count-1] == t[i]) {
                count--;
            }
            if (s[r] == t[i]) {
                r--;
            }

        } else {
            if (s[r+1] == t[i]) {
                r++;
            }
            if (s[count] == t[i]) {
                count++;
            }
        }
 //       printf("%d %d\n",count,r);
    }





    if (r < 1) {count2 = 0;}
    else {count2 = r-count+1;}
 
    printf("%d\n",count2);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%s"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1396736(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1400088(%rbp), %rdx
	leaq	-1400092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1400064(%rbp), %rax
	movl	$800004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -600048(%rbp)
	movq	$0, -600040(%rbp)
	leaq	-600032(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -400032(%rbp)
	movq	$0, -400024(%rbp)
	leaq	-400016(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -200016(%rbp)
	movq	$0, -200008(%rbp)
	leaq	-200000(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1400084(%rbp)
	jmp	.L2
.L3:
	leaq	-200016(%rbp), %rdx
	movl	-1400084(%rbp), %eax
	cltq
	addq	%rax, %rdx
	leaq	-400032(%rbp), %rcx
	movl	-1400084(%rbp), %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1400084(%rbp)
.L2:
	movl	-1400088(%rbp), %eax
	cmpl	%eax, -1400084(%rbp)
	jl	.L3
	movl	$0, -1400080(%rbp)
	movl	$0, -1400076(%rbp)
	movl	-1400092(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1400072(%rbp)
	movl	-1400088(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1400068(%rbp)
	jmp	.L4
.L9:
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L5
	movl	-1400080(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L6
	subl	$1, -1400080(%rbp)
.L6:
	movl	-1400072(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	subl	$1, -1400072(%rbp)
	jmp	.L7
.L5:
	movl	-1400072(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L8
	addl	$1, -1400072(%rbp)
.L8:
	movl	-1400080(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	addl	$1, -1400080(%rbp)
.L7:
	subl	$1, -1400068(%rbp)
.L4:
	cmpl	$0, -1400068(%rbp)
	jns	.L9
	cmpl	$0, -1400072(%rbp)
	jg	.L10
	movl	$0, -1400076(%rbp)
	jmp	.L11
.L10:
	movl	-1400072(%rbp), %eax
	subl	-1400080(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1400076(%rbp)
.L11:
	movl	-1400076(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%s%s"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1396736(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1400088(%rbp), %rdx
	leaq	-1400092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1400064(%rbp), %rax
	movl	$800004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -600048(%rbp)
	movq	$0, -600040(%rbp)
	leaq	-600032(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -400032(%rbp)
	movq	$0, -400024(%rbp)
	leaq	-400016(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$48, -200016(%rbp)
	movq	$0, -200008(%rbp)
	leaq	-200000(%rbp), %rax
	movl	$199985, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1400084(%rbp)
	jmp	.L2
.L3:
	leaq	-200016(%rbp), %rdx
	movl	-1400084(%rbp), %eax
	cltq
	addq	%rax, %rdx
	leaq	-400032(%rbp), %rcx
	movl	-1400084(%rbp), %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1400084(%rbp)
.L2:
	movl	-1400088(%rbp), %eax
	cmpl	%eax, -1400084(%rbp)
	jl	.L3
	movl	$0, -1400080(%rbp)
	movl	$0, -1400076(%rbp)
	movl	-1400092(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1400072(%rbp)
	movl	-1400088(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1400068(%rbp)
	jmp	.L4
.L9:
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L5
	movl	-1400080(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L6
	subl	$1, -1400080(%rbp)
.L6:
	movl	-1400072(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	subl	$1, -1400072(%rbp)
	jmp	.L7
.L5:
	movl	-1400072(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L8
	addl	$1, -1400072(%rbp)
.L8:
	movl	-1400080(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %edx
	movl	-1400068(%rbp), %eax
	cltq
	movzbl	-400032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	addl	$1, -1400080(%rbp)
.L7:
	subl	$1, -1400068(%rbp)
.L4:
	cmpl	$0, -1400068(%rbp)
	jns	.L9
	cmpl	$0, -1400072(%rbp)
	jg	.L10
	movl	$0, -1400076(%rbp)
	jmp	.L11
.L10:
	movl	-1400072(%rbp), %eax
	subl	-1400080(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1400076(%rbp)
.L11:
	movl	-1400076(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
