// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes.c
// Function: gt_randomcodes_fillbinsearchcache
static void gt_randomcodes_fillbinsearchcache(GtRandomcodesinfo *fci,
                                             unsigned int addbscache_depth)
{
  size_t allocbytes = 0;

  fci->binsearchcache.depth
    = addbscache_depth + (unsigned int) log10((double) fci->differentcodes);
  fci->binsearchcache.nextfreeGtIndexwithcodeRC = 0;
  fci->binsearchcache.allocatedGtIndexwithcodeRC
    = 1UL << (fci->binsearchcache.depth+1);
  fci->binsearchcache.width
    = fci->differentcodes/fci->binsearchcache.allocatedGtIndexwithcodeRC;
  if (fci->binsearchcache.allocatedGtIndexwithcodeRC < fci->differentcodes)
  {
    GtUword idx, current = fci->binsearchcache.width;

    allocbytes = sizeof (*fci->binsearchcache.spaceGtIndexwithcodeRC)
                 * fci->binsearchcache.allocatedGtIndexwithcodeRC;
    fci->binsearchcache.spaceGtIndexwithcodeRC = gt_malloc(allocbytes);
    for (idx=0; idx < fci->binsearchcache.allocatedGtIndexwithcodeRC; idx++)
    {
      gt_assert(current < fci->differentcodes);
      fci->binsearchcache.
           spaceGtIndexwithcodeRC[fci->binsearchcache.nextfreeGtIndexwithcodeRC]
                               .ptr = fci->allrandomcodes + current;
      fci->binsearchcache.
           spaceGtIndexwithcodeRC[fci->binsearchcache.nextfreeGtIndexwithcodeRC]
                               .index = current;
      fci->binsearchcache.
        spaceGtIndexwithcodeRC[fci->binsearchcache.nextfreeGtIndexwithcodeRC++]
        .code = fci->allrandomcodes[current];
      current += fci->binsearchcache.width;
    }
  }
  gt_log_log("binsearchcache.depth=%u => " GT_WU " bytes",
             fci->binsearchcache.depth,
             (GtUword) allocbytes);
  GT_FCI_ADDWORKSPACE(fci->fcsl, "binsearchcache", allocbytes);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq $0x0, 0x20(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rax), %xmm0
movaps 0x2aa101(%rip), %xmm1   # 0x518930
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2aa105(%rip), %xmm1   # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x19300
movl 0xc(%rsp), %ecx
cvttsd2si %xmm0, %rax
addl %eax, %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x68(%rax)
movq 0x30(%rsp), %rax
movq $0x0, 0x58(%rax)
movq 0x30(%rsp), %rax
movl 0x68(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rsp), %rcx
xorl %edx, %edx
divq 0x60(%rcx)
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x30(%rsp), %rax
movq 0x60(%rax), %rax
movq 0x30(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x26ea27
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
imulq $0x18, 0x60(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x3101e2(%rip), %rsi    # 0x57ead5
movl $0x77, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x48(%rax)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x60(%rcx), %rax
jae 0x26ea25
jmp 0x26e928
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jb 0x26e970
movq 0x3cd661(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a76ca(%rip), %rsi    # 0x516013
leaq 0x310647(%rip), %rdx    # 0x57ef97
leaq 0x31065e(%rip), %rcx    # 0x57efb5
leaq 0x310177(%rip), %r8     # 0x57ead5
movl $0x7a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26e972
movq 0x30(%rsp), %rax
movq 0xa0(%rax), %rcx
movq 0x10(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x30(%rsp), %rdx
imulq $0x18, 0x58(%rdx), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rcx
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x30(%rsp), %rdx
imulq $0x18, 0x58(%rdx), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq 0x30(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x30(%rsp), %rsi
movq 0x58(%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, 0x58(%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x26e912
jmp 0x26ea27
movq 0x30(%rsp), %rax
movl 0x68(%rax), %esi
movq 0x20(%rsp), %rdx
leaq 0x31059c(%rip), %rdi    # 0x57efd7
movb $0x0, %al
callq 0xe7740
movq 0x30(%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x20(%rsp), %rax
movl $0x8a, %esi
leaq 0x310076(%rip), %rdx    # 0x57ead5
movl $0x1, %r9d
leaq 0x31055c(%rip), %r8     # 0x57efc8
movl %r9d, %ecx
movq %rax, (%rsp)
callq 0x4bea60
addq $0x38, %rsp
retq
nopl (%rax)