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

```c
// ABC 149-D
// 2019.12.29 bal4u

#include <stdio.h>
#include <ctype.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0; int c;
	c = gc();
//	do c = gc();
//	while (isspace(c));
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	do *s = gc();
	while (*s++ > ' ');
	*(s-1) = 0;
}

int N;
char T[100005];
char a[100005];
int p[128];

int main()
{
	int i, R, S, P, K, ans;
	
	N = in(), K = in(), R = in(), S = in(), P = in();
	p['r'] = P, p['s'] = R, p['p'] = S;
	ins(T), ans = 0;
	for (i = 0; i < K; ++i) ans += p[T[i]], a[i] = T[i];
	for ( ; i < N; ++i) {
		if (a[i-K] != T[i]) ans += p[T[i]], a[i] = T[i];
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	ins
	.type	ins, @function
ins:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
.L5:
	call	getchar_unlocked@PLT
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movb	%dl, (%rax)
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -8(%rbp)
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L5
	movq	-8(%rbp), %rax
	subq	$1, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ins, .-ins
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	T
	.align 32
	.type	T, @object
	.size	T, 100005
T:
	.zero	100005
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 100005
a:
	.zero	100005
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 512
p:
	.zero	512
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, 456+p(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, 460+p(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, 448+p(%rip)
	leaq	T(%rip), %rax
	movq	%rax, %rdi
	call	ins
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L7
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	addl	$1, -24(%rbp)
.L7:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L8
	jmp	.L9
.L11:
	movl	-24(%rbp), %eax
	subl	-16(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	je	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L10:
	addl	$1, -24(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB25:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE25:
	.size	in, .-in
	.p2align 4
	.globl	ins
	.type	ins, @function
ins:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rax), %rdx
	addq	$1, %rbx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jle	.L15
.L16:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L13
	call	__uflow@PLT
	addq	$1, %rbx
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jg	.L16
.L15:
	movb	$0, -1(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	ins, .-ins
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	in
	movl	%eax, N(%rip)
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebp
	xorl	%eax, %eax
	call	in
	movl	%eax, %r12d
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	in
	movl	%ebx, 448+p(%rip)
	movd	%r12d, %xmm1
	leaq	T(%rip), %rbx
	movd	%eax, %xmm0
	movq	%rbx, %rdi
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 456+p(%rip)
	call	ins
	testl	%ebp, %ebp
	jle	.L24
	movslq	%ebp, %r9
	xorl	%eax, %eax
	leaq	p(%rip), %r8
	xorl	%edx, %edx
	leaq	a(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L20:
	movsbq	(%rbx,%rax), %rsi
	movb	%sil, (%rdi,%rax)
	addq	$1, %rax
	addl	(%r8,%rsi,4), %edx
	cmpq	%rax, %r9
	jne	.L20
	movl	%ebp, %esi
.L19:
	movl	N(%rip), %r9d
	cmpl	%esi, %r9d
	jle	.L21
	movslq	%esi, %rax
	subl	%ebp, %esi
	leaq	a(%rip), %rdi
	movslq	%esi, %rsi
	leaq	p(%rip), %r10
	subq	%rax, %rsi
	addq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L23:
	movzbl	(%rbx,%rax), %ecx
	cmpb	%cl, (%rsi,%rax)
	je	.L22
	movb	%cl, (%rdi,%rax)
	movsbq	%cl, %r8
	addl	(%r10,%r8,4), %edx
.L22:
	addq	$1, %rax
	cmpl	%eax, %r9d
	jg	.L23
.L21:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	.L19
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 512
p:
	.zero	512
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 100005
a:
	.zero	100005
	.globl	T
	.align 32
	.type	T, @object
	.size	T, 100005
T:
	.zero	100005
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB25:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE25:
	.size	in, .-in
	.p2align 4
	.globl	ins
	.type	ins, @function
ins:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rax), %rdx
	addq	$1, %rbx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jle	.L15
.L16:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L13
	call	__uflow@PLT
	addq	$1, %rbx
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jg	.L16
.L15:
	movb	$0, -1(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	ins, .-ins
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	in
	movl	%eax, N(%rip)
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebp
	xorl	%eax, %eax
	call	in
	movl	%eax, %r12d
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	in
	movl	%ebx, 448+p(%rip)
	movd	%r12d, %xmm1
	leaq	T(%rip), %rbx
	movd	%eax, %xmm0
	movq	%rbx, %rdi
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 456+p(%rip)
	call	ins
	testl	%ebp, %ebp
	jle	.L24
	movslq	%ebp, %r9
	xorl	%eax, %eax
	leaq	p(%rip), %r8
	xorl	%edx, %edx
	leaq	a(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L20:
	movsbq	(%rbx,%rax), %rsi
	movb	%sil, (%rdi,%rax)
	addq	$1, %rax
	addl	(%r8,%rsi,4), %edx
	cmpq	%rax, %r9
	jne	.L20
	movl	%ebp, %esi
.L19:
	movl	N(%rip), %r9d
	cmpl	%esi, %r9d
	jle	.L21
	movslq	%esi, %rax
	subl	%ebp, %esi
	leaq	a(%rip), %rdi
	movslq	%esi, %rsi
	leaq	p(%rip), %r10
	subq	%rax, %rsi
	addq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L23:
	movzbl	(%rbx,%rax), %ecx
	cmpb	%cl, (%rsi,%rax)
	je	.L22
	movb	%cl, (%rdi,%rax)
	movsbq	%cl, %r8
	addl	(%r10,%r8,4), %edx
.L22:
	addq	$1, %rax
	cmpl	%eax, %r9d
	jg	.L23
.L21:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	.L19
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 512
p:
	.zero	512
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 100005
a:
	.zero	100005
	.globl	T
	.align 32
	.type	T, @object
	.size	T, 100005
T:
	.zero	100005
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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:

// ABC 149-D
// 2019.12.29 bal4u

#include <stdio.h>
#include <ctype.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0; int c;
	c = gc();
//	do c = gc();
//	while (isspace(c));
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	do *s = gc();
	while (*s++ > ' ');
	*(s-1) = 0;
}

int N;
char T[100005];
char a[100005];
int p[128];

int main()
{
	int i, R, S, P, K, ans;
	
	N = in(), K = in(), R = in(), S = in(), P = in();
	p['r'] = P, p['s'] = R, p['p'] = S;
	ins(T), ans = 0;
	for (i = 0; i < K; ++i) ans += p[T[i]], a[i] = T[i];
	for ( ; i < N; ++i) {
		if (a[i-K] != T[i]) ans += p[T[i]], a[i] = T[i];
	}
	printf("%d\n", ans);
	return 0;
}

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
// ABC 149-D
// 2019.12.29 bal4u

#include <stdio.h>
#include <ctype.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0; int c;
	c = gc();
//	do c = gc();
//	while (isspace(c));
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	do *s = gc();
	while (*s++ > ' ');
	*(s-1) = 0;
}

int N;
char T[100005];
char a[100005];
int p[128];

int main()
{
	int i, R, S, P, K, ans;
	
	N = in(), K = in(), R = in(), S = in(), P = in();
	p['r'] = P, p['s'] = R, p['p'] = S;
	ins(T), ans = 0;
	for (i = 0; i < K; ++i) ans += p[T[i]], a[i] = T[i];
	for ( ; i < N; ++i) {
		if (a[i-K] != T[i]) ans += p[T[i]], a[i] = T[i];
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	ins
	.type	ins, @function
ins:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
.L5:
	call	getchar_unlocked@PLT
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movb	%dl, (%rax)
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -8(%rbp)
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L5
	movq	-8(%rbp), %rax
	subq	$1, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ins, .-ins
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	T
	.align 32
	.type	T, @object
	.size	T, 100005
T:
	.zero	100005
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 100005
a:
	.zero	100005
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 512
p:
	.zero	512
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, 456+p(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, 460+p(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, 448+p(%rip)
	leaq	T(%rip), %rax
	movq	%rax, %rdi
	call	ins
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L7
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	addl	$1, -24(%rbp)
.L7:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L8
	jmp	.L9
.L11:
	movl	-24(%rbp), %eax
	subl	-16(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	je	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L10:
	addl	$1, -24(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.globl	in
	.type	in, @function
in:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	ins
	.type	ins, @function
ins:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
.L5:
	call	getchar_unlocked@PLT
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movb	%dl, (%rax)
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -8(%rbp)
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L5
	movq	-8(%rbp), %rax
	subq	$1, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ins, .-ins
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	T
	.align 32
	.type	T, @object
	.size	T, 100005
T:
	.zero	100005
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 100005
a:
	.zero	100005
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 512
p:
	.zero	512
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, 456+p(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, 460+p(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, 448+p(%rip)
	leaq	T(%rip), %rax
	movq	%rax, %rdi
	call	ins
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L7
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	addl	$1, -24(%rbp)
.L7:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L8
	jmp	.L9
.L11:
	movl	-24(%rbp), %eax
	subl	-16(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	je	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	T(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L10:
	addl	$1, -24(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
