// File: /workspace/github_c_makefile_star2_O2/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 $0xb8, %rsp
movq %r8, %rbp
movq %rcx, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
callq 0xaaf34
testb %al, %al
je 0x4cedd
callq 0xaf478
movq %rax, 0x30(%rsp)
movq %rax, %rdi
callq 0xaf4d6
jmp 0x4cee6
movq $0x0, 0x30(%rsp)
testq %rbp, %rbp
je 0x4cefb
movq %rbp, %rdi
callq 0x89eb7
testb %al, %al
jne 0x4d44d
testq %r15, %r15
je 0x4d41f
movq 0x10(%r15), %rdi
pushq $0x1
popq %r12
movl %r12d, %esi
movq %rbp, %rdx
callq 0x169261
movq %rax, %r14
testq %rax, %rax
je 0x4cf47
cmpb $0x1, 0x3(%r15)
jne 0x4cf60
movq %r14, %rdi
callq 0x169236
testb %al, %al
je 0x4cf7f
movq %r14, %rdi
callq 0x169216
movl %eax, %edi
callq 0xb617b
movq %rax, (%rsp)
jmp 0x4cf87
movq %r12, 0x28(%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %ebx, %ebx
jmp 0x4d142
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x10(%rsp)
movq $0x0, (%rsp)
jmp 0x4cfaf
movq $0x0, (%rsp)
callq 0xb4e60
movq %rax, 0x10(%rsp)
xorl %eax, %eax
callq 0xf9624
movq %rax, %r13
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rcx, %rsi
xorl %edx, %edx
callq 0x1148f4
movq %rax, 0x8(%rsp)
movq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0x18de6b
movq %rax, %r12
pushq $-0x1
popq %rax
movq %rax, 0x28(%rsp)
testq %r12, %r12
je 0x4d018
movq %r12, %rdi
callq 0x18eb18
movq %rax, %rdi
callq 0x17b60
movq %r12, %rdi
callq 0x18e617
movq %rax, %rbx
movq %r12, %rdi
callq 0x18e65a
movq %rax, 0x48(%rsp)
cmpb $0x1, 0x3(%r15)
movq %rbx, 0x20(%rsp)
jne 0x4d022
movq %rbx, %rdi
callq 0x754e5
movq %rax, 0x68(%rsp)
movq %rbx, %rdi
callq 0x754f1
movl %eax, %ebx
jmp 0x4d02d
xorl %r12d, %r12d
xorl %ebx, %ebx
jmp 0x4d134
movb $0x4e, %bl
movq $0x0, 0x68(%rsp)
movq 0x3eae7c(%rip), %rax    # 0x437eb0
movq (%rax), %rdi
movq %r14, %rsi
callq 0x169994
cmpb $0x0, (%r15)
movb %bl, 0x38(%rsp)
je 0x4d04d
xorl %ebx, %ebx
jmp 0x4d0c0
movq %r12, %rdi
callq 0x18e723
testb %al, %al
je 0x4d065
movq 0x20(%rsp), %rdi
callq 0x18eff6
jmp 0x4d06d
movsd 0x2991bb(%rip), %xmm0   # 0x2e6228
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
callq 0x18e6e0
movq %rax, %xmm0
punpckldq 0x29a858(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x29a860(%rip), %xmm0   # 0x2e78f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x50(%rsp)
movq %r12, %rdi
callq 0x18e69d
movaps 0x50(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %rax, %rdi
callq 0x15cd14
movq %rax, %rbx
cmpb $0x1, 0x2(%r15)
jne 0x4d0cf
movq %r12, %rdi
callq 0x18e913
movq %r14, %rdi
callq 0x169236
testb %al, %al
jne 0x4d116
movq %r14, %rdi
callq 0x1690e6
testb %al, %al
jne 0x4d116
movq %r14, %rdi
callq 0x1690eb
testb %al, %al
jne 0x4d116
movq %r14, %rdi
callq 0x1690dc
testb %al, %al
jne 0x4d116
movq %r14, %rdi
callq 0x1690e1
testb %al, %al
jne 0x4d116
cmpb $0x1, 0x2(%r15)
jne 0x4d1b0
movzbl (%r15), %esi
xorl $0x1, %esi
pushq $0x3
popq %rcx
movq %r12, %rdi
movl %ecx, %edx
movq %r14, %r8
movq %rbp, %r9
callq 0x18e9f5
testl %eax, %eax
je 0x4d1b0
movq 0x10(%rsp), %r15
movq (%rsp), %rdi
movq 0x8(%rsp), %rbp
leaq 0x2ad2ff(%rip), %rsi    # 0x2fa448
movl $0x169, %edx            # imm = 0x169
callq 0x936f9
movq %rbx, %rdi
callq 0x15d13c
movq %r15, %rdi
callq 0xb647f
movq %rbp, %rdi
callq 0x114a03
movq %r13, %rdi
callq 0xf9658
movq %r12, %rdi
callq 0x18ddac
movq 0x28(%rsp), %r15
movq %r14, %rdi
callq 0x16924a
callq 0xaaf34
testb %al, %al
je 0x4d19b
movq 0x30(%rsp), %rdi
callq 0xafc5b
movl %r15d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, 0x70(%rsp)
movq %r13, 0x60(%rsp)
movq %r15, 0x18(%rsp)
movq %r12, %rdi
callq 0x18e7af
movl %eax, %ebp
movq %r12, %rdi
callq 0x18e765
movl %eax, %ebx
movq %r12, %rdi
callq 0x18e87f
movl %eax, %r13d
movq %r12, %rdi
callq 0x18e811
movq %rax, 0x78(%rsp)
movq %r14, %rdi
callq 0x169190
testb %al, %al
movq %r14, 0x40(%rsp)
jne 0x4d208
movq %r14, %rdi
callq 0x169198
testb %al, %al
je 0x4d241
movq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x7055e
movl %ebx, %r14d
movl %ebp, %ebx
movq %rax, %rbp
movq %r15, %rdi
callq 0x705a1
movq %rbp, %rdi
movl %ebx, %ebp
movl %r14d, %ebx
movq %rax, %rsi
movq 0x48(%rsp), %rdx
callq 0x1659df
movq %rax, 0x50(%rsp)
jmp 0x4d24a
movq $0x0, 0x50(%rsp)
movq 0x18(%rsp), %rax
cmpb $0x1, 0x1(%rax)
jne 0x4d260
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x18e91c
movzbl %bpl, %r15d
movzbl %r13b, %r13d
movzbl %bl, %ebx
movzbl 0x38(%rsp), %eax
movq %rax, 0x38(%rsp)
movq %r12, %rdi
callq 0x18e4c7
movq %rax, %rbp
movq %r12, %rdi
callq 0x18e88b
movsd %xmm0, 0x28(%rsp)
movq %r12, %rdi
callq 0x18e8cf
testq %rbp, %rbp
je 0x4d33a
movaps %xmm0, %xmm1
subq $0x8, %rsp
movq %rbp, %rdi
movq 0x48(%rsp), %rsi
movl %r15d, %edx
movl %r13d, %ecx
movq 0x80(%rsp), %r8
movl %ebx, %r9d
movsd 0x30(%rsp), %xmm0
pushq 0x58(%rsp)
pushq 0x58(%rsp)
pushq 0x38(%rsp)
callq 0x16bd6b
addq $0x20, %rsp
movq 0x18(%rsp), %rax
cmpb $0x1, 0x3(%rax)
jne 0x4d275
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %rbp, %rcx
callq 0x16bc8f
subq $0x8, %rsp
movq %rbp, %rdi
movq %r14, %rsi
movq 0x68(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x8(%rsp), %r9
pushq 0x40(%rsp)
pushq 0x78(%rsp)
pushq 0x58(%rsp)
callq 0x4cac0
addq $0x20, %rsp
jmp 0x4d275
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x18f431
movq 0x80(%rsp), %rdi
leaq 0x2ad0f5(%rip), %rbx    # 0x2fa448
movq %rbx, %rsi
movl $0x165, %edx            # imm = 0x165
callq 0x936f9
movq 0x88(%rsp), %rdi
movq %rbx, %rsi
movl $0x166, %edx            # imm = 0x166
callq 0x936f9
movq 0x50(%rsp), %rdi
callq 0x164cbc
movq (%rsp), %rdi
movq %rbx, %rsi
movl $0x169, %edx            # imm = 0x169
callq 0x936f9
movq 0x70(%rsp), %rdi
callq 0x15d13c
movq 0x10(%rsp), %rdi
callq 0xb647f
movq 0x8(%rsp), %rdi
callq 0x114a03
movq 0x60(%rsp), %rdi
callq 0xf9658
movq %r12, %rdi
callq 0x18ddac
callq 0xaaf34
testb %al, %al
movq 0x40(%rsp), %r14
je 0x4d180
movq %r14, %rdi
callq 0x169236
leaq 0x2ad246(%rip), %rcx    # 0x2fa627
leaq 0x2ad244(%rip), %rsi    # 0x2fa62c
testb %al, %al
cmovneq %rcx, %rsi
leaq 0x2ad210(%rip), %rdi    # 0x2fa605
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x17070
movq 0x3eaaaa(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2a9d45(%rip), %rsi    # 0x2f7155
movq 0x30(%rsp), %rdi
callq 0xaf5b6
jmp 0x4d180
movq 0x3eab42(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x297be3(%rip), %rsi    # 0x2e5013
leaq 0x298e35(%rip), %rdx    # 0x2e626c
leaq 0x2ad1b0(%rip), %rcx    # 0x2fa5ee
leaq 0x2ad003(%rip), %r8     # 0x2fa448
movl $0xde, %r9d
jmp 0x4d479
movq 0x3eab14(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x297bb5(%rip), %rsi    # 0x2e5013
leaq 0x297d5a(%rip), %rdx    # 0x2e51bf
leaq 0x2ad182(%rip), %rcx    # 0x2fa5ee
leaq 0x2acfd5(%rip), %r8     # 0x2fa448
movl $0xdd, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nopl (%rax)