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

```c
#include <stdio.h>


int main(void){
	char str[101];
	char dir[20];
	while(scanf("%s",str),str[0]!='#'){
		int i=0,j=0;
		while(str[i]){
			if(str[i]=='n'){
				dir[j]='n';
				j++;
				i+=5;
			}else if(str[i]=='w'){
				dir[j]='w';
				j++;
				i+=4;
			}
		}
		int numerator=0;
		int denominator=1<<(j-1);
		for(i=0;i<j;i++){
			if(i+1==j){
				if(dir[i]=='w'){
					numerator+=90*(1<<i);
				}else{
					numerator+=0;
				}
				break;
			}
			if(dir[i]=='w'){
				numerator+=90*(1<<i);
			}else{
				numerator-=90*(1<<i);
			}
		}
		while(denominator>1){
			if(numerator%2==0&&denominator%2==0){
				numerator/=2;
				denominator/=2;
			}else{
				break;
			}
		}
		printf("%d",numerator);
		if(denominator>1){
			printf("/%d",denominator);
		}
		printf("\n");
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"/%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$-1, %ecx
	movl	$1, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	sall	%cl, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	movl	%r15d, 12(%rsp)
	movl	$90, %r15d
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	48(%rsp), %eax
	cmpb	$35, %al
	je	.L19
	movl	12(%rsp), %r14d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$110, %al
	je	.L36
	cmpb	$119, %al
	jne	.L7
	movslq	%edx, %rax
	addl	$4, %ecx
	addl	$1, %edx
	movb	$119, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
.L4:
	testb	%al, %al
	jne	.L7
	leal	-1(%rdx), %ecx
	movl	%r12d, %r14d
	sall	%cl, %r14d
	testl	%edx, %edx
	je	.L8
	cmpl	$1, %edx
	je	.L37
	movl	%ecx, %eax
	xorl	%edx, %edx
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	subl	%esi, %edx
	cmpq	%rcx, %rax
	je	.L8
.L17:
	addq	$1, %rcx
	cmpq	%rcx, %rax
	je	.L9
.L11:
	movl	%r15d, %esi
	leal	1(%rcx), %r10d
	sall	%cl, %esi
	cmpb	$119, (%rdi,%rcx)
	jne	.L15
	addl	%esi, %edx
	cmpq	%rcx, %rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$1, %r14d
	jg	.L18
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%edx, %eax
	sarl	%r14d
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	cmpl	$1, %r14d
	je	.L12
.L18:
	movl	%edx, %eax
	orl	%r14d, %eax
	testb	$1, %al
	je	.L38
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
.L20:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	%edx, %rax
	addl	$5, %ecx
	addl	$1, %edx
	movb	$110, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
	jmp	.L4
.L37:
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%r10d, %rax
	cmpb	$119, 16(%rsp,%rax)
	jne	.L8
	movl	%r15d, %eax
	movl	%r10d, %ecx
	sall	%cl, %eax
	addl	%eax, %edx
	cmpl	$1, %r14d
	jg	.L18
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$168, %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
.L39:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"/%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$-1, %ecx
	movl	$1, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	sall	%cl, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	movl	%r15d, 12(%rsp)
	movl	$90, %r15d
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	48(%rsp), %eax
	cmpb	$35, %al
	je	.L19
	movl	12(%rsp), %r14d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$110, %al
	je	.L36
	cmpb	$119, %al
	jne	.L7
	movslq	%edx, %rax
	addl	$4, %ecx
	addl	$1, %edx
	movb	$119, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
.L4:
	testb	%al, %al
	jne	.L7
	leal	-1(%rdx), %ecx
	movl	%r12d, %r14d
	sall	%cl, %r14d
	testl	%edx, %edx
	je	.L8
	cmpl	$1, %edx
	je	.L37
	movl	%ecx, %eax
	xorl	%edx, %edx
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	subl	%esi, %edx
	cmpq	%rcx, %rax
	je	.L8
.L17:
	addq	$1, %rcx
	cmpq	%rcx, %rax
	je	.L9
.L11:
	movl	%r15d, %esi
	leal	1(%rcx), %r10d
	sall	%cl, %esi
	cmpb	$119, (%rdi,%rcx)
	jne	.L15
	addl	%esi, %edx
	cmpq	%rcx, %rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$1, %r14d
	jg	.L18
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%edx, %eax
	sarl	%r14d
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	cmpl	$1, %r14d
	je	.L12
.L18:
	movl	%edx, %eax
	orl	%r14d, %eax
	testb	$1, %al
	je	.L38
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
.L20:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	%edx, %rax
	addl	$5, %ecx
	addl	$1, %edx
	movb	$110, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
	jmp	.L4
.L37:
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%r10d, %rax
	cmpb	$119, 16(%rsp,%rax)
	jne	.L8
	movl	%r15d, %eax
	movl	%r10d, %ecx
	sall	%cl, %eax
	addl	%eax, %edx
	cmpl	$1, %r14d
	jg	.L18
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$168, %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
.L39:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"/%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$-1, %ecx
	movl	$1, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	sall	%cl, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	movl	%r15d, 12(%rsp)
	movl	$90, %r15d
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	48(%rsp), %eax
	cmpb	$35, %al
	je	.L19
	movl	12(%rsp), %r14d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$110, %al
	je	.L36
	cmpb	$119, %al
	jne	.L7
	movslq	%edx, %rax
	addl	$4, %ecx
	addl	$1, %edx
	movb	$119, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
.L4:
	testb	%al, %al
	jne	.L7
	leal	-1(%rdx), %ecx
	movl	%r12d, %r14d
	sall	%cl, %r14d
	testl	%edx, %edx
	je	.L8
	cmpl	$1, %edx
	je	.L37
	movl	%ecx, %eax
	xorl	%edx, %edx
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	subl	%esi, %edx
	cmpq	%rcx, %rax
	je	.L8
.L17:
	addq	$1, %rcx
	cmpq	%rcx, %rax
	je	.L9
.L11:
	movl	%r15d, %esi
	leal	1(%rcx), %r10d
	sall	%cl, %esi
	cmpb	$119, (%rdi,%rcx)
	jne	.L15
	addl	%esi, %edx
	cmpq	%rcx, %rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$1, %r14d
	jg	.L18
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%edx, %eax
	sarl	%r14d
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	cmpl	$1, %r14d
	je	.L12
.L18:
	movl	%edx, %eax
	orl	%r14d, %eax
	testb	$1, %al
	je	.L38
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
.L20:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	%edx, %rax
	addl	$5, %ecx
	addl	$1, %edx
	movb	$110, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
	jmp	.L4
.L37:
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%r10d, %rax
	cmpb	$119, 16(%rsp,%rax)
	jne	.L8
	movl	%r15d, %eax
	movl	%r10d, %ecx
	sall	%cl, %eax
	addl	%eax, %edx
	cmpl	$1, %r14d
	jg	.L18
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$168, %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
.L39:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include <stdio.h>


int main(void){
	char str[101];
	char dir[20];
	while(scanf("%s",str),str[0]!='#'){
		int i=0,j=0;
		while(str[i]){
			if(str[i]=='n'){
				dir[j]='n';
				j++;
				i+=5;
			}else if(str[i]=='w'){
				dir[j]='w';
				j++;
				i+=4;
			}
		}
		int numerator=0;
		int denominator=1<<(j-1);
		for(i=0;i<j;i++){
			if(i+1==j){
				if(dir[i]=='w'){
					numerator+=90*(1<<i);
				}else{
					numerator+=0;
				}
				break;
			}
			if(dir[i]=='w'){
				numerator+=90*(1<<i);
			}else{
				numerator-=90*(1<<i);
			}
		}
		while(denominator>1){
			if(numerator%2==0&&denominator%2==0){
				numerator/=2;
				denominator/=2;
			}else{
				break;
			}
		}
		printf("%d",numerator);
		if(denominator>1){
			printf("/%d",denominator);
		}
		printf("\n");
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>


int main(void){
	char str[101];
	char dir[20];
	while(scanf("%s",str),str[0]!='#'){
		int i=0,j=0;
		while(str[i]){
			if(str[i]=='n'){
				dir[j]='n';
				j++;
				i+=5;
			}else if(str[i]=='w'){
				dir[j]='w';
				j++;
				i+=4;
			}
		}
		int numerator=0;
		int denominator=1<<(j-1);
		for(i=0;i<j;i++){
			if(i+1==j){
				if(dir[i]=='w'){
					numerator+=90*(1<<i);
				}else{
					numerator+=0;
				}
				break;
			}
			if(dir[i]=='w'){
				numerator+=90*(1<<i);
			}else{
				numerator-=90*(1<<i);
			}
		}
		while(denominator>1){
			if(numerator%2==0&&denominator%2==0){
				numerator/=2;
				denominator/=2;
			}else{
				break;
			}
		}
		printf("%d",numerator);
		if(denominator>1){
			printf("/%d",denominator);
		}
		printf("\n");
	}
	return 0;
}```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

