// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/firstcodes.c
// Function: gt_firstcodes_init
static int gt_firstcodes_init(GtFirstcodesinfo *fci,
                              const GtEncseq *encseq,
                              unsigned int kmersize,
                              bool withsuftabcheck,
                              unsigned int minmatchlength,
                              GtError *err)
{
  GtUword totallength, maxseqlength, maxrelpos;
  unsigned int logtotallength, bitsforrelpos, bitsforseqnum;
  bool haserr = false;

  maxseqlength = gt_encseq_max_seq_length(encseq);
  totallength = gt_encseq_total_length(encseq);
  logtotallength
    = (unsigned int) gt_firstcodes_round(log((double) totallength));
  if (logtotallength >= 8U)
  {
    fci->markprefixunits = GT_MAX(8U,logtotallength - 8U);
  } else
  {
    fci->markprefixunits = GT_MIN(kmersize/2U,8U);
  }
  if (fci->markprefixunits >= 2U)
  {
    fci->marksuffixunits = fci->markprefixunits - 1;
  } else
  {
    fci->marksuffixunits = fci->markprefixunits;
  }
  if (fci->marksuffixunits + fci->markprefixunits > kmersize)
  {
    if (fci->marksuffixunits % 2U == 0)
    {
      fci->marksuffixunits = fci->markprefixunits = kmersize/2U;
    } else
    {
      fci->marksuffixunits = kmersize/2;
      fci->markprefixunits = kmersize - fci->marksuffixunits;
    }
  }
  gt_log_log("markprefixunits=%u,marksuffixunits=%u",fci->markprefixunits,
                                                     fci->marksuffixunits);
  if (maxseqlength > (GtUword) minmatchlength)
  {
    maxrelpos = maxseqlength - (GtUword) minmatchlength;
  } else
  {
    maxrelpos = 0;
  }
  bitsforrelpos = gt_determinebitspervalue(maxrelpos);
  fci->buf.snrp = gt_seqnumrelpos_new(bitsforrelpos,encseq);
  fci->buf.accum_all = false;
  fci->buf.markprefix = NULL;
  fci->buf.marksuffix = NULL;
  fci->numofsequences = gt_encseq_num_of_sequences(encseq);
  gt_assert(fci->numofsequences > 0);
  bitsforseqnum = gt_determinebitspervalue(fci->numofsequences - 1);
  if (bitsforseqnum + bitsforrelpos > (unsigned int) GT_INTWORDSIZE)
  {
    gt_seqnumrelpos_delete(fci->buf.snrp);
    fci->buf.snrp = NULL;
    gt_error_set(err,"cannot process encoded sequences with "GT_WU" sequences "
                     "of length up to "GT_WU" (%u+%u bits)",
                     fci->numofsequences,maxseqlength,bitsforseqnum,
                     bitsforrelpos);
    haserr = true;
  }
  fci->fcsl = gt_firstcodes_spacelog_new();
  fci->spmsuftab = NULL;
  fci->radixsort_code = NULL;
  fci->radixsort_codepos = NULL;
  fci->buf.spaceGtUwordPair = NULL;
  fci->buf.spaceGtUword = NULL;
  fci->mappedallfirstcodes = NULL;
  fci->mappedmarkprefix = NULL;
  fci->mappedleftborder = NULL;
  fci->binsearchcache = NULL;
  GT_FCI_ADDWORKSPACE(fci->fcsl,"encseq",(size_t) gt_encseq_sizeofrep(encseq));
  if (withsuftabcheck)
  {
    gt_firstcodes_spacelog_start_diff(fci->fcsl);
  }
  if (!haserr)
  {
    size_t sizeforcodestable
      = sizeof (*fci->allfirstcodes) * fci->numofsequences;
    fci->allfirstcodes = gt_malloc(sizeforcodestable);
    GT_FCI_ADDSPLITSPACE(fci->fcsl,"allfirstcodes",sizeforcodestable);
  } else
  {
    fci->allfirstcodes = NULL;
  }
  gt_firstcodes_countocc_setnull(&fci->tab);
  fci->countsequences = 0;
  fci->firstcodehits = 0;
  fci->firstcodeposhits = 0;
  fci->bitsforposref = bitsforseqnum + bitsforrelpos;
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x78, %rsp
movb %cl, %al
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl %edx, 0x64(%rsp)
andb $0x1, %al
movb %al, 0x63(%rsp)
movl %r8d, 0x5c(%rsp)
movq %r9, 0x50(%rsp)
movb $0x0, 0x2b(%rsp)
movq 0x68(%rsp), %rdi
callq 0xb10b0
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x48(%rsp)
movaps 0x2d1802(%rip), %xmm1   # 0x518930
movq 0x48(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2d1800(%rip), %xmm1   # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x195c0
callq 0x249830
cvttsd2si %xmm0, %rax
movl %eax, 0x34(%rsp)
cmpl $0x8, 0x34(%rsp)
jb 0x24719d
movl 0x34(%rsp), %ecx
subl $0x8, %ecx
movl $0x8, %eax
cmpl %ecx, %eax
jbe 0x247184
movl $0x8, %eax
movl %eax, 0x1c(%rsp)
jmp 0x24718f
movl 0x34(%rsp), %eax
subl $0x8, %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x5c(%rax)
jmp 0x2471cb
movl 0x64(%rsp), %eax
shrl %eax
cmpl $0x8, %eax
jae 0x2471b4
movl 0x64(%rsp), %eax
shrl %eax
movl %eax, 0x18(%rsp)
jmp 0x2471bf
movl $0x8, %eax
movl %eax, 0x18(%rsp)
jmp 0x2471bf
movl 0x18(%rsp), %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x5c(%rax)
movq 0x70(%rsp), %rax
cmpl $0x2, 0x5c(%rax)
jb 0x2471eb
movq 0x70(%rsp), %rax
movl 0x5c(%rax), %ecx
subl $0x1, %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x58(%rax)
jmp 0x2471fb
movq 0x70(%rsp), %rax
movl 0x5c(%rax), %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x58(%rax)
movq 0x70(%rsp), %rax
movl 0x58(%rax), %eax
movq 0x70(%rsp), %rcx
addl 0x5c(%rcx), %eax
cmpl 0x64(%rsp), %eax
jbe 0x24725d
movq 0x70(%rsp), %rax
movl 0x58(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x247239
movl 0x64(%rsp), %ecx
shrl %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x5c(%rax)
movq 0x70(%rsp), %rax
movl %ecx, 0x58(%rax)
jmp 0x24725b
movl 0x64(%rsp), %ecx
shrl %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x58(%rax)
movl 0x64(%rsp), %ecx
movq 0x70(%rsp), %rax
subl 0x58(%rax), %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x5c(%rax)
jmp 0x24725d
movq 0x70(%rsp), %rax
movl 0x5c(%rax), %esi
movq 0x70(%rsp), %rax
movl 0x58(%rax), %edx
leaq 0x331178(%rip), %rdi    # 0x5783ec
movb $0x0, %al
callq 0xe7740
movq 0x40(%rsp), %rax
movl 0x5c(%rsp), %ecx
cmpq %rcx, %rax
jbe 0x24729c
movq 0x40(%rsp), %rax
movl 0x5c(%rsp), %ecx
subq %rcx, %rax
movq %rax, 0x38(%rsp)
jmp 0x2472a5
movq $0x0, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0xec660
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %edi
movq 0x68(%rsp), %rsi
callq 0x2b1140
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0xf8(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x108(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0xd0(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0xd8(%rax)
movq 0x68(%rsp), %rdi
callq 0xa9d50
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x70(%rsp), %rax
cmpq $0x0, 0x18(%rax)
ja 0x247356
movq 0x3f4c7b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2cece4(%rip), %rsi    # 0x516013
leaq 0x3310dc(%rip), %rdx    # 0x578412
leaq 0x3310ed(%rip), %rcx    # 0x57842a
leaq 0x330eb8(%rip), %r8     # 0x5781fc
movl $0x2d0, %r9d            # imm = 0x2D0
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x247358
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rdi
subq $0x1, %rdi
callq 0xec660
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
addl 0x30(%rsp), %eax
cmpl $0x40, %eax
jbe 0x2473cc
movq 0x70(%rsp), %rax
movq 0xf8(%rax), %rdi
callq 0x2b11b0
movq 0x70(%rsp), %rax
movq $0x0, 0xf8(%rax)
movq 0x50(%rsp), %rdi
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rdx
movq 0x40(%rsp), %rcx
movl 0x2c(%rsp), %r8d
movl 0x30(%rsp), %r9d
leaq 0x33107d(%rip), %rsi    # 0x57843d
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x2b(%rsp)
callq 0x4be800
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0xa8(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x78(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x68(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0xe8(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0xf0(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x88(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x90(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x80(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x48(%rax)
movq 0x70(%rsp), %rax
movq 0xa8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rdi
callq 0xc2d70
movq 0x10(%rsp), %rdi
movl $0x2e6, %esi            # imm = 0x2E6
leaq 0x330d6c(%rip), %rdx    # 0x5781fc
movl $0x1, %r9d
leaq 0x3124d9(%rip), %r8     # 0x559976
movl %r9d, %ecx
movq %rax, (%rsp)
callq 0x4bea60
testb $0x1, 0x63(%rsp)
je 0x2474c1
movq 0x70(%rsp), %rax
movq 0xa8(%rax), %rdi
callq 0x4be880
testb $0x1, 0x2b(%rsp)
jne 0x247536
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rax
shlq $0x3, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x330d16(%rip), %rsi    # 0x5781fc
movl $0x2ef, %edx            # imm = 0x2EF
callq 0xe80f0
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x98(%rax)
movq 0x70(%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x20(%rsp), %rax
movl $0x2f0, %esi            # imm = 0x2F0
leaq 0x330ce0(%rip), %rdx    # 0x5781fc
movl $0x1, %ecx
leaq 0x2d437e(%rip), %r8     # 0x51b8a6
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x4bea60
jmp 0x247546
movq 0x70(%rsp), %rax
movq $0x0, 0x98(%rax)
movq 0x70(%rsp), %rdi
addq $0x110, %rdi            # imm = 0x110
callq 0x4c1190
movq 0x70(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x70(%rsp), %rax
movq $0x0, (%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x8(%rax)
movl 0x2c(%rsp), %ecx
addl 0x30(%rsp), %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x60(%rax)
movb 0x2b(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)