Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <math.h>
// r:グー s:チョキ p:パー
int main(){
  int N,K,R,S,P,i;
  char T[100002];
  scanf("%d %d",&N,&K);
  scanf("%d %d %d",&R,&S,&P);
  scanf("%s",T);
  int A[100002] = {0};
  int tmp = 0;
  for(i=0; i<N; i++){
    // 全部勝った場合の得点を計算
    if(T[i]=='r'){
      if(i>=K&&T[i-K]=='r'){
		T[i] = '0';
      }else{
        tmp += P;
        A[i] = tmp; 
      }
    }else if(T[i]=='s'){
      if(i>=K&&T[i-K]=='s'){
		T[i] = '0';
      }else{
        tmp += R;
        A[i] = tmp; 
      }
    }else if(T[i]=='p'){
      if(i>=K&&T[i-K]=='p'){
        T[i] = '0';
      }else{
        tmp += S;
        A[i] = tmp;
      }
    }
  }
  printf("%d\n",tmp);
}```

Assembly Code:

```assembly
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1744, %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	12(%rsp), %rsi
	leaq	32(%rsp), %rbx
	call	scanf@PLT
	leaq	28(%rsp), %rcx
	xorl	%eax, %eax
	leaq	24(%rsp), %rdx
	leaq	20(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L19
	movl	16(%rsp), %r8d
	movl	24(%rsp), %r12d
	movl	20(%rsp), %ebp
	movl	28(%rsp), %r11d
	testl	%r8d, %r8d
	jle	.L20
	cmpl	%r9d, %r8d
	movl	%r9d, %r10d
	movl	%r8d, %edi
	movq	%rbx, %rdx
	cmovle	%r8d, %r10d
	negl	%edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$115, %cl
	je	.L27
	cmpb	$112, %cl
	je	.L28
.L6:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jge	.L29
.L9:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L4
	cmpl	%eax, %r8d
	jg	.L5
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L24
.L5:
	addl	$1, %eax
	addl	%r11d, %esi
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jl	.L9
.L29:
	cmpl	%r9d, %eax
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	printf@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$100048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	addl	%ebp, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	%eax, %r8d
	jg	.L8
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L24
.L8:
	addl	%r12d, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movb	$48, (%rdx)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%esi, %esi
	xorl	%eax, %eax
.L3:
	movslq	%eax, %rdx
	movl	%eax, %edi
	addq	%rbx, %rdx
	subl	%r8d, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$115, %cl
	je	.L31
	cmpb	$112, %cl
	je	.L32
.L12:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%eax, %r9d
	jle	.L2
.L16:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L10
	cmpl	%r8d, %eax
	jl	.L11
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L25
.L11:
	addl	%r11d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	cmpl	%r8d, %eax
	jl	.L15
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L25
.L15:
	addl	%r12d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movb	$48, (%rdx)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%edi, %rcx
	cmpb	$115, 32(%rsp,%rcx)
	je	.L25
	addl	%ebp, %esi
	jmp	.L12
.L19:
	xorl	%esi, %esi
	jmp	.L2
.L30:
	call	__stack_chk_fail@PLT
	.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.
Optimized Assembly Code:

user
```assembly
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1744, %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	12(%rsp), %rsi
	leaq	32(%rsp), %rbx
	call	scanf@PLT
	leaq	28(%rsp), %rcx
	xorl	%eax, %eax
	leaq	24(%rsp), %rdx
	leaq	20(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L19
	movl	16(%rsp), %r8d
	movl	24(%rsp), %r12d
	movl	20(%rsp), %ebp
	movl	28(%rsp), %r11d
	testl	%r8d, %r8d
	jle	.L20
	cmpl	%r9d, %r8d
	movl	%r9d, %r10d
	movl	%r8d, %edi
	movq	%rbx, %rdx
	cmovle	%r8d, %r10d
	negl	%edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$115, %cl
	je	.L27
	cmpb	$112, %cl
	je	.L28
.L6:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jge	.L29
.L9:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L4
	cmpl	%eax, %r8d
	jg	.L5
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L24
.L5:
	addl	$1, %eax
	addl	%r11d, %esi
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jl	.L9
.L29:
	cmpl	%r9d, %eax
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	printf@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$100048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	addl	%ebp, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	%eax, %r8d
	jg	.L8
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L24
.L8:
	addl	%r12d, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movb	$48, (%rdx)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%esi, %esi
	xorl	%eax, %eax
.L3:
	movslq	%eax, %rdx
	movl	%eax, %edi
	addq	%rbx, %rdx
	subl	%r8d, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$115, %cl
	je	.L31
	cmpb	$112, %cl
	je	.L32
.L12:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%eax, %r9d
	jle	.L2
.L16:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L10
	cmpl	%r8d, %eax
	jl	.L11
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L25
.L11:
	addl	%r11d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	cmpl	%r8d, %eax
	jl	.L15
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L25
.L15:
	addl	%r12d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movb	$48, (%rdx)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%edi, %rcx
	cmpb	$115, 32(%rsp,%rcx)
	je	.L25
	addl	%ebp, %esi
	jmp	.L12
.L19:
	xorl	%esi, %esi
	jmp	.L2
.L30:
	call	__stack_chk_fail@PLT
	.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:
```
rule
```assembly
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1744, %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	12(%rsp), %rsi
	leaq	32(%rsp), %rbx
	call	scanf@PLT
	leaq	28(%rsp), %rcx
	xorl	%eax, %eax
	leaq	24(%rsp), %rdx
	leaq	20(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L19
	movl	16(%rsp), %r8d
	movl	24(%rsp), %r12d
	movl	20(%rsp), %ebp
	movl	28(%rsp), %r11d
	testl	%r8d, %r8d
	jle	.L20
	cmpl	%r9d, %r8d
	movl	%r9d, %r10d
	movl	%r8d, %edi
	movq	%rbx, %rdx
	cmovle	%r8d, %r10d
	negl	%edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$115, %cl
	je	.L27
	cmpb	$112, %cl
	je	.L28
.L6:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jge	.L29
.L9:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L4
	cmpl	%eax, %r8d
	jg	.L5
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L24
.L5:
	addl	$1, %eax
	addl	%r11d, %esi
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jl	.L9
.L29:
	cmpl	%r9d, %eax
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	printf@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$100048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	addl	%ebp, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	%eax, %r8d
	jg	.L8
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L24
.L8:
	addl	%r12d, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movb	$48, (%rdx)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%esi, %esi
	xorl	%eax, %eax
.L3:
	movslq	%eax, %rdx
	movl	%eax, %edi
	addq	%rbx, %rdx
	subl	%r8d, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$115, %cl
	je	.L31
	cmpb	$112, %cl
	je	.L32
.L12:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%eax, %r9d
	jle	.L2
.L16:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L10
	cmpl	%r8d, %eax
	jl	.L11
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L25
.L11:
	addl	%r11d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	cmpl	%r8d, %eax
	jl	.L15
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L25
.L15:
	addl	%r12d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movb	$48, (%rdx)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%edi, %rcx
	cmpb	$115, 32(%rsp,%rcx)
	je	.L25
	addl	%ebp, %esi
	jmp	.L12
.L19:
	xorl	%esi, %esi
	jmp	.L2
.L30:
	call	__stack_chk_fail@PLT
	.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:
```
```c
#include <math.h>
// r:グー s:チョキ p:パー
int main(){
  int N,K,R,S,P,i;
  char T[100002];
  scanf("%d %d",&N,&K);
  scanf("%d %d %d",&R,&S,&P);
  scanf("%s",T);
  int A[100002] = {0};
  int tmp = 0;
  for(i=0; i<N; i++){
    // 全部勝った場合の得点を計算
    if(T[i]=='r'){
      if(i>=K&&T[i-K]=='r'){
		T[i] = '0';
      }else{
        tmp += P;
        A[i] = tmp; 
      }
    }else if(T[i]=='s'){
      if(i>=K&&T[i-K]=='s'){
		T[i] = '0';
      }else{
        tmp += R;
        A[i] = tmp; 
      }
    }else if(T[i]=='p'){
      if(i>=K&&T[i-K]=='p'){
        T[i] = '0';
      }else{
        tmp += S;
        A[i] = tmp;
      }
    }
  }
  printf("%d\n",tmp);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <math.h>
// r:グー s:チョキ p:パー
int main(){
  int N,K,R,S,P,i;
  char T[100002];
  scanf("%d %d",&N,&K);
  scanf("%d %d %d",&R,&S,&P);
  scanf("%s",T);
  int A[100002] = {0};
  int tmp = 0;
  for(i=0; i<N; i++){
    // 全部勝った場合の得点を計算
    if(T[i]=='r'){
      if(i>=K&&T[i-K]=='r'){
		T[i] = '0';
      }else{
        tmp += P;
        A[i] = tmp; 
      }
    }else if(T[i]=='s'){
      if(i>=K&&T[i-K]=='s'){
		T[i] = '0';
      }else{
        tmp += R;
        A[i] = tmp; 
      }
    }else if(T[i]=='p'){
      if(i>=K&&T[i-K]=='p'){
        T[i] = '0';
      }else{
        tmp += S;
        A[i] = tmp;
      }
    }
  }
  printf("%d\n",tmp);
}```

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 <math.h>
// r:グー s:チョキ p:パー
int main(){
  int N,K,R,S,P,i;
  char T[100002];
  scanf("%d %d",&N,&K);
  scanf("%d %d %d",&R,&S,&P);
  scanf("%s",T);
  int A[100002] = {0};
  int tmp = 0;
  for(i=0; i<N; i++){
    // 全部勝った場合の得点を計算
    if(T[i]=='r'){
      if(i>=K&&T[i-K]=='r'){
		T[i] = '0';
      }else{
        tmp += P;
        A[i] = tmp; 
      }
    }else if(T[i]=='s'){
      if(i>=K&&T[i-K]=='s'){
		T[i] = '0';
      }else{
        tmp += R;
        A[i] = tmp; 
      }
    }else if(T[i]=='p'){
      if(i>=K&&T[i-K]=='p'){
        T[i] = '0';
      }else{
        tmp += S;
        A[i] = tmp;
      }
    }
  }
  printf("%d\n",tmp);
}```

Assembly Code:

```assembly
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1744, %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	12(%rsp), %rsi
	leaq	32(%rsp), %rbx
	call	scanf@PLT
	leaq	28(%rsp), %rcx
	xorl	%eax, %eax
	leaq	24(%rsp), %rdx
	leaq	20(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L19
	movl	16(%rsp), %r8d
	movl	24(%rsp), %r12d
	movl	20(%rsp), %ebp
	movl	28(%rsp), %r11d
	testl	%r8d, %r8d
	jle	.L20
	cmpl	%r9d, %r8d
	movl	%r9d, %r10d
	movl	%r8d, %edi
	movq	%rbx, %rdx
	cmovle	%r8d, %r10d
	negl	%edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$115, %cl
	je	.L27
	cmpb	$112, %cl
	je	.L28
.L6:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jge	.L29
.L9:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L4
	cmpl	%eax, %r8d
	jg	.L5
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L24
.L5:
	addl	$1, %eax
	addl	%r11d, %esi
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jl	.L9
.L29:
	cmpl	%r9d, %eax
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	printf@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$100048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	addl	%ebp, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	%eax, %r8d
	jg	.L8
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L24
.L8:
	addl	%r12d, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movb	$48, (%rdx)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%esi, %esi
	xorl	%eax, %eax
.L3:
	movslq	%eax, %rdx
	movl	%eax, %edi
	addq	%rbx, %rdx
	subl	%r8d, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$115, %cl
	je	.L31
	cmpb	$112, %cl
	je	.L32
.L12:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%eax, %r9d
	jle	.L2
.L16:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L10
	cmpl	%r8d, %eax
	jl	.L11
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L25
.L11:
	addl	%r11d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	cmpl	%r8d, %eax
	jl	.L15
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L25
.L15:
	addl	%r12d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movb	$48, (%rdx)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%edi, %rcx
	cmpb	$115, 32(%rsp,%rcx)
	je	.L25
	addl	%ebp, %esi
	jmp	.L12
.L19:
	xorl	%esi, %esi
	jmp	.L2
.L30:
	call	__stack_chk_fail@PLT
	.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.
Optimized Assembly Code:

train
```assembly
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1744, %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	12(%rsp), %rsi
	leaq	32(%rsp), %rbx
	call	scanf@PLT
	leaq	28(%rsp), %rcx
	xorl	%eax, %eax
	leaq	24(%rsp), %rdx
	leaq	20(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L19
	movl	16(%rsp), %r8d
	movl	24(%rsp), %r12d
	movl	20(%rsp), %ebp
	movl	28(%rsp), %r11d
	testl	%r8d, %r8d
	jle	.L20
	cmpl	%r9d, %r8d
	movl	%r9d, %r10d
	movl	%r8d, %edi
	movq	%rbx, %rdx
	cmovle	%r8d, %r10d
	negl	%edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$115, %cl
	je	.L27
	cmpb	$112, %cl
	je	.L28
.L6:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jge	.L29
.L9:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L4
	cmpl	%eax, %r8d
	jg	.L5
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L24
.L5:
	addl	$1, %eax
	addl	%r11d, %esi
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%r10d, %eax
	jl	.L9
.L29:
	cmpl	%r9d, %eax
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	printf@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$100048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	addl	%ebp, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	%eax, %r8d
	jg	.L8
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L24
.L8:
	addl	%r12d, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movb	$48, (%rdx)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%esi, %esi
	xorl	%eax, %eax
.L3:
	movslq	%eax, %rdx
	movl	%eax, %edi
	addq	%rbx, %rdx
	subl	%r8d, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$115, %cl
	je	.L31
	cmpb	$112, %cl
	je	.L32
.L12:
	addl	$1, %eax
	addq	$1, %rdx
	addl	$1, %edi
	cmpl	%eax, %r9d
	jle	.L2
.L16:
	movzbl	(%rdx), %ecx
	cmpb	$114, %cl
	jne	.L10
	cmpl	%r8d, %eax
	jl	.L11
	movslq	%edi, %rcx
	cmpb	$114, 32(%rsp,%rcx)
	je	.L25
.L11:
	addl	%r11d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	cmpl	%r8d, %eax
	jl	.L15
	movslq	%edi, %rcx
	cmpb	$112, 32(%rsp,%rcx)
	je	.L25
.L15:
	addl	%r12d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movb	$48, (%rdx)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%edi, %rcx
	cmpb	$115, 32(%rsp,%rcx)
	je	.L25
	addl	%ebp, %esi
	jmp	.L12
.L19:
	xorl	%esi, %esi
	jmp	.L2
.L30:
	call	__stack_chk_fail@PLT
	.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:
```