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 <math.h>

int main (void){
	int n; //じゃんけん回数
	int k; //k回前の手は出せない
	int r, s, p; //グー、チョキ、パーの点数
	long int sum =0; //合計点数
	int i; //for文用
	char t[100000];
	//改行した後の最初に%*cを記述することで改行文字を読み飛ばす
	scanf("%d%d%*c%d%d%d%*c%s", &n, &k, &r, &s, &p, t);
	for(i=0; i<n; i++){
		if(i-k>=0 ){
			if(t[i-k]== t[i])
			t[i]= 'o';
		}
		//点数配点間違えてt[i]はあくまで機体の手、勝つのは別の手
		switch (t[i]){
			case 'r':
						sum +=p;
						break;
			case 's':
						sum +=r;
						break;
			case 'p':
						sum +=s;
						break;
			default:
						break;
						
		}
	}
	printf("%ld", sum);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%*c%d%d%d%*c%s"
.LC1:
	.string	"%ld"
	.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	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1744, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100024(%rbp)
	leaq	-100032(%rbp), %r8
	leaq	-100036(%rbp), %rdi
	leaq	-100040(%rbp), %rcx
	leaq	-100044(%rbp), %rdx
	leaq	-100048(%rbp), %rax
	subq	$8, %rsp
	leaq	-100016(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$16, %rsp
	movl	$0, -100028(%rbp)
	jmp	.L2
.L8:
	movl	-100044(%rbp), %edx
	movl	-100028(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L3
	movl	-100044(%rbp), %edx
	movl	-100028(%rbp), %eax
	subl	%edx, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	-100028(%rbp), %eax
	cltq
	movb	$111, -100016(%rbp,%rax)
.L3:
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$115, %eax
	je	.L4
	cmpl	$115, %eax
	jg	.L11
	cmpl	$112, %eax
	je	.L6
	cmpl	$114, %eax
	jne	.L11
	movl	-100032(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L4:
	movl	-100040(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L6:
	movl	-100036(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L11:
	nop
.L7:
	addl	$1, -100028(%rbp)
.L2:
	movl	-100048(%rbp), %eax
	cmpl	%eax, -100028(%rbp)
	jl	.L8
	movq	-100024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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%*c%d%d%d%*c%s"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98328
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1752, %rsp
	.cfi_def_cfa_offset 100080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100040(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rcx
	leaq	12(%rsp), %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 100088
	leaq	40(%rsp), %rbx
	pushq	%rbx
	.cfi_def_cfa_offset 100096
	leaq	44(%rsp), %r9
	leaq	40(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r9d
	popq	%rax
	.cfi_def_cfa_offset 100088
	popq	%rdx
	.cfi_def_cfa_offset 100080
	testl	%r9d, %r9d
	jle	.L10
	movslq	16(%rsp), %rsi
	movslq	20(%rsp), %rbp
	xorl	%r8d, %r8d
	movslq	28(%rsp), %r11
	movslq	24(%rsp), %r10
	movl	%esi, %edx
	subl	%esi, %r9d
	negl	%edx
	movslq	%edx, %rax
	addq	%rbx, %rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L15:
	leaq	(%r8,%r10), %rdi
	cmpb	$112, %cl
	cmove	%rdi, %r8
.L4:
	addl	$1, %edx
	addq	$1, %rax
	cmpl	%r9d, %edx
	je	.L2
.L8:
	movzbl	(%rax,%rsi), %ecx
	testl	%edx, %edx
	js	.L3
	cmpb	%cl, (%rax)
	je	.L14
.L3:
	cmpb	$114, %cl
	je	.L5
	cmpb	$115, %cl
	jne	.L15
	addl	$1, %edx
	addq	%rbp, %r8
	addq	$1, %rax
	cmpl	%r9d, %edx
	jne	.L8
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$100056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	addq	%r11, %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$111, (%rax,%rsi)
	jmp	.L4
.L10:
	xorl	%r8d, %r8d
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%*c%d%d%d%*c%s"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98328
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1752, %rsp
	.cfi_def_cfa_offset 100080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100040(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rcx
	leaq	12(%rsp), %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 100088
	leaq	40(%rsp), %rbx
	pushq	%rbx
	.cfi_def_cfa_offset 100096
	leaq	44(%rsp), %r9
	leaq	40(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r9d
	popq	%rax
	.cfi_def_cfa_offset 100088
	popq	%rdx
	.cfi_def_cfa_offset 100080
	testl	%r9d, %r9d
	jle	.L10
	movslq	16(%rsp), %rsi
	movslq	20(%rsp), %rbp
	xorl	%r8d, %r8d
	movslq	28(%rsp), %r11
	movslq	24(%rsp), %r10
	movl	%esi, %edx
	subl	%esi, %r9d
	negl	%edx
	movslq	%edx, %rax
	addq	%rbx, %rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L15:
	leaq	(%r8,%r10), %rdi
	cmpb	$112, %cl
	cmove	%rdi, %r8
.L4:
	addl	$1, %edx
	addq	$1, %rax
	cmpl	%r9d, %edx
	je	.L2
.L8:
	movzbl	(%rax,%rsi), %ecx
	testl	%edx, %edx
	js	.L3
	cmpb	%cl, (%rax)
	je	.L14
.L3:
	cmpb	$114, %cl
	je	.L5
	cmpb	$115, %cl
	jne	.L15
	addl	$1, %edx
	addq	%rbp, %r8
	addq	$1, %rax
	cmpl	%r9d, %edx
	jne	.L8
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$100056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	addq	%r11, %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$111, (%rax,%rsi)
	jmp	.L4
.L10:
	xorl	%r8d, %r8d
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <math.h>

int main (void){
	int n; //じゃんけん回数
	int k; //k回前の手は出せない
	int r, s, p; //グー、チョキ、パーの点数
	long int sum =0; //合計点数
	int i; //for文用
	char t[100000];
	//改行した後の最初に%*cを記述することで改行文字を読み飛ばす
	scanf("%d%d%*c%d%d%d%*c%s", &n, &k, &r, &s, &p, t);
	for(i=0; i<n; i++){
		if(i-k>=0 ){
			if(t[i-k]== t[i])
			t[i]= 'o';
		}
		//点数配点間違えてt[i]はあくまで機体の手、勝つのは別の手
		switch (t[i]){
			case 'r':
						sum +=p;
						break;
			case 's':
						sum +=r;
						break;
			case 'p':
						sum +=s;
						break;
			default:
						break;
						
		}
	}
	printf("%ld", sum);
}
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 <math.h>

int main (void){
	int n; //じゃんけん回数
	int k; //k回前の手は出せない
	int r, s, p; //グー、チョキ、パーの点数
	long int sum =0; //合計点数
	int i; //for文用
	char t[100000];
	//改行した後の最初に%*cを記述することで改行文字を読み飛ばす
	scanf("%d%d%*c%d%d%d%*c%s", &n, &k, &r, &s, &p, t);
	for(i=0; i<n; i++){
		if(i-k>=0 ){
			if(t[i-k]== t[i])
			t[i]= 'o';
		}
		//点数配点間違えてt[i]はあくまで機体の手、勝つのは別の手
		switch (t[i]){
			case 'r':
						sum +=p;
						break;
			case 's':
						sum +=r;
						break;
			case 'p':
						sum +=s;
						break;
			default:
						break;
						
		}
	}
	printf("%ld", sum);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%*c%d%d%d%*c%s"
.LC1:
	.string	"%ld"
	.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	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1744, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100024(%rbp)
	leaq	-100032(%rbp), %r8
	leaq	-100036(%rbp), %rdi
	leaq	-100040(%rbp), %rcx
	leaq	-100044(%rbp), %rdx
	leaq	-100048(%rbp), %rax
	subq	$8, %rsp
	leaq	-100016(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$16, %rsp
	movl	$0, -100028(%rbp)
	jmp	.L2
.L8:
	movl	-100044(%rbp), %edx
	movl	-100028(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L3
	movl	-100044(%rbp), %edx
	movl	-100028(%rbp), %eax
	subl	%edx, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	-100028(%rbp), %eax
	cltq
	movb	$111, -100016(%rbp,%rax)
.L3:
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$115, %eax
	je	.L4
	cmpl	$115, %eax
	jg	.L11
	cmpl	$112, %eax
	je	.L6
	cmpl	$114, %eax
	jne	.L11
	movl	-100032(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L4:
	movl	-100040(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L6:
	movl	-100036(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L11:
	nop
.L7:
	addl	$1, -100028(%rbp)
.L2:
	movl	-100048(%rbp), %eax
	cmpl	%eax, -100028(%rbp)
	jl	.L8
	movq	-100024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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.
val
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%*c%d%d%d%*c%s"
.LC1:
	.string	"%ld"
	.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	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1744, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100024(%rbp)
	leaq	-100032(%rbp), %r8
	leaq	-100036(%rbp), %rdi
	leaq	-100040(%rbp), %rcx
	leaq	-100044(%rbp), %rdx
	leaq	-100048(%rbp), %rax
	subq	$8, %rsp
	leaq	-100016(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$16, %rsp
	movl	$0, -100028(%rbp)
	jmp	.L2
.L8:
	movl	-100044(%rbp), %edx
	movl	-100028(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L3
	movl	-100044(%rbp), %edx
	movl	-100028(%rbp), %eax
	subl	%edx, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	-100028(%rbp), %eax
	cltq
	movb	$111, -100016(%rbp,%rax)
.L3:
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$115, %eax
	je	.L4
	cmpl	$115, %eax
	jg	.L11
	cmpl	$112, %eax
	je	.L6
	cmpl	$114, %eax
	jne	.L11
	movl	-100032(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L4:
	movl	-100040(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L6:
	movl	-100036(%rbp), %eax
	cltq
	addq	%rax, -100024(%rbp)
	jmp	.L7
.L11:
	nop
.L7:
	addl	$1, -100028(%rbp)
.L2:
	movl	-100048(%rbp), %eax
	cmpl	%eax, -100028(%rbp)
	jl	.L8
	movq	-100024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
