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

```c
// AOJ 2967 AIGo
// 2019.9.24 bal4u

#include <stdio.h>

int L;
char S[105];

int main()
{
	int i, j, b, f, w, ans;
	
	scanf("%d%s", &L, S);
	ans = 0, b = 0, i = 0; while (i < L) {
		f = w = 0;
		if (S[i] == '.') {
			if (S[i+1] == '.') b = 0;
			while (S[i] == '.') i++;
			if (S[i] == 'B') { if (b == 0) f = 1; }
			else if (S[i] == 'W') {
				j = i+1; while (S[j] == 'W') j++;
				if (S[j] == '.') b = 0;
			}
		}
		if (S[i] == 'W') {
			f = 2; while (S[i] == 'W') i++;
		}
		if (S[i] == 'B') {
			b = 1, w = 0; while (S[i] == 'B') w++, i++;
		}
//		printf("f=%d, w=%d, ans=%d\n", f, w, ans);
		if (S[i] == 'W') {
			if (f == 1) {
				if (w > ans) ans = w;
				f = w = 0;
			}
			continue;
		}
		if (f == 2 && S[i] == '.') {
			j = i+1;
			while (S[j] == 'W') j++;
			if (S[j] != 'B' && w > ans) ans = w;
		}
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	L
	.bss
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.section	.rodata
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	S(%rip), %rax
	movq	%rax, %rdx
	leaq	L(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L21:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L3
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L5
	movl	$0, -16(%rbp)
	jmp	.L5
.L6:
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	je	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L7
	cmpl	$0, -16(%rbp)
	jne	.L3
	movl	$1, -12(%rbp)
	jmp	.L3
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L3
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L9
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L3
	movl	$0, -16(%rbp)
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L10
	movl	$2, -12(%rbp)
	jmp	.L11
.L12:
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L12
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L13
	movl	$1, -16(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L14
.L15:
	addl	$1, -8(%rbp)
	addl	$1, -24(%rbp)
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	je	.L15
.L13:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L16
	cmpl	$1, -12(%rbp)
	jne	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L18
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L18:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L16:
	cmpl	$2, -12(%rbp)
	jne	.L2
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L2
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L19
.L20:
	addl	$1, -20(%rbp)
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L20
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	je	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L2:
	movl	L(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	L(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	S(%rip), %rbx
	movq	%rbx, %rdx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	__isoc99_scanf@PLT
	movl	L(%rip), %r8d
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L2
	xorl	%r11d, %r11d
	xorl	%eax, %eax
	leaq	-1(%rbx), %rdi
	xorl	%r10d, %r10d
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$87, %cl
	je	.L24
	cmpb	$66, %cl
	je	.L59
.L20:
	cmpl	%eax, %r8d
	jle	.L2
.L23:
	movslq	%eax, %rdx
	movzbl	(%rbx,%rdx), %ecx
	cmpb	$46, %cl
	jne	.L3
	leal	1(%rax), %ebp
	movslq	%ebp, %rcx
	movzbl	(%rbx,%rcx), %ecx
	cmpb	$46, %cl
	je	.L60
	cmpb	$66, %cl
	jne	.L61
	testl	%r11d, %r11d
	je	.L25
	movl	%ebp, %eax
	xorl	%r11d, %r11d
	xorl	%ebp, %ebp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L60:
	addq	%rbx, %rdx
	movl	%ebp, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	movzbl	2(%rdx), %ecx
	movl	%eax, %esi
	addq	$1, %rdx
	addl	$1, %eax
	cmpb	$46, %cl
	je	.L5
	cmpb	$66, %cl
	je	.L32
	xorl	%r11d, %r11d
.L7:
	cmpb	$87, %cl
	jne	.L20
	leal	2(%rsi), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %ecx
	cmpb	$87, %cl
	jne	.L11
	movslq	%esi, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	3(%rdx), %ecx
	addq	$1, %rdx
	cmpb	$87, %cl
	je	.L12
.L11:
	cmpb	$46, %cl
	cmove	%r10d, %r11d
	.p2align 4,,10
	.p2align 3
.L24:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %eax
	addq	$1, %rdx
	movzbl	(%rdi,%rdx), %ecx
	cmpb	$87, %cl
	je	.L16
	movl	$1, %ebp
	cmpb	$66, %cl
	je	.L30
	xorl	%esi, %esi
.L19:
	cmpb	$46, %cl
	jne	.L20
	testb	%bpl, %bpl
	je	.L20
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %ecx
	cmpb	$87, %cl
	jne	.L21
	movslq	%eax, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movzbl	2(%rdx), %ecx
	addq	$1, %rdx
	cmpb	$87, %cl
	je	.L22
.L21:
	cmpb	$66, %cl
	je	.L20
.L57:
	cmpl	%esi, %r9d
	cmovl	%esi, %r9d
	cmpl	%eax, %r8d
	jg	.L23
.L2:
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L59:
	.cfi_restore_state
	xorl	%ebp, %ebp
	xorl	%r11d, %r11d
.L9:
	leal	1(%rax), %edx
	xorl	%esi, %esi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edx, %eax
	addq	$1, %rdx
	addl	$1, %esi
	movzbl	(%rdi,%rdx), %ecx
	cmpb	$66, %cl
	je	.L18
	cmpb	$87, %cl
	jne	.L28
	cmpl	$1, %r11d
	je	.L57
	movl	$1, %r11d
	jmp	.L20
.L30:
	movl	$2, %r11d
	jmp	.L9
.L32:
	movl	%eax, %ebp
.L25:
	movl	%ebp, %eax
	movl	$1, %r11d
	xorl	%ebp, %ebp
	jmp	.L9
.L28:
	movl	$1, %r11d
	jmp	.L19
.L61:
	movl	%eax, %esi
	movl	%ebp, %eax
	jmp	.L7
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.globl	L
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	L(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	S(%rip), %rbx
	movq	%rbx, %rdx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	__isoc99_scanf@PLT
	movl	L(%rip), %r8d
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L2
	xorl	%r11d, %r11d
	xorl	%eax, %eax
	leaq	-1(%rbx), %rdi
	xorl	%r10d, %r10d
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$87, %cl
	je	.L24
	cmpb	$66, %cl
	je	.L59
.L20:
	cmpl	%eax, %r8d
	jle	.L2
.L23:
	movslq	%eax, %rdx
	movzbl	(%rbx,%rdx), %ecx
	cmpb	$46, %cl
	jne	.L3
	leal	1(%rax), %ebp
	movslq	%ebp, %rcx
	movzbl	(%rbx,%rcx), %ecx
	cmpb	$46, %cl
	je	.L60
	cmpb	$66, %cl
	jne	.L61
	testl	%r11d, %r11d
	je	.L25
	movl	%ebp, %eax
	xorl	%r11d, %r11d
	xorl	%ebp, %ebp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L60:
	addq	%rbx, %rdx
	movl	%ebp, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	movzbl	2(%rdx), %ecx
	movl	%eax, %esi
	addq	$1, %rdx
	addl	$1, %eax
	cmpb	$46, %cl
	je	.L5
	cmpb	$66, %cl
	je	.L32
	xorl	%r11d, %r11d
.L7:
	cmpb	$87, %cl
	jne	.L20
	leal	2(%rsi), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %ecx
	cmpb	$87, %cl
	jne	.L11
	movslq	%esi, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	3(%rdx), %ecx
	addq	$1, %rdx
	cmpb	$87, %cl
	je	.L12
.L11:
	cmpb	$46, %cl
	cmove	%r10d, %r11d
	.p2align 4,,10
	.p2align 3
.L24:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %eax
	addq	$1, %rdx
	movzbl	(%rdi,%rdx), %ecx
	cmpb	$87, %cl
	je	.L16
	movl	$1, %ebp
	cmpb	$66, %cl
	je	.L30
	xorl	%esi, %esi
.L19:
	cmpb	$46, %cl
	jne	.L20
	testb	%bpl, %bpl
	je	.L20
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %ecx
	cmpb	$87, %cl
	jne	.L21
	movslq	%eax, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movzbl	2(%rdx), %ecx
	addq	$1, %rdx
	cmpb	$87, %cl
	je	.L22
.L21:
	cmpb	$66, %cl
	je	.L20
.L57:
	cmpl	%esi, %r9d
	cmovl	%esi, %r9d
	cmpl	%eax, %r8d
	jg	.L23
.L2:
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L59:
	.cfi_restore_state
	xorl	%ebp, %ebp
	xorl	%r11d, %r11d
.L9:
	leal	1(%rax), %edx
	xorl	%esi, %esi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edx, %eax
	addq	$1, %rdx
	addl	$1, %esi
	movzbl	(%rdi,%rdx), %ecx
	cmpb	$66, %cl
	je	.L18
	cmpb	$87, %cl
	jne	.L28
	cmpl	$1, %r11d
	je	.L57
	movl	$1, %r11d
	jmp	.L20
.L30:
	movl	$2, %r11d
	jmp	.L9
.L32:
	movl	%eax, %ebp
.L25:
	movl	%ebp, %eax
	movl	$1, %r11d
	xorl	%ebp, %ebp
	jmp	.L9
.L28:
	movl	$1, %r11d
	jmp	.L19
.L61:
	movl	%eax, %esi
	movl	%ebp, %eax
	jmp	.L7
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.globl	L
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.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:

// AOJ 2967 AIGo
// 2019.9.24 bal4u

#include <stdio.h>

int L;
char S[105];

int main()
{
	int i, j, b, f, w, ans;
	
	scanf("%d%s", &L, S);
	ans = 0, b = 0, i = 0; while (i < L) {
		f = w = 0;
		if (S[i] == '.') {
			if (S[i+1] == '.') b = 0;
			while (S[i] == '.') i++;
			if (S[i] == 'B') { if (b == 0) f = 1; }
			else if (S[i] == 'W') {
				j = i+1; while (S[j] == 'W') j++;
				if (S[j] == '.') b = 0;
			}
		}
		if (S[i] == 'W') {
			f = 2; while (S[i] == 'W') i++;
		}
		if (S[i] == 'B') {
			b = 1, w = 0; while (S[i] == 'B') w++, i++;
		}
//		printf("f=%d, w=%d, ans=%d\n", f, w, ans);
		if (S[i] == 'W') {
			if (f == 1) {
				if (w > ans) ans = w;
				f = w = 0;
			}
			continue;
		}
		if (f == 2 && S[i] == '.') {
			j = i+1;
			while (S[j] == 'W') j++;
			if (S[j] != 'B' && w > ans) ans = w;
		}
	}
	printf("%d\n", ans);
	return 0;
}

0

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

```c
// AOJ 2967 AIGo
// 2019.9.24 bal4u

