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

```c
// AOJ 3100 Strange Plants
// 2019.9.23 bal4u

#include <stdio.h>

//// 入出力関係
#if 1
#define gc() getchar_unlocked()
#define pc(x) putchar_unlocked(x)
#else
#define gc() getchar()
#define pc(x) putchar(x)
#endif

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

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

void out(int n) { // 非負整数の表示（出力）
	int i; char b[30];

	if (!n) pc('0');
	else {
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

int main()
{
	int i, X, A, B, N;
	char S[10];

	X = in(), A = in(), B = in(), N = in();
	while (N--) {
		ins(S);
		if (*S == 'n') X += A;
		else if (*S == 't') X += B;
		else X = 0;
		if (X < 0) X = 0;
	}
	out(X);
	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)
	cmpl	$45, -4(%rbp)
	jne	.L2
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L3:
	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	.L3
	movl	-8(%rbp), %eax
	negl	%eax
	jmp	.L4
.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
.L4:
	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)
.L6:
	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	.L6
	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	out
	.type	out, @function
out:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -68(%rbp)
	jne	.L8
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L9
.L8:
	movl	$0, -52(%rbp)
	jmp	.L10
.L11:
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -52(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -48(%rbp,%rax)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
.L10:
	cmpl	$0, -68(%rbp)
	jne	.L11
	jmp	.L12
.L13:
	movl	-52(%rbp), %eax
	cltq
	movzbl	-48(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L12:
	movl	-52(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -52(%rbp)
	testl	%eax, %eax
	jne	.L13
.L9:
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	out, .-out
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	in
	movl	%eax, -36(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -32(%rbp)
	jmp	.L16
.L20:
	leaq	-18(%rbp), %rax
	movq	%rax, %rdi
	call	ins
	movzbl	-18(%rbp), %eax
	cmpb	$110, %al
	jne	.L17
	movl	-28(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L18
.L17:
	movzbl	-18(%rbp), %eax
	cmpb	$116, %al
	jne	.L19
	movl	-24(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L18
.L19:
	movl	$0, -36(%rbp)
.L18:
	cmpl	$0, -36(%rbp)
	jns	.L16
	movl	$0, -36(%rbp)
.L16:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L20
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	out
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
.LFB23:
	.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	.L20
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	cmpl	$45, %eax
	jne	.L4
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L13:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L4:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L12
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	negl	%r12d
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	cmpq	%rcx, %rdx
	jnb	.L22
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
.L6:
	xorl	%r12d, %r12d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	1(%rsi), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rsi), %eax
	cmpl	$47, %eax
	jle	.L9
.L8:
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
.L10:
	leal	(%r12,%r12,4), %edx
	andl	$15, %eax
	leal	(%rax,%rdx,2), %r12d
	cmpq	%rcx, %rsi
	jb	.L7
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L9
	movq	stdin(%rip), %rdi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
.L22:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	jmp	.L6
	.cfi_endproc
.LFE23:
	.size	in, .-in
	.p2align 4
	.globl	ins
	.type	ins, @function
ins:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	1(%rax), %rdx
	addq	$1, %rbx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jle	.L26
.L27:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L24
	call	__uflow@PLT
	addq	$1, %rbx
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jg	.L27
.L26:
	movb	$0, -1(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	ins, .-ins
	.p2align 4
	.globl	out
	.type	out, @function
out:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %edx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	stdout(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	48(%rdi), %rcx
	movq	40(%rdi), %rax
	testl	%edx, %edx
	jne	.L39
	cmpq	%rcx, %rax
	jnb	.L44
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$48, (%rax)
.L32:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L45
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	xorl	%ecx, %ecx
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L30:
	movslq	%edx, %rax
	movl	%edx, %esi
	movslq	%ecx, %r8
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %edx
	addl	$48, %edx
	movb	%dl, (%rbx,%rcx)
	movl	%eax, %edx
	movq	%rcx, %rax
	addq	$1, %rcx
	testl	%edx, %edx
	jne	.L30
	leaq	-1(%rsp,%r8), %rbp
	addq	%r8, %rbx
	subq	%rax, %rbp
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L47:
	movq	stdout(%rip), %rdi
.L35:
	movzbl	(%rbx), %esi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L46
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%sil, (%rax)
.L34:
	subq	$1, %rbx
	cmpq	%rbx, %rbp
	jne	.L47
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L46:
	call	__overflow@PLT
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L45:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %esi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	__overflow@PLT
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	out, .-out
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebp
	xorl	%eax, %eax
	call	in
	movl	%eax, %r13d
	xorl	%eax, %eax
	call	in
	movl	%eax, %r14d
	xorl	%eax, %eax
	call	in
	testl	%eax, %eax
	je	.L49
	movl	%eax, %ebx
	leaq	14(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L57:
	movq	%r12, %r15
.L66:
	movq	stdin(%rip), %rdi
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L50:
	leaq	1(%rax), %rdx
	addq	$1, %r15
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, -1(%r15)
	cmpb	$32, %al
	jle	.L52
.L53:
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L50
	call	__uflow@PLT
	addq	$1, %r15
	movb	%al, -1(%r15)
	cmpb	$32, %al
	jg	.L66
	.p2align 4,,10
	.p2align 3
.L52:
	movb	$0, -1(%r15)
	movzbl	14(%rsp), %eax
	cmpb	$110, %al
	je	.L67
	cmpb	$116, %al
	je	.L68
	xorl	%ebp, %ebp
.L56:
	subl	$1, %ebx
	jne	.L57
.L49:
	movl	%ebp, %edi
	call	out
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L69
	addq	$40, %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
.L67:
	.cfi_restore_state
	addl	%r13d, %ebp
.L55:
	xorl	%eax, %eax
	testl	%ebp, %ebp
	cmovs	%eax, %ebp
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L68:
	addl	%r14d, %ebp
	jmp	.L55
.L69:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.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
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB23:
	.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	.L20
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	cmpl	$45, %eax
	jne	.L4
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L13:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L4:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L12
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	negl	%r12d
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	cmpq	%rcx, %rdx
	jnb	.L22
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
.L6:
	xorl	%r12d, %r12d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	1(%rsi), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rsi), %eax
	cmpl	$47, %eax
	jle	.L9
.L8:
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
.L10:
	leal	(%r12,%r12,4), %edx
	andl	$15, %eax
	leal	(%rax,%rdx,2), %r12d
	cmpq	%rcx, %rsi
	jb	.L7
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L9
	movq	stdin(%rip), %rdi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
.L22:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	jmp	.L6
	.cfi_endproc
.LFE23:
	.size	in, .-in
	.p2align 4
	.globl	ins
	.type	ins, @function
ins:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	1(%rax), %rdx
	addq	$1, %rbx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jle	.L26
.L27:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L24
	call	__uflow@PLT
	addq	$1, %rbx
	movb	%al, -1(%rbx)
	cmpb	$32, %al
	jg	.L27
.L26:
	movb	$0, -1(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	ins, .-ins
	.p2align 4
	.globl	out
	.type	out, @function
out:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %edx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	stdout(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	48(%rdi), %rcx
	movq	40(%rdi), %rax
	testl	%edx, %edx
	jne	.L39
	cmpq	%rcx, %rax
	jnb	.L44
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$48, (%rax)
.L32:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L45
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	xorl	%ecx, %ecx
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L30:
	movslq	%edx, %rax
	movl	%edx, %esi
	movslq	%ecx, %r8
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %edx
	addl	$48, %edx
	movb	%dl, (%rbx,%rcx)
	movl	%eax, %edx
	movq	%rcx, %rax
	addq	$1, %rcx
	testl	%edx, %edx
	jne	.L30
	leaq	-1(%rsp,%r8), %rbp
	addq	%r8, %rbx
	subq	%rax, %rbp
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L47:
	movq	stdout(%rip), %rdi
.L35:
	movzbl	(%rbx), %esi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L46
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%sil, (%rax)
.L34:
	subq	$1, %rbx
	cmpq	%rbx, %rbp
	jne	.L47
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L46:
	call	__overflow@PLT
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L45:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %esi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	__overflow@PLT
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	out, .-out
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebp
	xorl	%eax, %eax
	call	in
	movl	%eax, %r13d
	xorl	%eax, %eax
	call	in
	movl	%eax, %r14d
	xorl	%eax, %eax
	call	in
	testl	%eax, %eax
	je	.L49
	movl	%eax, %ebx
	leaq	14(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L57:
	movq	%r12, %r15
.L66:
	movq	stdin(%rip), %rdi
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L50:
	leaq	1(%rax), %rdx
	addq	$1, %r15
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, -1(%r15)
	cmpb	$32, %al
	jle	.L52
.L53:
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L50
	call	__uflow@PLT
	addq	$1, %r15
	movb	%al, -1(%r15)
	cmpb	$32, %al
	jg	.L66
	.p2align 4,,10
	.p2align 3
.L52:
	movb	$0, -1(%r15)
	movzbl	14(%rsp), %eax
	cmpb	$110, %al
	je	.L67
	cmpb	$116, %al
	je	.L68
	xorl	%ebp, %ebp
.L56:
	subl	$1, %ebx
	jne	.L57
.L49:
	movl	%ebp, %edi
	call	out
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L69
	addq	$40, %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
.L67:
	.cfi_restore_state
	addl	%r13d, %ebp
.L55:
	xorl	%eax, %eax
	testl	%ebp, %ebp
	cmovs	%eax, %ebp
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L68:
	addl	%r14d, %ebp
	jmp	.L55
.L69:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.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:

// AOJ 3100 Strange Plants
// 2019.9.23 bal4u

#include <stdio.h>

//// 入出力関係
#if 1
#define gc() getchar_unlocked()
#define pc(x) putchar_unlocked(x)
#else
#define gc() getchar()
#define pc(x) putchar(x)
#endif

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

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

void out(int n) { // 非負整数の表示（出力）
	int i; char b[30];

	if (!n) pc('0');
	else {
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

int main()
{
	int i, X, A, B, N;
	char S[10];

	X = in(), A = in(), B = in(), N = in();
	while (N--) {
		ins(S);
		if (*S == 'n') X += A;
		else if (*S == 't') X += B;
		else X = 0;
		if (X < 0) X = 0;
	}
	out(X);
	return 0;
}


10 30 10
0
nobiro
nobiro
tidime
 18 30 10
0
nobiro
nobiro
tidime
 15 30 9
0
noairo
oribon
midite
 23 30 9
0
noairo
oribon
midite
 44 30 5
0
noairo
nobiro
tidime
 59 30 5
0
oriaon
nobiro
tieimd
 83 48 5
0
orioan
nobiro
dmifit
 31 48 5
0
orioan
nobiro
dmifit
 19 48 5
0
orioan
nnciro
dmifit
 8 48 5
0
orioan
nnciro
dmifit

10
 18
 15
 23
 44
 59
 83
 31
 19
 8

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

```c
// AOJ 3100 Strange Plants
// 2019.9.23 bal4u

