// File: /workspace/github_c_makefile_star2_O0/yhg926[P]public_kssd/global_basic.c
// Function: find_lgst_primer_2pow
llong find_lgst_primer_2pow(int w)
{
 if( w < 2 || w > 62 ){
  perror("find_1st_primer_after_2pow: argument should between 8 and 62");
  exit(EXIT_FAILURE);
 }
  llong n = ( 1llu << w ) ;
 llong hshsz = (llong) ( (double)n * CTX_SPC_USE_L / LD_FCTR) ;
 printf("w=%d\tspace_sz=%llu\thashsize=%llu\tkmerlimt=%llu\n",w,n,hshsz,(llong)(hshsz*LD_FCTR) ) ;
 llong i = 3, c ; llong prime = 0;
 for(i = n - 1 ; i > (n >> 1) ; i--)
 {
  for ( c = 2 ; c <= (int)pow(i+1,0.5) ; c++ )
  {
   if( i%c == 0 )
    break;
  }
  if( c*c > i ){
   prime = i;
   break;
  }
 }
 printf("nearest prime=%llu\n",prime);
 return prime;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x2, -0x4(%rbp)
jl 0x17a97
cmpl $0x3e, -0x4(%rbp)
jle 0x17aad
leaq 0x734c(%rip), %rdi      # 0x1edea
callq 0x3380
movl $0x1, %edi
callq 0x3410
movb -0x4(%rbp), %cl
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %xmm0
movaps 0x4558(%rip), %xmm4     # 0x1c020
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0x455c(%rip), %xmm3     # 0x1c030
subpd %xmm3, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x4bb5(%rip), %xmm1     # 0x1c6a0
mulsd %xmm1, %xmm0
movsd 0x46e1(%rip), %xmm2     # 0x1c1d8
divsd %xmm2, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x4b9e(%rip), %xmm1     # 0x1c6b0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq %rcx, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm3, %xmm0
movaps %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm3, %xmm0
mulsd %xmm2, %xmm0
movaps %xmm0, %xmm2
cvttsd2si %xmm2, %r8
movq %r8, %rdi
sarq $0x3f, %rdi
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rdi, %rax
orq %rax, %r8
leaq 0x72b6(%rip), %rdi      # 0x1ee27
movb $0x0, %al
callq 0x3150
movq $0x3, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
jbe 0x17c53
movq $0x2, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
incq %rax
movq %rax, %xmm0
movaps 0x4455(%rip), %xmm1     # 0x1c020
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x4459(%rip), %xmm1     # 0x1c030
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x4aea(%rip), %xmm1     # 0x1c6d8
callq 0x30d0
movq -0x38(%rbp), %rax
cvttsd2si %xmm0, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
ja 0x17c27
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x28(%rbp)
cmpq $0x0, %rdx
jne 0x17c17
jmp 0x17c27
jmp 0x17c19
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x17bb0
movq -0x28(%rbp), %rax
imulq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0x17c40
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x17c53
jmp 0x17c42
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x17b94
movq -0x30(%rbp), %rsi
leaq 0x71f9(%rip), %rdi      # 0x1ee57
movb $0x0, %al
callq 0x3150
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop