// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/karlin_altschul_stat.c
// Function: gt_karlin_altschul_stat_new_gapped
GtKarlinAltschulStat *gt_karlin_altschul_stat_new_gapped(
                             GtUword total_length_db,
                             GtUword num_of_db_seqs,
                             GT_UNUSED const GtEncseq *query_encseq)
{
  const unsigned int gapped_alignment_flag = 0;
  GtScoreHandler *scorehandler = gt_scorehandler_new(1,-2,0,-2);
  GtKarlinAltschulStat *ka
    = gt_karlin_altschul_stat_new(gapped_alignment_flag,scorehandler);

  gt_scorehandler_delete(scorehandler);
  gt_assert(num_of_db_seqs > 0 &&
            ka->actual_length_db == GT_UWORD_MAX);
  ka->actual_length_db = total_length_db - (num_of_db_seqs - 1);
  ka->num_of_db_seqs = num_of_db_seqs;
  if (query_encseq != NULL)
  {
    GtUword *seq_length_tab = gt_all_sequence_lengths_get(query_encseq);
    GtUwordPair *store_under_construction;

    ka->num_of_query_seqs = gt_encseq_num_of_sequences(query_encseq);
    if (seq_length_tab == NULL) /* all are of the same length */
    {
      store_under_construction = gt_malloc(sizeof *ka->searchspace_store * 1);
      store_under_construction[0].a = gt_encseq_seqlength(query_encseq,0);
      store_under_construction[0].b
        = gt_evalue_searchspace(ka,store_under_construction[0].a);
      ka->different_lengths = 1;
    } else
    {
      GtUword ridx, widx;

      gt_radixsort_inplace_ulong(seq_length_tab,ka->num_of_query_seqs);
      gt_assert(ka->num_of_query_seqs > 0);
      for (ridx = 1, widx = 0; ridx < ka->num_of_query_seqs; ridx++)
      {
        if (seq_length_tab[ridx] != seq_length_tab[widx])
        {
          seq_length_tab[++widx] = seq_length_tab[ridx];
        }
      }
      ka->different_lengths = widx + 1;
      store_under_construction = gt_malloc(sizeof *ka->searchspace_store *
                                           ka->different_lengths);
      for (widx = 0; widx < ka->different_lengths; widx++)
      {
        store_under_construction[widx].a = seq_length_tab[widx];
        store_under_construction[widx].b
          = gt_evalue_searchspace(ka,store_under_construction[widx].a);
      }
      gt_free(seq_length_tab);
    }
    ka->searchspace_store = store_under_construction;
  }
  return ka;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movl $0x1, %edi
movq $-0x2, %rsi
xorl %edx, %edx
movq $-0x2, %rcx
callq 0x179740
movq %rax, %r13
xorl %edi, %edi
movq %rax, %rsi
callq 0x1befe4
movq %rax, %rbx
movq %r13, %rdi
callq 0x1797c3
testq %r14, %r14
je 0x1bfd40
cmpq $-0x1, 0x50(%rbx)
jne 0x1bfd40
subq %r14, %r12
incq %r12
movq %r12, 0x50(%rbx)
movq %r14, 0x58(%rbx)
testq %r15, %r15
je 0x1bfd33
movq %r15, %rdi
callq 0xef200
movq %rax, %r14
movq %r15, %rdi
callq 0xec1e8
movq %rax, 0x60(%rbx)
testq %r14, %r14
je 0x1bfcf0
movq %r14, %rdi
movq %rax, %rsi
callq 0x114e0b
cmpq $0x0, 0x60(%rbx)
je 0x1bfd45
movl $0x1, %edi
cmpq $0x2, 0x60(%rbx)
jb 0x1bfc8f
movl $0x1, %eax
xorl %edi, %edi
movq (%r14,%rax,8), %rcx
cmpq (%r14,%rdi,8), %rcx
je 0x1bfc83
movq %rcx, 0x8(%r14,%rdi,8)
incq %rdi
incq %rax
cmpq 0x60(%rbx), %rax
jb 0x1bfc71
incq %rdi
movq %rdi, 0x68(%rbx)
shlq $0x4, %rdi
leaq 0x1f28a2(%rip), %rsi    # 0x3b2540
movl $0x250, %edx            # imm = 0x250
callq 0x1092b2
movq %rax, %r12
cmpq $0x0, 0x68(%rbx)
je 0x1bfcda
leaq 0x8(%r12), %r15
xorl %r13d, %r13d
movq (%r14,%r13,8), %rsi
movq %rsi, -0x8(%r15)
movq %rbx, %rdi
callq 0x1bfd4a
movq %rax, (%r15)
incq %r13
addq $0x10, %r15
cmpq 0x68(%rbx), %r13
jb 0x1bfcba
leaq 0x1f285f(%rip), %rsi    # 0x3b2540
movq %r14, %rdi
movl $0x257, %edx            # imm = 0x257
callq 0x109670
jmp 0x1bfd2f
leaq 0x1f2849(%rip), %rsi    # 0x3b2540
movl $0x10, %edi
movl $0x23c, %edx            # imm = 0x23C
callq 0x1092b2
movq %rax, %r12
movq %r15, %rdi
xorl %esi, %esi
callq 0xeffd3
movq %rax, (%r12)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1bfd4a
movq %rax, 0x8(%r12)
movq $0x1, 0x68(%rbx)
movq %r12, 0x70(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x68169
callq 0x68130