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 <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max(a,b)-min(a,b))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1; rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)n,(int)n)
#define nHr(n,r) nCr((int)(n+r+1),(int)r)
#define sankaku(x) ((1+x)*x)/2
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll stack[LIMIT2],queue[LIMIT2*10];//stack[0]=count;queue[0]=start,queue[1]=length;
int enqueue(ll n){
    if(queue[0]+queue[1]>=LIMIT2) return -1;
    queue[queue[0]+queue[1]] = n;
    queue[1]++;
    return 1;
}
ll dequeue(){
    ll result;
    if(queue[1]<=0) return -1;
    result = queue[queue[0]];
    queue[0]++;
    queue[1]--;
    if(queue[1]==0){
        queue[0] = 2;
    }
    return result;
}
void initialize(){
    stack[0] = 0;
    queue[0] = 2;
    queue[1] = 0;
}
int main(void){
  initialize();
  ll n,m,k,i,j,result=0,sum=0;
  int a[LIMIT1];
  char s[LIMIT1];

  scanf("%lld",&n);
  for(i=1;i<=sqrtl((ld)(n-1));i++){//n-1の約数
    if((n-1)%i==0){
      if(i>=2&&i!=sqrtl((ld)(n-1))){
        result+=2;
        //printf("%lld %lld ",i,(n-1)/i);
      }else{
        if(n-1<=1) continue;
        result++;
        //if(i==1) printf("%lld ",n-1);
        //else printf("%lld ",i);
      }
    }
  }
  for(i=1;i<=sqrtl((ld)n);i++){
    if((n-1)%i==0&&i>=2){
      
    }else{
      if(i>=2){
        k=i;
        j=n;
        while(j%k==0) j/=k;
        if(j%k==1){
          //printf("%lld ",i);
          result++;
        }
      }
      k=n/i;
      if(k<=1||k==i) continue;
      j=n;
      while(j%k==0) j/=k;
      if(j%k==1){
        //printf("%lld ",n/i);
        result++;
      }
    }
  }
  //printf("\n");
  printf("%lld",result);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.globl	nPr
	.type	nPr, @function
nPr:
.LFB7:
	.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)
	movq	$1, -8(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	subq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addq	$1, -16(%rbp)
.L6:
	movl	-24(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L7
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	nPr, .-nPr
	.globl	nCr
	.type	nCr, @function
nCr:
.LFB8:
	.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)
	movq	$1, -8(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	subq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-8(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, -8(%rbp)
	addq	$1, -16(%rbp)
.L10:
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L11
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	nCr, .-nCr
	.globl	dx
	.data
	.align 32
	.type	dx, @object
	.size	dx, 32
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	-1
	.long	1
	.globl	dy
	.align 32
	.type	dy, @object
	.size	dy, 32
dy:
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.text
	.globl	upint
	.type	upint, @function
upint:
.LFB9:
	.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L14
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %eax
	jmp	.L16
.L14:
	movl	$-1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	upint, .-upint
	.globl	downint
	.type	downint, @function
downint:
.LFB10:
	.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L18
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	$-1, %eax
	jmp	.L22
.L19:
	movl	$0, %eax
	jmp	.L22
.L18:
	movl	$1, %eax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	downint, .-downint
	.globl	upchar
	.type	upchar, @function
upchar:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	upchar, .-upchar
	.globl	downchar
	.type	downchar, @function
downchar:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	downchar, .-downchar
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 4000016
stack:
	.zero	4000016
	.globl	queue
	.align 32
	.type	queue, @object
	.size	queue, 40000160
queue:
	.zero	40000160
	.text
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.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)
	movq	queue(%rip), %rdx
	movq	8+queue(%rip), %rax
	addq	%rdx, %rax
	cmpq	$500001, %rax
	jle	.L28
	movl	$-1, %eax
	jmp	.L29
.L28:
	movq	queue(%rip), %rdx
	movq	8+queue(%rip), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	queue(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movq	8+queue(%rip), %rax
	addq	$1, %rax
	movq	%rax, 8+queue(%rip)
	movl	$1, %eax
.L29:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	enqueue, .-enqueue
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	8+queue(%rip), %rax
	testq	%rax, %rax
	jg	.L31
	movq	$-1, %rax
	jmp	.L32
.L31:
	movq	queue(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	queue(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movq	queue(%rip), %rax
	addq	$1, %rax
	movq	%rax, queue(%rip)
	movq	8+queue(%rip), %rax
	subq	$1, %rax
	movq	%rax, 8+queue(%rip)
	movq	8+queue(%rip), %rax
	testq	%rax, %rax
	jne	.L33
	movq	$2, queue(%rip)
.L33:
	movq	-8(%rbp), %rax
.L32:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	dequeue, .-dequeue
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	$0, stack(%rip)
	movq	$2, queue(%rip)
	movq	$0, 8+queue(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	initialize, .-initialize
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	initialize
	movq	$0, -1000056(%rbp)
	movq	$0, -1000048(%rbp)
	leaq	-1000080(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -1000072(%rbp)
	jmp	.L36
.L41:
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L37
	cmpq	$1, -1000072(%rbp)
	jle	.L38
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fucomi	%st(1), %st
	jp	.L58
	fucomip	%st(1), %st
	fstp	%st(0)
	je	.L38
	jmp	.L55
.L58:
	fstp	%st(0)
	fstp	%st(0)
.L55:
	addq	$2, -1000056(%rbp)
	jmp	.L37
.L38:
	movq	-1000080(%rbp), %rax
	cmpq	$2, %rax
	jle	.L56
	addq	$1, -1000056(%rbp)
	jmp	.L37
.L56:
	nop
.L37:
	addq	$1, -1000072(%rbp)
.L36:
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jnb	.L41
	movq	$1, -1000072(%rbp)
	jmp	.L42
.L52:
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L43
	cmpq	$1, -1000072(%rbp)
	jg	.L44
.L43:
	cmpq	$1, -1000072(%rbp)
	jle	.L45
	movq	-1000072(%rbp), %rax
	movq	%rax, -1000040(%rbp)
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000064(%rbp)
	jmp	.L46
.L47:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rax, -1000064(%rbp)
.L46:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L47
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L45
	addq	$1, -1000056(%rbp)
.L45:
	movq	-1000080(%rbp), %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rax, -1000040(%rbp)
	cmpq	$1, -1000040(%rbp)
	jle	.L57
	movq	-1000040(%rbp), %rax
	cmpq	-1000072(%rbp), %rax
	je	.L57
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000064(%rbp)
	jmp	.L50
.L51:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rax, -1000064(%rbp)
.L50:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L51
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L44
	addq	$1, -1000056(%rbp)
	jmp	.L44
.L57:
	nop
.L44:
	addq	$1, -1000072(%rbp)
.L42:
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jnb	.L52
	movq	-1000056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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	gcd
	.type	gcd, @function
gcd:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rsi, %r8
	testq	%rsi, %rsi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %r8
.L3:
	cqto
	idivq	%r8
	movq	%r8, %rax
	testq	%rdx, %rdx
	jne	.L5
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rdi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.p2align 4
	.globl	nPr
	.type	nPr, @function
nPr:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L11
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movl	$1, %eax
	movq	%rdi, %rdx
	subq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	imulq	%rdi, %rax
	subq	$1, %rdi
	cmpq	%rdx, %rdi
	jne	.L10
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	nPr, .-nPr
	.p2align 4
	.globl	nCr
	.type	nCr, @function
nCr:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	subl	%esi, %r8d
	cmpl	%esi, %r8d
	cmovg	%esi, %r8d
	testl	%r8d, %r8d
	jle	.L16
	movslq	%edi, %rdi
	movslq	%r8d, %r8
	movl	$1, %ecx
	movl	$1, %eax
	leaq	1(%rdi), %rsi
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rsi, %rdx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rdx
	addq	$1, %rcx
	cmpq	%rdx, %r8
	jne	.L15
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	nCr, .-nCr
	.p2align 4
	.globl	upint
	.type	upint, @function
upint:
.LFB54:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	upint, .-upint
	.p2align 4
	.globl	downint
	.type	downint, @function
downint:
.LFB55:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, (%rdi)
	jl	.L21
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L21:
	ret
	.cfi_endproc
.LFE55:
	.size	downint, .-downint
	.p2align 4
	.globl	upchar
	.type	upchar, @function
upchar:
.LFB56:
	.cfi_startproc
	endbr64
	jmp	strcmp@PLT
	.cfi_endproc
.LFE56:
	.size	upchar, .-upchar
	.p2align 4
	.globl	downchar
	.type	downchar, @function
downchar:
.LFB57:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	movq	%rsi, %rdi
	movq	%r8, %rsi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE57:
	.size	downchar, .-downchar
	.p2align 4
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.LFB58:
	.cfi_startproc
	endbr64
	movq	8+queue(%rip), %rax
	addq	queue(%rip), %rax
	movl	$-1, %r8d
	cmpq	$500001, %rax
	jg	.L26
	leaq	queue(%rip), %rdx
	movl	$1, %r8d
	movq	%rdi, (%rdx,%rax,8)
	addq	$1, 8+queue(%rip)
.L26:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE58:
	.size	enqueue, .-enqueue
	.p2align 4
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB59:
	.cfi_startproc
	endbr64
	movq	8+queue(%rip), %rdx
	testq	%rdx, %rdx
	jle	.L31
	movq	queue(%rip), %rax
	leaq	queue(%rip), %rcx
	movq	(%rcx,%rax,8), %r8
	addq	$1, %rax
	subq	$1, %rdx
	movq	%rdx, 8+queue(%rip)
	movl	$2, %edx
	cmove	%rdx, %rax
	movq	%rax, queue(%rip)
.L29:
	movq	%r8, %rax
	ret
.L31:
	movq	$-1, %r8
	jmp	.L29
	.cfi_endproc
.LFE59:
	.size	dequeue, .-dequeue
	.p2align 4
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB60:
	.cfi_startproc
	endbr64
	movdqa	.LC0(%rip), %xmm0
	movq	$0, stack(%rip)
	movaps	%xmm0, queue(%rip)
	ret
	.cfi_endproc
.LFE60:
	.size	initialize, .-initialize
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB61:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	movq	$0, stack(%rip)
	movaps	%xmm0, queue(%rip)
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %r12
	leaq	-1(%r12), %rbp
	movq	%rbp, (%rsp)
	fildq	(%rsp)
	fldz
	fld	%st(0)
	fucomip	%st(2), %st
	ja	.L101
	fxch	%st(1)
	fsqrt
	xorl	%r14d, %r14d
	fld1
	cmpq	$2, %r12
	jle	.L105
	fxch	%st(1)
	fcomi	%st(1), %st
	movl	$1, %ecx
	jnb	.L45
	fstp	%st(0)
	fstp	%st(0)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L41:
	fxch	%st(1)
	fucomip	%st(1), %st
	jp	.L42
	je	.L44
.L42:
	addq	$2, %r14
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L112:
	fstp	%st(1)
.L40:
	addq	$1, %rcx
	movq	%rcx, (%rsp)
	fildq	(%rsp)
	fxch	%st(1)
	fcomi	%st(1), %st
	jb	.L111
.L45:
	movq	%rbp, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L112
	cmpq	$1, %rcx
	jne	.L41
	fstp	%st(1)
.L44:
	addq	$1, %r14
	jmp	.L40
.L105:
	fxch	%st(1)
	fcomi	%st(1), %st
	movl	$1, %ecx
	jb	.L113
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rbp, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L114
	cmpq	$1, %rcx
	je	.L115
	fucomi	%st(1), %st
	fstp	%st(1)
	jp	.L83
	je	.L58
.L83:
	addq	$2, %r14
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L114:
	fstp	%st(1)
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L115:
	fstp	%st(1)
.L58:
	addq	$1, %rcx
	movq	%rcx, (%rsp)
	fildq	(%rsp)
	fxch	%st(1)
	fcomi	%st(1), %st
	jnb	.L37
	fstp	%st(0)
	fstp	%st(0)
	jmp	.L38
.L111:
	fstp	%st(0)
	fstp	%st(0)
	jmp	.L38
.L113:
	fstp	%st(0)
	fstp	%st(0)
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r12, (%rsp)
	fildq	(%rsp)
	movl	$1, %ebx
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L107:
	cmpq	$1, %rbx
	je	.L63
.L62:
	addq	$1, %rbx
.L60:
	movq	%rbx, (%rsp)
	fildq	(%rsp)
	fld	%st(2)
	fucomip	%st(2), %st
	ja	.L102
	fld	%st(1)
	fsqrt
.L71:
	fcomip	%st(1), %st
	fstp	%st(0)
	jb	.L106
	movq	%rbp, %rax
	cqto
	idivq	%rbx
	testq	%rdx, %rdx
	je	.L107
	cmpq	$1, %rbx
	je	.L63
	movq	%r12, %rax
	cqto
	idivq	%rbx
	movq	%rax, %rsi
	testq	%rdx, %rdx
	jne	.L64
	movq	%r12, %rcx
	.p2align 4,,10
	.p2align 3
.L65:
	movq	%rcx, %rax
	cqto
	idivq	%rbx
	cqto
	movq	%rax, %rcx
	idivq	%rbx
	testq	%rdx, %rdx
	je	.L65
.L64:
	xorl	%eax, %eax
	cmpq	$1, %rdx
	sete	%al
	addq	%rax, %r14
	cmpq	$1, %rsi
	jle	.L62
	cmpq	%rsi, %rbx
	je	.L62
	movq	%r12, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L67
.L73:
	movq	%r12, %rcx
	.p2align 4,,10
	.p2align 3
.L68:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	cqto
	movq	%rax, %rcx
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L68
.L67:
	xorl	%eax, %eax
	cmpq	$1, %rdx
	sete	%al
	addq	%rax, %r14
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L63:
	movq	%r12, %rsi
	cmpq	$1, %r12
	jle	.L62
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L106:
	fstp	%st(0)
	fstp	%st(0)
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L102:
	.cfi_restore_state
	fstp	%st(2)
	fxch	%st(1)
	fstpt	16(%rsp)
	pushq	%rax
	.cfi_def_cfa_offset 104
	pushq	%rax
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	16(%rsp)
	call	sqrtl@PLT
	popq	%rdx
	.cfi_def_cfa_offset 104
	popq	%rcx
	.cfi_def_cfa_offset 96
	fldz
	fldt	16(%rsp)
	fldt	(%rsp)
	fxch	%st(2)
	fxch	%st(3)
	jmp	.L71
.L101:
	fstp	%st(0)
	xorl	%r14d, %r14d
	movl	$1, %ebx
	cmpq	$2, %r12
	jg	.L51
	jmp	.L46
.L109:
	pushq	%rax
	.cfi_def_cfa_offset 104
	pushq	%rax
	.cfi_def_cfa_offset 112
	fstpt	(%rsp)
	call	sqrtl@PLT
	popq	%rax
	.cfi_def_cfa_offset 104
	popq	%rdx
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fucomip	%st(1), %st
	fstp	%st(0)
	fldt	16(%rsp)
	jp	.L81
	je	.L49
.L81:
	addq	$2, %r14
.L48:
	addq	$1, %rbx
.L51:
	movq	%rbx, (%rsp)
	fildq	(%rsp)
	fstpt	(%rsp)
	pushq	%rcx
	.cfi_def_cfa_offset 104
	pushq	%rcx
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	32(%rsp)
	call	sqrtl@PLT
	popq	%rsi
	.cfi_def_cfa_offset 104
	popq	%rdi
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	fldz
	jb	.L38
	fstp	%st(0)
	fldt	16(%rsp)
	movq	%rbp, %rax
	cqto
	idivq	%rbx
	testq	%rdx, %rdx
	jne	.L48
	cmpq	$1, %rbx
	jne	.L109
.L49:
	addq	$1, %r14
	jmp	.L48
.L110:
	fstp	%st(0)
	fldt	16(%rsp)
	movq	%rbp, %rax
	cqto
	idivq	%rbx
	testq	%rdx, %rdx
	jne	.L53
	cmpq	$1, %rbx
	je	.L53
	pushq	%rsi
	.cfi_def_cfa_offset 104
	pushq	%rsi
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	32(%rsp)
	call	sqrtl@PLT
	popq	%rdi
	.cfi_def_cfa_offset 104
	popq	%r8
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fucomip	%st(1), %st
	fstp	%st(0)
	fldt	16(%rsp)
	jp	.L55
	je	.L53
.L55:
	addq	$2, %r14
.L53:
	addq	$1, %rbx
.L46:
	movq	%rbx, (%rsp)
	fildq	(%rsp)
	fstpt	(%rsp)
	pushq	%r9
	.cfi_def_cfa_offset 104
	pushq	%r9
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	32(%rsp)
	call	sqrtl@PLT
	popq	%r10
	.cfi_def_cfa_offset 104
	popq	%r11
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	fldz
	jnb	.L110
	jmp	.L38
.L108:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE61:
	.size	main, .-main
	.globl	queue
	.bss
	.align 32
	.type	queue, @object
	.size	queue, 40000160
queue:
	.zero	40000160
	.globl	stack
	.align 32
	.type	stack, @object
	.size	stack, 4000016
stack:
	.zero	4000016
	.globl	dy
	.data
	.align 32
	.type	dy, @object
	.size	dy, 32
dy:
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.globl	dx
	.align 32
	.type	dx, @object
	.size	dx, 32
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	-1
	.long	1
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	2
	.quad	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
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rsi, %r8
	testq	%rsi, %rsi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %r8
.L3:
	cqto
	idivq	%r8
	movq	%r8, %rax
	testq	%rdx, %rdx
	jne	.L5
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rdi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.p2align 4
	.globl	nPr
	.type	nPr, @function
nPr:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L11
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movl	$1, %eax
	movq	%rdi, %rdx
	subq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	imulq	%rdi, %rax
	subq	$1, %rdi
	cmpq	%rdx, %rdi
	jne	.L10
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	nPr, .-nPr
	.p2align 4
	.globl	nCr
	.type	nCr, @function
nCr:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	subl	%esi, %r8d
	cmpl	%esi, %r8d
	cmovg	%esi, %r8d
	testl	%r8d, %r8d
	jle	.L16
	movslq	%edi, %rdi
	movslq	%r8d, %r8
	movl	$1, %ecx
	movl	$1, %eax
	leaq	1(%rdi), %rsi
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rsi, %rdx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rdx
	addq	$1, %rcx
	cmpq	%rdx, %r8
	jne	.L15
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	nCr, .-nCr
	.p2align 4
	.globl	upint
	.type	upint, @function
upint:
.LFB54:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	upint, .-upint
	.p2align 4
	.globl	downint
	.type	downint, @function
downint:
.LFB55:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, (%rdi)
	jl	.L21
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L21:
	ret
	.cfi_endproc
.LFE55:
	.size	downint, .-downint
	.p2align 4
	.globl	upchar
	.type	upchar, @function
upchar:
.LFB56:
	.cfi_startproc
	endbr64
	jmp	strcmp@PLT
	.cfi_endproc
.LFE56:
	.size	upchar, .-upchar
	.p2align 4
	.globl	downchar
	.type	downchar, @function
downchar:
.LFB57:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	movq	%rsi, %rdi
	movq	%r8, %rsi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE57:
	.size	downchar, .-downchar
	.p2align 4
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.LFB58:
	.cfi_startproc
	endbr64
	movq	8+queue(%rip), %rax
	addq	queue(%rip), %rax
	movl	$-1, %r8d
	cmpq	$500001, %rax
	jg	.L26
	leaq	queue(%rip), %rdx
	movl	$1, %r8d
	movq	%rdi, (%rdx,%rax,8)
	addq	$1, 8+queue(%rip)
.L26:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE58:
	.size	enqueue, .-enqueue
	.p2align 4
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB59:
	.cfi_startproc
	endbr64
	movq	8+queue(%rip), %rdx
	testq	%rdx, %rdx
	jle	.L31
	movq	queue(%rip), %rax
	leaq	queue(%rip), %rcx
	movq	(%rcx,%rax,8), %r8
	addq	$1, %rax
	subq	$1, %rdx
	movq	%rdx, 8+queue(%rip)
	movl	$2, %edx
	cmove	%rdx, %rax
	movq	%rax, queue(%rip)
.L29:
	movq	%r8, %rax
	ret
.L31:
	movq	$-1, %r8
	jmp	.L29
	.cfi_endproc
.LFE59:
	.size	dequeue, .-dequeue
	.p2align 4
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB60:
	.cfi_startproc
	endbr64
	movdqa	.LC0(%rip), %xmm0
	movq	$0, stack(%rip)
	movaps	%xmm0, queue(%rip)
	ret
	.cfi_endproc
.LFE60:
	.size	initialize, .-initialize
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB61:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	movq	$0, stack(%rip)
	movaps	%xmm0, queue(%rip)
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %r12
	leaq	-1(%r12), %rbp
	movq	%rbp, (%rsp)
	fildq	(%rsp)
	fldz
	fld	%st(0)
	fucomip	%st(2), %st
	ja	.L101
	fxch	%st(1)
	fsqrt
	xorl	%r14d, %r14d
	fld1
	cmpq	$2, %r12
	jle	.L105
	fxch	%st(1)
	fcomi	%st(1), %st
	movl	$1, %ecx
	jnb	.L45
	fstp	%st(0)
	fstp	%st(0)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L41:
	fxch	%st(1)
	fucomip	%st(1), %st
	jp	.L42
	je	.L44
.L42:
	addq	$2, %r14
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L112:
	fstp	%st(1)
.L40:
	addq	$1, %rcx
	movq	%rcx, (%rsp)
	fildq	(%rsp)
	fxch	%st(1)
	fcomi	%st(1), %st
	jb	.L111
.L45:
	movq	%rbp, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L112
	cmpq	$1, %rcx
	jne	.L41
	fstp	%st(1)
.L44:
	addq	$1, %r14
	jmp	.L40
.L105:
	fxch	%st(1)
	fcomi	%st(1), %st
	movl	$1, %ecx
	jb	.L113
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rbp, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L114
	cmpq	$1, %rcx
	je	.L115
	fucomi	%st(1), %st
	fstp	%st(1)
	jp	.L83
	je	.L58
.L83:
	addq	$2, %r14
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L114:
	fstp	%st(1)
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L115:
	fstp	%st(1)
.L58:
	addq	$1, %rcx
	movq	%rcx, (%rsp)
	fildq	(%rsp)
	fxch	%st(1)
	fcomi	%st(1), %st
	jnb	.L37
	fstp	%st(0)
	fstp	%st(0)
	jmp	.L38
.L111:
	fstp	%st(0)
	fstp	%st(0)
	jmp	.L38
.L113:
	fstp	%st(0)
	fstp	%st(0)
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r12, (%rsp)
	fildq	(%rsp)
	movl	$1, %ebx
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L107:
	cmpq	$1, %rbx
	je	.L63
.L62:
	addq	$1, %rbx
.L60:
	movq	%rbx, (%rsp)
	fildq	(%rsp)
	fld	%st(2)
	fucomip	%st(2), %st
	ja	.L102
	fld	%st(1)
	fsqrt
.L71:
	fcomip	%st(1), %st
	fstp	%st(0)
	jb	.L106
	movq	%rbp, %rax
	cqto
	idivq	%rbx
	testq	%rdx, %rdx
	je	.L107
	cmpq	$1, %rbx
	je	.L63
	movq	%r12, %rax
	cqto
	idivq	%rbx
	movq	%rax, %rsi
	testq	%rdx, %rdx
	jne	.L64
	movq	%r12, %rcx
	.p2align 4,,10
	.p2align 3
.L65:
	movq	%rcx, %rax
	cqto
	idivq	%rbx
	cqto
	movq	%rax, %rcx
	idivq	%rbx
	testq	%rdx, %rdx
	je	.L65
.L64:
	xorl	%eax, %eax
	cmpq	$1, %rdx
	sete	%al
	addq	%rax, %r14
	cmpq	$1, %rsi
	jle	.L62
	cmpq	%rsi, %rbx
	je	.L62
	movq	%r12, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L67
.L73:
	movq	%r12, %rcx
	.p2align 4,,10
	.p2align 3
.L68:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	cqto
	movq	%rax, %rcx
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L68
.L67:
	xorl	%eax, %eax
	cmpq	$1, %rdx
	sete	%al
	addq	%rax, %r14
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L63:
	movq	%r12, %rsi
	cmpq	$1, %r12
	jle	.L62
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L106:
	fstp	%st(0)
	fstp	%st(0)
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L102:
	.cfi_restore_state
	fstp	%st(2)
	fxch	%st(1)
	fstpt	16(%rsp)
	pushq	%rax
	.cfi_def_cfa_offset 104
	pushq	%rax
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	16(%rsp)
	call	sqrtl@PLT
	popq	%rdx
	.cfi_def_cfa_offset 104
	popq	%rcx
	.cfi_def_cfa_offset 96
	fldz
	fldt	16(%rsp)
	fldt	(%rsp)
	fxch	%st(2)
	fxch	%st(3)
	jmp	.L71
.L101:
	fstp	%st(0)
	xorl	%r14d, %r14d
	movl	$1, %ebx
	cmpq	$2, %r12
	jg	.L51
	jmp	.L46
.L109:
	pushq	%rax
	.cfi_def_cfa_offset 104
	pushq	%rax
	.cfi_def_cfa_offset 112
	fstpt	(%rsp)
	call	sqrtl@PLT
	popq	%rax
	.cfi_def_cfa_offset 104
	popq	%rdx
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fucomip	%st(1), %st
	fstp	%st(0)
	fldt	16(%rsp)
	jp	.L81
	je	.L49
.L81:
	addq	$2, %r14
.L48:
	addq	$1, %rbx
.L51:
	movq	%rbx, (%rsp)
	fildq	(%rsp)
	fstpt	(%rsp)
	pushq	%rcx
	.cfi_def_cfa_offset 104
	pushq	%rcx
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	32(%rsp)
	call	sqrtl@PLT
	popq	%rsi
	.cfi_def_cfa_offset 104
	popq	%rdi
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	fldz
	jb	.L38
	fstp	%st(0)
	fldt	16(%rsp)
	movq	%rbp, %rax
	cqto
	idivq	%rbx
	testq	%rdx, %rdx
	jne	.L48
	cmpq	$1, %rbx
	jne	.L109
.L49:
	addq	$1, %r14
	jmp	.L48
.L110:
	fstp	%st(0)
	fldt	16(%rsp)
	movq	%rbp, %rax
	cqto
	idivq	%rbx
	testq	%rdx, %rdx
	jne	.L53
	cmpq	$1, %rbx
	je	.L53
	pushq	%rsi
	.cfi_def_cfa_offset 104
	pushq	%rsi
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	32(%rsp)
	call	sqrtl@PLT
	popq	%rdi
	.cfi_def_cfa_offset 104
	popq	%r8
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fucomip	%st(1), %st
	fstp	%st(0)
	fldt	16(%rsp)
	jp	.L55
	je	.L53
.L55:
	addq	$2, %r14
.L53:
	addq	$1, %rbx
.L46:
	movq	%rbx, (%rsp)
	fildq	(%rsp)
	fstpt	(%rsp)
	pushq	%r9
	.cfi_def_cfa_offset 104
	pushq	%r9
	.cfi_def_cfa_offset 112
	fld	%st(0)
	fstpt	(%rsp)
	fstpt	32(%rsp)
	call	sqrtl@PLT
	popq	%r10
	.cfi_def_cfa_offset 104
	popq	%r11
	.cfi_def_cfa_offset 96
	fldt	(%rsp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	fldz
	jnb	.L110
	jmp	.L38
.L108:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE61:
	.size	main, .-main
	.globl	queue
	.bss
	.align 32
	.type	queue, @object
	.size	queue, 40000160
queue:
	.zero	40000160
	.globl	stack
	.align 32
	.type	stack, @object
	.size	stack, 4000016
stack:
	.zero	4000016
	.globl	dy
	.data
	.align 32
	.type	dy, @object
	.size	dy, 32
dy:
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.globl	dx
	.align 32
	.type	dx, @object
	.size	dx, 32
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	-1
	.long	1
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	2
	.quad	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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max(a,b)-min(a,b))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1; rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)n,(int)n)
#define nHr(n,r) nCr((int)(n+r+1),(int)r)
#define sankaku(x) ((1+x)*x)/2
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll stack[LIMIT2],queue[LIMIT2*10];//stack[0]=count;queue[0]=start,queue[1]=length;
int enqueue(ll n){
    if(queue[0]+queue[1]>=LIMIT2) return -1;
    queue[queue[0]+queue[1]] = n;
    queue[1]++;
    return 1;
}
ll dequeue(){
    ll result;
    if(queue[1]<=0) return -1;
    result = queue[queue[0]];
    queue[0]++;
    queue[1]--;
    if(queue[1]==0){
        queue[0] = 2;
    }
    return result;
}
void initialize(){
    stack[0] = 0;
    queue[0] = 2;
    queue[1] = 0;
}
int main(void){
  initialize();
  ll n,m,k,i,j,result=0,sum=0;
  int a[LIMIT1];
  char s[LIMIT1];

  scanf("%lld",&n);
  for(i=1;i<=sqrtl((ld)(n-1));i++){//n-1の約数
    if((n-1)%i==0){
      if(i>=2&&i!=sqrtl((ld)(n-1))){
        result+=2;
        //printf("%lld %lld ",i,(n-1)/i);
      }else{
        if(n-1<=1) continue;
        result++;
        //if(i==1) printf("%lld ",n-1);
        //else printf("%lld ",i);
      }
    }
  }
  for(i=1;i<=sqrtl((ld)n);i++){
    if((n-1)%i==0&&i>=2){
      
    }else{
      if(i>=2){
        k=i;
        j=n;
        while(j%k==0) j/=k;
        if(j%k==1){
          //printf("%lld ",i);
          result++;
        }
      }
      k=n/i;
      if(k<=1||k==i) continue;
      j=n;
      while(j%k==0) j/=k;
      if(j%k==1){
        //printf("%lld ",n/i);
        result++;
      }
    }
  }
  //printf("\n");
  printf("%lld",result);
  return 0;
}


7705668993
 2827
 6363881708
 2031
 10229584853
 308
 13543667986
 23472293460
 45468207033
 9

64 12 17 16 6 4 33 11 48 5
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 <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max(a,b)-min(a,b))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1; rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)n,(int)n)
#define nHr(n,r) nCr((int)(n+r+1),(int)r)
#define sankaku(x) ((1+x)*x)/2
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll stack[LIMIT2],queue[LIMIT2*10];//stack[0]=count;queue[0]=start,queue[1]=length;
int enqueue(ll n){
    if(queue[0]+queue[1]>=LIMIT2) return -1;
    queue[queue[0]+queue[1]] = n;
    queue[1]++;
    return 1;
}
ll dequeue(){
    ll result;
    if(queue[1]<=0) return -1;
    result = queue[queue[0]];
    queue[0]++;
    queue[1]--;
    if(queue[1]==0){
        queue[0] = 2;
    }
    return result;
}
void initialize(){
    stack[0] = 0;
    queue[0] = 2;
    queue[1] = 0;
}
int main(void){
  initialize();
  ll n,m,k,i,j,result=0,sum=0;
  int a[LIMIT1];
  char s[LIMIT1];

  scanf("%lld",&n);
  for(i=1;i<=sqrtl((ld)(n-1));i++){//n-1の約数
    if((n-1)%i==0){
      if(i>=2&&i!=sqrtl((ld)(n-1))){
        result+=2;
        //printf("%lld %lld ",i,(n-1)/i);
      }else{
        if(n-1<=1) continue;
        result++;
        //if(i==1) printf("%lld ",n-1);
        //else printf("%lld ",i);
      }
    }
  }
  for(i=1;i<=sqrtl((ld)n);i++){
    if((n-1)%i==0&&i>=2){
      
    }else{
      if(i>=2){
        k=i;
        j=n;
        while(j%k==0) j/=k;
        if(j%k==1){
          //printf("%lld ",i);
          result++;
        }
      }
      k=n/i;
      if(k<=1||k==i) continue;
      j=n;
      while(j%k==0) j/=k;
      if(j%k==1){
        //printf("%lld ",n/i);
        result++;
      }
    }
  }
  //printf("\n");
  printf("%lld",result);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.globl	nPr
	.type	nPr, @function
nPr:
.LFB7:
	.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)
	movq	$1, -8(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	subq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addq	$1, -16(%rbp)
.L6:
	movl	-24(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L7
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	nPr, .-nPr
	.globl	nCr
	.type	nCr, @function
nCr:
.LFB8:
	.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)
	movq	$1, -8(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	subq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-8(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, -8(%rbp)
	addq	$1, -16(%rbp)
.L10:
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L11
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	nCr, .-nCr
	.globl	dx
	.data
	.align 32
	.type	dx, @object
	.size	dx, 32
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	-1
	.long	1
	.globl	dy
	.align 32
	.type	dy, @object
	.size	dy, 32
dy:
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.text
	.globl	upint
	.type	upint, @function
upint:
.LFB9:
	.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L14
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %eax
	jmp	.L16
.L14:
	movl	$-1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	upint, .-upint
	.globl	downint
	.type	downint, @function
downint:
.LFB10:
	.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L18
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	$-1, %eax
	jmp	.L22
.L19:
	movl	$0, %eax
	jmp	.L22
.L18:
	movl	$1, %eax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	downint, .-downint
	.globl	upchar
	.type	upchar, @function
upchar:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	upchar, .-upchar
	.globl	downchar
	.type	downchar, @function
downchar:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	downchar, .-downchar
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 4000016
stack:
	.zero	4000016
	.globl	queue
	.align 32
	.type	queue, @object
	.size	queue, 40000160
queue:
	.zero	40000160
	.text
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.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)
	movq	queue(%rip), %rdx
	movq	8+queue(%rip), %rax
	addq	%rdx, %rax
	cmpq	$500001, %rax
	jle	.L28
	movl	$-1, %eax
	jmp	.L29
.L28:
	movq	queue(%rip), %rdx
	movq	8+queue(%rip), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	queue(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movq	8+queue(%rip), %rax
	addq	$1, %rax
	movq	%rax, 8+queue(%rip)
	movl	$1, %eax
.L29:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	enqueue, .-enqueue
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	8+queue(%rip), %rax
	testq	%rax, %rax
	jg	.L31
	movq	$-1, %rax
	jmp	.L32
.L31:
	movq	queue(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	queue(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movq	queue(%rip), %rax
	addq	$1, %rax
	movq	%rax, queue(%rip)
	movq	8+queue(%rip), %rax
	subq	$1, %rax
	movq	%rax, 8+queue(%rip)
	movq	8+queue(%rip), %rax
	testq	%rax, %rax
	jne	.L33
	movq	$2, queue(%rip)
.L33:
	movq	-8(%rbp), %rax
.L32:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	dequeue, .-dequeue
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	$0, stack(%rip)
	movq	$2, queue(%rip)
	movq	$0, 8+queue(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	initialize, .-initialize
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	initialize
	movq	$0, -1000056(%rbp)
	movq	$0, -1000048(%rbp)
	leaq	-1000080(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -1000072(%rbp)
	jmp	.L36
.L41:
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L37
	cmpq	$1, -1000072(%rbp)
	jle	.L38
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fucomi	%st(1), %st
	jp	.L58
	fucomip	%st(1), %st
	fstp	%st(0)
	je	.L38
	jmp	.L55
.L58:
	fstp	%st(0)
	fstp	%st(0)
.L55:
	addq	$2, -1000056(%rbp)
	jmp	.L37
.L38:
	movq	-1000080(%rbp), %rax
	cmpq	$2, %rax
	jle	.L56
	addq	$1, -1000056(%rbp)
	jmp	.L37
.L56:
	nop
.L37:
	addq	$1, -1000072(%rbp)
.L36:
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jnb	.L41
	movq	$1, -1000072(%rbp)
	jmp	.L42
.L52:
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L43
	cmpq	$1, -1000072(%rbp)
	jg	.L44
.L43:
	cmpq	$1, -1000072(%rbp)
	jle	.L45
	movq	-1000072(%rbp), %rax
	movq	%rax, -1000040(%rbp)
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000064(%rbp)
	jmp	.L46
.L47:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rax, -1000064(%rbp)
.L46:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L47
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L45
	addq	$1, -1000056(%rbp)
.L45:
	movq	-1000080(%rbp), %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rax, -1000040(%rbp)
	cmpq	$1, -1000040(%rbp)
	jle	.L57
	movq	-1000040(%rbp), %rax
	cmpq	-1000072(%rbp), %rax
	je	.L57
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000064(%rbp)
	jmp	.L50
.L51:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rax, -1000064(%rbp)
.L50:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L51
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L44
	addq	$1, -1000056(%rbp)
	jmp	.L44
.L57:
	nop
.L44:
	addq	$1, -1000072(%rbp)
.L42:
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jnb	.L52
	movq	-1000056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.globl	nPr
	.type	nPr, @function
nPr:
.LFB7:
	.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)
	movq	$1, -8(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	subq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addq	$1, -16(%rbp)
.L6:
	movl	-24(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L7
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	nPr, .-nPr
	.globl	nCr
	.type	nCr, @function
nCr:
.LFB8:
	.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)
	movq	$1, -8(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	subq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-8(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, -8(%rbp)
	addq	$1, -16(%rbp)
.L10:
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L11
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	nCr, .-nCr
	.globl	dx
	.data
	.align 32
	.type	dx, @object
	.size	dx, 32
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	-1
	.long	1
	.globl	dy
	.align 32
	.type	dy, @object
	.size	dy, 32
dy:
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.text
	.globl	upint
	.type	upint, @function
upint:
.LFB9:
	.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L14
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %eax
	jmp	.L16
.L14:
	movl	$-1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	upint, .-upint
	.globl	downint
	.type	downint, @function
downint:
.LFB10:
	.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L18
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	$-1, %eax
	jmp	.L22
.L19:
	movl	$0, %eax
	jmp	.L22
.L18:
	movl	$1, %eax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	downint, .-downint
	.globl	upchar
	.type	upchar, @function
upchar:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	upchar, .-upchar
	.globl	downchar
	.type	downchar, @function
downchar:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	downchar, .-downchar
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 4000016
stack:
	.zero	4000016
	.globl	queue
	.align 32
	.type	queue, @object
	.size	queue, 40000160
queue:
	.zero	40000160
	.text
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.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)
	movq	queue(%rip), %rdx
	movq	8+queue(%rip), %rax
	addq	%rdx, %rax
	cmpq	$500001, %rax
	jle	.L28
	movl	$-1, %eax
	jmp	.L29
.L28:
	movq	queue(%rip), %rdx
	movq	8+queue(%rip), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	queue(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movq	8+queue(%rip), %rax
	addq	$1, %rax
	movq	%rax, 8+queue(%rip)
	movl	$1, %eax
.L29:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	enqueue, .-enqueue
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	8+queue(%rip), %rax
	testq	%rax, %rax
	jg	.L31
	movq	$-1, %rax
	jmp	.L32
.L31:
	movq	queue(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	queue(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movq	queue(%rip), %rax
	addq	$1, %rax
	movq	%rax, queue(%rip)
	movq	8+queue(%rip), %rax
	subq	$1, %rax
	movq	%rax, 8+queue(%rip)
	movq	8+queue(%rip), %rax
	testq	%rax, %rax
	jne	.L33
	movq	$2, queue(%rip)
.L33:
	movq	-8(%rbp), %rax
.L32:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	dequeue, .-dequeue
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	$0, stack(%rip)
	movq	$2, queue(%rip)
	movq	$0, 8+queue(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	initialize, .-initialize
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	initialize
	movq	$0, -1000056(%rbp)
	movq	$0, -1000048(%rbp)
	leaq	-1000080(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -1000072(%rbp)
	jmp	.L36
.L41:
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L37
	cmpq	$1, -1000072(%rbp)
	jle	.L38
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fucomi	%st(1), %st
	jp	.L58
	fucomip	%st(1), %st
	fstp	%st(0)
	je	.L38
	jmp	.L55
.L58:
	fstp	%st(0)
	fstp	%st(0)
.L55:
	addq	$2, -1000056(%rbp)
	jmp	.L37
.L38:
	movq	-1000080(%rbp), %rax
	cmpq	$2, %rax
	jle	.L56
	addq	$1, -1000056(%rbp)
	jmp	.L37
.L56:
	nop
.L37:
	addq	$1, -1000072(%rbp)
.L36:
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jnb	.L41
	movq	$1, -1000072(%rbp)
	jmp	.L42
.L52:
	movq	-1000080(%rbp), %rax
	subq	$1, %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L43
	cmpq	$1, -1000072(%rbp)
	jg	.L44
.L43:
	cmpq	$1, -1000072(%rbp)
	jle	.L45
	movq	-1000072(%rbp), %rax
	movq	%rax, -1000040(%rbp)
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000064(%rbp)
	jmp	.L46
.L47:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rax, -1000064(%rbp)
.L46:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L47
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L45
	addq	$1, -1000056(%rbp)
.L45:
	movq	-1000080(%rbp), %rax
	cqto
	idivq	-1000072(%rbp)
	movq	%rax, -1000040(%rbp)
	cmpq	$1, -1000040(%rbp)
	jle	.L57
	movq	-1000040(%rbp), %rax
	cmpq	-1000072(%rbp), %rax
	je	.L57
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000064(%rbp)
	jmp	.L50
.L51:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rax, -1000064(%rbp)
.L50:
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L51
	movq	-1000064(%rbp), %rax
	cqto
	idivq	-1000040(%rbp)
	movq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L44
	addq	$1, -1000056(%rbp)
	jmp	.L44
.L57:
	nop
.L44:
	addq	$1, -1000072(%rbp)
.L42:
	fildq	-1000072(%rbp)
	fstpt	-1000096(%rbp)
	movq	-1000080(%rbp), %rax
	movq	%rax, -1000104(%rbp)
	fildq	-1000104(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	sqrtl@PLT
	addq	$16, %rsp
	fldt	-1000096(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jnb	.L52
	movq	-1000056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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:
