// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes.c
// Function: gt_randomcodes_collectcodes
static int gt_randomcodes_collectcodes(GtRandomcodesinfo *fci,
    bool usefirstcodes, unsigned int sampling_factor, const GtEncseq *encseq,
    GtReadmode readmode, unsigned int bucketkeysize, size_t maximumspace,
    GtLogger *logger, GtTimer *timer, GtError *err)
{
  size_t sizeforcodestable;
  GtUword totallength = gt_encseq_total_length(encseq),
                nofsequences = gt_encseq_num_of_sequences(encseq);
  GtUword maskright = GT_MASKRIGHT((GtUword) bucketkeysize);

  if (usefirstcodes)
  {
    fci->numofcodes = nofsequences + 1;
  }
  else
  {
    fci->numofcodes = gt_randomcodes_calculate_nofsamples(encseq,
        nofsequences, totallength, bucketkeysize, sampling_factor) + 1;
  }
  sizeforcodestable = sizeof (*fci->allrandomcodes) * fci->numofcodes;
  if (maximumspace > 0 &&
      gt_firstcodes_spacelog_total(fci->fcsl) + sizeforcodestable >
      maximumspace)
  {
    gt_error_set(err, "already used %.2f MB of memory and require %.2f for the "
        "codes table => cannot compute index in at most %.2f MB",
        GT_MEGABYTES(gt_firstcodes_spacelog_total(fci->fcsl)),
        GT_MEGABYTES(sizeforcodestable),
        GT_MEGABYTES(maximumspace));
    return -1;
  }
  fci->allrandomcodes = gt_malloc(sizeforcodestable);
  GT_FCI_ADDSPLITSPACE(fci->fcsl, "allrandomcodes", sizeforcodestable);

  if (usefirstcodes)
  {
    if (timer != NULL)
      gt_timer_show_progress(timer, "to collect first codes", stdout);
    getencseqkmers_twobitencoding(encseq, readmode, bucketkeysize,
        bucketkeysize, true, gt_storerandomcodes, fci, NULL, NULL);
  }
  else
  {
    GtUword i;
    const GtTwobitencoding *twobitenc =
        gt_encseq_twobitencoding_export(encseq);
    GtUword realtotallength = totallength;
    if (gt_encseq_is_mirrored(encseq))
    {
      realtotallength >>= 1;
    }
    if (timer != NULL)
      gt_timer_show_progress(timer, "to generate sampling positions", stdout);
    gt_randomcodes_generate_sampling_positions(fci->allrandomcodes,
        fci->numofcodes - 1, encseq, totallength, sampling_factor,
        bucketkeysize, true, timer);
    if (timer != NULL)
      gt_timer_show_progress(timer, "to collect sample codes", stdout);
    for (i = 0; i < fci->numofcodes - 1; i++)
    {
      GtUword pos = fci->allrandomcodes[i];
      bool revcompl = false;
      if (pos > realtotallength)
      {
        pos = GT_REVERSEPOS(totallength, pos);
        revcompl = true;
      }
      fci->allrandomcodes[i] = gt_kmercode_at_position(twobitenc,
          pos, bucketkeysize);
      if (revcompl)
      {
        fci->allrandomcodes[i] = gt_kmercode_complement(
         gt_kmercode_reverse(fci->allrandomcodes[i], bucketkeysize), maskright);
      }
    }
    fci->countcodes = fci->numofcodes - 1;
  }
  /* add an artificial last bucket to collect suffixes
   * larger than the last code */
  gt_storerandomcodes(fci, true, /* unused*/ 0, maskright);
  gt_logger_log(logger, "have stored " GT_WU " bucket keys", fci->countcodes);
  if (timer != NULL)
  {
    gt_timer_show_progress(timer, "to sort bucket keys", stdout);
  }
  gt_radixsort_inplace_ulong(fci->allrandomcodes, fci->numofcodes);
  gt_assert(fci->allrandomcodes != NULL);
  fci->differentcodes = gt_randomcodes_remdups(fci->allrandomcodes,
      bucketkeysize, fci->numofcodes, logger);
  if (fci->differentcodes > 0 && fci->differentcodes < fci->numofcodes)
  {
    fci->allrandomcodes = gt_realloc(fci->allrandomcodes,
                                    sizeof (*fci->allrandomcodes) *
                                    fci->differentcodes);
    GT_FCI_SUBTRACTADDSPLITSPACE(fci->fcsl, "allrandomcodes",
                                 sizeof (*fci->allrandomcodes) *
                                 fci->differentcodes);
  }
  gt_randomcodes_countocc_new(fci->fcsl, &fci->tab, fci->differentcodes);
  return 0;
}

