// File: /workspace/github_c_makefile_star2_O3/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, %r13
movq %rcx, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
callq 0x119160
testb %al, %al
je 0xc8301
callq 0x11c954
movq %rax, 0x38(%rsp)
movq %rax, %rdi
callq 0x11c9e3
jmp 0xc830a
movq $0x0, 0x38(%rsp)
testq %r13, %r13
je 0xc831f
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0xc88ab
testq %rbp, %rbp
je 0xc88a6
movq 0x10(%rbp), %rdi
movl $0x1, %esi
movq %r13, %rdx
callq 0x1ba11e
movq %rax, %r14
testq %rax, %rax
je 0xc8369
cmpb $0x1, 0x3(%rbp)
jne 0xc8387
movq %r14, %rdi
callq 0x1ba0f3
testb %al, %al
je 0xc83a6
movq %r14, %rdi
callq 0x1ba0d3
movl %eax, %edi
callq 0x121b91
movq %rax, 0x10(%rsp)
jmp 0xc83af
movl $0x1, %eax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r15d, %r15d
jmp 0xc8578
movq $0x0, 0x20(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x28(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0xc83db
movq $0x0, 0x10(%rsp)
callq 0x120d2c
movq %rax, 0x28(%rsp)
xorl %eax, %eax
callq 0x15bb80
movq %rax, %rbx
movl $0x1, %esi
movl $0x1, %ecx
xorl %edi, %edi
xorl %edx, %edx
callq 0x17137c
movq %rax, 0x20(%rsp)
movq 0x8(%rbp), %rdi
movq %r13, %rsi
callq 0x1dfaca
movq %rax, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x8(%rsp)
testq %r12, %r12
je 0xc8446
movq %r12, %rdi
callq 0x1e0469
movq %rax, %rdi
callq 0x17bd0
movq %r12, %rdi
callq 0x1e01f1
movq %rax, %r15
movq %r12, %rdi
callq 0x1e0201
movq %rax, 0x48(%rsp)
cmpb $0x1, 0x3(%rbp)
movq %r15, 0x30(%rsp)
jne 0xc8451
movq %r15, %rdi
callq 0xebce1
movq %rax, 0x70(%rsp)
movq %r15, %rdi
callq 0xebced
movl %eax, %r15d
jmp 0xc845d
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0xc8569
movb $0x4e, %r15b
movq $0x0, 0x70(%rsp)
movq 0x3f0a74(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdi
movq %r14, %rsi
callq 0x1ba78a
cmpb $0x0, (%rbp)
movb %r15b, 0x40(%rsp)
je 0xc847f
xorl %r15d, %r15d
jmp 0xc84f2
movq %r12, %rdi
callq 0x1e0231
testb %al, %al
je 0xc8497
movq 0x30(%rsp), %rdi
callq 0x1e080a
jmp 0xc849f
movsd 0x27dd89(%rip), %xmm0   # 0x346228
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
callq 0x1e0221
movq %rax, %xmm0
punpckldq 0x27f426(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x27f42e(%rip), %xmm0   # 0x3478f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x50(%rsp)
movq %r12, %rdi
callq 0x1e0211
movaps 0x50(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %rax, %rdi
callq 0x1af7d0
movq %rax, %r15
cmpb $0x1, 0x2(%rbp)
jne 0xc8500
movq %r12, %rdi
callq 0x1e02ef
movq %r14, %rdi
callq 0x1ba0f3
testb %al, %al
jne 0xc8546
movq %r14, %rdi
callq 0x1b9ed5
testb %al, %al
jne 0xc8546
movq %r14, %rdi
callq 0x1b9ee6
testb %al, %al
jne 0xc8546
movq %r14, %rdi
callq 0x1b9eb3
testb %al, %al
jne 0xc8546
movq %r14, %rdi
callq 0x1b9ec4
testb %al, %al
jne 0xc8546
cmpb $0x1, 0x2(%rbp)
jne 0xc85e3
movzbl (%rbp), %esi
xorl $0x1, %esi
movq %r12, %rdi
movl $0x3, %edx
movl $0x3, %ecx
movq %r14, %r8
movq %r13, %r9
callq 0x1e0377
testl %eax, %eax
je 0xc85e3
movq 0x28(%rsp), %r13
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rbp
leaq 0x291ef1(%rip), %rsi    # 0x35a470
movl $0x169, %edx            # imm = 0x169
callq 0x1045eb
movq %r15, %rdi
callq 0x1afabf
movq %r13, %rdi
callq 0x121e3c
movq %rbp, %rdi
callq 0x1713ff
movq %rbx, %rdi
callq 0x15bbbb
movq %r12, %rdi
callq 0x1dfa04
movq %r14, %rdi
callq 0x1ba107
callq 0x119160
testb %al, %al
je 0xc85cc
movq 0x38(%rsp), %rdi
callq 0x11d054
movq 0x8(%rsp), %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, 0x78(%rsp)
movq %rbx, 0x68(%rsp)
movq %r12, %rdi
callq 0x1e0257
movl %eax, %r13d
movq %r12, %rdi
callq 0x1e0240
movb %al, 0x7(%rsp)
movq %r12, %rdi
callq 0x1e02c1
movb %al, 0x6(%rsp)
movq %r12, %rdi
callq 0x1e0286
movq %rax, 0x80(%rsp)
movq %r14, %rdi
callq 0x1ba06c
testb %al, %al
jne 0xc8638
movq %r14, %rdi
callq 0x1ba07d
testb %al, %al
je 0xc8667
movq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0xe7b9c
movq %rax, %rbx
movq %r15, %rdi
callq 0xe7bac
movq %rbx, %rdi
movq %rax, %rsi
movq 0x48(%rsp), %rdx
callq 0x1b70ec
movq %rax, 0x50(%rsp)
jmp 0xc8670
movq $0x0, 0x50(%rsp)
movq %r14, 0x18(%rsp)
movq %rbp, 0x88(%rsp)
cmpb $0x1, 0x1(%rbp)
jne 0xc8690
movq %r12, %rdi
movl $0x1, %esi
callq 0x1e02f8
movq %r12, %rdi
callq 0x1e00e3
movq %rax, %r15
movq %r12, %rdi
callq 0x1e02cd
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x1e02de
testq %r15, %r15
je 0xc87b4
movaps %xmm0, %xmm1
movzbl %r13b, %ebp
movzbl 0x6(%rsp), %r14d
movzbl 0x7(%rsp), %r13d
movzbl 0x40(%rsp), %eax
movq %rax, 0x40(%rsp)
subq $0x8, %rsp
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movl %ebp, %edx
movl %r14d, %ecx
movq 0x88(%rsp), %r8
movl %r13d, %r9d
movsd 0x10(%rsp), %xmm0
pushq 0x58(%rsp)
pushq 0x58(%rsp)
pushq 0x48(%rsp)
callq 0x1bc393
addq $0x20, %rsp
movq 0x88(%rsp), %rax
cmpb $0x1, 0x3(%rax)
jne 0xc8787
movq %r12, %rbx
movl %r13d, %r12d
movl %r14d, %r13d
movl %ebp, %r14d
leaq 0x90(%rsp), %rbp
movq %rbp, %rdi
movq 0x30(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %r15, %rcx
callq 0x1bc2b7
subq $0x8, %rsp
movq %r15, %rdi
movq %rbp, %rsi
movl %r14d, %ebp
movl %r13d, %r14d
movl %r12d, %r13d
movq %rbx, %r12
movq 0x70(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x18(%rsp), %r9
pushq 0x48(%rsp)
pushq 0x80(%rsp)
pushq 0x30(%rsp)
callq 0xc7f9c
addq $0x20, %rsp
movq %r12, %rdi
callq 0x1e00e3
movq %rax, %r15
movq %r12, %rdi
callq 0x1e02cd
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x1e02de
movaps %xmm0, %xmm1
testq %r15, %r15
jne 0xc86d7
movq $0x0, 0x8(%rsp)
xorl %edi, %edi
callq 0x1e0bbb
movq 0x90(%rsp), %rdi
leaq 0x291c9d(%rip), %r14    # 0x35a470
movq %r14, %rsi
movl $0x165, %edx            # imm = 0x165
callq 0x1045eb
movq 0x98(%rsp), %rdi
movq %r14, %rsi
movl $0x166, %edx            # imm = 0x166
callq 0x1045eb
movq 0x50(%rsp), %rdi
callq 0x1b6528
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movl $0x169, %edx            # imm = 0x169
callq 0x1045eb
movq 0x78(%rsp), %rdi
callq 0x1afabf
movq 0x28(%rsp), %rdi
callq 0x121e3c
movq 0x20(%rsp), %rdi
callq 0x1713ff
movq 0x68(%rsp), %rdi
callq 0x15bbbb
movq %r12, %rdi
callq 0x1dfa04
callq 0x119160
testb %al, %al
movq 0x18(%rsp), %r14
je 0xc85b1
movq %r14, %rdi
callq 0x1ba0f3
leaq 0x291ded(%rip), %rcx    # 0x35a64f
leaq 0x291deb(%rip), %rsi    # 0x35a654
testb %al, %al
cmovneq %rcx, %rsi
leaq 0x291db7(%rip), %rdi    # 0x35a62d
movq $0x0, 0x8(%rsp)
xorl %eax, %eax
callq 0x17070
movq 0x3f064b(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x28e8ae(%rip), %rsi    # 0x357145
movq 0x38(%rsp), %rdi
callq 0x11ca64
jmp 0xc85b1
callq 0x2006f
callq 0x20036