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 <string.h>
int main()
{
	int		N;		/* じゃんけんを行う回数			*/
	int		K;		/* 手の制限回数				*/
	int		R;		/* グー(Rock)で勝った場合の点数		*/
	int		S;		/* チョキ(Scissors)で勝った場合の点数	*/
	int		P;		/* パー(Paper)で勝った場合の点数	*/
	char		T[100005];	/* 筐体側の入力				*/
	char		U[100005];	/* ユーザー側の入力			*/
	int		index;		/* 配列のインデックス			*/
	int		result;		/* 合計点数を保存する			*/
	int	zero_r;			/* Rockでの0点手			*/
	int	zero_s;			/* Scissorsでの0点手			*/
	int	zero_p;			/* Paperでの0点手			*/
	
	/* 入力 */
	scanf("%d %d", &N, &K);
	scanf("%d %d %d", &R, &S, &P);
	scanf("%s", &T);

	result = 0;
	zero_r = 0;
	zero_s = 0;
	zero_p = 0;

	/* ユーザー側のKの値を考えない場合の最善手を入力する */

	for(index = 0; index < N; ++index){
		if(T[index] == 'r')
			U[index] = 'p';
		else if(T[index] == 's')
			U[index] = 'r';
		else if(T[index] == 'p')
			U[index] = 's';
	}
	/* これをTにコピーする */
	
	strcpy(T, U);

	/*
	 * 配列の処理を添え字Kからスタートする
	 * K個前の手と全く同じ手があれば現在の手に変更を加える
	 * K個先の手と比べて違う手を選ぶように処理をする	
	 *------------------------------------------------------------------
	 * if文内で条件として扱っている値を操作するとスタックオーバーフロー
	 * が発生するのでUser入力に値をコピーした
	 */

	for(index = K; index < N; ++index){
		if((T[index] == T[index - K]) && (T[index] == 'r')){

			if(T[index + K] == 's'){
				U[index] = 'p';
				++zero_p;
			}
			else if(T[index + K] == 'p'){
				U[index] = 's';
				++zero_s;
			}
			else{
				U[index] = 'p';
				++zero_p;	
			}
		}
		else if((T[index] == T[index - K]) && (T[index] == 's')){

			if(T[index + K] == 'r'){
				U[index] = 'p';
				++zero_p;
			}
			else if(T[index + K] == 'p'){
				U[index] = 'r';
				++zero_r;
			}
			else{
				U[index] = 'r';
				++zero_r;
			}
		}
		else if((T[index] == T[index - K]) && (T[index] == 'p')){

			if(T[index + K] == 'r'){
				U[index] = 's';
				++zero_s;
			}
			else if(T[index + K] == 's'){
				U[index] = 'r';
				++zero_r;
			}
			else{
				U[index] = 's';
				++zero_s;
			}
		}
      	/* Update */
      	strcpy(T, U);
	}
	/*
	 * ユーザーの手に対する点数をresultに加算していく
	 */
	for(index = 0; index < N; ++index){
		if(U[index] == 'r')
			result += R;
		else if(U[index] == 's')
			result += S;
		else if(U[index] == 'p')
			result += P;
	}
	result -= (R * zero_r);
	result -= (S * zero_s);
	result -= (P * zero_p);
	printf("%d\n", result);
	return (0);
}
/*
 * zero_rをshort intにしていたためテストケース41で範囲が足りなくなりWA
 */```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%s"
.LC3:
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200068(%rbp), %rdx
	leaq	-200072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200056(%rbp), %rcx
	leaq	-200060(%rbp), %rdx
	leaq	-200064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -200048(%rbp)
	movl	$0, -200044(%rbp)
	movl	$0, -200040(%rbp)
	movl	$0, -200036(%rbp)
	movl	$0, -200052(%rbp)
	jmp	.L2
.L6:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L3
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	jmp	.L4
.L3:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L5
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	jmp	.L4
.L5:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L4
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
.L4:
	addl	$1, -200052(%rbp)
.L2:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L6
	leaq	-100016(%rbp), %rdx
	leaq	-200032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	movl	-200068(%rbp), %eax
	movl	%eax, -200052(%rbp)
	jmp	.L7
.L19:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L8
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L8
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L9
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L9:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L11
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
	jmp	.L12
.L11:
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L8:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L13
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L14
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L14:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L16
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L16:
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L13:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L12
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L17
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
	jmp	.L12
.L17:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L18
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L18:
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
.L12:
	leaq	-100016(%rbp), %rdx
	leaq	-200032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	addl	$1, -200052(%rbp)
.L7:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L19
	movl	$0, -200052(%rbp)
	jmp	.L20
.L24:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L21
	movl	-200064(%rbp), %eax
	addl	%eax, -200048(%rbp)
	jmp	.L22
.L21:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L23
	movl	-200060(%rbp), %eax
	addl	%eax, -200048(%rbp)
	jmp	.L22
.L23:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L22
	movl	-200056(%rbp), %eax
	addl	%eax, -200048(%rbp)
.L22:
	addl	$1, -200052(%rbp)
.L20:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L24
	movl	-200064(%rbp), %eax
	imull	-200044(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200060(%rbp), %eax
	imull	-200040(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200056(%rbp), %eax
	imull	-200036(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200048(%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	.L26
	call	__stack_chk_fail@PLT
.L26:
	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 %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%s"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196664
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3496, %rsp
	.cfi_def_cfa_offset 200160
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200088(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	64(%rsp), %r13
	call	__isoc99_scanf@PLT
	leaq	60(%rsp), %rcx
	xorl	%eax, %eax
	leaq	56(%rsp), %rdx
	leaq	52(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	100080(%rsp), %r14
	leal	-1(%rbp), %ecx
	movq	%r13, %rdx
	movq	%r14, %rax
	leaq	100081(%rsp,%rcx), %rdi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$115, %cl
	je	.L34
	cmpb	$112, %cl
	jne	.L4
	movb	$115, (%rax)
.L4:
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	je	.L35
.L6:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L3
	movb	$112, (%rax)
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	jne	.L6
.L35:
	movl	$100005, %edx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__strcpy_chk@PLT
	movl	48(%rsp), %eax
	cmpl	%eax, %ebp
	jle	.L36
.L22:
	movslq	%eax, %rbx
	leal	(%rax,%rax), %r12d
	movq	%r13, %rax
	movl	$0, 20(%rsp)
	subq	%rbx, %rax
	movl	$0, 24(%rsp)
	leaq	(%r14,%rbx), %r15
	movl	$0, 28(%rsp)
	movq	%rax, 8(%rsp)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$100005, %edx
	movq	%r14, %rsi
	movq	%r13, %rdi
	addq	$1, %rbx
	call	__strcpy_chk@PLT
	addq	$1, %r15
	addl	$1, %r12d
	cmpl	%ebx, %ebp
	jle	.L37
.L16:
	movq	8(%rsp), %rsi
	movzbl	0(%r13,%rbx), %eax
	cmpb	(%rsi,%rbx), %al
	jne	.L8
	cmpb	$114, %al
	je	.L38
	cmpb	$115, %al
	je	.L39
	cmpb	$112, %al
	jne	.L8
	movslq	%r12d, %rax
	movzbl	64(%rsp,%rax), %eax
	cmpb	$114, %al
	je	.L15
	cmpb	$115, %al
	je	.L40
.L15:
	movb	$115, (%r15)
	addl	$1, 24(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L34:
	movb	$114, (%rax)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%r12d, %rax
	movzbl	64(%rsp,%rax), %eax
	cmpb	$115, %al
	je	.L32
	cmpb	$112, %al
	je	.L15
.L32:
	movb	$112, (%r15)
	addl	$1, 20(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L37:
	movl	52(%rsp), %r9d
	movl	56(%rsp), %r11d
	movl	60(%rsp), %r10d
	movl	%r9d, %ebx
	movl	%r11d, %r15d
	movl	%r10d, %r8d
	testl	%ebp, %ebp
	jle	.L25
.L23:
	movl	%r8d, %r10d
	movl	%r15d, %r11d
	movl	%ebx, %r9d
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	cmpb	$115, %cl
	je	.L41
	leal	(%rdx,%r8), %edi
	cmpb	$112, %cl
	cmove	%edi, %edx
.L19:
	addq	$1, %rax
	cmpl	%eax, %ebp
	jle	.L17
.L21:
	movzbl	(%r14,%rax), %ecx
	cmpb	$114, %cl
	jne	.L18
	addq	$1, %rax
	addl	%ebx, %edx
	cmpl	%eax, %ebp
	jg	.L21
.L17:
	imull	28(%rsp), %r9d
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	imull	24(%rsp), %r11d
	imull	20(%rsp), %r10d
	subl	%r9d, %edx
	subl	%r11d, %edx
	subl	%r10d, %edx
	call	__printf_chk@PLT
	movq	200088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$200104, %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
.L41:
	.cfi_restore_state
	addl	%r15d, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%r12d, %rax
	cmpb	$114, 64(%rsp,%rax)
	je	.L32
	addl	$1, 28(%rsp)
	movb	$114, (%r15)
	jmp	.L8
.L40:
	addl	$1, 28(%rsp)
	movb	$114, (%r15)
	jmp	.L8
.L2:
	leaq	100080(%rsp), %r14
	movl	$100005, %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	call	__strcpy_chk@PLT
	movl	48(%rsp), %eax
	movl	52(%rsp), %r9d
	movl	56(%rsp), %r11d
	movl	60(%rsp), %r10d
	cmpl	%eax, %ebp
	jg	.L22
	movl	$0, 24(%rsp)
	xorl	%edx, %edx
	movl	$0, 28(%rsp)
	movl	$0, 20(%rsp)
	jmp	.L17
.L36:
	movl	$0, 24(%rsp)
	movl	52(%rsp), %ebx
	movl	$0, 28(%rsp)
	movl	56(%rsp), %r15d
	movl	$0, 20(%rsp)
	movl	60(%rsp), %r8d
	jmp	.L23
.L25:
	xorl	%edx, %edx
	jmp	.L17
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%d %d %d"
.LC2:
	.string	"%s"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196664
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3496, %rsp
	.cfi_def_cfa_offset 200160
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200088(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	64(%rsp), %r13
	call	__isoc99_scanf@PLT
	leaq	60(%rsp), %rcx
	xorl	%eax, %eax
	leaq	56(%rsp), %rdx
	leaq	52(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	100080(%rsp), %r14
	leal	-1(%rbp), %ecx
	movq	%r13, %rdx
	movq	%r14, %rax
	leaq	100081(%rsp,%rcx), %rdi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$115, %cl
	je	.L34
	cmpb	$112, %cl
	jne	.L4
	movb	$115, (%rax)
.L4:
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	je	.L35
.L6:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L3
	movb	$112, (%rax)
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	jne	.L6
.L35:
	movl	$100005, %edx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__strcpy_chk@PLT
	movl	48(%rsp), %eax
	cmpl	%eax, %ebp
	jle	.L36
.L22:
	movslq	%eax, %rbx
	leal	(%rax,%rax), %r12d
	movq	%r13, %rax
	movl	$0, 20(%rsp)
	subq	%rbx, %rax
	movl	$0, 24(%rsp)
	leaq	(%r14,%rbx), %r15
	movl	$0, 28(%rsp)
	movq	%rax, 8(%rsp)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$100005, %edx
	movq	%r14, %rsi
	movq	%r13, %rdi
	addq	$1, %rbx
	call	__strcpy_chk@PLT
	addq	$1, %r15
	addl	$1, %r12d
	cmpl	%ebx, %ebp
	jle	.L37
.L16:
	movq	8(%rsp), %rsi
	movzbl	0(%r13,%rbx), %eax
	cmpb	(%rsi,%rbx), %al
	jne	.L8
	cmpb	$114, %al
	je	.L38
	cmpb	$115, %al
	je	.L39
	cmpb	$112, %al
	jne	.L8
	movslq	%r12d, %rax
	movzbl	64(%rsp,%rax), %eax
	cmpb	$114, %al
	je	.L15
	cmpb	$115, %al
	je	.L40
.L15:
	movb	$115, (%r15)
	addl	$1, 24(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L34:
	movb	$114, (%rax)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%r12d, %rax
	movzbl	64(%rsp,%rax), %eax
	cmpb	$115, %al
	je	.L32
	cmpb	$112, %al
	je	.L15
.L32:
	movb	$112, (%r15)
	addl	$1, 20(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L37:
	movl	52(%rsp), %r9d
	movl	56(%rsp), %r11d
	movl	60(%rsp), %r10d
	movl	%r9d, %ebx
	movl	%r11d, %r15d
	movl	%r10d, %r8d
	testl	%ebp, %ebp
	jle	.L25
.L23:
	movl	%r8d, %r10d
	movl	%r15d, %r11d
	movl	%ebx, %r9d
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	cmpb	$115, %cl
	je	.L41
	leal	(%rdx,%r8), %edi
	cmpb	$112, %cl
	cmove	%edi, %edx
.L19:
	addq	$1, %rax
	cmpl	%eax, %ebp
	jle	.L17
.L21:
	movzbl	(%r14,%rax), %ecx
	cmpb	$114, %cl
	jne	.L18
	addq	$1, %rax
	addl	%ebx, %edx
	cmpl	%eax, %ebp
	jg	.L21
.L17:
	imull	28(%rsp), %r9d
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	imull	24(%rsp), %r11d
	imull	20(%rsp), %r10d
	subl	%r9d, %edx
	subl	%r11d, %edx
	subl	%r10d, %edx
	call	__printf_chk@PLT
	movq	200088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$200104, %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
.L41:
	.cfi_restore_state
	addl	%r15d, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%r12d, %rax
	cmpb	$114, 64(%rsp,%rax)
	je	.L32
	addl	$1, 28(%rsp)
	movb	$114, (%r15)
	jmp	.L8
.L40:
	addl	$1, 28(%rsp)
	movb	$114, (%r15)
	jmp	.L8
.L2:
	leaq	100080(%rsp), %r14
	movl	$100005, %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	call	__strcpy_chk@PLT
	movl	48(%rsp), %eax
	movl	52(%rsp), %r9d
	movl	56(%rsp), %r11d
	movl	60(%rsp), %r10d
	cmpl	%eax, %ebp
	jg	.L22
	movl	$0, 24(%rsp)
	xorl	%edx, %edx
	movl	$0, 28(%rsp)
	movl	$0, 20(%rsp)
	jmp	.L17
.L36:
	movl	$0, 24(%rsp)
	movl	52(%rsp), %ebx
	movl	$0, 28(%rsp)
	movl	56(%rsp), %r15d
	movl	$0, 20(%rsp)
	movl	60(%rsp), %r8d
	jmp	.L23
.L25:
	xorl	%edx, %edx
	jmp	.L17
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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 <string.h>
int main()
{
	int		N;		/* じゃんけんを行う回数			*/
	int		K;		/* 手の制限回数				*/
	int		R;		/* グー(Rock)で勝った場合の点数		*/
	int		S;		/* チョキ(Scissors)で勝った場合の点数	*/
	int		P;		/* パー(Paper)で勝った場合の点数	*/
	char		T[100005];	/* 筐体側の入力				*/
	char		U[100005];	/* ユーザー側の入力			*/
	int		index;		/* 配列のインデックス			*/
	int		result;		/* 合計点数を保存する			*/
	int	zero_r;			/* Rockでの0点手			*/
	int	zero_s;			/* Scissorsでの0点手			*/
	int	zero_p;			/* Paperでの0点手			*/
	
	/* 入力 */
	scanf("%d %d", &N, &K);
	scanf("%d %d %d", &R, &S, &P);
	scanf("%s", &T);

	result = 0;
	zero_r = 0;
	zero_s = 0;
	zero_p = 0;

	/* ユーザー側のKの値を考えない場合の最善手を入力する */

	for(index = 0; index < N; ++index){
		if(T[index] == 'r')
			U[index] = 'p';
		else if(T[index] == 's')
			U[index] = 'r';
		else if(T[index] == 'p')
			U[index] = 's';
	}
	/* これをTにコピーする */
	
	strcpy(T, U);

	/*
	 * 配列の処理を添え字Kからスタートする
	 * K個前の手と全く同じ手があれば現在の手に変更を加える
	 * K個先の手と比べて違う手を選ぶように処理をする	
	 *------------------------------------------------------------------
	 * if文内で条件として扱っている値を操作するとスタックオーバーフロー
	 * が発生するのでUser入力に値をコピーした
	 */

	for(index = K; index < N; ++index){
		if((T[index] == T[index - K]) && (T[index] == 'r')){

			if(T[index + K] == 's'){
				U[index] = 'p';
				++zero_p;
			}
			else if(T[index + K] == 'p'){
				U[index] = 's';
				++zero_s;
			}
			else{
				U[index] = 'p';
				++zero_p;	
			}
		}
		else if((T[index] == T[index - K]) && (T[index] == 's')){

			if(T[index + K] == 'r'){
				U[index] = 'p';
				++zero_p;
			}
			else if(T[index + K] == 'p'){
				U[index] = 'r';
				++zero_r;
			}
			else{
				U[index] = 'r';
				++zero_r;
			}
		}
		else if((T[index] == T[index - K]) && (T[index] == 'p')){

			if(T[index + K] == 'r'){
				U[index] = 's';
				++zero_s;
			}
			else if(T[index + K] == 's'){
				U[index] = 'r';
				++zero_r;
			}
			else{
				U[index] = 's';
				++zero_s;
			}
		}
      	/* Update */
      	strcpy(T, U);
	}
	/*
	 * ユーザーの手に対する点数をresultに加算していく
	 */
	for(index = 0; index < N; ++index){
		if(U[index] == 'r')
			result += R;
		else if(U[index] == 's')
			result += S;
		else if(U[index] == 'p')
			result += P;
	}
	result -= (R * zero_r);
	result -= (S * zero_s);
	result -= (P * zero_p);
	printf("%d\n", result);
	return (0);
}
/*
 * zero_rをshort intにしていたためテストケース41で範囲が足りなくなりWA
 */
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
int main()
{
	int		N;		/* じゃんけんを行う回数			*/
	int		K;		/* 手の制限回数				*/
	int		R;		/* グー(Rock)で勝った場合の点数		*/
	int		S;		/* チョキ(Scissors)で勝った場合の点数	*/
	int		P;		/* パー(Paper)で勝った場合の点数	*/
	char		T[100005];	/* 筐体側の入力				*/
	char		U[100005];	/* ユーザー側の入力			*/
	int		index;		/* 配列のインデックス			*/
	int		result;		/* 合計点数を保存する			*/
	int	zero_r;			/* Rockでの0点手			*/
	int	zero_s;			/* Scissorsでの0点手			*/
	int	zero_p;			/* Paperでの0点手			*/
	
	/* 入力 */
	scanf("%d %d", &N, &K);
	scanf("%d %d %d", &R, &S, &P);
	scanf("%s", &T);

	result = 0;
	zero_r = 0;
	zero_s = 0;
	zero_p = 0;

	/* ユーザー側のKの値を考えない場合の最善手を入力する */

	for(index = 0; index < N; ++index){
		if(T[index] == 'r')
			U[index] = 'p';
		else if(T[index] == 's')
			U[index] = 'r';
		else if(T[index] == 'p')
			U[index] = 's';
	}
	/* これをTにコピーする */
	
	strcpy(T, U);

	/*
	 * 配列の処理を添え字Kからスタートする
	 * K個前の手と全く同じ手があれば現在の手に変更を加える
	 * K個先の手と比べて違う手を選ぶように処理をする	
	 *------------------------------------------------------------------
	 * if文内で条件として扱っている値を操作するとスタックオーバーフロー
	 * が発生するのでUser入力に値をコピーした
	 */

	for(index = K; index < N; ++index){
		if((T[index] == T[index - K]) && (T[index] == 'r')){

			if(T[index + K] == 's'){
				U[index] = 'p';
				++zero_p;
			}
			else if(T[index + K] == 'p'){
				U[index] = 's';
				++zero_s;
			}
			else{
				U[index] = 'p';
				++zero_p;	
			}
		}
		else if((T[index] == T[index - K]) && (T[index] == 's')){

			if(T[index + K] == 'r'){
				U[index] = 'p';
				++zero_p;
			}
			else if(T[index + K] == 'p'){
				U[index] = 'r';
				++zero_r;
			}
			else{
				U[index] = 'r';
				++zero_r;
			}
		}
		else if((T[index] == T[index - K]) && (T[index] == 'p')){

			if(T[index + K] == 'r'){
				U[index] = 's';
				++zero_s;
			}
			else if(T[index + K] == 's'){
				U[index] = 'r';
				++zero_r;
			}
			else{
				U[index] = 's';
				++zero_s;
			}
		}
      	/* Update */
      	strcpy(T, U);
	}
	/*
	 * ユーザーの手に対する点数をresultに加算していく
	 */
	for(index = 0; index < N; ++index){
		if(U[index] == 'r')
			result += R;
		else if(U[index] == 's')
			result += S;
		else if(U[index] == 'p')
			result += P;
	}
	result -= (R * zero_r);
	result -= (S * zero_s);
	result -= (P * zero_p);
	printf("%d\n", result);
	return (0);
}
/*
 * zero_rをshort intにしていたためテストケース41で範囲が足りなくなりWA
 */```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%s"
