// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_show_seedext.c
// Function: gt_show_seedext_runner
static int gt_show_seedext_runner(GT_UNUSED int argc,
                                  GT_UNUSED const char **argv,
                                  GT_UNUSED int parsed_args,
                                  void *tool_arguments,
                                  GtError *err)
{
  int had_err = 0;
  GtShowSeedextArguments *arguments = tool_arguments;
  GtSeedextendMatchIterator *semi = NULL;
  const GtEncseq *aencseq = NULL, *bencseq = NULL;
  GtSeedExtendDisplayFlag *out_display_flag = NULL;
  GtFtPolishing_info *pol_info = NULL;
  GtGreedyextendmatchinfo *greedyextendmatchinfo = NULL;
  const GtExtendCharAccess a_extend_char_access = GT_EXTEND_CHAR_ACCESS_ANY;
  const GtExtendCharAccess b_extend_char_access = GT_EXTEND_CHAR_ACCESS_ANY;
  GtUchar *alignment_show_buffer = NULL;
  GtAlignment *alignment = NULL;
  GtSequencepairbuffer seqpairbuf = {NULL,NULL,0,0};
  GtLinspaceManagement *linspace_spacemanager = NULL;
  GtScoreHandler *linspace_scorehandler = NULL;
  const GtUchar *characters = NULL;
  GtUchar wildcardshow = (GtUchar) 'N';
  GtTimer *timer = NULL;
  const GtSeedExtendDisplaySetMode setmode
    = GT_SEED_EXTEND_DISPLAY_SET_STANDARD;

  if (gt_showtime_enabled())
  {
    timer = gt_timer_new();
    gt_timer_start(timer);
  }
  gt_error_check(err);
  gt_assert(arguments != NULL);
  /* Parse option string in first line of file specified by filename. */
  out_display_flag
    = gt_querymatch_display_flag_new(arguments->display_args,setmode,err);
  if (out_display_flag == NULL)
  {
    had_err = true;
  }
  if (!had_err)
  {
    if (arguments->optimal_alignment)
    {
      if (gt_querymatch_alignment_display(out_display_flag))
      {
        GtUword alignmentwidth
          = gt_querymatch_display_alignmentwidth(out_display_flag);
        alignment_show_buffer = gt_alignment_buffer_new(alignmentwidth);
      }
      alignment = gt_alignment_new();
      linspace_spacemanager = gt_linspace_management_new();
      linspace_scorehandler = gt_scorehandler_new(0,1,0,1);
    }
    semi = gt_seedextend_match_iterator_new(arguments->matchfilename,err);
    if (semi == NULL)
    {
      had_err = -1;
    }
  }
  /* Parse seed extensions. */
  if (!had_err)
  {
    printf("%s\n",gt_seedextend_match_iterator_Options_line(semi));
    aencseq = gt_seedextend_match_iterator_aencseq(semi);
    bencseq = gt_seedextend_match_iterator_bencseq(semi);
    /* the following are used if seed_extend is set */
    if (arguments->optimal_alignment)
    {
      characters = gt_encseq_alphabetcharacters(aencseq);
      wildcardshow = gt_encseq_alphabetwildcardshow(aencseq);
    }
    gt_querymatch_Fields_output(stdout,out_display_flag);
    if (!arguments->relax_polish)
    {
      double matchscore_bias = GT_DEFAULT_MATCHSCORE_BIAS;
      if (gt_seedextend_match_iterator_bias_parameters(semi))
      {
        matchscore_bias = gt_greedy_dna_sequence_bias_get(aencseq);
      }
      pol_info = polishing_info_new_with_bias(
                          gt_seedextend_match_iterator_errorpercentage(semi),
                          matchscore_bias,
                          gt_seedextend_match_iterator_history_size(semi));
    }
    if (arguments->verify_alignment)
    {
      gt_seedextend_match_iterator_verify_alignment_set(semi);
    }
    if (gt_querymatch_alignment_display(out_display_flag) ||
        gt_querymatch_trace_display(out_display_flag) ||
        gt_querymatch_dtrace_display(out_display_flag) ||
        gt_querymatch_cigar_display(out_display_flag) ||
        gt_querymatch_cigarX_display(out_display_flag) ||
        arguments->verify_alignment)
    {
      if (gt_seedextend_match_iterator_querymatchoutoptions_set(
                            semi,
                            !arguments->relax_polish,
                            a_extend_char_access,
                            b_extend_char_access,
                            out_display_flag,
                            err) != 0)
      {
        had_err = -1;
      }
    }
  }
  if (!had_err)
  {
    GtKarlinAltschulStat *karlin_altschul_stat = NULL;
    const bool match_has_cigar = gt_seedextend_match_iterator_has_cigar(semi),
               match_has_seed = gt_seedextend_match_iterator_has_seed(semi),
               dtrace = gt_seedextend_match_iterator_dtrace(semi);
    const GtUword trace_delta = gt_seedextend_match_iterator_trace_delta(semi);

    if (gt_querymatch_evalue_display(out_display_flag) ||
        gt_querymatch_bitscore_display(out_display_flag))
    {
      karlin_altschul_stat = gt_karlin_altschul_stat_new_gapped(
                                       gt_encseq_total_length(aencseq),
                                       gt_encseq_num_of_sequences(aencseq),
                                       bencseq);
    }
    if (arguments->sortmatches)
    {
      (void) gt_seedextend_match_iterator_all_sorted(semi,true);
    }
    while (true)
    {
      GtQuerymatch *querymatchptr = gt_seedextend_match_iterator_next(semi);
      const double evalue = gt_seedextend_match_iterator_evalue(semi),
                   bitscore = gt_seedextend_match_iterator_bitscore(semi);

      if (querymatchptr == NULL)
      {
        break;
      }
      gt_querymatch_recompute_alignment(querymatchptr,
                                        out_display_flag,
                                        match_has_cigar,
                                        dtrace,
                                        trace_delta,
                                        match_has_seed,
                                        aencseq,
                                        bencseq,
                                        karlin_altschul_stat,
                                        evalue,
                                        bitscore);
      if (arguments->optimal_alignment)
      {
        gt_querymatch_extract_sequence_pair(&seqpairbuf,
                                            aencseq,
                                            bencseq,
                                            querymatchptr);
        gt_querymatch_optimal_alignment(querymatchptr,
                                        &seqpairbuf,
                                        linspace_spacemanager,
                                        linspace_scorehandler,
                                        alignment,
                                        alignment_show_buffer,
                                        out_display_flag,
                                        characters,
                                        wildcardshow);
      }
    }
    gt_greedy_extend_matchinfo_delete(greedyextendmatchinfo);
    gt_free(seqpairbuf.a_sequence);
    gt_free(seqpairbuf.b_sequence);
    gt_karlin_altschul_stat_delete(karlin_altschul_stat);
  }
  gt_free(alignment_show_buffer);
  polishing_info_delete(pol_info);
  gt_alignment_delete(alignment);
  gt_scorehandler_delete(linspace_scorehandler);
  gt_linspace_management_delete(linspace_spacemanager);
  gt_seedextend_match_iterator_delete(semi);
  if (!had_err && gt_showtime_enabled())
  {
    printf("# TIME show_seedext %s alignment ",
           gt_querymatch_alignment_display(out_display_flag)
           ? "with" : "without");
    gt_timer_show_formatted(timer,GT_WD ".%06ld\n",stdout);
  }
  gt_querymatch_display_flag_delete(out_display_flag);
  if (gt_showtime_enabled())
  {
    gt_timer_delete(timer);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r8, %rbp
movq %rcx, %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
callq 0x11ed94
testb %al, %al
je 0xca51f
callq 0x1226a4
movq %rax, %rbx
movq %rax, %rdi
callq 0x122733
jmp 0xca521
xorl %ebx, %ebx
testq %rbp, %rbp
je 0xca536
movq %rbp, %rdi
callq 0x101a9a
testb %al, %al
jne 0xcaad3
testq %r13, %r13
je 0xcaace
movq 0x10(%r13), %rdi
movl $0x1, %r14d
movl $0x1, %esi
movq %rbp, %rdx
callq 0x1c2dbd
movq %rax, %r15
testq %rax, %rax
je 0xca58a
xorl %r14d, %r14d
cmpb $0x1, 0x3(%r13)
jne 0xca5b0
movq %r15, %rdi
callq 0x1c2d92
testb %al, %al
je 0xca5d6
movq %r15, %rdi
callq 0x1c2d72
movl %eax, %edi
callq 0x12797a
movq %rax, 0x10(%rsp)
jmp 0xca5df
movq $0x0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0xca62b
movq $0x0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0xca60d
movq $0x0, 0x10(%rsp)
callq 0x126b24
movq %rax, 0x20(%rsp)
xorl %eax, %eax
callq 0x1638ec
movq %rax, 0x28(%rsp)
movl $0x1, %esi
movl $0x1, %ecx
xorl %edi, %edi
xorl %edx, %edx
callq 0x179740
movq %rax, 0x18(%rsp)
movq 0x8(%r13), %rdi
movq %rbp, %rsi
callq 0x1e9322
testq %rax, %rax
je 0xca625
movq %rax, %r12
movb $0x1, %al
jmp 0xca630
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %r12d, %r12d
xorl %eax, %eax
testb %al, %al
movq %rbx, 0x60(%rsp)
je 0xca683
movq %r12, %rdi
callq 0x1e9cce
movq %rax, %rdi
callq 0x17bd0
movq %r12, %rdi
callq 0x1e9a56
movq %rax, %r14
movq %r12, %rdi
callq 0x1e9a66
movq %rax, 0x38(%rsp)
cmpb $0x1, 0x3(%r13)
jne 0xca6aa
movq %r14, %rdi
callq 0xf02e2
movq %rax, 0x40(%rsp)
movq %r14, %rdi
callq 0xf02ee
movb %al, 0x30(%rsp)
jmp 0xca6b8
movb $0x4e, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x38(%rsp)
movq $0x0, 0x8(%rsp)
jmp 0xca7c8
movb $0x4e, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x3f9829(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdi
movq %r15, %rsi
callq 0x1c34da
cmpb $0x0, (%r13)
je 0xca6d5
xorl %ebx, %ebx
jmp 0xca746
movq %r12, %rdi
callq 0x1e9a96
testb %al, %al
je 0xca6eb
movq %r14, %rdi
callq 0x1ea072
jmp 0xca6f3
movsd 0x284b35(%rip), %xmm0   # 0x34f228
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x1e9a86
movq %rax, %xmm0
punpckldq 0x2861d2(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2861da(%rip), %xmm0   # 0x3508f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x50(%rsp)
movq %r12, %rdi
callq 0x1e9a76
movaps 0x50(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %rax, %rdi
callq 0x1b8300
movq %rax, %rbx
movq %r14, 0x8(%rsp)
cmpb $0x1, 0x2(%r13)
jne 0xca75a
movq %r12, %rdi
callq 0x1e9b54
movq %r15, %rdi
callq 0x1c2d92
testb %al, %al
jne 0xca7a0
movq %r15, %rdi
callq 0x1c2b65
testb %al, %al
jne 0xca7a0
movq %r15, %rdi
callq 0x1c2b76
testb %al, %al
jne 0xca7a0
movq %r15, %rdi
callq 0x1c2b43
testb %al, %al
jne 0xca7a0
movq %r15, %rdi
callq 0x1c2b54
testb %al, %al
jne 0xca7a0
xorl %r14d, %r14d
cmpb $0x1, 0x2(%r13)
jne 0xca7c8
movzbl (%r13), %esi
xorl $0x1, %esi
movq %r12, %rdi
movl $0x3, %edx
movl $0x3, %ecx
movq %r15, %r8
movq %rbp, %r9
callq 0x1e9bdc
xorl %r14d, %r14d
negl %eax
sbbl %r14d, %r14d
testl %r14d, %r14d
je 0xca81b
leaq 0x298d10(%rip), %rsi    # 0x3634e4
movq 0x10(%rsp), %rdi
movl $0x169, %edx            # imm = 0x169
callq 0x109670
movq %rbx, %rdi
callq 0x1b85e9
movq 0x20(%rsp), %rdi
callq 0x127c25
movq 0x18(%rsp), %rdi
callq 0x1797c3
movq 0x28(%rsp), %rdi
callq 0x163927
movq %r12, %rdi
callq 0x1e925c
movq 0x60(%rsp), %rbx
jmp 0xcaaa0
movq %rbx, 0x70(%rsp)
movq %r14, 0x78(%rsp)
movq %r12, %rdi
callq 0x1e9abc
movl %eax, %r14d
movq %r12, %rdi
callq 0x1e9aa5
movl %eax, %ebx
movq %r12, %rdi
callq 0x1e9b26
movl %eax, %ebp
movq %r12, %rdi
callq 0x1e9aeb
movq %rax, 0x88(%rsp)
movq %r15, %rdi
callq 0x1c2cfc
testb %al, %al
movq %r15, 0x48(%rsp)
movq %r13, 0x68(%rsp)
jne 0xca876
movq %r15, %rdi
callq 0x1c2d0d
testb %al, %al
je 0xca8ba
movl %ebp, %r15d
movl %ebx, %ebp
movl %r14d, %ebx
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xec1d8
movq %rax, %r13
movq %r14, %rdi
movl %ebx, %r14d
movl %ebp, %ebx
movl %r15d, %ebp
callq 0xec1e8
movq %r13, %rdi
movq 0x68(%rsp), %r13
movq %rax, %rsi
movq 0x38(%rsp), %rdx
callq 0x1bfbb9
movq %rax, 0x50(%rsp)
jmp 0xca8c3
movq $0x0, 0x50(%rsp)
cmpb $0x1, 0x1(%r13)
jne 0xca8d7
movq %r12, %rdi
movl $0x1, %esi
callq 0x1e9b5d
movzbl %r14b, %r14d
movzbl %bpl, %r13d
movzbl %bl, %ebx
movzbl 0x30(%rsp), %eax
movq %rax, 0x80(%rsp)
movq %r12, %rdi
callq 0x1e9928
movq %rax, %rbp
movq %r12, %rdi
callq 0x1e9b32
movsd %xmm0, 0x30(%rsp)
movq %r12, %rdi
callq 0x1e9b43
testq %rbp, %rbp
je 0xca9c1
movaps %xmm0, %xmm1
subq $0x8, %rsp
movq %rbp, %rdi
movq 0x50(%rsp), %rsi
movl %r14d, %edx
movl %r13d, %ecx
movq 0x90(%rsp), %r8
movl %ebx, %r9d
movsd 0x38(%rsp), %xmm0
pushq 0x58(%rsp)
pushq 0x48(%rsp)
pushq 0x20(%rsp)
callq 0x1c510f
addq $0x20, %rsp
movq 0x68(%rsp), %rax
cmpb $0x1, 0x3(%rax)
jne 0xca9b8
movq %r12, %r15
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbp, %rcx
callq 0x1c5033
subq $0x8, %rsp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %r12
movq 0x30(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x18(%rsp), %r9
pushq 0x88(%rsp)
pushq 0x50(%rsp)
pushq 0x60(%rsp)
callq 0xca1bc
addq $0x20, %rsp
testq %rbp, %rbp
jne 0xca8ef
xorl %edi, %edi
callq 0x1ea424
movq 0x90(%rsp), %rdi
leaq 0x298b0d(%rip), %rbx    # 0x3634e4
movq %rbx, %rsi
movl $0x165, %edx            # imm = 0x165
callq 0x109670
movq 0x98(%rsp), %rdi
movq %rbx, %rsi
movl $0x166, %edx            # imm = 0x166
callq 0x109670
movq 0x50(%rsp), %rdi
callq 0x1befa8
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl $0x169, %edx            # imm = 0x169
callq 0x109670
movq 0x70(%rsp), %rdi
callq 0x1b85e9
movq 0x20(%rsp), %rdi
callq 0x127c25
movq 0x18(%rsp), %rdi
callq 0x1797c3
movq 0x28(%rsp), %rdi
callq 0x163927
movq %r12, %rdi
callq 0x1e925c
callq 0x11ed94
testb %al, %al
movq 0x60(%rsp), %rbx
movq 0x48(%rsp), %r15
movq 0x78(%rsp), %r14
je 0xcaaa0
movq %r15, %rdi
callq 0x1c2d92
leaq 0x298c57(%rip), %rcx    # 0x3636c3
leaq 0x298c55(%rip), %rsi    # 0x3636c8
testb %al, %al
cmovneq %rcx, %rsi
leaq 0x298c21(%rip), %rdi    # 0x3636a1
xorl %eax, %eax
callq 0x17070
movq 0x3f945a(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdx
leaq 0x295700(%rip), %rsi    # 0x360198
movq %rbx, %rdi
callq 0x1227b4
movq %r15, %rdi
callq 0x1c2da6
callq 0x11ed94
testb %al, %al
je 0xcaab9
movq %rbx, %rdi
callq 0x122d79
movl %r14d, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2046b
callq 0x20432