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 <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
#define NUM 100001

void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}
int GCD(int a,int b){int c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
int LCM(int a,int b){return a*b/GCD(a,b);}
int POW(int a,int n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return (int)ans;}
int icmp(const void* a,const void* b){return *(int*)a-*(int*)b;}
int lcmp(const void* a,const void* b){return *(LL*)a-*(LL*)b;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int scmp(const void* a,const void* b){return strcmp(*(char**)a,*(char**)b);}
LL fac[NUM],finv[NUM],inv[NUM];
void comi(){int i;fac[0]=fac[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fac[i]=fac[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
int com(int n,int k){if(n<k||n<0||k<0)return 0;return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;}


int main(){
  LL K,i,a=1,b=0,ans=0;
  char S[101];
  scanf("%s",S);
  scanf("%lld",&K);
  int l=strlen(S);
  FOR(i,0,l-1){
    if(S[i]==S[i+1])a++;
    else ans+=a/2,a=1;
  }
  ans+=a/2,ans*=K,a=1;
  if(S[0]==S[l-1]){
    FOR(i,0,l-1){
      if(S[i]==S[i+1])a++;
      else break;
    }
    if(a!=l){
      b++;
      for(i=l-1;i>0;i--){
        if(S[i]==S[i-1])a++;
        else break;
      }
    }
  }
  if(a%2==1&&b%2==1)ans+=K-1;
  if(a==l)ans=l*K/2;

  printf("%lld\n",ans);
	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	dup
	.type	dup, @function
dup:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	addl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dup, .-dup
	.globl	mod
	.type	mod, @function
mod:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L6
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	jmp	.L7
.L6:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mod, .-mod
	.globl	GCD
	.type	GCD, @function
GCD:
.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	$1, -8(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -24(%rbp)
.L9:
	cmpl	$0, -8(%rbp)
	jne	.L10
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	GCD, .-GCD
	.globl	LCM
	.type	LCM, @function
LCM:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$8, %rsp
	.cfi_offset 3, -24
	movl	%edi, -12(%rbp)
	movl	%esi, -16(%rbp)
	movl	-12(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %ebx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	GCD
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	LCM, .-LCM
	.globl	POW
	.type	POW, @function
POW:
.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, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	$1, -8(%rbp)
	jmp	.L15
.L17:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L16
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L16:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	movslq	%eax, %rdx
	imulq	$1152921497, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$28, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, -20(%rbp)
	movl	-20(%rbp), %edx
	imull	$1000000007, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	sarl	-24(%rbp)
.L15:
	cmpl	$0, -24(%rbp)
	jg	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	POW, .-POW
	.globl	icmp
	.type	icmp, @function
icmp:
.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)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	icmp, .-icmp
	.globl	lcmp
	.type	lcmp, @function
lcmp:
.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	lcmp, .-lcmp
	.globl	ccmp
	.type	ccmp, @function
ccmp:
.LFB14:
	.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
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	ccmp, .-ccmp
	.globl	scmp
	.type	scmp, @function
scmp:
.LFB15:
	.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), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	scmp, .-scmp
	.globl	fac
	.bss
	.align 32
	.type	fac, @object
	.size	fac, 800008
fac:
	.zero	800008
	.globl	finv
	.align 32
	.type	finv, @object
	.size	finv, 800008
finv:
	.zero	800008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 800008
inv:
	.zero	800008
	.text
	.globl	comi
	.type	comi, @function
comi:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	$1, 8+fac(%rip)
	movq	8+fac(%rip), %rax
	movq	%rax, fac(%rip)
	movq	$1, 8+finv(%rip)
	movq	8+finv(%rip), %rax
	movq	%rax, finv(%rip)
	movq	$1, 8+inv(%rip)
	movl	$2, -4(%rbp)
	jmp	.L28
.L29:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fac(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	fac(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$1000000007, %eax
	cltd
	idivl	-4(%rbp)
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	inv(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	$1000000007, %eax
	cltd
	idivl	-4(%rbp)
	cltq
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	$1000000007, %edx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	inv(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	finv(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	inv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	finv(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L28:
	cmpl	$100000, -4(%rbp)
	jle	.L29
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	comi, .-comi
	.globl	com
	.type	com, @function
com:
.LFB17:
	.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
	jl	.L31
	cmpl	$0, -4(%rbp)
	js	.L31
	cmpl	$0, -8(%rbp)
	jns	.L32
.L31:
	movl	$0, %eax
	jmp	.L33
.L32:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fac(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	finv(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	finv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
.L33:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	com, .-com
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB18:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$160, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -136(%rbp)
	movq	$0, -128(%rbp)
	movq	$0, -120(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -156(%rbp)
	movq	$0, -144(%rbp)
	jmp	.L35
.L38:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	addq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L36
	addq	$1, -136(%rbp)
	jmp	.L37
.L36:
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	$1, -136(%rbp)
.L37:
	addq	$1, -144(%rbp)
.L35:
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -144(%rbp)
	jl	.L38
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	-152(%rbp), %rax
	movq	-120(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	$1, -136(%rbp)
	movzbl	-112(%rbp), %edx
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L39
	movq	$0, -144(%rbp)
	jmp	.L40
.L44:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	addq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L53
	addq	$1, -136(%rbp)
	addq	$1, -144(%rbp)
.L40:
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -144(%rbp)
	jl	.L44
	jmp	.L43
.L53:
	nop
.L43:
	movl	-156(%rbp), %eax
	cltq
	cmpq	%rax, -136(%rbp)
	je	.L39
	addq	$1, -128(%rbp)
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	movq	%rax, -144(%rbp)
	jmp	.L45
.L48:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	subq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L54
	addq	$1, -136(%rbp)
	subq	$1, -144(%rbp)
.L45:
	cmpq	$0, -144(%rbp)
	jg	.L48
	jmp	.L39
.L54:
	nop
.L39:
	movq	-136(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L49
	movq	-128(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L49
	movq	-152(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -120(%rbp)
.L49:
	movl	-156(%rbp), %eax
	cltq
	cmpq	%rax, -136(%rbp)
	jne	.L50
	movl	-156(%rbp), %eax
	movslq	%eax, %rdx
	movq	-152(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -120(%rbp)
.L50:
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.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	dup
	.type	dup, @function
dup:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cltd
	idivl	%esi
	cmpl	$1, %edx
	sbbl	$-1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	dup, .-dup
	.p2align 4
	.globl	mod
	.type	mod, @function
mod:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cltd
	idivl	%esi
	addl	%edx, %esi
	movl	%edx, %eax
	testl	%edi, %edi
	cmovs	%esi, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	mod, .-mod
	.p2align 4
	.globl	GCD
	.type	GCD, @function
GCD:
.LFB54:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %esi
	cmovge	%edi, %eax
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L10
	ret
	.cfi_endproc
.LFE54:
	.size	GCD, .-GCD
	.p2align 4
	.globl	LCM
	.type	LCM, @function
LCM:
.LFB55:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	movl	%esi, %ecx
	imull	%esi, %r8d
	cmpl	%esi, %edi
	cmovle	%edi, %esi
	cmovge	%edi, %ecx
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %eax
	movl	%edx, %esi
	cltd
	movl	%esi, %ecx
	idivl	%esi
	testl	%edx, %edx
	jne	.L13
	movl	%r8d, %eax
	cltd
	idivl	%esi
	ret
	.cfi_endproc
.LFE55:
	.size	LCM, .-LCM
	.p2align 4
	.globl	POW
	.type	POW, @function
POW:
.LFB56:
	.cfi_startproc
	endbr64
	movl	%edi, %ecx
	testl	%esi, %esi
	jle	.L19
	movabsq	$-8543223828751151131, %r8
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	testb	$1, %sil
	je	.L17
	movslq	%ecx, %rdi
	imulq	%rdx, %rdi
	movq	%rdi, %rax
	imulq	%r8
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rdi, %rdx
	subq	%rax, %rdx
.L17:
	movl	%ecx, %eax
	imull	%ecx, %eax
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$1152921497, %rcx, %rcx
	sarl	$31, %edi
	sarq	$60, %rcx
	subl	%edi, %ecx
	imull	$1000000007, %ecx, %edi
	subl	%edi, %eax
	sarl	%esi
	movl	%eax, %ecx
	jne	.L18
	movl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	POW, .-POW
	.p2align 4
	.globl	icmp
	.type	icmp, @function
icmp:
.LFB57:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE57:
	.size	icmp, .-icmp
	.p2align 4
	.globl	lcmp
	.type	lcmp, @function
lcmp:
.LFB58:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE58:
	.size	lcmp, .-lcmp
	.p2align 4
	.globl	ccmp
	.type	ccmp, @function
ccmp:
.LFB59:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE59:
	.size	ccmp, .-ccmp
	.p2align 4
	.globl	scmp
	.type	scmp, @function
scmp:
.LFB60:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE60:
	.size	scmp, .-scmp
	.p2align 4
	.globl	comi
	.type	comi, @function
comi:
.LFB61:
	.cfi_startproc
	endbr64
	movdqa	.LC0(%rip), %xmm0
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$3, %edi
	movl	$2, %ecx
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	$500000004, %r8d
	leaq	inv(%rip), %r11
	movl	$1000000007, %r10d
	movaps	%xmm0, fac(%rip)
	movabsq	$-8543223828751151131, %r9
	movaps	%xmm0, finv(%rip)
	movdqa	.LC1(%rip), %xmm0
	movq	$2, 16+fac(%rip)
	movq	$500000004, 16+finv(%rip)
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	fac(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	finv(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	$1000000007, %ebx
	movups	%xmm0, 8+inv(%rip)
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r10d, %eax
	imulq	%rdi, %rcx
	cltd
	idivl	%edi
	movq	%rcx, %r13
	movslq	%eax, %rsi
	movq	%rcx, %rax
	movslq	%edx, %r14
	imulq	%r9
	movq	%r13, %rax
	sarq	$63, %rax
	imulq	(%r11,%r14,8), %rsi
	leaq	(%rdx,%rcx), %rcx
	sarq	$29, %rcx
	subq	%rax, %rcx
	imulq	$1000000007, %rcx, %rax
	movq	%r13, %rcx
	subq	%rax, %rcx
	movq	%rsi, %rax
	imulq	%r9
	movq	%rcx, (%r12,%rdi,8)
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rsi
	movq	%rbx, %rax
	subq	%rsi, %rax
	movq	%rax, (%r11,%rdi,8)
	imulq	%r8, %rax
	movq	%rax, %rsi
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, 0(%rbp,%rdi,8)
	addq	$1, %rdi
	movq	%rsi, %r8
	cmpq	$100001, %rdi
	jne	.L29
	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
	.cfi_endproc
.LFE61:
	.size	comi, .-comi
	.p2align 4
	.globl	com
	.type	com, @function
com:
.LFB62:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	testl	%esi, %esi
	cmovns	%esi, %eax
	cmpl	%eax, %edi
	jl	.L34
	testl	%esi, %esi
	js	.L34
	movl	%edi, %eax
	leaq	finv(%rip), %rdx
	movslq	%edi, %rdi
	subl	%esi, %eax
	movslq	%esi, %rsi
	cltq
	movq	(%rdx,%rax,8), %rcx
	imulq	(%rdx,%rsi,8), %rcx
	movabsq	$-8543223828751151131, %rsi
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	leaq	fac(%rip), %rax
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	(%rax,%rdi,8), %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%ecx, %eax
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE62:
	.size	com, .-com
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%s"
.LC3:
	.string	"%lld"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB63:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC2(%rip), %rdi
	addq	$-128, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	leaq	8(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	leal	-1(%rax), %r11d
	movq	%rax, %r10
	testl	%r11d, %r11d
	jle	.L36
	leaq	(%rbx,%rax), %r8
	leaq	17(%rsp), %rcx
	xorl	%edi, %edi
	movl	$1, %esi
	movzbl	16(%rsp), %r9d
	movl	%r9d, %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	sarq	%rsi
	addq	$1, %rcx
	addq	%rsi, %rdi
	movl	$1, %esi
	cmpq	%rcx, %r8
	je	.L64
.L39:
	movl	%eax, %edx
	movzbl	(%rcx), %eax
	cmpb	%al, %dl
	jne	.L37
	addq	$1, %rcx
	addq	$1, %rsi
	cmpq	%rcx, %r8
	jne	.L39
.L64:
	sarq	%rsi
	movslq	%r11d, %r11
	movl	$1, %ecx
	leaq	(%rsi,%rdi), %r8
	movq	8(%rsp), %rdi
	imulq	%rdi, %r8
	cmpb	16(%rsp,%r11), %r9b
	je	.L42
.L48:
	cmpq	%rcx, %r10
	je	.L49
.L47:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	subq	$-128, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L66:
	.cfi_restore_state
	addq	$1, %rcx
	cmpq	%r10, %rcx
	je	.L41
.L42:
	movl	%r9d, %edx
	movzbl	(%rbx,%rcx), %r9d
	cmpb	%dl, %r9b
	je	.L66
.L41:
	cmpq	%rcx, %r10
	je	.L44
	leaq	(%rbx,%r10), %rdx
	movzbl	15(%rsp,%r10), %esi
	addq	$1, %rbx
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L67:
	subq	$1, %rdx
	addq	$1, %rcx
	cmpq	%rbx, %rdx
	je	.L45
.L46:
	movl	%esi, %eax
	movzbl	-2(%rdx), %esi
	cmpb	%al, %sil
	je	.L67
.L45:
	movq	%rcx, %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	subq	$1, %rdx
	jne	.L48
.L43:
	leaq	-1(%r8,%rdi), %r8
	jmp	.L48
.L44:
	movq	%r10, %rcx
.L49:
	movq	%rdi, %rax
	movl	$2, %esi
	imulq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rax, %r8
	jmp	.L47
.L36:
	movslq	%r11d, %r11
	movq	8(%rsp), %rdi
	movzbl	16(%rsp,%r11), %eax
	cmpb	%al, 16(%rsp)
	je	.L52
	movl	$1, %ecx
	xorl	%r8d, %r8d
	jmp	.L48
.L52:
	cmpq	$1, %r10
	je	.L44
	xorl	%r8d, %r8d
	movl	$1, %ecx
	jmp	.L43
.L65:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE63:
	.size	main, .-main
	.globl	inv
	.bss
	.align 32
	.type	inv, @object
	.size	inv, 800008
inv:
	.zero	800008
	.globl	finv
	.align 32
	.type	finv, @object
	.size	finv, 800008
finv:
	.zero	800008
	.globl	fac
	.align 32
	.type	fac, @object
	.size	fac, 800008
fac:
	.zero	800008
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	1
	.quad	1
	.align 16
.LC1:
	.quad	1
	.quad	500000004
	.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	dup
	.type	dup, @function
dup:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cltd
	idivl	%esi
	cmpl	$1, %edx
	sbbl	$-1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	dup, .-dup
	.p2align 4
	.globl	mod
	.type	mod, @function
mod:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cltd
	idivl	%esi
	addl	%edx, %esi
	movl	%edx, %eax
	testl	%edi, %edi
	cmovs	%esi, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	mod, .-mod
	.p2align 4
	.globl	GCD
	.type	GCD, @function
GCD:
.LFB54:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %esi
	cmovge	%edi, %eax
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L10
	ret
	.cfi_endproc
.LFE54:
	.size	GCD, .-GCD
	.p2align 4
	.globl	LCM
	.type	LCM, @function
LCM:
.LFB55:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	movl	%esi, %ecx
	imull	%esi, %r8d
	cmpl	%esi, %edi
	cmovle	%edi, %esi
	cmovge	%edi, %ecx
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %eax
	movl	%edx, %esi
	cltd
	movl	%esi, %ecx
	idivl	%esi
	testl	%edx, %edx
	jne	.L13
	movl	%r8d, %eax
	cltd
	idivl	%esi
	ret
	.cfi_endproc
.LFE55:
	.size	LCM, .-LCM
	.p2align 4
	.globl	POW
	.type	POW, @function
POW:
.LFB56:
	.cfi_startproc
	endbr64
	movl	%edi, %ecx
	testl	%esi, %esi
	jle	.L19
	movabsq	$-8543223828751151131, %r8
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	testb	$1, %sil
	je	.L17
	movslq	%ecx, %rdi
	imulq	%rdx, %rdi
	movq	%rdi, %rax
	imulq	%r8
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rdi, %rdx
	subq	%rax, %rdx
.L17:
	movl	%ecx, %eax
	imull	%ecx, %eax
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$1152921497, %rcx, %rcx
	sarl	$31, %edi
	sarq	$60, %rcx
	subl	%edi, %ecx
	imull	$1000000007, %ecx, %edi
	subl	%edi, %eax
	sarl	%esi
	movl	%eax, %ecx
	jne	.L18
	movl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	POW, .-POW
	.p2align 4
	.globl	icmp
	.type	icmp, @function
icmp:
.LFB57:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE57:
	.size	icmp, .-icmp
	.p2align 4
	.globl	lcmp
	.type	lcmp, @function
lcmp:
.LFB58:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE58:
	.size	lcmp, .-lcmp
	.p2align 4
	.globl	ccmp
	.type	ccmp, @function
ccmp:
.LFB59:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE59:
	.size	ccmp, .-ccmp
	.p2align 4
	.globl	scmp
	.type	scmp, @function
scmp:
.LFB60:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE60:
	.size	scmp, .-scmp
	.p2align 4
	.globl	comi
	.type	comi, @function
comi:
.LFB61:
	.cfi_startproc
	endbr64
	movdqa	.LC0(%rip), %xmm0
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$3, %edi
	movl	$2, %ecx
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	$500000004, %r8d
	leaq	inv(%rip), %r11
	movl	$1000000007, %r10d
	movaps	%xmm0, fac(%rip)
	movabsq	$-8543223828751151131, %r9
	movaps	%xmm0, finv(%rip)
	movdqa	.LC1(%rip), %xmm0
	movq	$2, 16+fac(%rip)
	movq	$500000004, 16+finv(%rip)
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	fac(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	finv(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	$1000000007, %ebx
	movups	%xmm0, 8+inv(%rip)
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r10d, %eax
	imulq	%rdi, %rcx
	cltd
	idivl	%edi
	movq	%rcx, %r13
	movslq	%eax, %rsi
	movq	%rcx, %rax
	movslq	%edx, %r14
	imulq	%r9
	movq	%r13, %rax
	sarq	$63, %rax
	imulq	(%r11,%r14,8), %rsi
	leaq	(%rdx,%rcx), %rcx
	sarq	$29, %rcx
	subq	%rax, %rcx
	imulq	$1000000007, %rcx, %rax
	movq	%r13, %rcx
	subq	%rax, %rcx
	movq	%rsi, %rax
	imulq	%r9
	movq	%rcx, (%r12,%rdi,8)
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rsi
	movq	%rbx, %rax
	subq	%rsi, %rax
	movq	%rax, (%r11,%rdi,8)
	imulq	%r8, %rax
	movq	%rax, %rsi
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, 0(%rbp,%rdi,8)
	addq	$1, %rdi
	movq	%rsi, %r8
	cmpq	$100001, %rdi
	jne	.L29
	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
	.cfi_endproc
.LFE61:
	.size	comi, .-comi
	.p2align 4
	.globl	com
	.type	com, @function
com:
.LFB62:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	testl	%esi, %esi
	cmovns	%esi, %eax
	cmpl	%eax, %edi
	jl	.L34
	testl	%esi, %esi
	js	.L34
	movl	%edi, %eax
	leaq	finv(%rip), %rdx
	movslq	%edi, %rdi
	subl	%esi, %eax
	movslq	%esi, %rsi
	cltq
	movq	(%rdx,%rax,8), %rcx
	imulq	(%rdx,%rsi,8), %rcx
	movabsq	$-8543223828751151131, %rsi
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	leaq	fac(%rip), %rax
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	(%rax,%rdi,8), %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%ecx, %eax
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE62:
	.size	com, .-com
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%s"
.LC3:
	.string	"%lld"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB63:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC2(%rip), %rdi
	addq	$-128, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	leaq	8(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	leal	-1(%rax), %r11d
	movq	%rax, %r10
	testl	%r11d, %r11d
	jle	.L36
	leaq	(%rbx,%rax), %r8
	leaq	17(%rsp), %rcx
	xorl	%edi, %edi
	movl	$1, %esi
	movzbl	16(%rsp), %r9d
	movl	%r9d, %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	sarq	%rsi
	addq	$1, %rcx
	addq	%rsi, %rdi
	movl	$1, %esi
	cmpq	%rcx, %r8
	je	.L64
.L39:
	movl	%eax, %edx
	movzbl	(%rcx), %eax
	cmpb	%al, %dl
	jne	.L37
	addq	$1, %rcx
	addq	$1, %rsi
	cmpq	%rcx, %r8
	jne	.L39
.L64:
	sarq	%rsi
	movslq	%r11d, %r11
	movl	$1, %ecx
	leaq	(%rsi,%rdi), %r8
	movq	8(%rsp), %rdi
	imulq	%rdi, %r8
	cmpb	16(%rsp,%r11), %r9b
	je	.L42
.L48:
	cmpq	%rcx, %r10
	je	.L49
.L47:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	subq	$-128, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L66:
	.cfi_restore_state
	addq	$1, %rcx
	cmpq	%r10, %rcx
	je	.L41
.L42:
	movl	%r9d, %edx
	movzbl	(%rbx,%rcx), %r9d
	cmpb	%dl, %r9b
	je	.L66
.L41:
	cmpq	%rcx, %r10
	je	.L44
	leaq	(%rbx,%r10), %rdx
	movzbl	15(%rsp,%r10), %esi
	addq	$1, %rbx
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L67:
	subq	$1, %rdx
	addq	$1, %rcx
	cmpq	%rbx, %rdx
	je	.L45
.L46:
	movl	%esi, %eax
	movzbl	-2(%rdx), %esi
	cmpb	%al, %sil
	je	.L67
.L45:
	movq	%rcx, %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	subq	$1, %rdx
	jne	.L48
.L43:
	leaq	-1(%r8,%rdi), %r8
	jmp	.L48
.L44:
	movq	%r10, %rcx
.L49:
	movq	%rdi, %rax
	movl	$2, %esi
	imulq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rax, %r8
	jmp	.L47
.L36:
	movslq	%r11d, %r11
	movq	8(%rsp), %rdi
	movzbl	16(%rsp,%r11), %eax
	cmpb	%al, 16(%rsp)
	je	.L52
	movl	$1, %ecx
	xorl	%r8d, %r8d
	jmp	.L48
.L52:
	cmpq	$1, %r10
	je	.L44
	xorl	%r8d, %r8d
	movl	$1, %ecx
	jmp	.L43
.L65:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE63:
	.size	main, .-main
	.globl	inv
	.bss
	.align 32
	.type	inv, @object
	.size	inv, 800008
inv:
	.zero	800008
	.globl	finv
	.align 32
	.type	finv, @object
	.size	finv, 800008
finv:
	.zero	800008
	.globl	fac
	.align 32
	.type	fac, @object
	.size	fac, 800008
fac:
	.zero	800008
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	1
	.quad	1
	.align 16
.LC1:
	.quad	1
	.quad	500000004
	.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 <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
#define NUM 100001

void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}
int GCD(int a,int b){int c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
int LCM(int a,int b){return a*b/GCD(a,b);}
int POW(int a,int n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return (int)ans;}
int icmp(const void* a,const void* b){return *(int*)a-*(int*)b;}
int lcmp(const void* a,const void* b){return *(LL*)a-*(LL*)b;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int scmp(const void* a,const void* b){return strcmp(*(char**)a,*(char**)b);}
LL fac[NUM],finv[NUM],inv[NUM];
void comi(){int i;fac[0]=fac[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fac[i]=fac[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
int com(int n,int k){if(n<k||n<0||k<0)return 0;return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;}


int main(){
  LL K,i,a=1,b=0,ans=0;
  char S[101];
  scanf("%s",S);
  scanf("%lld",&K);
  int l=strlen(S);
  FOR(i,0,l-1){
    if(S[i]==S[i+1])a++;
    else ans+=a/2,a=1;
  }
  ans+=a/2,ans*=K,a=1;
  if(S[0]==S[l-1]){
    FOR(i,0,l-1){
      if(S[i]==S[i+1])a++;
      else break;
    }
    if(a!=l){
      b++;
      for(i=l-1;i>0;i--){
        if(S[i]==S[i-1])a++;
        else break;
      }
    }
  }
  if(a%2==1&&b%2==1)ans+=K-1;
  if(a==l)ans=l*K/2;

  printf("%lld\n",ans);
	return 0;
}

cooooooooonteeeeeeeedest
999993333
 issih
2
 rq
81
 hssih
2
 cooooooooonteeeeeeeedest
1894324309
 hssih
3
 hssih
6
 tsedeeeeeeeetnoooooonooc
54816478
 tsedeeeeeeeetnoooooonooc
93364260
 rr
552

7999946664
 2
 0
 3
 15154594472
 5
 11
 438531824
 746914080
 552

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 <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
#define NUM 100001

void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}
int GCD(int a,int b){int c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
int LCM(int a,int b){return a*b/GCD(a,b);}
int POW(int a,int n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return (int)ans;}
int icmp(const void* a,const void* b){return *(int*)a-*(int*)b;}
int lcmp(const void* a,const void* b){return *(LL*)a-*(LL*)b;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int scmp(const void* a,const void* b){return strcmp(*(char**)a,*(char**)b);}
LL fac[NUM],finv[NUM],inv[NUM];
void comi(){int i;fac[0]=fac[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fac[i]=fac[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
int com(int n,int k){if(n<k||n<0||k<0)return 0;return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;}


int main(){
  LL K,i,a=1,b=0,ans=0;
  char S[101];
  scanf("%s",S);
  scanf("%lld",&K);
  int l=strlen(S);
  FOR(i,0,l-1){
    if(S[i]==S[i+1])a++;
    else ans+=a/2,a=1;
  }
  ans+=a/2,ans*=K,a=1;
  if(S[0]==S[l-1]){
    FOR(i,0,l-1){
      if(S[i]==S[i+1])a++;
      else break;
    }
    if(a!=l){
      b++;
      for(i=l-1;i>0;i--){
        if(S[i]==S[i-1])a++;
        else break;
      }
    }
  }
  if(a%2==1&&b%2==1)ans+=K-1;
  if(a==l)ans=l*K/2;

  printf("%lld\n",ans);
	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	dup
	.type	dup, @function
dup:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	addl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dup, .-dup
	.globl	mod
	.type	mod, @function
mod:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L6
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	jmp	.L7
.L6:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mod, .-mod
	.globl	GCD
	.type	GCD, @function
GCD:
.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	$1, -8(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -24(%rbp)
.L9:
	cmpl	$0, -8(%rbp)
	jne	.L10
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	GCD, .-GCD
	.globl	LCM
	.type	LCM, @function
LCM:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$8, %rsp
	.cfi_offset 3, -24
	movl	%edi, -12(%rbp)
	movl	%esi, -16(%rbp)
	movl	-12(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %ebx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	GCD
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	LCM, .-LCM
	.globl	POW
	.type	POW, @function
POW:
.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, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	$1, -8(%rbp)
	jmp	.L15
.L17:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L16
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L16:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	movslq	%eax, %rdx
	imulq	$1152921497, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$28, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, -20(%rbp)
	movl	-20(%rbp), %edx
	imull	$1000000007, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	sarl	-24(%rbp)
.L15:
	cmpl	$0, -24(%rbp)
	jg	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	POW, .-POW
	.globl	icmp
	.type	icmp, @function
icmp:
.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)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	icmp, .-icmp
	.globl	lcmp
	.type	lcmp, @function
lcmp:
.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	lcmp, .-lcmp
	.globl	ccmp
	.type	ccmp, @function
ccmp:
.LFB14:
	.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
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	ccmp, .-ccmp
	.globl	scmp
	.type	scmp, @function
scmp:
.LFB15:
	.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), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	scmp, .-scmp
	.globl	fac
	.bss
	.align 32
	.type	fac, @object
	.size	fac, 800008
fac:
	.zero	800008
	.globl	finv
	.align 32
	.type	finv, @object
	.size	finv, 800008
finv:
	.zero	800008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 800008
inv:
	.zero	800008
	.text
	.globl	comi
	.type	comi, @function
comi:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	$1, 8+fac(%rip)
	movq	8+fac(%rip), %rax
	movq	%rax, fac(%rip)
	movq	$1, 8+finv(%rip)
	movq	8+finv(%rip), %rax
	movq	%rax, finv(%rip)
	movq	$1, 8+inv(%rip)
	movl	$2, -4(%rbp)
	jmp	.L28
.L29:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fac(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	fac(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$1000000007, %eax
	cltd
	idivl	-4(%rbp)
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	inv(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	$1000000007, %eax
	cltd
	idivl	-4(%rbp)
	cltq
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	$1000000007, %edx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	inv(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	finv(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	inv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	finv(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L28:
	cmpl	$100000, -4(%rbp)
	jle	.L29
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	comi, .-comi
	.globl	com
	.type	com, @function
com:
.LFB17:
	.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
	jl	.L31
	cmpl	$0, -4(%rbp)
	js	.L31
	cmpl	$0, -8(%rbp)
	jns	.L32
.L31:
	movl	$0, %eax
	jmp	.L33
.L32:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fac(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	finv(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	finv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
.L33:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	com, .-com
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB18:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$160, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -136(%rbp)
	movq	$0, -128(%rbp)
	movq	$0, -120(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -156(%rbp)
	movq	$0, -144(%rbp)
	jmp	.L35
.L38:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	addq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L36
	addq	$1, -136(%rbp)
	jmp	.L37
.L36:
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	$1, -136(%rbp)
.L37:
	addq	$1, -144(%rbp)
.L35:
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -144(%rbp)
	jl	.L38
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	-152(%rbp), %rax
	movq	-120(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	$1, -136(%rbp)
	movzbl	-112(%rbp), %edx
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L39
	movq	$0, -144(%rbp)
	jmp	.L40
.L44:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	addq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L53
	addq	$1, -136(%rbp)
	addq	$1, -144(%rbp)
.L40:
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -144(%rbp)
	jl	.L44
	jmp	.L43
.L53:
	nop
.L43:
	movl	-156(%rbp), %eax
	cltq
	cmpq	%rax, -136(%rbp)
	je	.L39
	addq	$1, -128(%rbp)
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	movq	%rax, -144(%rbp)
	jmp	.L45
.L48:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	subq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L54
	addq	$1, -136(%rbp)
	subq	$1, -144(%rbp)
.L45:
	cmpq	$0, -144(%rbp)
	jg	.L48
	jmp	.L39
.L54:
	nop
.L39:
	movq	-136(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L49
	movq	-128(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L49
	movq	-152(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -120(%rbp)
.L49:
	movl	-156(%rbp), %eax
	cltq
	cmpq	%rax, -136(%rbp)
	jne	.L50
	movl	-156(%rbp), %eax
	movslq	%eax, %rdx
	movq	-152(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -120(%rbp)
.L50:
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.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	dup
	.type	dup, @function
dup:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	addl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dup, .-dup
	.globl	mod
	.type	mod, @function
mod:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L6
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	jmp	.L7
.L6:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mod, .-mod
	.globl	GCD
	.type	GCD, @function
GCD:
.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	$1, -8(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -24(%rbp)
.L9:
	cmpl	$0, -8(%rbp)
	jne	.L10
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	GCD, .-GCD
	.globl	LCM
	.type	LCM, @function
LCM:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$8, %rsp
	.cfi_offset 3, -24
	movl	%edi, -12(%rbp)
	movl	%esi, -16(%rbp)
	movl	-12(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %ebx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	GCD
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	LCM, .-LCM
	.globl	POW
	.type	POW, @function
POW:
.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, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	$1, -8(%rbp)
	jmp	.L15
.L17:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L16
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L16:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	movslq	%eax, %rdx
	imulq	$1152921497, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$28, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, -20(%rbp)
	movl	-20(%rbp), %edx
	imull	$1000000007, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	sarl	-24(%rbp)
.L15:
	cmpl	$0, -24(%rbp)
	jg	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	POW, .-POW
	.globl	icmp
	.type	icmp, @function
icmp:
.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)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	icmp, .-icmp
	.globl	lcmp
	.type	lcmp, @function
lcmp:
.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	lcmp, .-lcmp
	.globl	ccmp
	.type	ccmp, @function
ccmp:
.LFB14:
	.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
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	ccmp, .-ccmp
	.globl	scmp
	.type	scmp, @function
scmp:
.LFB15:
	.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), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	scmp, .-scmp
	.globl	fac
	.bss
	.align 32
	.type	fac, @object
	.size	fac, 800008
fac:
	.zero	800008
	.globl	finv
	.align 32
	.type	finv, @object
	.size	finv, 800008
finv:
	.zero	800008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 800008
inv:
	.zero	800008
	.text
	.globl	comi
	.type	comi, @function
comi:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	$1, 8+fac(%rip)
	movq	8+fac(%rip), %rax
	movq	%rax, fac(%rip)
	movq	$1, 8+finv(%rip)
	movq	8+finv(%rip), %rax
	movq	%rax, finv(%rip)
	movq	$1, 8+inv(%rip)
	movl	$2, -4(%rbp)
	jmp	.L28
.L29:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fac(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	fac(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$1000000007, %eax
	cltd
	idivl	-4(%rbp)
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	inv(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	$1000000007, %eax
	cltd
	idivl	-4(%rbp)
	cltq
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	$1000000007, %edx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	inv(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	finv(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	inv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	finv(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L28:
	cmpl	$100000, -4(%rbp)
	jle	.L29
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	comi, .-comi
	.globl	com
	.type	com, @function
com:
.LFB17:
	.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
	jl	.L31
	cmpl	$0, -4(%rbp)
	js	.L31
	cmpl	$0, -8(%rbp)
	jns	.L32
.L31:
	movl	$0, %eax
	jmp	.L33
.L32:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fac(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	finv(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	finv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
.L33:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	com, .-com
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB18:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$160, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -136(%rbp)
	movq	$0, -128(%rbp)
	movq	$0, -120(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -156(%rbp)
	movq	$0, -144(%rbp)
	jmp	.L35
.L38:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	addq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L36
	addq	$1, -136(%rbp)
	jmp	.L37
.L36:
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	$1, -136(%rbp)
.L37:
	addq	$1, -144(%rbp)
.L35:
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -144(%rbp)
	jl	.L38
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	-152(%rbp), %rax
	movq	-120(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	$1, -136(%rbp)
	movzbl	-112(%rbp), %edx
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L39
	movq	$0, -144(%rbp)
	jmp	.L40
.L44:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	addq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L53
	addq	$1, -136(%rbp)
	addq	$1, -144(%rbp)
.L40:
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -144(%rbp)
	jl	.L44
	jmp	.L43
.L53:
	nop
.L43:
	movl	-156(%rbp), %eax
	cltq
	cmpq	%rax, -136(%rbp)
	je	.L39
	addq	$1, -128(%rbp)
	movl	-156(%rbp), %eax
	subl	$1, %eax
	cltq
	movq	%rax, -144(%rbp)
	jmp	.L45
.L48:
	leaq	-112(%rbp), %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movq	-144(%rbp), %rax
	subq	$1, %rax
	movzbl	-112(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L54
	addq	$1, -136(%rbp)
	subq	$1, -144(%rbp)
.L45:
	cmpq	$0, -144(%rbp)
	jg	.L48
	jmp	.L39
.L54:
	nop
.L39:
	movq	-136(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L49
	movq	-128(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L49
	movq	-152(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -120(%rbp)
.L49:
	movl	-156(%rbp), %eax
	cltq
	cmpq	%rax, -136(%rbp)
	jne	.L50
	movl	-156(%rbp), %eax
	movslq	%eax, %rdx
	movq	-152(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -120(%rbp)
.L50:
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.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:
