// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-diffcov.c
// Function: gt_differencecover_new
GtDifferencecover *gt_differencecover_new(unsigned int vparam,
                                          const GtEncseq *encseq,
                                          GtReadmode readmode,
                                          unsigned int outerprefixlength,
                                          GtLogger *logger)
{
  unsigned int offset = 0, v = 1U;
  GtDifferencecover *dcov;
  bool found = false;

  dcov = gt_malloc(sizeof (*dcov));
  dcov->requiredspace = sizeof (*dcov);
  dcov->numofchars = gt_alphabet_num_of_chars(gt_encseq_alphabet(encseq));
  dcov->totallength = gt_encseq_total_length(encseq);
  dcov->logger = logger;
  dcov->samplesize_upperbound = 0;
  dcov->rmq = NULL;
  for (dcov->logmod = 0;
       dcov->logmod < (unsigned int) (sizeof (differencecoversizes)/
                                      sizeof (differencecoversizes[0]));
       dcov->logmod++)
  {
    if (v == vparam)
    {
      dcov->size = differencecoversizes[dcov->logmod];
      dcov->samplesize_upperbound
        = (GtUword) (GT_DIVV(dcov->totallength) + 1) * dcov->size;
      dcov->diffvalues = differencecovertab + offset;
      if (dcov->samplesize_upperbound <= GT_DIFFERENCECOVER_MAX_SAMPLESIZE)
      {
        found = true;
        break;
      }
    }
    offset += differencecoversizes[dcov->logmod];
    v = GT_MULT2(v);
  }
  if (!found)
  {
    gt_free(dcov);
    return NULL;
  }
  if (outerprefixlength == 0)
  {
    dcov->prefixlength = 0;
  } else
  {
    dcov->prefixlength
      = gt_recommendedprefixlength(dcov->numofchars,
                                   dcov->samplesize_upperbound,
                                   GT_RECOMMENDED_MULTIPLIER_DEFAULT,
                                   true);
    if (outerprefixlength > 0 && dcov->prefixlength > outerprefixlength)
    {
      dcov->prefixlength = outerprefixlength;
    }
    gt_assert(dcov->prefixlength > 0);
  }
  dcov->vparam = 1U << (dcov->logmod);
  dcov->vmodmask = dcov->vparam-1;
#ifdef WITHcomputehvalue
  dcov->hvalue = dc_computehvalue(dcov,totallength);
#endif
  dcov->encseq = encseq;
  dcov->readmode = readmode;
  dcov->bcktab = NULL;
  dcov->sortedsample = NULL;
  dcov->filltable = NULL;
  dcov->multimappower = NULL;
  dc_fillcoverrank(dcov);
  dcov->diff2pos = NULL; /* this is later initialized */
  dcov->allocateditvinfo = 0;
  dcov->itvinfo = NULL;
  dcov->currentdepth = 0;
  dcov->firstwithnewdepth.defined = false;
  dcov->firstwithnewdepth.depth = 0;
  dcov->firstwithnewdepth.totalwidth = 0;
  dcov->firstwithnewdepth.count = 0;
  dcov->firstwithnewdepth.blisbl = 0;
  dcov->firstwithnewdepth.width = 0;
  dcov->firstwithnewdepth.maxwidth = 0;
  dcov->currentqueuesize = 0;
  dcov->maxqueuesize = 0;
  dcov->inversesuftab = NULL;
  dcov->samplelcpvalues = NULL;
  dcov->firstgenerationtotalwidth = 0;
  dcov->firstgenerationcount = 0;
  GT_INITARRAY(&dcov->firstgeneration,GtDcPairsuffixptr);
  return dcov;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbp
movl %ecx, %r12d
movl %edx, 0x4(%rsp)
movq %rsi, %r15
movl %edi, %r13d
leaq 0x1bee6a(%rip), %rsi    # 0x356d90
movl $0x158, %edi            # imm = 0x158
movl $0x1aa, %edx            # imm = 0x1AA
callq 0x93160
movq %rax, %rbx
movq $0x158, 0x40(%rax)      # imm = 0x158
movq %r15, %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x56c8e
movl %eax, 0x14(%rbx)
movq %r15, %rdi
callq 0x7055e
movq %rax, %r14
movq %rax, 0x48(%rbx)
movq %rbp, 0x140(%rbx)
andq $0x0, 0x80(%rbx)
andq $0x0, 0x150(%rbx)
pushq $0x1
popq %rax
xorl %ecx, %ecx
leaq 0x1bedfb(%rip), %rdx    # 0x356d80
leaq 0x2a1644(%rip), %rdi    # 0x4395d0
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
cmpq $0x10, %rcx
je 0x197fda
movzbl (%rcx,%rdx), %r10d
cmpl %r13d, %eax
jne 0x197fd0
movl %r10d, 0x8(%rbx)
movq %r14, %r11
shrq %cl, %r11
incq %r11
movl %r10d, %esi
imulq %r11, %rsi
movq %rsi, 0x80(%rbx)
movl %r9d, %r11d
leaq (%rdi,%r11,2), %r11
movq %r11, 0x30(%rbx)
cmpq %r8, %rsi
jb 0x197ffc
addl %r10d, %r9d
addl %eax, %eax
incq %rcx
jmp 0x197f95
movl $0x10, 0x4(%rbx)
leaq 0x1beda8(%rip), %rsi    # 0x356d90
movq %rbx, %rdi
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x936f9
xorl %ebx, %ebx
jmp 0x19818a
movl %ecx, 0x4(%rbx)
testl %r12d, %r12d
je 0x198033
movl 0x14(%rbx), %edi
movsd 0x1596d9(%rip), %xmm0   # 0x2f16e8
pushq $0x1
popq %rdx
callq 0x191cf8
cmpl %r12d, %eax
cmovbl %eax, %r12d
movl %r12d, 0x18(%rbx)
testl %eax, %eax
je 0x1981ca
movl 0x4(%rbx), %ecx
movq 0x48(%rbx), %r14
jmp 0x198037
andl $0x0, 0x18(%rbx)
pushq $0x1
popq %rdi
shll %cl, %edi
movl %edi, (%rbx)
leal -0x1(%rdi), %eax
movl %eax, 0xc(%rbx)
movq %r15, 0x60(%rbx)
movl 0x4(%rsp), %eax
movl %eax, 0x68(%rbx)
andq $0x0, 0x58(%rbx)
andq $0x0, 0x148(%rbx)
shrq %cl, %r14
shlq $0x3, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
leaq 0x1bed1c(%rip), %r15    # 0x356d90
movq %r15, %rsi
movl $0x14d, %edx            # imm = 0x14D
callq 0x93160
movq %rax, 0x20(%rbx)
movl (%rbx), %eax
leal -0x1(%rax), %ecx
shrl $0x6, %ecx
cmpl $0x40, %eax
leal 0x8(,%rcx,8), %eax
pushq $0x8
popq %r12
cmovael %eax, %r12d
xorl %edi, %edi
movq %r12, %rsi
movq %r15, %rdx
movl $0x14e, %ecx            # imm = 0x14E
callq 0x93472
movq %rax, 0x28(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x17380
movl (%rbx), %ecx
movl 0x8(%rbx), %eax
leaq (,%rcx,8), %rdx
addq %rdx, 0x40(%rbx)
cmpq $0xff, %rax
ja 0x19819c
incq %r14
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x1980f7
movq 0x20(%rbx), %rsi
orq $-0x1, (%rsi,%rdx,8)
incq %rdx
jmp 0x1980e4
xorl %edx, %edx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorl %edi, %edi
cmpq %rdi, %rax
je 0x198133
movq 0x20(%rbx), %r8
movq 0x30(%rbx), %rcx
movzwl (%rcx,%rdi,2), %ecx
movq %rdx, (%r8,%rcx,8)
movq %rsi, %r8
shrq %cl, %r8
movq 0x28(%rbx), %r9
shrl $0x6, %ecx
orq %r8, (%r9,%rcx,8)
incq %rdi
addq %r14, %rdx
jmp 0x198105
andq $0x0, 0x38(%rbx)
xorps %xmm0, %xmm0
andq $0x0, 0xb8(%rbx)
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0xa8(%rbx)
movups %xmm0, 0xc8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xe8(%rbx)
movb $0x0, 0xf8(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x128(%rbx)
andq $0x0, 0x138(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x29fdc5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14ce66(%rip), %rsi    # 0x2e5013
leaq 0x1bef53(%rip), %rdx    # 0x357107
leaq 0x1bef66(%rip), %rcx    # 0x357121
leaq 0x1bebce(%rip), %r8     # 0x356d90
movl $0x150, %r9d            # imm = 0x150
jmp 0x1981f6
movq 0x29fd97(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14ce38(%rip), %rsi    # 0x2e5013
leaq 0x1bebc6(%rip), %rdx    # 0x356da8
leaq 0x1bebd6(%rip), %rcx    # 0x356dbf
leaq 0x1beba0(%rip), %r8     # 0x356d90
movl $0x1d8, %r9d            # imm = 0x1D8
xorl %eax, %eax
callq 0x17a50
callq 0x17390