// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movl %r9d, 0x2c(%rsp)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x2037f0
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x20593f
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
addq $0x1, %rsi
callq 0x2037f0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jbe 0x205930
movq 0x20(%rsp), %rcx
movq 0x50(%rsp), %rax
subq (%rax), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x20593d
movq 0x50(%rsp), %rax
movq $0x0, 0x8(%rax)
jmp 0x2059a0
jmp 0x205941
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x205988
movq 0x436649(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3106b2(%rip), %rsi    # 0x516013
leaq 0x36b78b(%rip), %rdx    # 0x5710f3
leaq 0x36b7a3(%rip), %rcx    # 0x571112
leaq 0x36b49c(%rip), %r8     # 0x570e12
movl $0x3b5, %r9d            # imm = 0x3B5
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x20598a
movq 0x30(%rsp), %rcx
movq 0x50(%rsp), %rax
subq (%rax), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rsp), %rax
testb $0x1, 0xa1(%rax)
je 0x205b33
movl 0x2c(%rsp), %eax
movq 0x48(%rsp), %rcx
movl 0x4c(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x205b33
jmp 0x2059cb
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movl 0x4c(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x205a1a
movq 0x4365b7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x310620(%rip), %rsi    # 0x516013
leaq 0x36b650(%rip), %rdx    # 0x57104a
leaq 0x36b711(%rip), %rcx    # 0x571112
leaq 0x36b40a(%rip), %r8     # 0x570e12
movl $0x3bd, %r9d            # imm = 0x3BD
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x205a1c
movq 0x48(%rsp), %rax
cmpl $0x4, 0x4c(%rax)
jne 0x205a37
movq 0x40(%rsp), %rax
shrq $0x2, %rax
movq %rax, 0x10(%rsp)
jmp 0x205a5e
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movl 0x4c(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
subq %rcx, %rax
movq 0x48(%rsp), %rcx
movl 0x4c(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x205a91
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x205af5
jmp 0x205a93
movq 0x48(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x205ad7
movq 0x4364fa(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x310563(%rip), %rsi    # 0x516013
leaq 0x36b5bf(%rip), %rdx    # 0x571076
leaq 0x36b654(%rip), %rcx    # 0x571112
leaq 0x36b34d(%rip), %r8     # 0x570e12
movl $0x3c5, %r9d            # imm = 0x3C5
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x205ad9
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, %ecx
movq 0x50(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x50(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x205b24
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdx
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
jmp 0x205b31
movq 0x50(%rsp), %rax
movq $0x0, 0x8(%rax)
jmp 0x205b40
movq 0x50(%rsp), %rax
movq $0x0, 0x10(%rax)
movl 0x2c(%rsp), %eax
movq 0x48(%rsp), %rcx
movl 0x4c(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x205b60
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x205b68
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0x205b68
movl 0xc(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)