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>
#define M 1000000
int main(){
  int X[]={0,1,0,-1};
  int Y[]={1,0,-1,0};
  int w,h,d,a,x,y;
  char s;
  while(scanf("%d %d",&w,&h),w||h){
    d=0;
    x=y=1;
    while(scanf(" %c%*s",&s)){
      if(s=='F'){
	scanf("%d",&a);
	x+=X[d]*a;
	y+=Y[d]*a;
      }
      if(s=='B'){
	scanf("%d",&a);
	x-=X[d]*a;
	y-=Y[d]*a;
      }
      if(s=='L')d--;
      if(s=='R')d++;
      if(s=='S'){
	printf("%d %d\n",x,y);
	break;
      }
      d+=4;
      d%=4;
      if(x<1)x=1;
      if(w<x)x=w;
      if(y<1)y=1;
      if(h<y)y=h;
    }
  }
  return 0;
}

      ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	" %c%*s"
.LC3:
	.string	"%d %d"
	.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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -48(%rbp)
	movl	$1, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$-1, -36(%rbp)
	movl	$1, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$-1, -24(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L2
.L16:
	movl	$0, -60(%rbp)
	movl	$1, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -56(%rbp)
	jmp	.L3
.L12:
	movzbl	-73(%rbp), %eax
	cmpb	$70, %al
	jne	.L4
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -56(%rbp)
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -52(%rbp)
.L4:
	movzbl	-73(%rbp), %eax
	cmpb	$66, %al
	jne	.L5
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	subl	%eax, -56(%rbp)
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	subl	%eax, -52(%rbp)
.L5:
	movzbl	-73(%rbp), %eax
	cmpb	$76, %al
	jne	.L6
	subl	$1, -60(%rbp)
.L6:
	movzbl	-73(%rbp), %eax
	cmpb	$82, %al
	jne	.L7
	addl	$1, -60(%rbp)
.L7:
	movzbl	-73(%rbp), %eax
	cmpb	$83, %al
	jne	.L8
	movl	-52(%rbp), %edx
	movl	-56(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L8:
	addl	$4, -60(%rbp)
	movl	-60(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, -60(%rbp)
	cmpl	$0, -56(%rbp)
	jg	.L9
	movl	$1, -56(%rbp)
.L9:
	movl	-72(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jle	.L10
	movl	-72(%rbp), %eax
	movl	%eax, -56(%rbp)
.L10:
	cmpl	$0, -52(%rbp)
	jg	.L11
	movl	$1, -52(%rbp)
.L11:
	movl	-68(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L3
	movl	-68(%rbp), %eax
	movl	%eax, -52(%rbp)
.L3:
	leaq	-73(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L12
.L2:
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-68(%rbp), %eax
	testl	%eax, %eax
	je	.L14
.L13:
	movl	$1, %eax
	jmp	.L15
.L14:
	movl	$0, %eax
.L15:
	testl	%eax, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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
.LC2:
	.string	"%d"
.LC3:
	.string	"%d %d\n"
.LC4:
	.string	" %c%*s"
.LC5:
	.string	"%d %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
	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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movq	%rax, (%rsp)
	movaps	%xmm0, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	19(%rsp), %rbx
.L10:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	orl	24(%rsp), %eax
	je	.L16
	movl	$1, %r14d
	movl	$1, %r13d
	xorl	%r15d, %r15d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	cmpb	$82, %al
	je	.L7
	cmpb	$83, %al
	je	.L17
.L6:
	andl	$3, %r15d
	movl	$1, %eax
	testl	%r13d, %r13d
	movl	20(%rsp), %edx
	cmovg	%r13d, %eax
	movl	24(%rsp), %ecx
	cmpl	%edx, %eax
	cmovle	%eax, %edx
	testl	%r14d, %r14d
	movl	$1, %eax
	cmovg	%r14d, %eax
	movl	%edx, %r13d
	cmpl	%ecx, %eax
	cmovle	%eax, %ecx
	movl	%ecx, %r14d
.L11:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L10
	movzbl	19(%rsp), %eax
	cmpb	$70, %al
	je	.L18
.L3:
	cmpb	$66, %al
	je	.L19
.L4:
	cmpb	$76, %al
	jne	.L5
	subl	$1, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	leaq	28(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%r15d, %rsi
	movl	28(%rsp), %eax
	movl	32(%rsp,%rsi,4), %edi
	imull	%eax, %edi
	imull	48(%rsp,%rsi,4), %eax
	subl	%edi, %r13d
	subl	%eax, %r14d
	movzbl	19(%rsp), %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	28(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%r15d, %rsi
	movl	28(%rsp), %eax
	movl	32(%rsp,%rsi,4), %edi
	imull	%eax, %edi
	imull	48(%rsp,%rsi,4), %eax
	addl	%edi, %r13d
	addl	%eax, %r14d
	movzbl	19(%rsp), %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r14d, %ecx
	movl	%r13d, %edx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L2
.L16:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$88, %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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	0
	.long	-1
	.align 16
.LC1:
	.long	1
	.long	0
	.long	-1
	.long	0
	.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
.LC2:
	.string	"%d"
.LC3:
	.string	"%d %d\n"
.LC4:
	.string	" %c%*s"
.LC5:
	.string	"%d %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
	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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movq	%rax, (%rsp)
	movaps	%xmm0, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	19(%rsp), %rbx
.L10:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	orl	24(%rsp), %eax
	je	.L16
	movl	$1, %r14d
	movl	$1, %r13d
	xorl	%r15d, %r15d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	cmpb	$82, %al
	je	.L7
	cmpb	$83, %al
	je	.L17
.L6:
	andl	$3, %r15d
	movl	$1, %eax
	testl	%r13d, %r13d
	movl	20(%rsp), %edx
	cmovg	%r13d, %eax
	movl	24(%rsp), %ecx
	cmpl	%edx, %eax
	cmovle	%eax, %edx
	testl	%r14d, %r14d
	movl	$1, %eax
	cmovg	%r14d, %eax
	movl	%edx, %r13d
	cmpl	%ecx, %eax
	cmovle	%eax, %ecx
	movl	%ecx, %r14d
.L11:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L10
	movzbl	19(%rsp), %eax
	cmpb	$70, %al
	je	.L18
.L3:
	cmpb	$66, %al
	je	.L19
.L4:
	cmpb	$76, %al
	jne	.L5
	subl	$1, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	leaq	28(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%r15d, %rsi
	movl	28(%rsp), %eax
	movl	32(%rsp,%rsi,4), %edi
	imull	%eax, %edi
	imull	48(%rsp,%rsi,4), %eax
	subl	%edi, %r13d
	subl	%eax, %r14d
	movzbl	19(%rsp), %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	28(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%r15d, %rsi
	movl	28(%rsp), %eax
	movl	32(%rsp,%rsi,4), %edi
	imull	%eax, %edi
	imull	48(%rsp,%rsi,4), %eax
	addl	%edi, %r13d
	addl	%eax, %r14d
	movzbl	19(%rsp), %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r14d, %ecx
	movl	%r13d, %edx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L2
.L16:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$88, %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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	0
	.long	-1
	.align 16
.LC1:
	.long	1
	.long	0
	.long	-1
	.long	0
	.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>
#define M 1000000
int main(){
  int X[]={0,1,0,-1};
  int Y[]={1,0,-1,0};
  int w,h,d,a,x,y;
  char s;
  while(scanf("%d %d",&w,&h),w||h){
    d=0;
    x=y=1;
    while(scanf(" %c%*s",&s)){
      if(s=='F'){
	scanf("%d",&a);
	x+=X[d]*a;
	y+=Y[d]*a;
      }
      if(s=='B'){
	scanf("%d",&a);
	x-=X[d]*a;
	y-=Y[d]*a;
      }
      if(s=='L')d--;
      if(s=='R')d++;
      if(s=='S'){
	printf("%d %d\n",x,y);
	break;
      }
      d+=4;
      d%=4;
      if(x<1)x=1;
      if(w<x)x=w;
      if(y<1)y=1;
      if(h<y)y=h;
    }
  }
  return 0;
}

      
6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
5 1
FORWARD 2
STOP
0 0
 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 3
STOP
3 1
FORWARD 2
STOP
0 0
 6 6
FORDARW 1
RIGHT
FORWARD 5
LEFT
BACKWARD 3
STOP
3 2
FORWARD 2
STOP
0 0

6 2
1 1
 6 1
1 1
 6 1
1 2

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>
#define M 1000000
int main(){
  int X[]={0,1,0,-1};
  int Y[]={1,0,-1,0};
  int w,h,d,a,x,y;
  char s;
  while(scanf("%d %d",&w,&h),w||h){
    d=0;
    x=y=1;
    while(scanf(" %c%*s",&s)){
      if(s=='F'){
	scanf("%d",&a);
	x+=X[d]*a;
	y+=Y[d]*a;
      }
      if(s=='B'){
	scanf("%d",&a);
	x-=X[d]*a;
	y-=Y[d]*a;
      }
      if(s=='L')d--;
      if(s=='R')d++;
      if(s=='S'){
	printf("%d %d\n",x,y);
	break;
      }
      d+=4;
      d%=4;
      if(x<1)x=1;
      if(w<x)x=w;
      if(y<1)y=1;
      if(h<y)y=h;
    }
  }
  return 0;
}

      ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	" %c%*s"
.LC3:
	.string	"%d %d"
	.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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -48(%rbp)
	movl	$1, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$-1, -36(%rbp)
	movl	$1, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$-1, -24(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L2
.L16:
	movl	$0, -60(%rbp)
	movl	$1, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -56(%rbp)
	jmp	.L3
.L12:
	movzbl	-73(%rbp), %eax
	cmpb	$70, %al
	jne	.L4
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -56(%rbp)
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -52(%rbp)
.L4:
	movzbl	-73(%rbp), %eax
	cmpb	$66, %al
	jne	.L5
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	subl	%eax, -56(%rbp)
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	subl	%eax, -52(%rbp)
.L5:
	movzbl	-73(%rbp), %eax
	cmpb	$76, %al
	jne	.L6
	subl	$1, -60(%rbp)
.L6:
	movzbl	-73(%rbp), %eax
	cmpb	$82, %al
	jne	.L7
	addl	$1, -60(%rbp)
.L7:
	movzbl	-73(%rbp), %eax
	cmpb	$83, %al
	jne	.L8
	movl	-52(%rbp), %edx
	movl	-56(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L8:
	addl	$4, -60(%rbp)
	movl	-60(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, -60(%rbp)
	cmpl	$0, -56(%rbp)
	jg	.L9
	movl	$1, -56(%rbp)
.L9:
	movl	-72(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jle	.L10
	movl	-72(%rbp), %eax
	movl	%eax, -56(%rbp)
.L10:
	cmpl	$0, -52(%rbp)
	jg	.L11
	movl	$1, -52(%rbp)
.L11:
	movl	-68(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L3
	movl	-68(%rbp), %eax
	movl	%eax, -52(%rbp)
.L3:
	leaq	-73(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L12
.L2:
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-68(%rbp), %eax
	testl	%eax, %eax
	je	.L14
.L13:
	movl	$1, %eax
	jmp	.L15
.L14:
	movl	$0, %eax
.L15:
	testl	%eax, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	" %c%*s"
.LC3:
	.string	"%d %d"
	.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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -48(%rbp)
	movl	$1, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$-1, -36(%rbp)
	movl	$1, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$-1, -24(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L2
.L16:
	movl	$0, -60(%rbp)
	movl	$1, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -56(%rbp)
	jmp	.L3
.L12:
	movzbl	-73(%rbp), %eax
	cmpb	$70, %al
	jne	.L4
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -56(%rbp)
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -52(%rbp)
.L4:
	movzbl	-73(%rbp), %eax
	cmpb	$66, %al
	jne	.L5
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	subl	%eax, -56(%rbp)
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-64(%rbp), %eax
	imull	%edx, %eax
	subl	%eax, -52(%rbp)
.L5:
	movzbl	-73(%rbp), %eax
	cmpb	$76, %al
	jne	.L6
	subl	$1, -60(%rbp)
.L6:
	movzbl	-73(%rbp), %eax
	cmpb	$82, %al
	jne	.L7
	addl	$1, -60(%rbp)
.L7:
	movzbl	-73(%rbp), %eax
	cmpb	$83, %al
	jne	.L8
	movl	-52(%rbp), %edx
	movl	-56(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L8:
	addl	$4, -60(%rbp)
	movl	-60(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, -60(%rbp)
	cmpl	$0, -56(%rbp)
	jg	.L9
	movl	$1, -56(%rbp)
.L9:
	movl	-72(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jle	.L10
	movl	-72(%rbp), %eax
	movl	%eax, -56(%rbp)
.L10:
	cmpl	$0, -52(%rbp)
	jg	.L11
	movl	$1, -52(%rbp)
.L11:
	movl	-68(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L3
	movl	-68(%rbp), %eax
	movl	%eax, -52(%rbp)
.L3:
	leaq	-73(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L12
.L2:
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-68(%rbp), %eax
	testl	%eax, %eax
	je	.L14
.L13:
	movl	$1, %eax
	jmp	.L15
.L14:
	movl	$0, %eax
.L15:
	testl	%eax, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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:
