// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/firstcodes-cache.c
// Function: gt_firstcodes_binsearchcache_new
GtArrayGtIndexwithcode *gt_firstcodes_binsearchcache_new(
                                      GtUword differentcodes,
                                      unsigned int addbscache_depth,
                                      GtFirstcodesspacelog *fcsl)
{
  unsigned int depth = addbscache_depth +
                       (unsigned int) log10((double) differentcodes);
  while (true)
  {
    GtUword allocated = 1UL << (depth+1);
    if (allocated < differentcodes && differentcodes/allocated >= 32UL)
    {
      GtArrayGtIndexwithcode *binsearchcache;
      size_t allocbytes;

      binsearchcache = gt_malloc(sizeof (*binsearchcache));
      binsearchcache->depth = depth;
      binsearchcache->nextfreeGtIndexwithcode = 0;
      binsearchcache->allocatedGtIndexwithcode = allocated;
      binsearchcache->width = differentcodes/allocated;
      allocbytes = sizeof (*binsearchcache->spaceGtIndexwithcode)
                   * binsearchcache->allocatedGtIndexwithcode;
      gt_assert(binsearchcache->width > 0);
      binsearchcache->spaceGtIndexwithcode = gt_malloc(allocbytes);
      gt_log_log("binsearchcache->depth=%u => "GT_WU" bytes",
                 binsearchcache->depth,
                 (GtUword) allocbytes);
      GT_FCI_ADDWORKSPACE(fcsl,"binsearchcache",allocbytes);
      return binsearchcache;
    } else
    {
      if (depth > 0)
      {
        depth--;
      } else
      {
        break;
      }
    }
  }
  return NULL;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movl %esi, 0x44(%rsp)
movq %rdx, 0x38(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x14(%rsp)
movaps 0x5e34f(%rip), %xmm1    # 0x518930
movq 0x48(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x5e34d(%rip), %xmm1    # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x19300
movl 0x14(%rsp), %eax
cvttsd2si %xmm0, %rcx
addl %ecx, %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x4ba781
movq 0x48(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x28(%rsp)
cmpq $0x20, %rax
jb 0x4ba781
movl $0x28, %edi
leaq 0xfd13d(%rip), %rsi     # 0x5b779f
movl $0x37, %edx
callq 0xe80f0
movq %rax, 0x20(%rsp)
movl 0x34(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x28(%rsp)
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
shlq $0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
ja 0x4ba708
movq 0x1818c9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x5b932(%rip), %rsi     # 0x516013
leaq 0xfd0d4(%rip), %rdx     # 0x5b77bc
leaq 0xfd0e7(%rip), %rcx     # 0x5b77d6
leaq 0xfd0a9(%rip), %r8      # 0x5b779f
movl $0x3e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4ba70a
movq 0x18(%rsp), %rdi
leaq 0xfd089(%rip), %rsi     # 0x5b779f
movl $0x3f, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movl 0x20(%rax), %esi
movq 0x18(%rsp), %rdx
leaq 0xfd0b8(%rip), %rdi     # 0x5b77f7
movb $0x0, %al
callq 0xe7740
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rax
movl $0x43, %esi
leaq 0xfd043(%rip), %rdx     # 0x5b779f
movl $0x1, %r9d
leaq 0xc485f(%rip), %r8      # 0x57efc8
movl %r9d, %ecx
movq %rax, (%rsp)
callq 0x4bea60
movq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x4ba7a7
cmpl $0x0, 0x34(%rsp)
jbe 0x4ba795
movl 0x34(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x4ba797
jmp 0x4ba79e
jmp 0x4ba799
jmp 0x4ba616
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)