// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/pckbucket.c
// Function: gt_pckbuckettable_new
Pckbuckettable *gt_pckbuckettable_new(const FMindex *fmindex,
                                      unsigned int numofchars,
                                      GtUword totallength,
                                      unsigned int maxdepth)
{
  GtArrayPckbck_Boundsatdepth stack;
  Pckbck_Boundsatdepth parent, child;
  GtUword rangesize, idx, *rangeOccs;
  Pckbuckettable *pckbt;
  Mbtab *tmpmbtab;

  GT_INITARRAY(&stack,Pckbck_Boundsatdepth);
  child.lowerbound = 0;
  child.upperbound = totallength+1;
  child.depth = 0;
  child.code = (GtCodetype) 0;
  GT_STOREINARRAY(&stack,Pckbck_Boundsatdepth,128,child);
  rangeOccs = gt_malloc(sizeof (*rangeOccs) * GT_MULT2(numofchars));
  tmpmbtab = gt_malloc(sizeof (*tmpmbtab) * numofchars);
  pckbt = pckbuckettable_allocandinittable(numofchars,maxdepth,true);
  while (stack.nextfreePckbck_Boundsatdepth > 0)
  {
    parent
      = stack.spacePckbck_Boundsatdepth[--stack.nextfreePckbck_Boundsatdepth];
    gt_assert(parent.lowerbound < parent.upperbound);
    rangesize = gt_bwtrangesplitallwithoutspecial(tmpmbtab,
                                                  rangeOccs,
                                                  fmindex,
                                                  parent.lowerbound,
                                                  parent.upperbound);
    gt_assert(rangesize <= (GtUword) numofchars);
    for (idx = 0; idx < rangesize; idx++)
    {
      child.lowerbound = tmpmbtab[idx].lowerbound;
      child.upperbound = tmpmbtab[idx].upperbound;
      child.depth = parent.depth + 1;
      gt_assert(child.depth <= maxdepth);
      child.code = parent.code * numofchars + idx;
      pckbuckettable_storeBoundsatdepth(pckbt,&child);
      if (child.depth < maxdepth)
      {
        if (child.lowerbound + 1 < child.upperbound)
        {
          GT_STOREINARRAY(&stack,Pckbck_Boundsatdepth,128,child);
        } else
        {
          pckbuckettable_followleafedge(pckbt,fmindex,&child);
        }
      }
    }
  }
  GT_FREEARRAY(&stack,Pckbck_Boundsatdepth);
  gt_free(rangeOccs);
  gt_free(tmpmbtab);
  printf("filled: "GT_WU" (%.2f)\n",pckbt->numofvalues,
                        (double) pckbt->numofvalues/pckbt->maxnumofvalues);
  return pckbt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, %ebp
movl %esi, %r14d
movq %rdi, 0x70(%rsp)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
incq %rdx
movq %rdx, 0x48(%rsp)
movl $0x0, 0x50(%rsp)
movq %rax, 0x58(%rsp)
leaq 0x1f163d(%rip), %rdx    # 0x3a9829
movl $0x1000, %esi           # imm = 0x1000
xorl %edi, %edi
movl $0xad, %ecx
callq 0x104461
testq %rax, %rax
je 0x1b8537
leaq 0x40(%rsp), %rcx
movaps (%rcx), %xmm0
movaps 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movq %rax, 0x8(%rsp)
movups %xmm0, (%rax)
leal (%r14,%r14), %edi
shlq $0x3, %rdi
leaq 0x1f15fc(%rip), %rbx    # 0x3a9829
movq %rbx, %rsi
movl $0xae, %edx
callq 0x104226
movq %rax, 0x60(%rsp)
movl %r14d, %edi
movq %rdi, 0x68(%rsp)
shlq $0x4, %rdi
movq %rbx, %rsi
movl $0xaf, %edx
callq 0x104226
movq %rax, 0x28(%rsp)
movl %r14d, %edi
movl %ebp, %esi
movl $0x1, %edx
callq 0x1b853c
movq %rax, %r15
movl $0x80, %ebx
movl $0x1, %eax
leaq 0x78(%rsp), %r12
movl %ebp, 0x3c(%rsp)
decq %rax
movq %rax, 0x18(%rsp)
shlq $0x5, %rax
movq 0x8(%rsp), %rdx
movq (%rdx,%rax), %rcx
movq 0x8(%rdx,%rax), %r8
cmpq %r8, %rcx
jae 0x1b8532
movl 0x10(%rdx,%rax), %esi
movl %esi, 0x14(%rsp)
movq 0x18(%rdx,%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x1a02f7
cmpq 0x68(%rsp), %rax
ja 0x1b852d
movq %rax, %r13
movq %rbx, 0x20(%rsp)
testq %rax, %rax
je 0x1b846d
incl 0x14(%rsp)
movq 0x30(%rsp), %rax
imulq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
xorl %ebx, %ebx
movq %rbx, %rax
shlq $0x4, %rax
movq 0x28(%rsp), %rcx
movups (%rcx,%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x50(%rsp)
cmpl %ebp, %eax
ja 0x1b8523
movq 0x30(%rsp), %rax
addq %rbx, %rax
movq %rax, 0x58(%rsp)
movq %r15, %rdi
leaq 0x40(%rsp), %rsi
callq 0x1b865f
movl 0x50(%rsp), %r14d
cmpl %ebp, %r14d
jae 0x1b8461
movq 0x40(%rsp), %rsi
leaq 0x1(%rsi), %rax
cmpq 0x48(%rsp), %rax
jae 0x1b8374
movq 0x20(%rsp), %rsi
cmpq %rsi, 0x18(%rsp)
jae 0x1b8408
movq 0x8(%rsp), %rax
jmp 0x1b842b
movq 0x58(%rsp), %rax
movq %rax, 0x90(%rsp)
movl %r14d, 0x88(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x70(%rsp), %rdi
callq 0x19fba0
movq %rax, %rbp
cmpl 0x4(%r15), %r14d
jae 0x1b83fa
incl %r14d
movl %r14d, 0x88(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x19fc2b
cmpb $-0x3, %al
ja 0x1b83fa
movl (%r15), %ecx
imulq 0x90(%rsp), %rcx
movzbl %al, %eax
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x78(%rsp), %rax
incq %rax
movq %rax, 0x80(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1b865f
movl 0x88(%rsp), %r14d
jmp 0x1b839b
movq %rbp, %rdi
callq 0x19feca
movl 0x3c(%rsp), %ebp
jmp 0x1b8461
subq $-0x80, %rsi
movq %rsi, 0x20(%rsp)
shlq $0x5, %rsi
movq 0x8(%rsp), %rdi
leaq 0x1f1408(%rip), %rdx    # 0x3a9829
movl $0xc8, %ecx
callq 0x104461
testq %rax, %rax
je 0x1b8528
movq %rax, %rcx
movq 0x18(%rsp), %rdx
leaq 0x1(%rdx), %rax
shlq $0x5, %rdx
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rcx,%rdx)
movq %rcx, 0x8(%rsp)
movups %xmm0, (%rcx,%rdx)
movq %rax, 0x18(%rsp)
incq %rbx
cmpq %r13, %rbx
jne 0x1b82fd
movq 0x18(%rsp), %rax
testq %rax, %rax
movq 0x20(%rsp), %rbx
jne 0x1b8282
leaq 0x1f13a2(%rip), %rbx    # 0x3a9829
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl $0xd0, %edx
callq 0x1045eb
movq 0x60(%rsp), %rdi
movq %rbx, %rsi
movl $0xd1, %edx
callq 0x1045eb
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
movl $0xd2, %edx
callq 0x1045eb
movq 0x8(%r15), %rsi
movdqu 0x8(%r15), %xmm0
movdqa 0x1becc1(%rip), %xmm1   # 0x377190
pand %xmm0, %xmm1
por 0x1becc5(%rip), %xmm1   # 0x3771a0
psrlq $0x20, %xmm0
por 0x1becc8(%rip), %xmm0   # 0x3771b0
subpd 0x1becd0(%rip), %xmm0   # 0x3771c0
addpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
divsd %xmm1, %xmm0
leaq 0x1f13da(%rip), %rdi    # 0x3a98e1
movb $0x1, %al
callq 0x17070
movq %r15, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x66e66
callq 0x66e2d
callq 0x66e9f
callq 0x66df4
callq 0x66ed8