// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/bcktab.c
// Function: gt_bcktab_calcboundsparts
unsigned int gt_bcktab_calcboundsparts(GtBucketspecification *bucketspec,
                                       const GtBcktab *bcktab,
                                       GtCodetype code,
                                       GtCodetype maxcode,
                                       GtUword totalwidth,
                                       unsigned int rightchar)
{
  bucketspec->left = gt_bcktab_get_leftborder(bcktab,code);
  if (code < maxcode)
  {
    GtUword nextleftborder = gt_bcktab_get_leftborder(bcktab,code+1);

    if (nextleftborder > 0)
    {
      bucketspec->nonspecialsinbucket = nextleftborder - bucketspec->left;
    } else
    {
      bucketspec->nonspecialsinbucket = 0;
    }
  } else
  {
    gt_assert(totalwidth >= bucketspec->left);
    bucketspec->nonspecialsinbucket
      = (GtUword) (totalwidth - bucketspec->left);
  }
  if (bcktab->withspecialsuffixes && rightchar == bcktab->numofchars - 1)
  {
    GtCodetype specialcode;

    gt_assert(code >= (GtCodetype) (bcktab->numofchars-1));
    specialcode = GT_FROMCODE2SPECIALCODE(code,bcktab->numofchars);
    if (bcktab->ulongcountspecialcodes != NULL)
    {
      bucketspec->specialsinbucket
        = bcktab->ulongcountspecialcodes[specialcode];
    } else
    {
      gt_assert(bcktab->uintcountspecialcodes != NULL);
      bucketspec->specialsinbucket
        = (GtUword) bcktab->uintcountspecialcodes[specialcode];
    }
    if (bucketspec->nonspecialsinbucket >= bucketspec->specialsinbucket)
    {
      bucketspec->nonspecialsinbucket -= bucketspec->specialsinbucket;
    } else
    {
      bucketspec->nonspecialsinbucket = 0;
    }
  } else
  {
    bucketspec->specialsinbucket = 0;
  }
  return (rightchar < bcktab->numofchars - 1) ? (rightchar + 1) : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, %r15
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x134141
movq %rax, (%r14)
cmpq %rbp, %r12
jae 0x13540c
leaq 0x1(%r12), %rsi
movq %r13, %rdi
callq 0x134141
testq %rax, %rax
je 0x135442
movq %rax, %r15
subq (%r14), %r15
jmp 0x135445
subq %rax, %r15
jae 0x135445
movq 0x302b50(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1afbf1(%rip), %rsi    # 0x2e5013
leaq 0x20953e(%rip), %rdx    # 0x33e967
leaq 0x209556(%rip), %rcx    # 0x33e986
leaq 0x20924f(%rip), %r8     # 0x33e686
movl $0x3b5, %r9d            # imm = 0x3B5
jmp 0x135528
xorl %r15d, %r15d
movq %r15, 0x8(%r14)
movl 0x4c(%r13), %ecx
leal -0x1(%rcx), %edx
cmpl %ebx, %edx
sete %al
andb 0xa1(%r13), %al
cmpb $0x1, %al
jne 0x135477
movl %ebx, %edx
movq %r12, %rax
subq %rdx, %rax
jb 0x1354ce
movl %ecx, %ecx
cmpl $0x4, %ecx
jne 0x13547e
shrq $0x2, %r12
jmp 0x135486
andq $0x0, 0x10(%r14)
jmp 0x1354b5
xorl %edx, %edx
divq %rcx
movq %rax, %r12
movq 0x20(%r13), %rax
testq %rax, %rax
je 0x135495
movq (%rax,%r12,8), %rax
jmp 0x1354a2
movq 0x10(%r13), %rax
testq %rax, %rax
je 0x1354fc
movl (%rax,%r12,4), %eax
movq %rax, 0x10(%r14)
xorl %ecx, %ecx
subq %rax, %r15
cmovaeq %r15, %rcx
movq %rcx, 0x8(%r14)
movl %ebx, %edx
leal 0x1(%rbx), %ecx
xorl %eax, %eax
cmpl %ebx, %edx
cmoval %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x302a93(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1afb34(%rip), %rsi    # 0x2e5013
leaq 0x2093d8(%rip), %rdx    # 0x33e8be
leaq 0x209499(%rip), %rcx    # 0x33e986
leaq 0x209192(%rip), %r8     # 0x33e686
movl $0x3bd, %r9d            # imm = 0x3BD
jmp 0x135528
movq 0x302a65(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1afb06(%rip), %rsi    # 0x2e5013
leaq 0x2093d6(%rip), %rdx    # 0x33e8ea
leaq 0x20946b(%rip), %rcx    # 0x33e986
leaq 0x209164(%rip), %r8     # 0x33e686
movl $0x3c5, %r9d            # imm = 0x3C5
xorl %eax, %eax
callq 0x17a50
callq 0x17390