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>

int main(int argc, char const *argv[]) {

  int N, K, R, S, P;
  char T[100000];
  scanf("%d", &N);
  scanf("%d", &K);
  scanf("%d", &R);
  scanf("%d", &S);
  scanf("%d", &P);
  scanf("%s", T);

  int pnt = 0;

  for (int i = 0; i < N; i++) {

    if (i < K) {

      switch (T[i]) {

        case 'r':
        pnt = pnt + P;
        break;

        case 's':
        pnt = pnt + R;
        break;

        case 'p':
        pnt = pnt + S;
        break;

      }

    }

    if (i >= K) {

      if (T[i] == T[i - K]) {

        pnt += 0;
        T[i] = 'n';

      }else{

        switch (T[i]) {

          case 'r':
          pnt = pnt + P;
          break;

          case 's':
          pnt = pnt + R;
          break;

          case 'p':
          pnt = pnt + S;
          break;

        }

      }

    }

  }

  printf("%d\n", pnt);

  return 0;

}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%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	%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	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1752, %rsp
	.cfi_def_cfa_offset 100096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 100040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %r13
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	24(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L17
	movl	16(%rsp), %r12d
	movl	20(%rsp), %ebx
	movl	28(%rsp), %r11d
	movl	24(%rsp), %r9d
	testl	%r12d, %r12d
	jle	.L18
	cmpl	%r8d, %r12d
	movl	%r8d, %r10d
	movq	%r13, %rsi
	cmovle	%r12d, %r10d
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	leal	(%rdx,%r9), %edi
	cmpb	$112, %al
	cmove	%edi, %edx
.L7:
	addl	$1, %ecx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jge	.L23
.L8:
	movzbl	(%rsi), %eax
	cmpb	$114, %al
	je	.L4
	cmpb	$115, %al
	jne	.L24
	addl	$1, %ecx
	addl	%ebx, %edx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jl	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%r8d, %ecx
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$100056, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	addl	%r11d, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.L3:
	movslq	%ecx, %rbp
	movl	%ecx, %r10d
	leaq	0(%r13,%rbp), %rax
	subl	%r12d, %r10d
	movslq	%r10d, %r10
	subl	%eax, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$114, %sil
	je	.L11
	cmpb	$115, %sil
	je	.L12
	leal	(%rdx,%r9), %edi
	cmpb	$112, %sil
	cmove	%edi, %edx
.L10:
	addq	$1, %rax
	leal	(%rcx,%rax), %esi
	cmpl	%esi, %r8d
	jle	.L2
.L14:
	movq	%rax, %rdi
	movzbl	(%rax), %esi
	subq	%rbp, %rdi
	cmpb	(%rdi,%r10), %sil
	jne	.L9
	movb	$110, (%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	addl	%ebx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%r11d, %edx
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L2
.L25:
	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"
.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	%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	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1752, %rsp
	.cfi_def_cfa_offset 100096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 100040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %r13
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	24(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L17
	movl	16(%rsp), %r12d
	movl	20(%rsp), %ebx
	movl	28(%rsp), %r11d
	movl	24(%rsp), %r9d
	testl	%r12d, %r12d
	jle	.L18
	cmpl	%r8d, %r12d
	movl	%r8d, %r10d
	movq	%r13, %rsi
	cmovle	%r12d, %r10d
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	leal	(%rdx,%r9), %edi
	cmpb	$112, %al
	cmove	%edi, %edx
.L7:
	addl	$1, %ecx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jge	.L23
.L8:
	movzbl	(%rsi), %eax
	cmpb	$114, %al
	je	.L4
	cmpb	$115, %al
	jne	.L24
	addl	$1, %ecx
	addl	%ebx, %edx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jl	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%r8d, %ecx
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$100056, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	addl	%r11d, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.L3:
	movslq	%ecx, %rbp
	movl	%ecx, %r10d
	leaq	0(%r13,%rbp), %rax
	subl	%r12d, %r10d
	movslq	%r10d, %r10
	subl	%eax, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$114, %sil
	je	.L11
	cmpb	$115, %sil
	je	.L12
	leal	(%rdx,%r9), %edi
	cmpb	$112, %sil
	cmove	%edi, %edx
.L10:
	addq	$1, %rax
	leal	(%rcx,%rax), %esi
	cmpl	%esi, %r8d
	jle	.L2
.L14:
	movq	%rax, %rdi
	movzbl	(%rax), %esi
	subq	%rbp, %rdi
	cmpb	(%rdi,%r10), %sil
	jne	.L9
	movb	$110, (%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	addl	%ebx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%r11d, %edx
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L2
.L25:
	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"
.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	%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	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1752, %rsp
	.cfi_def_cfa_offset 100096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 100040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %r13
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	24(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L17
	movl	16(%rsp), %r12d
	movl	20(%rsp), %ebx
	movl	28(%rsp), %r11d
	movl	24(%rsp), %r9d
	testl	%r12d, %r12d
	jle	.L18
	cmpl	%r8d, %r12d
	movl	%r8d, %r10d
	movq	%r13, %rsi
	cmovle	%r12d, %r10d
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	leal	(%rdx,%r9), %edi
	cmpb	$112, %al
	cmove	%edi, %edx
.L7:
	addl	$1, %ecx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jge	.L23
.L8:
	movzbl	(%rsi), %eax
	cmpb	$114, %al
	je	.L4
	cmpb	$115, %al
	jne	.L24
	addl	$1, %ecx
	addl	%ebx, %edx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jl	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%r8d, %ecx
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$100056, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	addl	%r11d, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.L3:
	movslq	%ecx, %rbp
	movl	%ecx, %r10d
	leaq	0(%r13,%rbp), %rax
	subl	%r12d, %r10d
	movslq	%r10d, %r10
	subl	%eax, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$114, %sil
	je	.L11
	cmpb	$115, %sil
	je	.L12
	leal	(%rdx,%r9), %edi
	cmpb	$112, %sil
	cmove	%edi, %edx
.L10:
	addq	$1, %rax
	leal	(%rcx,%rax), %esi
	cmpl	%esi, %r8d
	jle	.L2
.L14:
	movq	%rax, %rdi
	movzbl	(%rax), %esi
	subq	%rbp, %rdi
	cmpb	(%rdi,%r10), %sil
	jne	.L9
	movb	$110, (%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	addl	%ebx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%r11d, %edx
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L2
.L25:
	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>

int main(int argc, char const *argv[]) {

  int N, K, R, S, P;
  char T[100000];
  scanf("%d", &N);
  scanf("%d", &K);
  scanf("%d", &R);
  scanf("%d", &S);
  scanf("%d", &P);
  scanf("%s", T);

  int pnt = 0;

  for (int i = 0; i < N; i++) {

    if (i < K) {

      switch (T[i]) {

        case 'r':
        pnt = pnt + P;
        break;

        case 's':
        pnt = pnt + R;
        break;

        case 'p':
        pnt = pnt + S;
        break;

      }

    }

    if (i >= K) {

      if (T[i] == T[i - K]) {

        pnt += 0;
        T[i] = 'n';

      }else{

        switch (T[i]) {

          case 'r':
          pnt = pnt + P;
          break;

          case 's':
          pnt = pnt + R;
          break;

          case 'p':
          pnt = pnt + S;
          break;

        }

      }

    }

  }

  printf("%d\n", pnt);

  return 0;

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

```c
#include <stdio.h>

int main(int argc, char const *argv[]) {

  int N, K, R, S, P;
  char T[100000];
  scanf("%d", &N);
  scanf("%d", &K);
  scanf("%d", &R);
  scanf("%d", &S);
  scanf("%d", &P);
  scanf("%s", T);

  int pnt = 0;

  for (int i = 0; i < N; i++) {

    if (i < K) {

      switch (T[i]) {

        case 'r':
        pnt = pnt + P;
        break;

        case 's':
        pnt = pnt + R;
        break;

        case 'p':
        pnt = pnt + S;
        break;

      }

    }

    if (i >= K) {

      if (T[i] == T[i - K]) {

        pnt += 0;
        T[i] = 'n';

      }else{

        switch (T[i]) {

          case 'r':
          pnt = pnt + P;
          break;

          case 's':
          pnt = pnt + R;
          break;

          case 'p':
          pnt = pnt + S;
          break;

        }

      }

    }

  }

  printf("%d\n", pnt);

  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>

int main(int argc, char const *argv[]) {

  int N, K, R, S, P;
  char T[100000];
  scanf("%d", &N);
  scanf("%d", &K);
  scanf("%d", &R);
  scanf("%d", &S);
  scanf("%d", &P);
  scanf("%s", T);

  int pnt = 0;

  for (int i = 0; i < N; i++) {

    if (i < K) {

      switch (T[i]) {

        case 'r':
        pnt = pnt + P;
        break;

        case 's':
        pnt = pnt + R;
        break;

        case 'p':
        pnt = pnt + S;
        break;

      }

    }

    if (i >= K) {

      if (T[i] == T[i - K]) {

        pnt += 0;
        T[i] = 'n';

      }else{

        switch (T[i]) {

          case 'r':
          pnt = pnt + P;
          break;

          case 's':
          pnt = pnt + R;
          break;

          case 'p':
          pnt = pnt + S;
          break;

        }

      }

    }

  }

  printf("%d\n", pnt);

  return 0;

}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%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	%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	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1752, %rsp
	.cfi_def_cfa_offset 100096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 100040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %r13
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	24(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L17
	movl	16(%rsp), %r12d
	movl	20(%rsp), %ebx
	movl	28(%rsp), %r11d
	movl	24(%rsp), %r9d
	testl	%r12d, %r12d
	jle	.L18
	cmpl	%r8d, %r12d
	movl	%r8d, %r10d
	movq	%r13, %rsi
	cmovle	%r12d, %r10d
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	leal	(%rdx,%r9), %edi
	cmpb	$112, %al
	cmove	%edi, %edx
.L7:
	addl	$1, %ecx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jge	.L23
.L8:
	movzbl	(%rsi), %eax
	cmpb	$114, %al
	je	.L4
	cmpb	$115, %al
	jne	.L24
	addl	$1, %ecx
	addl	%ebx, %edx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jl	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%r8d, %ecx
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$100056, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	addl	%r11d, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.L3:
	movslq	%ecx, %rbp
	movl	%ecx, %r10d
	leaq	0(%r13,%rbp), %rax
	subl	%r12d, %r10d
	movslq	%r10d, %r10
	subl	%eax, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$114, %sil
	je	.L11
	cmpb	$115, %sil
	je	.L12
	leal	(%rdx,%r9), %edi
	cmpb	$112, %sil
	cmove	%edi, %edx
.L10:
	addq	$1, %rax
	leal	(%rcx,%rax), %esi
	cmpl	%esi, %r8d
	jle	.L2
.L14:
	movq	%rax, %rdi
	movzbl	(%rax), %esi
	subq	%rbp, %rdi
	cmpb	(%rdi,%r10), %sil
	jne	.L9
	movb	$110, (%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	addl	%ebx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%r11d, %edx
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L2
.L25:
	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"
.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	%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	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1752, %rsp
	.cfi_def_cfa_offset 100096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 100040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %r13
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	24(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L17
	movl	16(%rsp), %r12d
	movl	20(%rsp), %ebx
	movl	28(%rsp), %r11d
	movl	24(%rsp), %r9d
	testl	%r12d, %r12d
	jle	.L18
	cmpl	%r8d, %r12d
	movl	%r8d, %r10d
	movq	%r13, %rsi
	cmovle	%r12d, %r10d
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	leal	(%rdx,%r9), %edi
	cmpb	$112, %al
	cmove	%edi, %edx
.L7:
	addl	$1, %ecx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jge	.L23
.L8:
	movzbl	(%rsi), %eax
	cmpb	$114, %al
	je	.L4
	cmpb	$115, %al
	jne	.L24
	addl	$1, %ecx
	addl	%ebx, %edx
	addq	$1, %rsi
	cmpl	%r10d, %ecx
	jl	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%r8d, %ecx
	jl	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	100040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$100056, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	addl	%r11d, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.L3:
	movslq	%ecx, %rbp
	movl	%ecx, %r10d
	leaq	0(%r13,%rbp), %rax
	subl	%r12d, %r10d
	movslq	%r10d, %r10
	subl	%eax, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$114, %sil
	je	.L11
	cmpb	$115, %sil
	je	.L12
	leal	(%rdx,%r9), %edi
	cmpb	$112, %sil
	cmove	%edi, %edx
.L10:
	addq	$1, %rax
	leal	(%rcx,%rax), %esi
	cmpl	%esi, %r8d
	jle	.L2
.L14:
	movq	%rax, %rdi
	movzbl	(%rax), %esi
	subq	%rbp, %rdi
	cmpb	(%rdi,%r10), %sil
	jne	.L9
	movb	$110, (%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	addl	%ebx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%r11d, %edx
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L2
.L25:
	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:
```