// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/bcktab.c
// Function: gt_bcktab_new
GtBcktab *gt_bcktab_new(unsigned int numofchars,
                        unsigned int prefixlength,
                        GtUword maxvalue,
                        bool storespecialcodes,
                        bool withspecialsuffixes,
                        GtLogger *logger,
                        GtError *err)
{
  GtBcktab *bcktab;
  bool haserr = false;

  bcktab = gt_bcktab_new_withinit(numofchars,prefixlength,maxvalue,
                                  withspecialsuffixes);
  bcktab->allocated = true;
  if (storespecialcodes && bcktab->numofallcodes > 0 &&
      bcktab->numofallcodes-1 > (GtUword) GT_MAXCODEVALUE)
  {
    gt_error_set(err,"alphasize^prefixlength-1 = " FormatGtCodetype
                     " does not fit into %u"
                     " bits: choose smaller value for prefixlength",
                     bcktab->numofallcodes-1,
                     GT_CODEBITS);
    haserr = true;
  }
  if (!haserr)
  {
    size_t allocsize_bounds, allocsize_countspecialcodes = 0;
    if (bcktab->useulong)
    {
      allocsize_bounds = sizeof (*bcktab->leftborder.ulongbounds) *
                         (bcktab->numofallcodes+1);
      bcktab->leftborder.ulongbounds = gt_malloc(allocsize_bounds);
      memset(bcktab->leftborder.ulongbounds,0,allocsize_bounds);
      if (withspecialsuffixes)
      {
        allocsize_countspecialcodes = sizeof (*bcktab->ulongcountspecialcodes) *
                                      bcktab->numofspecialcodes;
        bcktab->ulongcountspecialcodes = gt_malloc(allocsize_countspecialcodes);
        memset(bcktab->ulongcountspecialcodes,0,allocsize_countspecialcodes);
      }
    } else
    {
      allocsize_bounds = sizeof (*bcktab->leftborder.uintbounds) *
                         (bcktab->numofallcodes+1);
      bcktab->leftborder.uintbounds = gt_malloc(allocsize_bounds);
      memset(bcktab->leftborder.uintbounds,0,allocsize_bounds);
      if (withspecialsuffixes)
      {
        allocsize_countspecialcodes = sizeof (*bcktab->uintcountspecialcodes) *
                                      bcktab->numofspecialcodes;
        bcktab->uintcountspecialcodes = gt_malloc(allocsize_countspecialcodes);
        memset(bcktab->uintcountspecialcodes,0,allocsize_countspecialcodes);
      }
    }
    gt_logger_log(logger,"sizeof (leftborder)="GT_WU" bytes",
                (GtUword) allocsize_bounds);
    if (withspecialsuffixes)
    {
      gt_logger_log(logger,"sizeof (countspecialcodes)="GT_WU" bytes",
                (GtUword) allocsize_countspecialcodes);
      allocdistpfxidxcounts(bcktab,prefixlength,logger);
    }
    gt_logger_log(logger,"sizeof (bcktab)=" Formatuint64_t " bytes",
              PRINTuint64_tcast(gt_bcktab_sizeoftable(numofchars,
                                                      prefixlength,
                                                      maxvalue,
                                                      withspecialsuffixes)));
  }
  if (haserr)
  {
    gt_bcktab_delete(bcktab);
    return NULL;
  }
  return bcktab;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r13
movl %esi, %r12d
movl %edi, 0xc(%rsp)
movl %r8d, %ecx
callq 0x193a3c
movq %rax, %rbx
movb $0x1, 0xa0(%rax)
testl %r14d, %r14d
je 0x1937a2
movq 0x58(%rbx), %rdx
testq %rdx, %rdx
je 0x1937a2
decq %rdx
cmpq $0x10000000, %rdx       # imm = 0x10000000
jb 0x1937a2
movq 0x50(%rsp), %rdi
leaq 0x2140f5(%rip), %rsi    # 0x3a7887
movl $0x1c, %ecx
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %al
jmp 0x1937a4
xorl %eax, %eax
testb %al, %al
jne 0x193a1b
movl %eax, 0x8(%rsp)
movq %r15, (%rsp)
movq 0x58(%rbx), %rax
cmpb $0x1, 0xa2(%rbx)
movq %r13, 0x10(%rsp)
jne 0x193821
leaq 0x8(,%rax,8), %r14
leaq 0x214049(%rip), %rsi    # 0x3a781e
movq %r14, %rdi
movl $0x1da, %edx            # imm = 0x1DA
callq 0x1092b2
movq %rax, 0x8(%rbx)
xorl %r15d, %r15d
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x173a0
testb %bpl, %bpl
je 0x193882
movq 0x60(%rbx), %r15
shlq $0x3, %r15
leaq 0x214010(%rip), %rsi    # 0x3a781e
movq %r15, %rdi
movl $0x1e0, %edx            # imm = 0x1E0
callq 0x1092b2
movq %rax, 0x20(%rbx)
jmp 0x193875
leaq 0x4(,%rax,4), %r14
leaq 0x213fee(%rip), %rsi    # 0x3a781e
movq %r14, %rdi
movl $0x1e7, %edx            # imm = 0x1E7
callq 0x1092b2
movq %rax, (%rbx)
xorl %r15d, %r15d
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x173a0
testb %bpl, %bpl
je 0x193882
movq 0x60(%rbx), %r15
shlq $0x2, %r15
leaq 0x213fba(%rip), %rsi    # 0x3a781e
movq %r15, %rdi
movl $0x1ed, %edx            # imm = 0x1ED
callq 0x1092b2
movq %rax, 0x10(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x173a0
leaq 0x21405e(%rip), %rsi    # 0x3a78e7
movq (%rsp), %r13
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10906e
testb %bpl, %bpl
je 0x1939eb
leaq 0x21405b(%rip), %rsi    # 0x3a7905
movq %r13, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x10906e
cmpb $0x0, 0xa1(%rbx)
je 0x193a37
cmpl $0x3, %r12d
movq (%rsp), %r13
jb 0x1939eb
cmpq $0x0, 0x40(%rbx)
je 0x1939eb
leal -0x1(%r12), %r15d
leaq (,%r15,8), %rdi
cmpb $0x1, 0xa2(%rbx)
jne 0x193966
leaq 0x213f24(%rip), %r13    # 0x3a781e
movq %r13, %rsi
movl $0x179, %edx            # imm = 0x179
callq 0x1092b2
movq %rax, 0x28(%rbx)
movq 0x40(%rbx), %r14
shlq $0x3, %r14
movq %r14, %rdi
movq %r13, %rsi
movl $0x17b, %edx            # imm = 0x17B
callq 0x1092b2
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x173a0
movq 0x28(%rbx), %rax
movq 0x70(%rbx), %rcx
movq %r13, (%rax)
cmpl $0x2, %r15d
jb 0x1939d3
movq (%rax), %rdx
movl $0x1, %esi
movq (%rcx,%rsi,8), %rdi
leaq (%rdx,%rdi,8), %rdx
movq %rdx, (%rax,%rsi,8)
incq %rsi
cmpq %rsi, %r15
jne 0x193950
jmp 0x1939d3
leaq 0x213eb1(%rip), %r13    # 0x3a781e
movq %r13, %rsi
movl $0x181, %edx            # imm = 0x181
callq 0x1092b2
movq %rax, 0x18(%rbx)
movq 0x40(%rbx), %r14
shlq $0x2, %r14
movq %r14, %rdi
movq %r13, %rsi
movl $0x183, %edx            # imm = 0x183
callq 0x1092b2
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x173a0
movq 0x18(%rbx), %rax
movq 0x70(%rbx), %rcx
movq %r13, (%rax)
cmpl $0x2, %r15d
jb 0x1939d3
movq (%rax), %rdx
movl $0x1, %esi
movq (%rcx,%rsi,8), %rdi
leaq (%rdx,%rdi,4), %rdx
movq %rdx, (%rax,%rsi,8)
incq %rsi
cmpq %rsi, %r15
jne 0x1939bf
leaq 0x214324(%rip), %rsi    # 0x3a7cfe
movq (%rsp), %r13
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10906e
movzbl %bpl, %ecx
movl 0xc(%rsp), %edi
movl %r12d, %esi
movq 0x10(%rsp), %rdx
callq 0x193660
leaq 0x213f23(%rip), %rsi    # 0x3a792a
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10906e
cmpb $0x0, 0x8(%rsp)
je 0x193a25
movq %rbx, %rdi
callq 0x193ba9
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5cd77