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

```c
#include<stdio.h>

int f(int n)
{
	int c[8]={7,112,1792,273,1092,546,1057,292},i=0;
	for(;i<8;i++)
		if((n&c[i])==c[i])
			return 1;
	return 0;
}
int main()
{
	int i,t,b=0,w=0;
	for(i=0;(t=getchar())!=48;i++)
	{	
		if(i==11)
		{
			if(f(b))
				puts("b");
			else if(f(w))
				puts("w");
			else
				puts("NA");
			i=b=w=0;
			i--;
		}
		else
		{
			if(t==98)
				b+=(1<<i%11);
			else if(t==119)
				w+=(1<<i%11);
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.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
	movl	$7, -48(%rbp)
	movl	$112, -44(%rbp)
	movl	$1792, -40(%rbp)
	movl	$273, -36(%rbp)
	movl	$1092, -32(%rbp)
	movl	$546, -28(%rbp)
	movl	$1057, -24(%rbp)
	movl	$292, -20(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L5:
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$1, %eax
	jmp	.L6
.L3:
	addl	$1, -52(%rbp)
.L2:
	cmpl	$7, -52(%rbp)
	jle	.L5
	movl	$0, %eax
.L6:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"b"
.LC1:
	.string	"w"
.LC2:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.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
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L9
.L16:
	cmpl	$11, -16(%rbp)
	jne	.L10
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L11
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L11:
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L13:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	subl	$1, -16(%rbp)
	jmp	.L14
.L10:
	cmpl	$98, -4(%rbp)
	jne	.L15
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%ecx, %edx
	subl	%eax, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	addl	%eax, -12(%rbp)
	jmp	.L14
.L15:
	cmpl	$119, -4(%rbp)
	jne	.L14
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	addl	%eax, -8(%rbp)
.L14:
	addl	$1, -16(%rbp)
.L9:
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$48, -4(%rbp)
	jne	.L16
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	f
	.type	f, @function
f:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	andl	$7, %eax
	cmpl	$7, %eax
	je	.L9
	movl	%edi, %eax
	andl	$112, %eax
	cmpl	$112, %eax
	je	.L9
	movl	%edi, %eax
	andl	$1792, %eax
	cmpl	$1792, %eax
	je	.L9
	movl	%edi, %eax
	andl	$273, %eax
	cmpl	$273, %eax
	je	.L9
	movl	%edi, %eax
	andl	$1092, %eax
	cmpl	$1092, %eax
	je	.L9
	movl	%edi, %eax
	andl	$546, %eax
	cmpl	$546, %eax
	je	.L9
	movl	%edi, %eax
	andl	$1057, %eax
	cmpl	$1057, %eax
	je	.L9
	andl	$292, %edi
	xorl	%eax, %eax
	cmpl	$292, %edi
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"b"
.LC1:
	.string	"w"
.LC2:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$3123612579, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$119, %eax
	jne	.L15
	movl	%r15d, %eax
	movl	%r15d, %ecx
	imulq	%r12, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %esi
	leal	(%rax,%rsi,2), %eax
	subl	%eax, %ecx
	movl	$1, %eax
	sall	%cl, %eax
	addl	%eax, %ebp
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, %r15d
.L12:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$48, %eax
	je	.L64
	cmpl	$11, %r15d
	je	.L65
	leal	1(%r15), %edx
	cmpl	$98, %eax
	jne	.L19
	movl	%r15d, %eax
	movl	%r15d, %ecx
	imulq	%r12, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %esi
	leal	(%rax,%rsi,2), %eax
	subl	%eax, %ecx
	movl	$1, %eax
	sall	%cl, %eax
	addl	%eax, %ebx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%ebx, %eax
	andl	$7, %eax
	cmpl	$7, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$112, %eax
	cmpl	$112, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$1792, %eax
	cmpl	$1792, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$273, %eax
	cmpl	$273, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$1092, %eax
	cmpl	$1092, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$546, %eax
	cmpl	$546, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$1057, %eax
	cmpl	$1057, %eax
	je	.L16
	andl	$292, %ebx
	cmpl	$292, %ebx
	je	.L16
	movl	%ebp, %eax
	andl	$7, %eax
	cmpl	$7, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$112, %eax
	cmpl	$112, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$1792, %eax
	cmpl	$1792, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$273, %eax
	cmpl	$273, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$1092, %eax
	cmpl	$1092, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$546, %eax
	cmpl	$546, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$1057, %eax
	cmpl	$1057, %eax
	je	.L18
	andl	$292, %ebp
	cmpl	$292, %ebp
	je	.L18
	movq	%r14, %rdi
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	call	puts@PLT
	xorl	%edx, %edx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L64:
	addq	$8, %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
.L16:
	.cfi_restore_state
	movq	%r13, %rdi
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	call	puts@PLT
	xorl	%edx, %edx
	jmp	.L15
.L18:
	leaq	.LC1(%rip), %rdi
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	call	puts@PLT
	xorl	%edx, %edx
	jmp	.L15
	.cfi_endproc
.LFE24:
	.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	f
	.type	f, @function
f:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	andl	$7, %eax
	cmpl	$7, %eax
	je	.L9
	movl	%edi, %eax
	andl	$112, %eax
	cmpl	$112, %eax
	je	.L9
	movl	%edi, %eax
	andl	$1792, %eax
	cmpl	$1792, %eax
	je	.L9
	movl	%edi, %eax
	andl	$273, %eax
	cmpl	$273, %eax
	je	.L9
	movl	%edi, %eax
	andl	$1092, %eax
	cmpl	$1092, %eax
	je	.L9
	movl	%edi, %eax
	andl	$546, %eax
	cmpl	$546, %eax
	je	.L9
	movl	%edi, %eax
	andl	$1057, %eax
	cmpl	$1057, %eax
	je	.L9
	andl	$292, %edi
	xorl	%eax, %eax
	cmpl	$292, %edi
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"b"
.LC1:
	.string	"w"
.LC2:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$3123612579, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$119, %eax
	jne	.L15
	movl	%r15d, %eax
	movl	%r15d, %ecx
	imulq	%r12, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %esi
	leal	(%rax,%rsi,2), %eax
	subl	%eax, %ecx
	movl	$1, %eax
	sall	%cl, %eax
	addl	%eax, %ebp
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, %r15d
.L12:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$48, %eax
	je	.L64
	cmpl	$11, %r15d
	je	.L65
	leal	1(%r15), %edx
	cmpl	$98, %eax
	jne	.L19
	movl	%r15d, %eax
	movl	%r15d, %ecx
	imulq	%r12, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %esi
	leal	(%rax,%rsi,2), %eax
	subl	%eax, %ecx
	movl	$1, %eax
	sall	%cl, %eax
	addl	%eax, %ebx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%ebx, %eax
	andl	$7, %eax
	cmpl	$7, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$112, %eax
	cmpl	$112, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$1792, %eax
	cmpl	$1792, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$273, %eax
	cmpl	$273, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$1092, %eax
	cmpl	$1092, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$546, %eax
	cmpl	$546, %eax
	je	.L16
	movl	%ebx, %eax
	andl	$1057, %eax
	cmpl	$1057, %eax
	je	.L16
	andl	$292, %ebx
	cmpl	$292, %ebx
	je	.L16
	movl	%ebp, %eax
	andl	$7, %eax
	cmpl	$7, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$112, %eax
	cmpl	$112, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$1792, %eax
	cmpl	$1792, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$273, %eax
	cmpl	$273, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$1092, %eax
	cmpl	$1092, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$546, %eax
	cmpl	$546, %eax
	je	.L18
	movl	%ebp, %eax
	andl	$1057, %eax
	cmpl	$1057, %eax
	je	.L18
	andl	$292, %ebp
	cmpl	$292, %ebp
	je	.L18
	movq	%r14, %rdi
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	call	puts@PLT
	xorl	%edx, %edx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L64:
	addq	$8, %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
.L16:
	.cfi_restore_state
	movq	%r13, %rdi
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	call	puts@PLT
	xorl	%edx, %edx
	jmp	.L15
.L18:
	leaq	.LC1(%rip), %rdi
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	call	puts@PLT
	xorl	%edx, %edx
	jmp	.L15
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

int f(int n)
{
	int c[8]={7,112,1792,273,1092,546,1057,292},i=0;
	for(;i<8;i++)
		if((n&c[i])==c[i])
			return 1;
	return 0;
}
int main()
{
	int i,t,b=0,w=0;
	for(i=0;(t=getchar())!=48;i++)
	{	
		if(i==11)
		{
			if(f(b))
				puts("b");
			else if(f(w))
				puts("w");
			else
				puts("NA");
			i=b=w=0;
			i--;
		}
		else
		{
			if(t==98)
				b+=(1<<i%11);
			else if(t==119)
				w+=(1<<i%11);
		}
	}
	return 0;
}
bbw
wbw
+b+
bwb
wbx
wbw
0
 bbw
bww
+b+
bwb
wbx
wbw
0
 bbw
wwb
+a+
bwb
xbw
wvb
0
 bbw
wbw
+b+
bbw
wcw
bww
0
 bbw
wcw
+c+
wbb
wcw
wwb
0
 cwb
wwb
++b
bwb
wbw
xyb
0
 bbw
wbw
+b+
bwb
wcw
wbw
0
 cbw
wbw
+b+
bwb
wbx
wbw
0
 cbw
wbw
+b+
bwb
wxb
wbw
0
 caw
wbw
+b+
bwb
wxb
wbw
0

b
NA
 NA
NA
 NA
b
 b
w
 NA
w
 b
b
 b
NA
 b
NA
 b
NA
 NA
NA

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

```c
#include<stdio.h>