#include <stdio.h>

int L;
char S[105];

int main()
{
	int i, j, b, f, w, ans;
	
	scanf("%d%s", &L, S);
	ans = 0, b = 0, i = 0; while (i < L) {
		f = w = 0;
		if (S[i] == '.') {
			if (S[i+1] == '.') b = 0;
			while (S[i] == '.') i++;
			if (S[i] == 'B') { if (b == 0) f = 1; }
			else if (S[i] == 'W') {
				j = i+1; while (S[j] == 'W') j++;
				if (S[j] == '.') b = 0;
			}
		}
		if (S[i] == 'W') {
			f = 2; while (S[i] == 'W') i++;
		}
		if (S[i] == 'B') {
			b = 1, w = 0; while (S[i] == 'B') w++, i++;
		}
//		printf("f=%d, w=%d, ans=%d\n", f, w, ans);
		if (S[i] == 'W') {
			if (f == 1) {
				if (w > ans) ans = w;
				f = w = 0;
			}
			continue;
		}
		if (f == 2 && S[i] == '.') {
			j = i+1;
			while (S[j] == 'W') j++;
			if (S[j] != 'B' && w > ans) ans = w;
		}
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	L
	.bss
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.section	.rodata
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	S(%rip), %rax
	movq	%rax, %rdx
	leaq	L(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L21:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L3
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L5
	movl	$0, -16(%rbp)
	jmp	.L5
.L6:
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	je	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L7
	cmpl	$0, -16(%rbp)
	jne	.L3
	movl	$1, -12(%rbp)
	jmp	.L3
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L3
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L9
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L3
	movl	$0, -16(%rbp)
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L10
	movl	$2, -12(%rbp)
	jmp	.L11
.L12:
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L12
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L13
	movl	$1, -16(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L14
.L15:
	addl	$1, -8(%rbp)
	addl	$1, -24(%rbp)
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	je	.L15
.L13:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L16
	cmpl	$1, -12(%rbp)
	jne	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L18
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L18:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L16:
	cmpl	$2, -12(%rbp)
	jne	.L2
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L2
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L19
.L20:
	addl	$1, -20(%rbp)
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L20
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	je	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L2:
	movl	L(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	L
	.bss
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.section	.rodata
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	S(%rip), %rax
	movq	%rax, %rdx
	leaq	L(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L21:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L3
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L5
	movl	$0, -16(%rbp)
	jmp	.L5
.L6:
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	je	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L7
	cmpl	$0, -16(%rbp)
	jne	.L3
	movl	$1, -12(%rbp)
	jmp	.L3
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L3
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L9
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L3
	movl	$0, -16(%rbp)
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L10
	movl	$2, -12(%rbp)
	jmp	.L11
.L12:
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L12
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L13
	movl	$1, -16(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L14
.L15:
	addl	$1, -8(%rbp)
	addl	$1, -24(%rbp)
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	je	.L15
.L13:
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L16
	cmpl	$1, -12(%rbp)
	jne	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L18
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L18:
	movl	$0, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L16:
	cmpl	$2, -12(%rbp)
	jne	.L2
	movl	-24(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L2
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L19
.L20:
	addl	$1, -20(%rbp)
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	je	.L20
	movl	-20(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	je	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L2:
	movl	L(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