north
west
northwest
northnorthwest
westwestwestnorth
#
 north
west
northwest
northnorthwest
westwestwestnorth
#

0
90
45
45/2
315/4
 0
90
45
45/2
315/4

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

```c
#include <stdio.h>


int main(void){
	char str[101];
	char dir[20];
	while(scanf("%s",str),str[0]!='#'){
		int i=0,j=0;
		while(str[i]){
			if(str[i]=='n'){
				dir[j]='n';
				j++;
				i+=5;
			}else if(str[i]=='w'){
				dir[j]='w';
				j++;
				i+=4;
			}
		}
		int numerator=0;
		int denominator=1<<(j-1);
		for(i=0;i<j;i++){
			if(i+1==j){
				if(dir[i]=='w'){
					numerator+=90*(1<<i);
				}else{
					numerator+=0;
				}
				break;
			}
			if(dir[i]=='w'){
				numerator+=90*(1<<i);
			}else{
				numerator-=90*(1<<i);
			}
		}
		while(denominator>1){
			if(numerator%2==0&&denominator%2==0){
				numerator/=2;
				denominator/=2;
			}else{
				break;
			}
		}
		printf("%d",numerator);
		if(denominator>1){
			printf("/%d",denominator);
		}
		printf("\n");
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"/%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$-1, %ecx
	movl	$1, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	sall	%cl, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	movl	%r15d, 12(%rsp)
	movl	$90, %r15d
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	48(%rsp), %eax
	cmpb	$35, %al
	je	.L19
	movl	12(%rsp), %r14d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$110, %al
	je	.L36
	cmpb	$119, %al
	jne	.L7
	movslq	%edx, %rax
	addl	$4, %ecx
	addl	$1, %edx
	movb	$119, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
.L4:
	testb	%al, %al
	jne	.L7
	leal	-1(%rdx), %ecx
	movl	%r12d, %r14d
	sall	%cl, %r14d
	testl	%edx, %edx
	je	.L8
	cmpl	$1, %edx
	je	.L37
	movl	%ecx, %eax
	xorl	%edx, %edx
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	subl	%esi, %edx
	cmpq	%rcx, %rax
	je	.L8
.L17:
	addq	$1, %rcx
	cmpq	%rcx, %rax
	je	.L9
.L11:
	movl	%r15d, %esi
	leal	1(%rcx), %r10d
	sall	%cl, %esi
	cmpb	$119, (%rdi,%rcx)
	jne	.L15
	addl	%esi, %edx
	cmpq	%rcx, %rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$1, %r14d
	jg	.L18
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%edx, %eax
	sarl	%r14d
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	cmpl	$1, %r14d
	je	.L12
.L18:
	movl	%edx, %eax
	orl	%r14d, %eax
	testb	$1, %al
	je	.L38
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
.L20:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	%edx, %rax
	addl	$5, %ecx
	addl	$1, %edx
	movb	$110, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
	jmp	.L4
.L37:
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%r10d, %rax
	cmpb	$119, 16(%rsp,%rax)
	jne	.L8
	movl	%r15d, %eax
	movl	%r10d, %ecx
	sall	%cl, %eax
	addl	%eax, %edx
	cmpl	$1, %r14d
	jg	.L18
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$168, %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
.L39:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"/%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$-1, %ecx
	movl	$1, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	sall	%cl, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	movl	%r15d, 12(%rsp)
	movl	$90, %r15d
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	48(%rsp), %eax
	cmpb	$35, %al
	je	.L19
	movl	12(%rsp), %r14d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$110, %al
	je	.L36
	cmpb	$119, %al
	jne	.L7
	movslq	%edx, %rax
	addl	$4, %ecx
	addl	$1, %edx
	movb	$119, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
.L4:
	testb	%al, %al
	jne	.L7
	leal	-1(%rdx), %ecx
	movl	%r12d, %r14d
	sall	%cl, %r14d
	testl	%edx, %edx
	je	.L8
	cmpl	$1, %edx
	je	.L37
	movl	%ecx, %eax
	xorl	%edx, %edx
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	subl	%esi, %edx
	cmpq	%rcx, %rax
	je	.L8
.L17:
	addq	$1, %rcx
	cmpq	%rcx, %rax
	je	.L9
.L11:
	movl	%r15d, %esi
	leal	1(%rcx), %r10d
	sall	%cl, %esi
	cmpb	$119, (%rdi,%rcx)
	jne	.L15
	addl	%esi, %edx
	cmpq	%rcx, %rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$1, %r14d
	jg	.L18
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%edx, %eax
	sarl	%r14d
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	cmpl	$1, %r14d
	je	.L12
.L18:
	movl	%edx, %eax
	orl	%r14d, %eax
	testb	$1, %al
	je	.L38
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
.L20:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	%edx, %rax
	addl	$5, %ecx
	addl	$1, %edx
	movb	$110, 16(%rsp,%rax)
	movslq	%ecx, %rax
	movzbl	48(%rsp,%rax), %eax
	jmp	.L4
.L37:
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%r10d, %rax
	cmpb	$119, 16(%rsp,%rax)
	jne	.L8
	movl	%r15d, %eax
	movl	%r10d, %ecx
	sall	%cl, %eax
	addl	%eax, %edx
	cmpl	$1, %r14d
	jg	.L18
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$168, %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
.L39:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```