int f(int n)
{
	int c[8]={7,112,1792,273,1092,546,1057,292},i=0;
	for(;i<8;i++)
		if((n&c[i])==c[i])
			return 1;
	return 0;
}
int main()
{
	int i,t,b=0,w=0;
	for(i=0;(t=getchar())!=48;i++)
	{	
		if(i==11)
		{
			if(f(b))
				puts("b");
			else if(f(w))
				puts("w");
			else
				puts("NA");
			i=b=w=0;
			i--;
		}
		else
		{
			if(t==98)
				b+=(1<<i%11);
			else if(t==119)
				w+=(1<<i%11);
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.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
	movl	$7, -48(%rbp)
	movl	$112, -44(%rbp)
	movl	$1792, -40(%rbp)
	movl	$273, -36(%rbp)
	movl	$1092, -32(%rbp)
	movl	$546, -28(%rbp)
	movl	$1057, -24(%rbp)
	movl	$292, -20(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L5:
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$1, %eax
	jmp	.L6
.L3:
	addl	$1, -52(%rbp)
.L2:
	cmpl	$7, -52(%rbp)
	jle	.L5
	movl	$0, %eax
.L6:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"b"
.LC1:
	.string	"w"
.LC2:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.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
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L9
.L16:
	cmpl	$11, -16(%rbp)
	jne	.L10
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L11
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L11:
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L13:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	subl	$1, -16(%rbp)
	jmp	.L14
.L10:
	cmpl	$98, -4(%rbp)
	jne	.L15
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%ecx, %edx
	subl	%eax, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	addl	%eax, -12(%rbp)
	jmp	.L14
.L15:
	cmpl	$119, -4(%rbp)
	jne	.L14
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	addl	%eax, -8(%rbp)
.L14:
	addl	$1, -16(%rbp)
.L9:
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$48, -4(%rbp)
	jne	.L16
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	f
	.type	f, @function
f:
.LFB0:
	.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
	movl	$7, -48(%rbp)
	movl	$112, -44(%rbp)
	movl	$1792, -40(%rbp)
	movl	$273, -36(%rbp)
	movl	$1092, -32(%rbp)
	movl	$546, -28(%rbp)
	movl	$1057, -24(%rbp)
	movl	$292, -20(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L5:
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$1, %eax
	jmp	.L6
.L3:
	addl	$1, -52(%rbp)
.L2:
	cmpl	$7, -52(%rbp)
	jle	.L5
	movl	$0, %eax
.L6:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"b"
.LC1:
	.string	"w"
.LC2:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.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
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L9
.L16:
	cmpl	$11, -16(%rbp)
	jne	.L10
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L11
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L11:
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L13:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	subl	$1, -16(%rbp)
	jmp	.L14
.L10:
	cmpl	$98, -4(%rbp)
	jne	.L15
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%ecx, %edx
	subl	%eax, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	addl	%eax, -12(%rbp)
	jmp	.L14
.L15:
	cmpl	$119, -4(%rbp)
	jne	.L14
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	addl	%eax, -8(%rbp)
.L14:
	addl	$1, -16(%rbp)
.L9:
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$48, -4(%rbp)
	jne	.L16
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