.LC3:
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200068(%rbp), %rdx
	leaq	-200072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200056(%rbp), %rcx
	leaq	-200060(%rbp), %rdx
	leaq	-200064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -200048(%rbp)
	movl	$0, -200044(%rbp)
	movl	$0, -200040(%rbp)
	movl	$0, -200036(%rbp)
	movl	$0, -200052(%rbp)
	jmp	.L2
.L6:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L3
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	jmp	.L4
.L3:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L5
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	jmp	.L4
.L5:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L4
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
.L4:
	addl	$1, -200052(%rbp)
.L2:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L6
	leaq	-100016(%rbp), %rdx
	leaq	-200032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	movl	-200068(%rbp), %eax
	movl	%eax, -200052(%rbp)
	jmp	.L7
.L19:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L8
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L8
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L9
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L9:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L11
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
	jmp	.L12
.L11:
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L8:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L13
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L14
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L14:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L16
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L16:
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L13:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L12
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L17
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
	jmp	.L12
.L17:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L18
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L18:
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
.L12:
	leaq	-100016(%rbp), %rdx
	leaq	-200032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	addl	$1, -200052(%rbp)
.L7:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L19
	movl	$0, -200052(%rbp)
	jmp	.L20
.L24:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L21
	movl	-200064(%rbp), %eax
	addl	%eax, -200048(%rbp)
	jmp	.L22
