// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/seed-extend-iter.c
// Function: gt_seedextend_match_iterator_new
GtSeedextendMatchIterator *gt_seedextend_match_iterator_new(
                                            const GtStr *matchfilename,
                                            GtError *err)
{
  FILE *defline_infp;
  int had_err = 0;
  GtSeedextendMatchIterator *semi = gt_malloc(sizeof *semi);
  GtEncseqLoader *encseq_loader = NULL;

  semi->ii = gt_str_new(),
  semi->qii = gt_str_new();
  semi->mirror = false;
  semi->bias_parameters = false;
  semi->aencseq = semi->bencseq = NULL;
  semi->errorpercentage = 0;
  semi->history_size = 0;
  semi->matchfilename = gt_str_get(matchfilename);
  semi->line_buffer = NULL;
  semi->inputfileptr = NULL;
  semi->querymatchptr = gt_querymatch_new();
  semi->currentmatchindex = GT_UWORD_MAX;
  semi->evalue = DBL_MAX;
  semi->bitscore = DBL_MAX;
  semi->currentmatch = NULL;
  semi->querymatchoutoptions = NULL;
  semi->in_display_flag = NULL;
  semi->trace_delta = GT_SEED_EXTEND_DEFAULT_TRACE_DELTA;
  semi->saved_options_line = NULL;
  GT_INITARRAY(&semi->querymatch_table,GtQuerymatch);
  defline_infp = fopen(semi->matchfilename, "r");
  if (defline_infp == NULL)
  {
    gt_error_set(err, "file %s does not exist", semi->matchfilename);
    had_err = -1;
  }
  if (!had_err)
  {
    GtStr *options_line_buffer = gt_str_new();
    /* read first line and evaluate tokens */
    if (gt_str_read_next_line(options_line_buffer,defline_infp) != EOF)
    {
      char *tok, *line_ptr = gt_str_get(options_line_buffer);
      bool parse_ii = false, parse_qii = false, parse_minid = false,
           parse_history = false, parse_outfmt = false;

      semi->saved_options_line = gt_str_clone(options_line_buffer);
      while (!had_err && (tok = strsep(&line_ptr," ")) != NULL)
      {
        if (parse_minid || parse_history)
        {
          GtWord readgtword;

          if (sscanf(tok,GT_WD,&readgtword) != 1 ||
              readgtword < 0  || (parse_minid && readgtword > 99) ||
              (parse_history && readgtword > 64))
          {
            gt_error_set(err,"cannot parse argument for option -%s from "
                             "first line of file %s",
                             parse_minid ? "minidentity"
                                         : "history",
                             semi->matchfilename);
            had_err = -1;
          }
          if (parse_minid)
          {
            semi->errorpercentage = 100 - readgtword;
            parse_minid = false;
          } else
          {
            semi->history_size = (GtUword) readgtword;
            parse_history = false;
          }
          continue;
        }
        if (parse_outfmt)
        {
          GtWord this_trace_delta;

          if (sscanf(tok,"trace=" GT_WD,&this_trace_delta) == 1 ||
              sscanf(tok,"dtrace=" GT_WD,&this_trace_delta) == 1)
          {
            if (this_trace_delta < 0)
            {
              gt_error_set(err,"value of trace= cannot be negative");
              had_err = -1;
            }
            semi->trace_delta = (GtUword) this_trace_delta;
          }
        }
        if (parse_ii)
        {
          gt_str_set(semi->ii, tok);
          parse_ii = false;
          continue;
        }
        if (parse_qii)
        {
          gt_str_set(semi->qii, tok);
          parse_qii = false;
          continue;
        }
        if (strcmp(tok, "-ii") == 0)
        {
          parse_ii = true;
          parse_outfmt = false;
          continue;
        }
        if (strcmp(tok, "-qii") == 0)
        {
          parse_qii = true;
          parse_outfmt = false;
          continue;
        }
        if (strcmp(tok, "-minidentity") == 0)
        {
          parse_minid = true;
          parse_outfmt = false;
          continue;
        }
        if (strcmp(tok, "-history") == 0)
        {
          parse_history = true;
          parse_outfmt = false;
          continue;
        }
        if (strcmp(tok, "-mirror") == 0)
        {
          parse_outfmt = false;
          semi->mirror = true; /* found -mirror option */
        }
        if (strcmp(tok, "-bias-parameters") == 0)
        {
          parse_outfmt = false;
          semi->bias_parameters = true;
        }
        if (strcmp(tok, "-outfmt") == 0)
        {
          parse_outfmt = true;
        }
      }
      if (!had_err)
      {
        if (gt_str_length(semi->ii) == 0UL)
        {
          gt_error_set(err, "missing option string");
          had_err = -1;
        }
        if (semi->errorpercentage == 0)
        {
          gt_error_set(err,"missing option -minidentity in first line of file "
                           "%s",semi->matchfilename);
          had_err = -1;
        }
      }
    } else
    {
      gt_error_set(err, "file %s is empty", semi->matchfilename);
      had_err = -1;
    };
    gt_str_delete(options_line_buffer);
  }
  if (!had_err)
  {
    GtStr *fieldsline_buffer = gt_str_new();
    GtStrArray *fields = NULL;

    while (gt_str_read_next_line(fieldsline_buffer,defline_infp) != EOF &&
           fields == NULL)
    {
      char *line_ptr = gt_str_get(fieldsline_buffer);
      fields = gt_querymatch_read_Fields_line(line_ptr);

      gt_str_reset(fieldsline_buffer);
    }
    gt_str_delete(fieldsline_buffer);
    if (fields != NULL)
    {
      const GtSeedExtendDisplaySetMode setmode = GT_SEED_EXTEND_DISPLAY_SET_NO;

      semi->in_display_flag = gt_querymatch_display_flag_new(fields,setmode,
                                                             err);
      if (semi->in_display_flag == NULL)
      {
        had_err = -1;
      }
      gt_str_array_delete(fields);
    }
  }
  if (defline_infp != NULL)
  {
    fclose(defline_infp);
  }
  /* Load encseqs */
  if (!had_err)
  {
    encseq_loader = gt_encseq_loader_new();
    gt_encseq_loader_enable_autosupport(encseq_loader);
    semi->aencseq
      = gt_encseq_loader_load(encseq_loader, gt_str_get(semi->ii), err);
    if (semi->aencseq == NULL)
    {
      had_err = -1;
    }
  }
  if (!had_err)
  {
    if (gt_str_length(semi->qii) != 0)
    {
      semi->bencseq
        = gt_encseq_loader_load(encseq_loader, gt_str_get(semi->qii), err);
    } else {
      semi->bencseq = gt_encseq_ref(semi->aencseq);
    }
    if (semi->bencseq == NULL)
    {
      had_err = -1;
      gt_encseq_delete(semi->aencseq);
    }
  }
  gt_encseq_loader_delete(encseq_loader);
  if (!had_err)
  {
    gt_assert(semi->bencseq != NULL);
    semi->line_buffer = gt_str_new();
    semi->linenum = 0;
    semi->inputfileptr = fopen(semi->matchfilename, "rb");
    if (semi->inputfileptr == NULL)
    {
      gt_error_set(err, "file %s does not exist", semi->matchfilename);
      had_err = true;
    }
  }
  if (had_err)
  {
    gt_seedextend_match_iterator_delete(semi);
    return NULL;
  }
  return semi;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movl $0x0, 0x74(%rsp)
movl $0xc0, %edi
leaq 0x2dc3af(%rip), %rsi    # 0x58622a
movl $0x5f, %edx
callq 0xe80f0
movq %rax, 0x68(%rsp)
movq $0x0, 0x60(%rsp)
callq 0x11d4a0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
callq 0x11d4a0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x68(%rsp), %rax
movb $0x0, 0x10(%rax)
movq 0x68(%rsp), %rax
movb $0x0, 0x11(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x88(%rsp), %rdi
callq 0x11dee0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x50(%rax)
callq 0x267320
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x78(%rax)
movq 0x68(%rsp), %rax
movq $-0x1, 0x68(%rax)
movq 0x68(%rsp), %rax
movsd 0x26edf8(%rip), %xmm0   # 0x518d50
movsd %xmm0, 0x58(%rax)
movq 0x68(%rsp), %rax
movsd 0x26ede6(%rip), %xmm0   # 0x518d50
movsd %xmm0, 0x60(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x80(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0xa0(%rax)
movq 0x68(%rsp), %rax
movq $0x32, 0xb0(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0xa8(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x88(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x98(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x90(%rax)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rdi
leaq 0x281fde(%rip), %rsi    # 0x52bfda
callq 0x19800
movq %rax, 0x78(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x2aa035
movq 0x80(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rdx
leaq 0x2dc221(%rip), %rsi    # 0x586247
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x74(%rsp)
jne 0x2aa409
callq 0x11d4a0
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x11e3a0
cmpl $-0x1, %eax
je 0x2aa3d8
movq 0x58(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x48(%rsp)
movb $0x0, 0x47(%rsp)
movb $0x0, 0x46(%rsp)
movb $0x0, 0x45(%rsp)
movb $0x0, 0x44(%rsp)
movb $0x0, 0x43(%rsp)
movq 0x58(%rsp), %rdi
callq 0x11e280
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0xa8(%rax)
xorl %eax, %eax
cmpl $0x0, 0x74(%rsp)
movb %al, 0x13(%rsp)
jne 0x2aa0d1
leaq 0x48(%rsp), %rdi
leaq 0x2eb3c3(%rip), %rsi    # 0x59547f
callq 0x19430
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0x13(%rsp)
movb 0x13(%rsp), %al
testb $0x1, %al
jne 0x2aa0de
jmp 0x2aa369
testb $0x1, 0x45(%rsp)
jne 0x2aa0f0
testb $0x1, 0x44(%rsp)
je 0x2aa1ac
movq 0x50(%rsp), %rdi
leaq 0x2a4773(%rip), %rsi    # 0x54e86f
leaq 0x38(%rsp), %rdx
movb $0x0, %al
callq 0x19770
cmpl $0x1, %eax
jne 0x2aa133
cmpq $0x0, 0x38(%rsp)
jl 0x2aa133
testb $0x1, 0x45(%rsp)
je 0x2aa124
cmpq $0x63, 0x38(%rsp)
jg 0x2aa133
testb $0x1, 0x44(%rsp)
je 0x2aa173
cmpq $0x40, 0x38(%rsp)
jle 0x2aa173
movq 0x80(%rsp), %rdi
movb 0x45(%rsp), %cl
leaq 0x27c41c(%rip), %rdx    # 0x526562
leaq 0x2d3855(%rip), %rax    # 0x57d9a2
testb $0x1, %cl
cmovneq %rax, %rdx
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rcx
leaq 0x2dc0fa(%rip), %rsi    # 0x58625e
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
testb $0x1, 0x45(%rsp)
je 0x2aa194
movl $0x64, %ecx
subq 0x38(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x28(%rax)
movb $0x0, 0x45(%rsp)
jmp 0x2aa1a7
movq 0x38(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x30(%rax)
movb $0x0, 0x44(%rsp)
jmp 0x2aa0a3
testb $0x1, 0x43(%rsp)
je 0x2aa226
movq 0x50(%rsp), %rdi
leaq 0x2dc0e0(%rip), %rsi    # 0x58629f
leaq 0x30(%rsp), %rdx
movb $0x0, %al
callq 0x19770
cmpl $0x1, %eax
je 0x2aa1ed
movq 0x50(%rsp), %rdi
leaq 0x2dc0c2(%rip), %rsi    # 0x58629e
leaq 0x30(%rsp), %rdx
movb $0x0, %al
callq 0x19770
cmpl $0x1, %eax
jne 0x2aa224
cmpq $0x0, 0x30(%rsp)
jge 0x2aa213
movq 0x80(%rsp), %rdi
leaq 0x2dc0a5(%rip), %rsi    # 0x5862a9
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movq 0x30(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0xb0(%rax)
jmp 0x2aa226
testb $0x1, 0x47(%rsp)
je 0x2aa249
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x50(%rsp), %rsi
callq 0x11d650
movb $0x0, 0x47(%rsp)
jmp 0x2aa0a3
testb $0x1, 0x46(%rsp)
je 0x2aa26d
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x50(%rsp), %rsi
callq 0x11d650
movb $0x0, 0x46(%rsp)
jmp 0x2aa0a3
movq 0x50(%rsp), %rdi
leaq 0x2dc053(%rip), %rsi    # 0x5862cc
callq 0x19980
cmpl $0x0, %eax
jne 0x2aa292
movb $0x1, 0x47(%rsp)
movb $0x0, 0x43(%rsp)
jmp 0x2aa0a3
movq 0x50(%rsp), %rdi
leaq 0x2dc032(%rip), %rsi    # 0x5862d0
callq 0x19980
cmpl $0x0, %eax
jne 0x2aa2b7
movb $0x1, 0x46(%rsp)
movb $0x0, 0x43(%rsp)
jmp 0x2aa0a3
movq 0x50(%rsp), %rdi
leaq 0x2d36de(%rip), %rsi    # 0x57d9a1
callq 0x19980
cmpl $0x0, %eax
jne 0x2aa2dc
movb $0x1, 0x45(%rsp)
movb $0x0, 0x43(%rsp)
jmp 0x2aa0a3
movq 0x50(%rsp), %rdi
leaq 0x2d36c6(%rip), %rsi    # 0x57d9ae
callq 0x19980
cmpl $0x0, %eax
jne 0x2aa301
movb $0x1, 0x44(%rsp)
movb $0x0, 0x43(%rsp)
jmp 0x2aa0a3
movq 0x50(%rsp), %rdi
leaq 0x2dbfc8(%rip), %rsi    # 0x5862d5
callq 0x19980
cmpl $0x0, %eax
jne 0x2aa325
movb $0x0, 0x43(%rsp)
movq 0x68(%rsp), %rax
movb $0x1, 0x10(%rax)
movq 0x50(%rsp), %rdi
leaq 0x2dbfac(%rip), %rsi    # 0x5862dd
callq 0x19980
cmpl $0x0, %eax
jne 0x2aa349
movb $0x0, 0x43(%rsp)
movq 0x68(%rsp), %rax
movb $0x1, 0x11(%rax)
movq 0x50(%rsp), %rdi
leaq 0x2d3b2d(%rip), %rsi    # 0x57de82
callq 0x19980
cmpl $0x0, %eax
jne 0x2aa364
movb $0x1, 0x43(%rsp)
jmp 0x2aa0a3
cmpl $0x0, 0x74(%rsp)
jne 0x2aa3d6
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
jne 0x2aa3a1
movq 0x80(%rsp), %rdi
leaq 0x2dbf5c(%rip), %rsi    # 0x5862ee
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movq 0x68(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x2aa3d4
movq 0x80(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rdx
leaq 0x2dbf3f(%rip), %rsi    # 0x586304
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x2aa3d6
jmp 0x2aa3ff
movq 0x80(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rdx
leaq 0x2dbf49(%rip), %rsi    # 0x586339
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movq 0x58(%rsp), %rdi
callq 0x11f560
cmpl $0x0, 0x74(%rsp)
jne 0x2aa4e4
callq 0x11d4a0
movq %rax, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x11e3a0
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
movb %al, 0x12(%rsp)
je 0x2aa450
cmpq $0x0, 0x20(%rsp)
sete %al
movb %al, 0x12(%rsp)
movb 0x12(%rsp), %al
testb $0x1, %al
jne 0x2aa45a
jmp 0x2aa484
movq 0x28(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x266e50
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0x11e110
jmp 0x2aa427
movq 0x28(%rsp), %rdi
callq 0x11f560
cmpq $0x0, 0x20(%rsp)
je 0x2aa4e2
movl $0x0, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movq 0x80(%rsp), %rdx
xorl %esi, %esi
callq 0x265d50
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0xa0(%rax)
movq 0x68(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
jne 0x2aa4d8
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rdi
callq 0x11fd20
jmp 0x2aa4e4
cmpq $0x0, 0x78(%rsp)
je 0x2aa4f6
movq 0x78(%rsp), %rdi
callq 0x19780
cmpl $0x0, 0x74(%rsp)
jne 0x2aa55f
callq 0xb7a40
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
callq 0xba590
movq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x80(%rsp), %rdx
callq 0xb7aa0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x68(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2aa55d
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x2aa55f
cmpl $0x0, 0x74(%rsp)
jne 0x2aa5f5
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
je 0x2aa5b7
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x80(%rsp), %rdx
callq 0xb7aa0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x2aa5d1
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xaebc0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x68(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x2aa5f3
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xae070
jmp 0x2aa5f5
movq 0x60(%rsp), %rdi
callq 0xb7e50
cmpl $0x0, 0x74(%rsp)
jne 0x2aa6c6
jmp 0x2aa60c
movq 0x68(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x2aa650
movq 0x391981(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x26b9ea(%rip), %rsi    # 0x516013
leaq 0x2dbd1a(%rip), %rdx    # 0x58634a
leaq 0x2dbd29(%rip), %rcx    # 0x586360
leaq 0x2dbbec(%rip), %r8     # 0x58622a
movl $0x137, %r9d            # imm = 0x137
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2aa652
callq 0x11d4a0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x48(%rax)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rdi
leaq 0x2cd865(%rip), %rsi    # 0x577ee5
callq 0x19800
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x68(%rsp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x2aa6c4
movq 0x80(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rdx
leaq 0x2dbb92(%rip), %rsi    # 0x586247
movb $0x0, %al
callq 0xd88c0
movl $0x1, 0x74(%rsp)
jmp 0x2aa6c6
cmpl $0x0, 0x74(%rsp)
je 0x2aa6e5
movq 0x68(%rsp), %rdi
callq 0x2a9d30
movq $0x0, 0x90(%rsp)
jmp 0x2aa6f2
movq 0x68(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)