// Assembly:
subq $0x98, %rsp
movb %sil, %al
movq 0xb8(%rsp), %rsi
movq 0xb0(%rsp), %rsi
movq 0xa8(%rsp), %rsi
movq 0xa0(%rsp), %rsi
movq %rdi, 0x88(%rsp)
andb $0x1, %al
movb %al, 0x87(%rsp)
movl %edx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movl %r8d, 0x74(%rsp)
movl %r9d, 0x70(%rsp)
movq 0x78(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rdi
callq 0xa9d50
movq %rax, 0x58(%rsp)
movl 0x70(%rsp), %eax
movl $0x20, %ecx
subq %rax, %rcx
shlq %rcx
movq $-0x1, %rax
shrq %cl, %rax
movq %rax, 0x50(%rsp)
testb $0x1, 0x87(%rsp)
je 0x26dfae
movq 0x58(%rsp), %rcx
addq $0x1, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x26dfe1
movq 0x78(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movl 0x70(%rsp), %ecx
movl 0x80(%rsp), %r8d
callq 0x270390
movq %rax, %rcx
addq $0x1, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x88(%rsp), %rax
movq 0x18(%rax), %rax
shlq $0x3, %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, 0xa0(%rsp)
jbe 0x26e0e8
movq 0x88(%rsp), %rax
movq 0xa8(%rax), %rdi
callq 0x4be8b0
addq 0x68(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jbe 0x26e0e8
movq 0xb8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x88(%rsp), %rax
movq 0xa8(%rax), %rdi
callq 0x4be8b0
movq 0x20(%rsp), %rdi
movq %rax, %xmm0
movaps 0x2aa8d2(%rip), %xmm4   # 0x518930
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0x2aa8d6(%rip), %xmm3   # 0x518940
subpd %xmm3, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x2aa8a7(%rip), %xmm2   # 0x518928
mulsd %xmm2, %xmm0
movq 0x68(%rsp), %xmm1
punpckldq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
subpd %xmm3, %xmm1
movaps %xmm1, %xmm5
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm5, %xmm1
mulsd %xmm2, %xmm1
movq 0xa0(%rsp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
movsd 0x2aa85a(%rip), %xmm3   # 0x518920
divsd %xmm3, %xmm2
leaq 0x310bce(%rip), %rsi    # 0x57ec9f
movb $0x3, %al
callq 0xd88c0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x26e5b2
movq 0x68(%rsp), %rdi
leaq 0x3109e1(%rip), %rsi    # 0x57ead5
movl $0x414, %edx            # imm = 0x414
callq 0xe80f0
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0xa0(%rax)
movq 0x88(%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x68(%rsp), %rax
movl $0x415, %esi            # imm = 0x415
leaq 0x3109a5(%rip), %rdx    # 0x57ead5
movl $0x1, %ecx
leaq 0x2bb048(%rip), %r8     # 0x529184
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x4bea60
testb $0x1, 0x87(%rsp)
je 0x26e1c4
cmpq $0x0, 0xb0(%rsp)
je 0x26e17b
movq 0xb0(%rsp), %rdi
movq 0x3cddcc(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x310b98(%rip), %rsi    # 0x57ed0e
callq 0x121930
movq 0x78(%rsp), %rdi
movl 0x74(%rsp), %esi
movl 0x70(%rsp), %edx
movl 0x70(%rsp), %ecx
movq 0x88(%rsp), %rax
movl $0x1, %r8d
leaq 0x231f(%rip), %r9       # 0x2704c0
xorl %r10d, %r10d
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0x2de9c0
jmp 0x26e3b7
movq 0x78(%rsp), %rdi
callq 0xb5250
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x78(%rsp), %rdi
callq 0xc2ec0
testb $0x1, %al
jne 0x26e1ed
jmp 0x26e1fa
movq 0x38(%rsp), %rax
shrq %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0xb0(%rsp)
je 0x26e223
movq 0xb0(%rsp), %rdi
movq 0x3cdd24(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x310b07(%rip), %rsi    # 0x57ed25
callq 0x121930
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0x88(%rsp), %rax
movq 0x18(%rax), %rsi
subq $0x1, %rsi
movq 0x78(%rsp), %rdx
movq 0x60(%rsp), %rcx
movl 0x80(%rsp), %r8d
movl 0x70(%rsp), %r9d
movq 0xb0(%rsp), %rax
movl $0x1, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x270580
cmpq $0x0, 0xb0(%rsp)
je 0x26e29b
movq 0xb0(%rsp), %rdi
movq 0x3cdcac(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x310aae(%rip), %rsi    # 0x57ed44
callq 0x121930
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x88(%rsp), %rcx
movq 0x18(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x26e39b
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movb $0x0, 0x2f(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
jbe 0x26e308
movq 0x60(%rsp), %rax
subq $0x1, %rax
subq 0x30(%rsp), %rax
movq %rax, 0x30(%rsp)
movb $0x1, 0x2f(%rsp)
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x70(%rsp), %edx
callq 0x2707a0
movq %rax, %rdx
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x48(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
testb $0x1, 0x2f(%rsp)
je 0x26e386
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x70(%rsp), %esi
callq 0x2708a0
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x270880
movq %rax, %rdx
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x48(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x26e388
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x26e2a4
movq 0x88(%rsp), %rax
movq 0x18(%rax), %rcx
subq $0x1, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x88(%rsp), %rdi
movq 0x50(%rsp), %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2704c0
movq 0xa8(%rsp), %rdi
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rdx
leaq 0x31096f(%rip), %rsi    # 0x57ed5c
movb $0x0, %al
callq 0xe7cd0
cmpq $0x0, 0xb0(%rsp)
je 0x26e41d
movq 0xb0(%rsp), %rdi
movq 0x3cdb2a(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x310960(%rip), %rsi    # 0x57ed78
callq 0x121930
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0x88(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x100d90
movq 0x88(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
jne 0x26e487
movq 0x3cdb4a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a7bb3(%rip), %rsi    # 0x516013
leaq 0x310925(%rip), %rdx    # 0x57ed8c
leaq 0x31093a(%rip), %rcx    # 0x57eda8
leaq 0x310660(%rip), %r8     # 0x57ead5
movl $0x44b, %r9d            # imm = 0x44B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26e489
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rdi
movl 0x70(%rsp), %esi
movq 0x88(%rsp), %rax
movq 0x18(%rax), %rdx
movq 0xa8(%rsp), %rcx
callq 0x4dacd0
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x88(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jbe 0x26e578
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x88(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x26e578
movq 0x88(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rsi
shlq $0x3, %rsi
leaq 0x3105ba(%rip), %rdx    # 0x57ead5
movl $0x452, %ecx            # imm = 0x452
callq 0xe8540
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0xa0(%rax)
movq 0x88(%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rax
shlq $0x3, %rax
movl $0x455, %esi            # imm = 0x455
leaq 0x310573(%rip), %rdx    # 0x57ead5
xorl %r9d, %r9d
leaq 0x2bac18(%rip), %r8     # 0x529184
movl %r9d, %ecx
movq %rax, (%rsp)
callq 0x4bea60
movq 0x88(%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x88(%rsp), %rsi
addq $0x110, %rsi            # imm = 0x110
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rdx
callq 0x4daa90
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)