#include <stdio.h>

//// 入出力関係
#if 1
#define gc() getchar_unlocked()
#define pc(x) putchar_unlocked(x)
#else
#define gc() getchar()
#define pc(x) putchar(x)
#endif

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

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

void out(int n) { // 非負整数の表示（出力）
	int i; char b[30];

	if (!n) pc('0');
	else {
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

int main()
{
	int i, X, A, B, N;
	char S[10];

	X = in(), A = in(), B = in(), N = in();
	while (N--) {
		ins(S);
		if (*S == 'n') X += A;
		else if (*S == 't') X += B;
		else X = 0;
		if (X < 0) X = 0;
	}
	out(X);
	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)
	cmpl	$45, -4(%rbp)
	jne	.L2
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L3:
	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	.L3
	movl	-8(%rbp), %eax
	negl	%eax
	jmp	.L4
.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
.L4:
	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)
.L6:
	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	.L6
	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	out
	.type	out, @function
out:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -68(%rbp)
	jne	.L8
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L9
.L8:
	movl	$0, -52(%rbp)
	jmp	.L10
.L11:
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -52(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -48(%rbp,%rax)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
.L10:
	cmpl	$0, -68(%rbp)
	jne	.L11
	jmp	.L12
.L13:
	movl	-52(%rbp), %eax
	cltq
	movzbl	-48(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L12:
	movl	-52(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -52(%rbp)
	testl	%eax, %eax
	jne	.L13
.L9:
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	out, .-out
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	in
	movl	%eax, -36(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -32(%rbp)
	jmp	.L16
.L20:
	leaq	-18(%rbp), %rax
	movq	%rax, %rdi
	call	ins
	movzbl	-18(%rbp), %eax
	cmpb	$110, %al
	jne	.L17
	movl	-28(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L18
.L17:
	movzbl	-18(%rbp), %eax
	cmpb	$116, %al
	jne	.L19
	movl	-24(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L18
.L19:
	movl	$0, -36(%rbp)
.L18:
	cmpl	$0, -36(%rbp)
	jns	.L16
	movl	$0, -36(%rbp)
.L16:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L20
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	out
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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)
	cmpl	$45, -4(%rbp)
	jne	.L2
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L3:
	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	.L3
	movl	-8(%rbp), %eax
	negl	%eax
	jmp	.L4
.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
.L4:
	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)
.L6:
	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	.L6
	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	out
	.type	out, @function
out:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -68(%rbp)
	jne	.L8
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L9
.L8:
	movl	$0, -52(%rbp)
	jmp	.L10
.L11:
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -52(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -48(%rbp,%rax)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
.L10:
	cmpl	$0, -68(%rbp)
	jne	.L11
	jmp	.L12
.L13:
	movl	-52(%rbp), %eax
	cltq
	movzbl	-48(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L12:
	movl	-52(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -52(%rbp)
	testl	%eax, %eax
	jne	.L13
.L9:
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	out, .-out
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	in
	movl	%eax, -36(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -32(%rbp)
	jmp	.L16
.L20:
	leaq	-18(%rbp), %rax
	movq	%rax, %rdi
	call	ins
	movzbl	-18(%rbp), %eax
	cmpb	$110, %al
	jne	.L17
	movl	-28(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L18
.L17:
	movzbl	-18(%rbp), %eax
	cmpb	$116, %al
	jne	.L19
	movl	-24(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L18
.L19:
	movl	$0, -36(%rbp)
.L18:
	cmpl	$0, -36(%rbp)
	jns	.L16
	movl	$0, -36(%rbp)
.L16:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L20
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	out
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
