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 <math.h>
#include <stdbool.h>

int main() {
	int n,k,r,s,p;
	int ans=0;
	char t[100001]={};
	scanf("%d%d%d%d%d", &n, &k, &r, &s, &p);
	scanf("%s", t);
	int cmpt[200001]={};
	for (int i = 0; i < n; i++) {
		if(t[i]=='r')
		cmpt[i]=0;
		else if(t[i]=='s')
		cmpt[i]=1;
		else if(t[i]=='p')
		cmpt[i]=2;
	}
	for (int i = 0; i < n; i++) {
		if(cmpt[i]==cmpt[i+k]){
			cmpt[i+k]=-1;
		}
		switch (cmpt[i]) {
			case 0:
			ans+=p;
			break;
			case 1:
			ans+=r;
			break;
			case 2:
			ans+=s;
			break;
			default:
			break;
		}
	}
	printf("%d\n", ans);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-897024(%rsp), %r11
	.cfi_def_cfa 11, 897040
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3040, %rsp
	.cfi_def_cfa_offset 900080
	pxor	%xmm0, %xmm0
	movl	$99985, %edx
	xorl	%esi, %esi
	leaq	800064(%rsp), %rdi
	leaq	800048(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 900056(%rsp)
	xorl	%eax, %eax
	movaps	%xmm0, 800048(%rsp)
	call	memset@PLT
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	xorl	%eax, %eax
	leaq	28(%rsp), %r9
	leaq	24(%rsp), %r8
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$800004, %edx
	leaq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L13
	subl	$1, %edx
	movq	%rbx, %rcx
	leaq	36(%rsp,%rdx,4), %rdi
	movq	%rax, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$115, %sil
	je	.L18
	cmpb	$112, %sil
	jne	.L4
	movl	$2, (%rdx)
.L4:
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	je	.L19
.L6:
	movzbl	(%rcx), %esi
	cmpb	$114, %sil
	jne	.L3
	movl	$0, (%rdx)
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	jne	.L6
.L19:
	movl	24(%rsp), %ebx
	movl	20(%rsp), %r11d
	xorl	%r8d, %r8d
	movl	$-1, %r9d
	movl	28(%rsp), %r10d
	movslq	16(%rsp), %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	leal	(%r8,%r10), %esi
	testl	%edx, %edx
	cmove	%esi, %r8d
.L10:
	addq	$4, %rax
	cmpq	%rdi, %rax
	je	.L2
.L11:
	movl	(%rax,%rcx,4), %edx
	cmpl	%edx, (%rax)
	cmove	%r9d, %edx
	movl	%edx, (%rax,%rcx,4)
	movl	(%rax), %edx
	cmpl	$1, %edx
	je	.L8
	cmpl	$2, %edx
	jne	.L20
	addq	$4, %rax
	addl	%ebx, %r8d
	cmpq	%rdi, %rax
	jne	.L11
.L2:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	900056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$900064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movl	$1, (%rdx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	addl	%r11d, %r8d
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
	jmp	.L2
.L21:
	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:
```

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%d%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-897024(%rsp), %r11
	.cfi_def_cfa 11, 897040
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3040, %rsp
	.cfi_def_cfa_offset 900080
	pxor	%xmm0, %xmm0
	movl	$99985, %edx
	xorl	%esi, %esi
	leaq	800064(%rsp), %rdi
	leaq	800048(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 900056(%rsp)
	xorl	%eax, %eax
	movaps	%xmm0, 800048(%rsp)
	call	memset@PLT
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	xorl	%eax, %eax
	leaq	28(%rsp), %r9
	leaq	24(%rsp), %r8
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$800004, %edx
	leaq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L13
	subl	$1, %edx
	movq	%rbx, %rcx
	leaq	36(%rsp,%rdx,4), %rdi
	movq	%rax, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$115, %sil
	je	.L18
	cmpb	$112, %sil
	jne	.L4
	movl	$2, (%rdx)
.L4:
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	je	.L19
.L6:
	movzbl	(%rcx), %esi
	cmpb	$114, %sil
	jne	.L3
	movl	$0, (%rdx)
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	jne	.L6
.L19:
	movl	24(%rsp), %ebx
	movl	20(%rsp), %r11d
	xorl	%r8d, %r8d
	movl	$-1, %r9d
	movl	28(%rsp), %r10d
	movslq	16(%rsp), %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	leal	(%r8,%r10), %esi
	testl	%edx, %edx
	cmove	%esi, %r8d
.L10:
	addq	$4, %rax
	cmpq	%rdi, %rax
	je	.L2
.L11:
	movl	(%rax,%rcx,4), %edx
	cmpl	%edx, (%rax)
	cmove	%r9d, %edx
	movl	%edx, (%rax,%rcx,4)
	movl	(%rax), %edx
	cmpl	$1, %edx
	je	.L8
	cmpl	$2, %edx
	jne	.L20
	addq	$4, %rax
	addl	%ebx, %r8d
	cmpq	%rdi, %rax
	jne	.L11
.L2:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	900056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$900064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movl	$1, (%rdx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	addl	%r11d, %r8d
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
	jmp	.L2
.L21:
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-897024(%rsp), %r11
	.cfi_def_cfa 11, 897040
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3040, %rsp
	.cfi_def_cfa_offset 900080
	pxor	%xmm0, %xmm0
	movl	$99985, %edx
	xorl	%esi, %esi
	leaq	800064(%rsp), %rdi
	leaq	800048(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 900056(%rsp)
	xorl	%eax, %eax
	movaps	%xmm0, 800048(%rsp)
	call	memset@PLT
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	xorl	%eax, %eax
	leaq	28(%rsp), %r9
	leaq	24(%rsp), %r8
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$800004, %edx
	leaq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L13
	subl	$1, %edx
	movq	%rbx, %rcx
	leaq	36(%rsp,%rdx,4), %rdi
	movq	%rax, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$115, %sil
	je	.L18
	cmpb	$112, %sil
	jne	.L4
	movl	$2, (%rdx)
.L4:
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	je	.L19
.L6:
	movzbl	(%rcx), %esi
	cmpb	$114, %sil
	jne	.L3
	movl	$0, (%rdx)
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	jne	.L6
.L19:
	movl	24(%rsp), %ebx
	movl	20(%rsp), %r11d
	xorl	%r8d, %r8d
	movl	$-1, %r9d
	movl	28(%rsp), %r10d
	movslq	16(%rsp), %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	leal	(%r8,%r10), %esi
	testl	%edx, %edx
	cmove	%esi, %r8d
.L10:
	addq	$4, %rax
	cmpq	%rdi, %rax
	je	.L2
.L11:
	movl	(%rax,%rcx,4), %edx
	cmpl	%edx, (%rax)
	cmove	%r9d, %edx
	movl	%edx, (%rax,%rcx,4)
	movl	(%rax), %edx
	cmpl	$1, %edx
	je	.L8
	cmpl	$2, %edx
	jne	.L20
	addq	$4, %rax
	addl	%ebx, %r8d
	cmpq	%rdi, %rax
	jne	.L11
.L2:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	900056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$900064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movl	$1, (%rdx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	addl	%r11d, %r8d
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
	jmp	.L2
.L21:
	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:
```
```c
#include <stdio.h>
#include <math.h>
#include <stdbool.h>

int main() {
	int n,k,r,s,p;
	int ans=0;
	char t[100001]={};
	scanf("%d%d%d%d%d", &n, &k, &r, &s, &p);
	scanf("%s", t);
	int cmpt[200001]={};
	for (int i = 0; i < n; i++) {
		if(t[i]=='r')
		cmpt[i]=0;
		else if(t[i]=='s')
		cmpt[i]=1;
		else if(t[i]=='p')
		cmpt[i]=2;
	}
	for (int i = 0; i < n; i++) {
		if(cmpt[i]==cmpt[i+k]){
			cmpt[i+k]=-1;
		}
		switch (cmpt[i]) {
			case 0:
			ans+=p;
			break;
			case 1:
			ans+=r;
			break;
			case 2:
			ans+=s;
			break;
			default:
			break;
		}
	}
	printf("%d\n", ans);
	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 <math.h>
#include <stdbool.h>

int main() {
	int n,k,r,s,p;
	int ans=0;
	char t[100001]={};
	scanf("%d%d%d%d%d", &n, &k, &r, &s, &p);
	scanf("%s", t);
	int cmpt[200001]={};
	for (int i = 0; i < n; i++) {
		if(t[i]=='r')
		cmpt[i]=0;
		else if(t[i]=='s')
		cmpt[i]=1;
		else if(t[i]=='p')
		cmpt[i]=2;
	}
	for (int i = 0; i < n; i++) {
		if(cmpt[i]==cmpt[i+k]){
			cmpt[i+k]=-1;
		}
		switch (cmpt[i]) {
			case 0:
			ans+=p;
			break;
			case 1:
			ans+=r;
			break;
			case 2:
			ans+=s;
			break;
			default:
			break;
		}
	}
	printf("%d\n", ans);
	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:

30 6
325 234 123
rspsspspsrpspsppprpsprpssprpsr
 30 6
42 234 123
rspsspspsrpspsppprpsprpssprpsr
 30 6
30 234 123
rspsspspsrpspsppprpsprpssprpsr
 30 6
30 234 123
rspsspspsrpspsppprpsprpssprpss
 30 6
30 234 165
rspsspspsrpspsppprpsprpssprpss
 30 9
30 234 165
rspsspspsrpspsppprpsprpssprpss
 30 9
30 234 88
rspsspspsrpspsppprpsprpssprpss
 30 9
30 234 88
rrpsspspsrpspsppprpsprpssprpss
 30 9
30 234 21
rrpsspspsrpspsppprpsprpssprpss
 30 3
30 234 21
rrpsspspsrpspsppprpsprpssprpss

6328
 3498
 3378
 3255
 3465
 3135
 2904
 2962
 2694
 2502

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 <math.h>
#include <stdbool.h>

int main() {
	int n,k,r,s,p;
	int ans=0;
	char t[100001]={};
	scanf("%d%d%d%d%d", &n, &k, &r, &s, &p);
	scanf("%s", t);
	int cmpt[200001]={};
	for (int i = 0; i < n; i++) {
		if(t[i]=='r')
		cmpt[i]=0;
		else if(t[i]=='s')
		cmpt[i]=1;
		else if(t[i]=='p')
		cmpt[i]=2;
	}
	for (int i = 0; i < n; i++) {
		if(cmpt[i]==cmpt[i+k]){
			cmpt[i+k]=-1;
		}
		switch (cmpt[i]) {
			case 0:
			ans+=p;
			break;
			case 1:
			ans+=r;
			break;
			case 2:
			ans+=s;
			break;
			default:
			break;
		}
	}
	printf("%d\n", ans);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-897024(%rsp), %r11
	.cfi_def_cfa 11, 897040
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3040, %rsp
	.cfi_def_cfa_offset 900080
	pxor	%xmm0, %xmm0
	movl	$99985, %edx
	xorl	%esi, %esi
	leaq	800064(%rsp), %rdi
	leaq	800048(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 900056(%rsp)
	xorl	%eax, %eax
	movaps	%xmm0, 800048(%rsp)
	call	memset@PLT
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	xorl	%eax, %eax
	leaq	28(%rsp), %r9
	leaq	24(%rsp), %r8
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$800004, %edx
	leaq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L13
	subl	$1, %edx
	movq	%rbx, %rcx
	leaq	36(%rsp,%rdx,4), %rdi
	movq	%rax, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$115, %sil
	je	.L18
	cmpb	$112, %sil
	jne	.L4
	movl	$2, (%rdx)
.L4:
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	je	.L19
.L6:
	movzbl	(%rcx), %esi
	cmpb	$114, %sil
	jne	.L3
	movl	$0, (%rdx)
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	jne	.L6
.L19:
	movl	24(%rsp), %ebx
	movl	20(%rsp), %r11d
	xorl	%r8d, %r8d
	movl	$-1, %r9d
	movl	28(%rsp), %r10d
	movslq	16(%rsp), %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	leal	(%r8,%r10), %esi
	testl	%edx, %edx
	cmove	%esi, %r8d
.L10:
	addq	$4, %rax
	cmpq	%rdi, %rax
	je	.L2
.L11:
	movl	(%rax,%rcx,4), %edx
	cmpl	%edx, (%rax)
	cmove	%r9d, %edx
	movl	%edx, (%rax,%rcx,4)
	movl	(%rax), %edx
	cmpl	$1, %edx
	je	.L8
	cmpl	$2, %edx
	jne	.L20
	addq	$4, %rax
	addl	%ebx, %r8d
	cmpq	%rdi, %rax
	jne	.L11
.L2:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	900056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$900064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movl	$1, (%rdx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	addl	%r11d, %r8d
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
	jmp	.L2
.L21:
	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:
```

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%d%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-897024(%rsp), %r11
	.cfi_def_cfa 11, 897040
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3040, %rsp
	.cfi_def_cfa_offset 900080
	pxor	%xmm0, %xmm0
	movl	$99985, %edx
	xorl	%esi, %esi
	leaq	800064(%rsp), %rdi
	leaq	800048(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 900056(%rsp)
	xorl	%eax, %eax
	movaps	%xmm0, 800048(%rsp)
	call	memset@PLT
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	xorl	%eax, %eax
	leaq	28(%rsp), %r9
	leaq	24(%rsp), %r8
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$800004, %edx
	leaq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L13
	subl	$1, %edx
	movq	%rbx, %rcx
	leaq	36(%rsp,%rdx,4), %rdi
	movq	%rax, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$115, %sil
	je	.L18
	cmpb	$112, %sil
	jne	.L4
	movl	$2, (%rdx)
.L4:
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	je	.L19
.L6:
	movzbl	(%rcx), %esi
	cmpb	$114, %sil
	jne	.L3
	movl	$0, (%rdx)
	addq	$4, %rdx
	addq	$1, %rcx
	cmpq	%rdi, %rdx
	jne	.L6
.L19:
	movl	24(%rsp), %ebx
	movl	20(%rsp), %r11d
	xorl	%r8d, %r8d
	movl	$-1, %r9d
	movl	28(%rsp), %r10d
	movslq	16(%rsp), %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	leal	(%r8,%r10), %esi
	testl	%edx, %edx
	cmove	%esi, %r8d
.L10:
	addq	$4, %rax
	cmpq	%rdi, %rax
	je	.L2
.L11:
	movl	(%rax,%rcx,4), %edx
	cmpl	%edx, (%rax)
	cmove	%r9d, %edx
	movl	%edx, (%rax,%rcx,4)
	movl	(%rax), %edx
	cmpl	$1, %edx
	je	.L8
	cmpl	$2, %edx
	jne	.L20
	addq	$4, %rax
	addl	%ebx, %r8d
	cmpq	%rdi, %rax
	jne	.L11
.L2:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	900056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$900064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movl	$1, (%rdx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	addl	%r11d, %r8d
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
	jmp	.L2
.L21:
	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:
```