// File: /workspace/github_c_makefile_star2_O3/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 0x1ce4f2(%rip), %rsi    # 0x3b6930
movl $0x158, %edi            # imm = 0x158
movl $0x1aa, %edx            # imm = 0x1AA
callq 0x104226
movq %rax, %rbx
movq $0x158, 0x40(%rax)      # imm = 0x158
movq %r15, %rdi
callq 0xebcd9
movq %rax, %rdi
callq 0xd11be
movl %eax, 0x14(%rbx)
movq %r15, %rdi
callq 0xe7b9c
movq %rax, %r14
movq %rax, 0x48(%rbx)
movq %rbp, 0x140(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x80(%rbx)
movq %rcx, 0x150(%rbx)
movl $0x1, %eax
leaq 0x1ce483(%rip), %rdx    # 0x3b6920
leaq 0x2d217c(%rip), %rdi    # 0x4ba620
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
movzbl (%rcx,%rdx), %r10d
cmpl %r13d, %eax
jne 0x1e84e2
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 0x1e8512
addl %r10d, %r9d
addl %eax, %eax
incq %rcx
cmpq $0x10, %rcx
jne 0x1e84ad
movl $0x10, 0x4(%rbx)
leaq 0x1ce432(%rip), %rsi    # 0x3b6930
movq %rbx, %rdi
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x1045eb
xorl %ebx, %ebx
jmp 0x1e86b3
movl %ecx, 0x4(%rbx)
testl %r12d, %r12d
je 0x1e854b
movl 0x14(%rbx), %edi
movsd 0x1691b3(%rip), %xmm0   # 0x3516d8
movl $0x1, %edx
callq 0x1e2c5c
cmpl %r12d, %eax
cmovbl %eax, %r12d
movl %r12d, 0x18(%rbx)
testl %eax, %eax
je 0x1e86ca
movl 0x4(%rbx), %ecx
movq 0x48(%rbx), %r14
jmp 0x1e8552
movl $0x0, 0x18(%rbx)
movl $0x1, %edi
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)
xorl %eax, %eax
movq %rax, 0x58(%rbx)
shrq %cl, %r14
movq %rax, 0x148(%rbx)
shlq $0x3, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
leaq 0x1ce39f(%rip), %r15    # 0x3b6930
movq %r15, %rsi
movl $0x14d, %edx            # imm = 0x14D
callq 0x104226
movq %rax, 0x20(%rbx)
movl (%rbx), %eax
leal -0x1(%rax), %ecx
shrl $0x6, %ecx
cmpl $0x40, %eax
leal 0x8(,%rcx,8), %eax
movl $0x8, %r12d
cmovael %eax, %r12d
xorl %edi, %edi
movq %r12, %rsi
movq %r15, %rdx
movl $0x14e, %ecx            # imm = 0x14E
callq 0x104461
movq %rax, 0x28(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x173a0
movl (%rbx), %eax
movl 0x8(%rbx), %ebp
leaq (,%rax,8), %rdx
addq %rdx, 0x40(%rbx)
cmpl $0xff, %ebp
ja 0x1e86c5
testl %eax, %eax
je 0x1e8610
movq 0x20(%rbx), %rdi
movl $0xff, %esi
callq 0x173a0
testl %ebp, %ebp
je 0x1e865d
incq %r14
movq 0x30(%rbx), %rax
movq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rsi
movb $0x1, %r9b
xorl %edi, %edi
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
leal -0x1(%r9), %ecx
movzbl %cl, %ecx
movzwl (%rax,%rcx,2), %ecx
movq %rdi, (%rdx,%rcx,8)
movq %r8, %r10
shrq %cl, %r10
shrl $0x6, %ecx
orq %r10, (%rsi,%rcx,8)
movzbl %r9b, %ecx
leal 0x1(%rcx), %r9d
addq %r14, %rdi
cmpl %ecx, %ebp
ja 0x1e8632
xorl %eax, %eax
movq %rax, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0xa8(%rbx)
movq %rax, 0xb8(%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)
movq %rax, 0x138(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7701f
callq 0x76fe6