.L21:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L23
	movl	-200060(%rbp), %eax
	addl	%eax, -200048(%rbp)
	jmp	.L22
.L23:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L22
	movl	-200056(%rbp), %eax
	addl	%eax, -200048(%rbp)
.L22:
	addl	$1, -200052(%rbp)
.L20:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L24
	movl	-200064(%rbp), %eax
	imull	-200044(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200060(%rbp), %eax
	imull	-200040(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200056(%rbp), %eax
	imull	-200036(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200048(%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	.L26
	call	__stack_chk_fail@PLT
.L26:
	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 %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%s"
.LC3:
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200068(%rbp), %rdx
	leaq	-200072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200056(%rbp), %rcx
	leaq	-200060(%rbp), %rdx
	leaq	-200064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -200048(%rbp)
	movl	$0, -200044(%rbp)
	movl	$0, -200040(%rbp)
	movl	$0, -200036(%rbp)
	movl	$0, -200052(%rbp)
	jmp	.L2
.L6:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L3
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	jmp	.L4
.L3:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L5
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	jmp	.L4
.L5:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L4
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
.L4:
	addl	$1, -200052(%rbp)
.L2:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L6
	leaq	-100016(%rbp), %rdx
	leaq	-200032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	movl	-200068(%rbp), %eax
	movl	%eax, -200052(%rbp)
	jmp	.L7
.L19:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L8
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L8
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L9
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L9:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L11
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
	jmp	.L12
.L11:
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L8:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L13
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L14
	movl	-200052(%rbp), %eax
	cltq
	movb	$112, -100016(%rbp,%rax)
	addl	$1, -200036(%rbp)
	jmp	.L12
.L14:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L16
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L16:
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L13:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %edx
	movl	-200068(%rbp), %ecx
	movl	-200052(%rbp), %eax
	subl	%ecx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L12
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L17
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
	jmp	.L12
.L17:
	movl	-200068(%rbp), %edx
	movl	-200052(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L18
	movl	-200052(%rbp), %eax
	cltq
	movb	$114, -100016(%rbp,%rax)
	addl	$1, -200044(%rbp)
	jmp	.L12
.L18:
	movl	-200052(%rbp), %eax
	cltq
	movb	$115, -100016(%rbp,%rax)
	addl	$1, -200040(%rbp)
.L12:
	leaq	-100016(%rbp), %rdx
	leaq	-200032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
	addl	$1, -200052(%rbp)
.L7:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L19
	movl	$0, -200052(%rbp)
	jmp	.L20
.L24:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L21
	movl	-200064(%rbp), %eax
	addl	%eax, -200048(%rbp)
	jmp	.L22
.L21:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L23
	movl	-200060(%rbp), %eax
	addl	%eax, -200048(%rbp)
	jmp	.L22
.L23:
	movl	-200052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$112, %al
	jne	.L22
	movl	-200056(%rbp), %eax
	addl	%eax, -200048(%rbp)
.L22:
	addl	$1, -200052(%rbp)
.L20:
	movl	-200072(%rbp), %eax
	cmpl	%eax, -200052(%rbp)
	jl	.L24
	movl	-200064(%rbp), %eax
	imull	-200044(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200060(%rbp), %eax
	imull	-200040(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200056(%rbp), %eax
	imull	-200036(%rbp), %eax
	subl	%eax, -200048(%rbp)
	movl	-200048(%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	.L26
	call	__stack_chk_fail@PLT
.L26:
	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:
