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>
#include <stdlib.h>
#include <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  int n;
  scanf("%d", &n);
  char c[n];
  scanf("%s", c);
  int r=0;
  int w=0;
  int i;
  for(i=0; i<n; i++){
    if(c[i] == 'W'){
      w++;
    }else{
      r++;
    }
  }
  int ans=0;
  for(i=0; i<=(r-1); i++){
    if(c[i]=='W'){
      ans++;
    }
  }
  if(w==0){
    printf("0\n");
    return 0;
  }else{
    printf("%d\n", ans);
    return 0;
  }
  
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L3
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L3:
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-20(%rbp), %eax
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	dn
	.type	dn, @function
dn:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	dn, .-dn
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L11
.L13:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	imull	-20(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -4(%rbp)
.L12:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
.L11:
	cmpl	$0, -24(%rbp)
	jg	.L13
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	modpow, .-modpow
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L16
	movl	-8(%rbp), %eax
	jmp	.L17
.L16:
	movl	-4(%rbp), %eax
.L17:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L19
	movl	-4(%rbp), %eax
	jmp	.L20
.L19:
	movl	-8(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	min, .-min
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L24:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	chmax, .-chmax
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L28
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L28:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L30:
	cmpq	%rdx, %rsp
	je	.L31
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L30
.L31:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L32
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L32:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -88(%rbp)
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L33
.L36:
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L34
	addl	$1, -84(%rbp)
	jmp	.L35
.L34:
	addl	$1, -88(%rbp)
.L35:
	addl	$1, -80(%rbp)
.L33:
	movl	-92(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L36
	movl	$0, -76(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L37
.L39:
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L38
	addl	$1, -76(%rbp)
.L38:
	addl	$1, -80(%rbp)
.L37:
	movl	-88(%rbp), %eax
	cmpl	-80(%rbp), %eax
	jg	.L39
	cmpl	$0, -84(%rbp)
	jne	.L40
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L41
.L40:
	movl	-76(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L41:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.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	swap
	.type	swap, @function
swap:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE51:
	.size	swap, .-swap
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	cmpl	%esi, %edi
	jge	.L4
	movl	%esi, %r8d
	movl	%edi, %esi
.L4:
	testl	%esi, %esi
	je	.L3
	movl	%r8d, %eax
	cltd
	idivl	%esi
	movl	%edx, %r8d
	testl	%edx, %edx
	jne	.L6
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %r8d
.L6:
	movl	%esi, %eax
	movl	%r8d, %esi
	cltd
	idivl	%r8d
	testl	%edx, %edx
	jne	.L9
.L3:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%esi, %r8d
	jmp	.L3
	.cfi_endproc
.LFE52:
	.size	gcd, .-gcd
	.p2align 4
	.globl	dn
	.type	dn, @function
dn:
.LFB53:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	dn, .-dn
	.p2align 4
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB54:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movl	$1, %r8d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L16:
	testb	$1, %sil
	je	.L15
	movl	%r8d, %eax
	imull	%edi, %eax
	cltd
	idivl	%ecx
	movl	%edx, %r8d
.L15:
	imull	%edi, %edi
	movl	%edi, %eax
	cltd
	idivl	%ecx
	sarl	%esi
	movl	%edx, %edi
	jne	.L16
.L13:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	modpow, .-modpow
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB56:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	min, .-min
	.p2align 4
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB57:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jge	.L24
	movl	%esi, (%rdi)
.L24:
	ret
	.cfi_endproc
.LFE57:
	.size	chmax, .-chmax
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB58:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L26
	movl	%esi, (%rdi)
.L26:
	ret
	.cfi_endproc
.LFE58:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-28(%rbp), %rax
	movq	%rsp, %rcx
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L30
.L104:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L104
.L30:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L105
.L31:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %esi
	testl	%esi, %esi
	jle	.L32
	leal	-1(%rsi), %eax
	cmpl	$14, %eax
	jbe	.L94
	movl	%esi, %edx
	pxor	%xmm8, %xmm8
	pxor	%xmm5, %xmm5
	movq	%rsp, %rax
	shrl	$4, %edx
	movdqa	%xmm8, %xmm7
	pxor	%xmm4, %xmm4
	movdqa	.LC2(%rip), %xmm3
	salq	$4, %rdx
	movdqa	.LC3(%rip), %xmm2
	addq	%rsp, %rdx
	.p2align 4,,10
	.p2align 3
.L34:
	movdqu	(%rax), %xmm0
	movdqa	%xmm5, %xmm1
	movdqa	%xmm4, %xmm10
	addq	$16, %rax
	pcmpeqb	%xmm3, %xmm0
	movdqa	%xmm0, %xmm6
	pand	%xmm2, %xmm0
	pandn	%xmm2, %xmm6
	pcmpgtb	%xmm6, %xmm1
	movdqa	%xmm6, %xmm9
	punpcklbw	%xmm1, %xmm9
	punpckhbw	%xmm1, %xmm6
	pcmpgtw	%xmm9, %xmm10
	movdqa	%xmm9, %xmm1
	punpcklwd	%xmm10, %xmm1
	punpckhwd	%xmm10, %xmm9
	paddd	%xmm7, %xmm1
	movdqa	%xmm4, %xmm7
	pcmpgtw	%xmm6, %xmm7
	paddd	%xmm9, %xmm1
	movdqa	%xmm6, %xmm9
	punpcklwd	%xmm7, %xmm9
	punpckhwd	%xmm7, %xmm6
	paddd	%xmm9, %xmm1
	movdqa	%xmm4, %xmm9
	movdqa	%xmm1, %xmm7
	movdqa	%xmm5, %xmm1
	pcmpgtb	%xmm0, %xmm1
	paddd	%xmm6, %xmm7
	movdqa	%xmm0, %xmm6
	punpcklbw	%xmm1, %xmm6
	punpckhbw	%xmm1, %xmm0
	pcmpgtw	%xmm6, %xmm9
	movdqa	%xmm6, %xmm1
	punpcklwd	%xmm9, %xmm1
	punpckhwd	%xmm9, %xmm6
	paddd	%xmm8, %xmm1
	movdqa	%xmm0, %xmm8
	paddd	%xmm6, %xmm1
	movdqa	%xmm4, %xmm6
	pcmpgtw	%xmm0, %xmm6
	punpcklwd	%xmm6, %xmm8
	punpckhwd	%xmm6, %xmm0
	paddd	%xmm8, %xmm1
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm8
	cmpq	%rdx, %rax
	jne	.L34
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	psrldq	$8, %xmm0
	andl	$-16, %edx
	paddd	%xmm0, %xmm8
	movdqa	%xmm8, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm8
	movdqa	%xmm7, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm8, %ecx
	paddd	%xmm0, %xmm7
	movdqa	%xmm7, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm7
	movd	%xmm7, %eax
	testb	$15, %sil
	je	.L35
.L33:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L106
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L37:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L107
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L41:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L108
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L43:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L109
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L45:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L110
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L47:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L111
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L49:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L112
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L51:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L113
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L53:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L114
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L55:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L115
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L57:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L116
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L59:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L117
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L61:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L118
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L63:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L119
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L65:
	movslq	%edx, %rdx
	cmpb	$87, (%rbx,%rdx)
	je	.L66
	addl	$1, %eax
.L35:
	testl	%eax, %eax
	jle	.L95
.L39:
	leal	-1(%rax), %edx
	cmpl	$14, %edx
	jbe	.L96
	movl	%eax, %esi
	pxor	%xmm1, %xmm1
	pxor	%xmm7, %xmm7
	movq	%rbx, %rdx
	shrl	$4, %esi
	movdqa	.LC2(%rip), %xmm3
	movdqa	.LC3(%rip), %xmm2
	pxor	%xmm6, %xmm6
	subl	$1, %esi
	salq	$4, %rsi
	leaq	16(%rbx,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L71:
	movdqu	(%rdx), %xmm0
	movdqa	%xmm7, %xmm5
	addq	$16, %rdx
	pcmpeqb	%xmm3, %xmm0
	pand	%xmm2, %xmm0
	pcmpgtb	%xmm0, %xmm5
	movdqa	%xmm0, %xmm4
	punpcklbw	%xmm5, %xmm4
	punpckhbw	%xmm5, %xmm0
	movdqa	%xmm6, %xmm5
	pcmpgtw	%xmm4, %xmm5
	movdqa	%xmm4, %xmm8
	punpcklwd	%xmm5, %xmm8
	punpckhwd	%xmm5, %xmm4
	movdqa	%xmm0, %xmm5
	paddd	%xmm8, %xmm1
	paddd	%xmm4, %xmm1
	movdqa	%xmm6, %xmm4
	pcmpgtw	%xmm0, %xmm4
	punpcklwd	%xmm4, %xmm5
	punpckhwd	%xmm4, %xmm0
	paddd	%xmm5, %xmm1
	paddd	%xmm0, %xmm1
	cmpq	%rsi, %rdx
	jne	.L71
	movdqa	%xmm1, %xmm0
	movl	%eax, %esi
	psrldq	$8, %xmm0
	andl	$-16, %esi
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$15, %al
	je	.L69
.L70:
	movslq	%esi, %rdi
	cmpb	$87, (%rbx,%rdi)
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %edx
	leal	1(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %edx
	leal	2(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L76
	addl	$1, %edx
.L76:
	leal	3(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L77
	addl	$1, %edx
.L77:
	leal	4(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L78
	addl	$1, %edx
.L78:
	leal	5(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L79
	addl	$1, %edx
.L79:
	leal	6(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L80
	addl	$1, %edx
.L80:
	leal	7(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L81
	addl	$1, %edx
.L81:
	leal	8(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L82
	addl	$1, %edx
.L82:
	leal	9(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L120
.L83:
	leal	10(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L121
.L84:
	leal	11(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L122
.L85:
	leal	12(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L123
.L86:
	leal	13(%rsi), %edi
	cmpl	%edi, %eax
	jle	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L87
	addl	$1, %edx
.L87:
	addl	$14, %esi
	cmpl	%esi, %eax
	jle	.L69
	movslq	%esi, %rsi
	cmpb	$87, (%rbx,%rsi)
	jne	.L69
	addl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L69:
	testl	%ecx, %ecx
	je	.L32
.L90:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L91:
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L124
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L32:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L91
.L106:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L37
.L38:
	xorl	%edx, %edx
	testl	%eax, %eax
	jg	.L39
	jmp	.L90
.L107:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L41
	jmp	.L38
.L108:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L43
	jmp	.L38
.L109:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L45
	jmp	.L38
.L105:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L31
.L115:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L57
	jmp	.L38
.L120:
	addl	$1, %edx
	jmp	.L83
.L121:
	addl	$1, %edx
	jmp	.L84
.L122:
	addl	$1, %edx
	jmp	.L85
.L123:
	addl	$1, %edx
	jmp	.L86
.L110:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L47
	jmp	.L38
.L111:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L49
	jmp	.L38
.L112:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L51
	jmp	.L38
.L113:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L53
	jmp	.L38
.L114:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L55
	jmp	.L38
.L94:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L33
.L116:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L59
	jmp	.L38
.L96:
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	.L70
.L117:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L61
	jmp	.L38
.L118:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L63
	jmp	.L38
.L119:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L65
	jmp	.L38
.L66:
	addl	$1, %ecx
	jmp	.L35
.L95:
	xorl	%edx, %edx
	jmp	.L69
.L124:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE59:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.align 16
.LC3:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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	swap
	.type	swap, @function
swap:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE51:
	.size	swap, .-swap
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	cmpl	%esi, %edi
	jge	.L4
	movl	%esi, %r8d
	movl	%edi, %esi
.L4:
	testl	%esi, %esi
	je	.L3
	movl	%r8d, %eax
	cltd
	idivl	%esi
	movl	%edx, %r8d
	testl	%edx, %edx
	jne	.L6
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %r8d
.L6:
	movl	%esi, %eax
	movl	%r8d, %esi
	cltd
	idivl	%r8d
	testl	%edx, %edx
	jne	.L9
.L3:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%esi, %r8d
	jmp	.L3
	.cfi_endproc
.LFE52:
	.size	gcd, .-gcd
	.p2align 4
	.globl	dn
	.type	dn, @function
dn:
.LFB53:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	dn, .-dn
	.p2align 4
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB54:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movl	$1, %r8d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L16:
	testb	$1, %sil
	je	.L15
	movl	%r8d, %eax
	imull	%edi, %eax
	cltd
	idivl	%ecx
	movl	%edx, %r8d
.L15:
	imull	%edi, %edi
	movl	%edi, %eax
	cltd
	idivl	%ecx
	sarl	%esi
	movl	%edx, %edi
	jne	.L16
.L13:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	modpow, .-modpow
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB56:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	min, .-min
	.p2align 4
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB57:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jge	.L24
	movl	%esi, (%rdi)
.L24:
	ret
	.cfi_endproc
.LFE57:
	.size	chmax, .-chmax
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB58:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L26
	movl	%esi, (%rdi)
.L26:
	ret
	.cfi_endproc
.LFE58:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-28(%rbp), %rax
	movq	%rsp, %rcx
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L30
.L104:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L104
.L30:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L105
.L31:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %esi
	testl	%esi, %esi
	jle	.L32
	leal	-1(%rsi), %eax
	cmpl	$14, %eax
	jbe	.L94
	movl	%esi, %edx
	pxor	%xmm8, %xmm8
	pxor	%xmm5, %xmm5
	movq	%rsp, %rax
	shrl	$4, %edx
	movdqa	%xmm8, %xmm7
	pxor	%xmm4, %xmm4
	movdqa	.LC2(%rip), %xmm3
	salq	$4, %rdx
	movdqa	.LC3(%rip), %xmm2
	addq	%rsp, %rdx
	.p2align 4,,10
	.p2align 3
.L34:
	movdqu	(%rax), %xmm0
	movdqa	%xmm5, %xmm1
	movdqa	%xmm4, %xmm10
	addq	$16, %rax
	pcmpeqb	%xmm3, %xmm0
	movdqa	%xmm0, %xmm6
	pand	%xmm2, %xmm0
	pandn	%xmm2, %xmm6
	pcmpgtb	%xmm6, %xmm1
	movdqa	%xmm6, %xmm9
	punpcklbw	%xmm1, %xmm9
	punpckhbw	%xmm1, %xmm6
	pcmpgtw	%xmm9, %xmm10
	movdqa	%xmm9, %xmm1
	punpcklwd	%xmm10, %xmm1
	punpckhwd	%xmm10, %xmm9
	paddd	%xmm7, %xmm1
	movdqa	%xmm4, %xmm7
	pcmpgtw	%xmm6, %xmm7
	paddd	%xmm9, %xmm1
	movdqa	%xmm6, %xmm9
	punpcklwd	%xmm7, %xmm9
	punpckhwd	%xmm7, %xmm6
	paddd	%xmm9, %xmm1
	movdqa	%xmm4, %xmm9
	movdqa	%xmm1, %xmm7
	movdqa	%xmm5, %xmm1
	pcmpgtb	%xmm0, %xmm1
	paddd	%xmm6, %xmm7
	movdqa	%xmm0, %xmm6
	punpcklbw	%xmm1, %xmm6
	punpckhbw	%xmm1, %xmm0
	pcmpgtw	%xmm6, %xmm9
	movdqa	%xmm6, %xmm1
	punpcklwd	%xmm9, %xmm1
	punpckhwd	%xmm9, %xmm6
	paddd	%xmm8, %xmm1
	movdqa	%xmm0, %xmm8
	paddd	%xmm6, %xmm1
	movdqa	%xmm4, %xmm6
	pcmpgtw	%xmm0, %xmm6
	punpcklwd	%xmm6, %xmm8
	punpckhwd	%xmm6, %xmm0
	paddd	%xmm8, %xmm1
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm8
	cmpq	%rdx, %rax
	jne	.L34
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	psrldq	$8, %xmm0
	andl	$-16, %edx
	paddd	%xmm0, %xmm8
	movdqa	%xmm8, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm8
	movdqa	%xmm7, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm8, %ecx
	paddd	%xmm0, %xmm7
	movdqa	%xmm7, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm7
	movd	%xmm7, %eax
	testb	$15, %sil
	je	.L35
.L33:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L106
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L37:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L107
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L41:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L108
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L43:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L109
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L45:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L110
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L47:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L111
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L49:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L112
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L51:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L113
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L53:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L114
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L55:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L115
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L57:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L116
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L59:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L117
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L61:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L118
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L63:
	movslq	%edx, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L119
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %esi
	jle	.L39
.L65:
	movslq	%edx, %rdx
	cmpb	$87, (%rbx,%rdx)
	je	.L66
	addl	$1, %eax
.L35:
	testl	%eax, %eax
	jle	.L95
.L39:
	leal	-1(%rax), %edx
	cmpl	$14, %edx
	jbe	.L96
	movl	%eax, %esi
	pxor	%xmm1, %xmm1
	pxor	%xmm7, %xmm7
	movq	%rbx, %rdx
	shrl	$4, %esi
	movdqa	.LC2(%rip), %xmm3
	movdqa	.LC3(%rip), %xmm2
	pxor	%xmm6, %xmm6
	subl	$1, %esi
	salq	$4, %rsi
	leaq	16(%rbx,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L71:
	movdqu	(%rdx), %xmm0
	movdqa	%xmm7, %xmm5
	addq	$16, %rdx
	pcmpeqb	%xmm3, %xmm0
	pand	%xmm2, %xmm0
	pcmpgtb	%xmm0, %xmm5
	movdqa	%xmm0, %xmm4
	punpcklbw	%xmm5, %xmm4
	punpckhbw	%xmm5, %xmm0
	movdqa	%xmm6, %xmm5
	pcmpgtw	%xmm4, %xmm5
	movdqa	%xmm4, %xmm8
	punpcklwd	%xmm5, %xmm8
	punpckhwd	%xmm5, %xmm4
	movdqa	%xmm0, %xmm5
	paddd	%xmm8, %xmm1
	paddd	%xmm4, %xmm1
	movdqa	%xmm6, %xmm4
	pcmpgtw	%xmm0, %xmm4
	punpcklwd	%xmm4, %xmm5
	punpckhwd	%xmm4, %xmm0
	paddd	%xmm5, %xmm1
	paddd	%xmm0, %xmm1
	cmpq	%rsi, %rdx
	jne	.L71
	movdqa	%xmm1, %xmm0
	movl	%eax, %esi
	psrldq	$8, %xmm0
	andl	$-16, %esi
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$15, %al
	je	.L69
.L70:
	movslq	%esi, %rdi
	cmpb	$87, (%rbx,%rdi)
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %edx
	leal	1(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %edx
	leal	2(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L76
	addl	$1, %edx
.L76:
	leal	3(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L77
	addl	$1, %edx
.L77:
	leal	4(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L78
	addl	$1, %edx
.L78:
	leal	5(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L79
	addl	$1, %edx
.L79:
	leal	6(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L80
	addl	$1, %edx
.L80:
	leal	7(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L81
	addl	$1, %edx
.L81:
	leal	8(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L82
	addl	$1, %edx
.L82:
	leal	9(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L120
.L83:
	leal	10(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L121
.L84:
	leal	11(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L122
.L85:
	leal	12(%rsi), %edi
	cmpl	%eax, %edi
	jge	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	je	.L123
.L86:
	leal	13(%rsi), %edi
	cmpl	%edi, %eax
	jle	.L69
	movslq	%edi, %rdi
	cmpb	$87, (%rbx,%rdi)
	jne	.L87
	addl	$1, %edx
.L87:
	addl	$14, %esi
	cmpl	%esi, %eax
	jle	.L69
	movslq	%esi, %rsi
	cmpb	$87, (%rbx,%rsi)
	jne	.L69
	addl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L69:
	testl	%ecx, %ecx
	je	.L32
.L90:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L91:
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L124
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L32:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L91
.L106:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L37
.L38:
	xorl	%edx, %edx
	testl	%eax, %eax
	jg	.L39
	jmp	.L90
.L107:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L41
	jmp	.L38
.L108:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L43
	jmp	.L38
.L109:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L45
	jmp	.L38
.L105:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L31
.L115:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L57
	jmp	.L38
.L120:
	addl	$1, %edx
	jmp	.L83
.L121:
	addl	$1, %edx
	jmp	.L84
.L122:
	addl	$1, %edx
	jmp	.L85
.L123:
	addl	$1, %edx
	jmp	.L86
.L110:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L47
	jmp	.L38
.L111:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L49
	jmp	.L38
.L112:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L51
	jmp	.L38
.L113:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L53
	jmp	.L38
.L114:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L55
	jmp	.L38
.L94:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L33
.L116:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L59
	jmp	.L38
.L96:
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	.L70
.L117:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L61
	jmp	.L38
.L118:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L63
	jmp	.L38
.L119:
	addl	$1, %edx
	addl	$1, %ecx
	cmpl	%edx, %esi
	jg	.L65
	jmp	.L38
.L66:
	addl	$1, %ecx
	jmp	.L35
.L95:
	xorl	%edx, %edx
	jmp	.L69
.L124:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE59:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.align 16
.LC3:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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>
#include <stdlib.h>
#include <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  int n;
  scanf("%d", &n);
  char c[n];
  scanf("%s", c);
  int r=0;
  int w=0;
  int i;
  for(i=0; i<n; i++){
    if(c[i] == 'W'){
      w++;
    }else{
      r++;
    }
  }
  int ans=0;
  for(i=0; i<=(r-1); i++){
    if(c[i]=='W'){
      ans++;
    }
  }
  if(w==0){
    printf("0\n");
    return 0;
  }else{
    printf("%d\n", ans);
    return 0;
  }
  
  return 0;
}
8
RRWRWWRW
 2
RQ
 8
RRWWWRRW
 8
WRWWWRRR
 8
WWWWRRRR
 8
RRWRVWRW
 4
RRWW
 4
RWWR
 2
RS
 4
RRVW

1
 0
 2
 3
 4
 1
 0
 1
 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
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  int n;
  scanf("%d", &n);
  char c[n];
  scanf("%s", c);
  int r=0;
  int w=0;
  int i;
  for(i=0; i<n; i++){
    if(c[i] == 'W'){
      w++;
    }else{
      r++;
    }
  }
  int ans=0;
  for(i=0; i<=(r-1); i++){
    if(c[i]=='W'){
      ans++;
    }
  }
  if(w==0){
    printf("0\n");
    return 0;
  }else{
    printf("%d\n", ans);
    return 0;
  }
  
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L3
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L3:
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-20(%rbp), %eax
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	dn
	.type	dn, @function
dn:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	dn, .-dn
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L11
.L13:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	imull	-20(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -4(%rbp)
.L12:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
.L11:
	cmpl	$0, -24(%rbp)
	jg	.L13
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	modpow, .-modpow
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L16
	movl	-8(%rbp), %eax
	jmp	.L17
.L16:
	movl	-4(%rbp), %eax
.L17:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L19
	movl	-4(%rbp), %eax
	jmp	.L20
.L19:
	movl	-8(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	min, .-min
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L24:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	chmax, .-chmax
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L28
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L28:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L30:
	cmpq	%rdx, %rsp
	je	.L31
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L30
.L31:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L32
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L32:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -88(%rbp)
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L33
.L36:
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L34
	addl	$1, -84(%rbp)
	jmp	.L35
.L34:
	addl	$1, -88(%rbp)
.L35:
	addl	$1, -80(%rbp)
.L33:
	movl	-92(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L36
	movl	$0, -76(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L37
.L39:
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L38
	addl	$1, -76(%rbp)
.L38:
	addl	$1, -80(%rbp)
.L37:
	movl	-88(%rbp), %eax
	cmpl	-80(%rbp), %eax
	jg	.L39
	cmpl	$0, -84(%rbp)
	jne	.L40
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L41
.L40:
	movl	-76(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L41:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.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	swap
	.type	swap, @function
swap:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L3
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L3:
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-20(%rbp), %eax
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	dn
	.type	dn, @function
dn:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	dn, .-dn
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L11
.L13:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	imull	-20(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -4(%rbp)
.L12:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
.L11:
	cmpl	$0, -24(%rbp)
	jg	.L13
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	modpow, .-modpow
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L16
	movl	-8(%rbp), %eax
	jmp	.L17
.L16:
	movl	-4(%rbp), %eax
.L17:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L19
	movl	-4(%rbp), %eax
	jmp	.L20
.L19:
	movl	-8(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	min, .-min
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L24:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	chmax, .-chmax
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L28
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L28:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L30:
	cmpq	%rdx, %rsp
	je	.L31
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L30
.L31:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L32
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L32:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -88(%rbp)
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L33
.L36:
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L34
	addl	$1, -84(%rbp)
	jmp	.L35
.L34:
	addl	$1, -88(%rbp)
.L35:
	addl	$1, -80(%rbp)
.L33:
	movl	-92(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L36
	movl	$0, -76(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L37
.L39:
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L38
	addl	$1, -76(%rbp)
.L38:
	addl	$1, -80(%rbp)
.L37:
	movl	-88(%rbp), %eax
	cmpl	-80(%rbp), %eax
	jg	.L39
	cmpl	$0, -84(%rbp)
	jne	.L40
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L41
.L40:
	movl	-76(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L41:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.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:
