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){

  int n,i;

  for(;;){
    scanf("%d",&n);
    if(n==0)break;

    int m=0,point=0,state=0;
    char s[n][2];

    for(i=0;i<n;i++)scanf("%s",s[i]);

    for(i=0;i<n;i++){

      if(state==0){
	if(s[i][1]=='d')point--;
	if(s[i][1]=='u'){
	  point++;
	  if(point==2){
	  m++;
	  state=1;
	  point=0;
	  }
	}
      }

      else if(state==1){
	if(s[i][1]=='u')point--;
	if(s[i][1]=='d'){
	  point++;
	  if(point==2){
	  m++;
	  state=0;
	  point=0;
	  }
	}
      }
    }
    
    printf("%d\n",m);
  }

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$40, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-60(%rbp), %rax
	movq	%rax, -72(%rbp)
	.p2align 4,,10
	.p2align 3
.L22:
	movq	-72(%rbp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	testl	%esi, %esi
	je	.L2
	movslq	%esi, %rax
	movq	%rsp, %rcx
	leaq	15(%rax,%rax), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L4
.L35:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L35
.L4:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L5
	orq	$0, -8(%rsp,%rdx)
.L5:
	movq	%rsp, %r12
	movq	%rsp, %r15
	xorl	%r14d, %r14d
	testl	%esi, %esi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	addq	$2, %r15
	cmpl	%r14d, %esi
	jg	.L8
	testl	%esi, %esi
	jle	.L10
	xorl	%r8d, %r8d
	xorl	%eax, %eax
.L9:
	addl	$1, %eax
	xorl	%edi, %edi
	cltq
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	je	.L36
.L11:
	cmpb	$117, %cl
	jne	.L32
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L15
.L32:
	cmpl	%eax, %esi
	jle	.L7
.L14:
	addq	$1, %rax
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	jne	.L11
.L36:
	subl	$1, %edi
	cmpl	%eax, %esi
	jg	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rsp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L15:
	leal	1(%r8), %r9d
	cmpl	%eax, %esi
	jle	.L25
	addl	$1, %edx
	xorl	%edi, %edi
	movslq	%edx, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	je	.L37
.L17:
	cmpb	$100, %cl
	jne	.L18
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L38
.L18:
	cmpl	%edx, %esi
	jle	.L25
.L21:
	addq	$1, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	jne	.L17
.L37:
	subl	$1, %edi
	cmpl	%edx, %esi
	jg	.L21
.L25:
	movl	%r9d, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L38:
	addl	$2, %r8d
	cmpl	%edx, %esi
	jg	.L9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L39
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L10:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
.L39:
	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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$40, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-60(%rbp), %rax
	movq	%rax, -72(%rbp)
	.p2align 4,,10
	.p2align 3
.L22:
	movq	-72(%rbp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	testl	%esi, %esi
	je	.L2
	movslq	%esi, %rax
	movq	%rsp, %rcx
	leaq	15(%rax,%rax), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L4
.L35:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L35
.L4:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L5
	orq	$0, -8(%rsp,%rdx)
.L5:
	movq	%rsp, %r12
	movq	%rsp, %r15
	xorl	%r14d, %r14d
	testl	%esi, %esi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	addq	$2, %r15
	cmpl	%r14d, %esi
	jg	.L8
	testl	%esi, %esi
	jle	.L10
	xorl	%r8d, %r8d
	xorl	%eax, %eax
.L9:
	addl	$1, %eax
	xorl	%edi, %edi
	cltq
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	je	.L36
.L11:
	cmpb	$117, %cl
	jne	.L32
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L15
.L32:
	cmpl	%eax, %esi
	jle	.L7
.L14:
	addq	$1, %rax
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	jne	.L11
.L36:
	subl	$1, %edi
	cmpl	%eax, %esi
	jg	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rsp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L15:
	leal	1(%r8), %r9d
	cmpl	%eax, %esi
	jle	.L25
	addl	$1, %edx
	xorl	%edi, %edi
	movslq	%edx, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	je	.L37
.L17:
	cmpb	$100, %cl
	jne	.L18
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L38
.L18:
	cmpl	%edx, %esi
	jle	.L25
.L21:
	addq	$1, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	jne	.L17
.L37:
	subl	$1, %edi
	cmpl	%edx, %esi
	jg	.L21
.L25:
	movl	%r9d, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L38:
	addl	$2, %r8d
	cmpl	%edx, %esi
	jg	.L9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L39
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L10:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
.L39:
	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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$40, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-60(%rbp), %rax
	movq	%rax, -72(%rbp)
	.p2align 4,,10
	.p2align 3
.L22:
	movq	-72(%rbp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	testl	%esi, %esi
	je	.L2
	movslq	%esi, %rax
	movq	%rsp, %rcx
	leaq	15(%rax,%rax), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L4
.L35:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L35
.L4:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L5
	orq	$0, -8(%rsp,%rdx)
.L5:
	movq	%rsp, %r12
	movq	%rsp, %r15
	xorl	%r14d, %r14d
	testl	%esi, %esi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	addq	$2, %r15
	cmpl	%r14d, %esi
	jg	.L8
	testl	%esi, %esi
	jle	.L10
	xorl	%r8d, %r8d
	xorl	%eax, %eax
.L9:
	addl	$1, %eax
	xorl	%edi, %edi
	cltq
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	je	.L36
.L11:
	cmpb	$117, %cl
	jne	.L32
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L15
.L32:
	cmpl	%eax, %esi
	jle	.L7
.L14:
	addq	$1, %rax
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	jne	.L11
.L36:
	subl	$1, %edi
	cmpl	%eax, %esi
	jg	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rsp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L15:
	leal	1(%r8), %r9d
	cmpl	%eax, %esi
	jle	.L25
	addl	$1, %edx
	xorl	%edi, %edi
	movslq	%edx, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	je	.L37
.L17:
	cmpb	$100, %cl
	jne	.L18
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L38
.L18:
	cmpl	%edx, %esi
	jle	.L25
.L21:
	addq	$1, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	jne	.L17
.L37:
	subl	$1, %edi
	cmpl	%edx, %esi
	jg	.L21
.L25:
	movl	%r9d, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L38:
	addl	$2, %r8d
	cmpl	%edx, %esi
	jg	.L9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L39
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L10:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
.L39:
	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){

  int n,i;

  for(;;){
    scanf("%d",&n);
    if(n==0)break;

    int m=0,point=0,state=0;
    char s[n][2];

    for(i=0;i<n;i++)scanf("%s",s[i]);

    for(i=0;i<n;i++){

      if(state==0){
	if(s[i][1]=='d')point--;
	if(s[i][1]=='u'){
	  point++;
	  if(point==2){
	  m++;
	  state=1;
	  point=0;
	  }
	}
      }

      else if(state==1){
	if(s[i][1]=='u')point--;
	if(s[i][1]=='d'){
	  point++;
	  if(point==2){
	  m++;
	  state=0;
	  point=0;
	  }
	}
      }
    }
    
    printf("%d\n",m);
  }

  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){

  int n,i;

  for(;;){
    scanf("%d",&n);
    if(n==0)break;

    int m=0,point=0,state=0;
    char s[n][2];

    for(i=0;i<n;i++)scanf("%s",s[i]);

    for(i=0;i<n;i++){

      if(state==0){
	if(s[i][1]=='d')point--;
	if(s[i][1]=='u'){
	  point++;
	  if(point==2){
	  m++;
	  state=1;
	  point=0;
	  }
	}
      }

      else if(state==1){
	if(s[i][1]=='u')point--;
	if(s[i][1]=='d'){
	  point++;
	  if(point==2){
	  m++;
	  state=0;
	  point=0;
	  }
	}
      }
    }
    
    printf("%d\n",m);
  }

  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:

4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd ru rd ru lu rd ld
0
 4
lu ru ld rd
0
lu ld lu ru
0
ul
10
vr lu ld rd rv rd ru lu rc kd
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd ru rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd su rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd su rd ru lu sd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt dr ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld dr su rd ru lu sd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt dr ru lu rd dl
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd ru rd ru lu rc ld
0

2
1
 2
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1

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){

  int n,i;

  for(;;){
    scanf("%d",&n);
    if(n==0)break;

    int m=0,point=0,state=0;
    char s[n][2];

    for(i=0;i<n;i++)scanf("%s",s[i]);

    for(i=0;i<n;i++){

      if(state==0){
	if(s[i][1]=='d')point--;
	if(s[i][1]=='u'){
	  point++;
	  if(point==2){
	  m++;
	  state=1;
	  point=0;
	  }
	}
      }

      else if(state==1){
	if(s[i][1]=='u')point--;
	if(s[i][1]=='d'){
	  point++;
	  if(point==2){
	  m++;
	  state=0;
	  point=0;
	  }
	}
      }
    }
    
    printf("%d\n",m);
  }

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$40, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-60(%rbp), %rax
	movq	%rax, -72(%rbp)
	.p2align 4,,10
	.p2align 3
.L22:
	movq	-72(%rbp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	testl	%esi, %esi
	je	.L2
	movslq	%esi, %rax
	movq	%rsp, %rcx
	leaq	15(%rax,%rax), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L4
.L35:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L35
.L4:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L5
	orq	$0, -8(%rsp,%rdx)
.L5:
	movq	%rsp, %r12
	movq	%rsp, %r15
	xorl	%r14d, %r14d
	testl	%esi, %esi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	addq	$2, %r15
	cmpl	%r14d, %esi
	jg	.L8
	testl	%esi, %esi
	jle	.L10
	xorl	%r8d, %r8d
	xorl	%eax, %eax
.L9:
	addl	$1, %eax
	xorl	%edi, %edi
	cltq
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	je	.L36
.L11:
	cmpb	$117, %cl
	jne	.L32
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L15
.L32:
	cmpl	%eax, %esi
	jle	.L7
.L14:
	addq	$1, %rax
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	jne	.L11
.L36:
	subl	$1, %edi
	cmpl	%eax, %esi
	jg	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rsp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L15:
	leal	1(%r8), %r9d
	cmpl	%eax, %esi
	jle	.L25
	addl	$1, %edx
	xorl	%edi, %edi
	movslq	%edx, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	je	.L37
.L17:
	cmpb	$100, %cl
	jne	.L18
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L38
.L18:
	cmpl	%edx, %esi
	jle	.L25
.L21:
	addq	$1, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	jne	.L17
.L37:
	subl	$1, %edi
	cmpl	%edx, %esi
	jg	.L21
.L25:
	movl	%r9d, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L38:
	addl	$2, %r8d
	cmpl	%edx, %esi
	jg	.L9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L39
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L10:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
.L39:
	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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$40, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-60(%rbp), %rax
	movq	%rax, -72(%rbp)
	.p2align 4,,10
	.p2align 3
.L22:
	movq	-72(%rbp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	testl	%esi, %esi
	je	.L2
	movslq	%esi, %rax
	movq	%rsp, %rcx
	leaq	15(%rax,%rax), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L4
.L35:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L35
.L4:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L5
	orq	$0, -8(%rsp,%rdx)
.L5:
	movq	%rsp, %r12
	movq	%rsp, %r15
	xorl	%r14d, %r14d
	testl	%esi, %esi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	addq	$2, %r15
	cmpl	%r14d, %esi
	jg	.L8
	testl	%esi, %esi
	jle	.L10
	xorl	%r8d, %r8d
	xorl	%eax, %eax
.L9:
	addl	$1, %eax
	xorl	%edi, %edi
	cltq
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	je	.L36
.L11:
	cmpb	$117, %cl
	jne	.L32
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L15
.L32:
	cmpl	%eax, %esi
	jle	.L7
.L14:
	addq	$1, %rax
	movzbl	-1(%r12,%rax,2), %ecx
	movl	%eax, %edx
	cmpb	$100, %cl
	jne	.L11
.L36:
	subl	$1, %edi
	cmpl	%eax, %esi
	jg	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rsp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L15:
	leal	1(%r8), %r9d
	cmpl	%eax, %esi
	jle	.L25
	addl	$1, %edx
	xorl	%edi, %edi
	movslq	%edx, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	je	.L37
.L17:
	cmpb	$100, %cl
	jne	.L18
	addl	$1, %edi
	cmpl	$2, %edi
	je	.L38
.L18:
	cmpl	%edx, %esi
	jle	.L25
.L21:
	addq	$1, %rdx
	movzbl	-1(%r12,%rdx,2), %ecx
	movl	%edx, %eax
	cmpb	$117, %cl
	jne	.L17
.L37:
	subl	$1, %edi
	cmpl	%edx, %esi
	jg	.L21
.L25:
	movl	%r9d, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L38:
	addl	$2, %r8d
	cmpl	%edx, %esi
	jg	.L9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L39
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L10:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
.L39:
	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:
```