// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x1d38eb(%rip), %rsi    # 0x3b33d0
movl $0xc0, %edi
movl $0x5f, %edx
callq 0x104226
movq %rax, %rbx
callq 0x11ac6c
movq %rax, (%rbx)
callq 0x11ac6c
movq %rax, 0x8(%rbx)
movw $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x28(%rbx)
movq %r14, %rdi
callq 0x11b0a1
movq %rax, 0x38(%rbx)
xorl %r14d, %r14d
movq %r14, 0x40(%rbx)
movq %r14, 0x50(%rbx)
callq 0x1baabc
movq %rax, 0x78(%rbx)
movq $-0x1, 0x68(%rbx)
movaps 0x1d3878(%rip), %xmm0   # 0x3b33c0
movups %xmm0, 0x58(%rbx)
movq %r14, 0x70(%rbx)
movq %r14, 0x80(%rbx)
movq $0x32, 0xb0(%rbx)
movq %r14, 0xa8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movq 0x38(%rbx), %rdi
leaq 0x17b2d0(%rip), %rsi    # 0x35ae55
callq 0x178b0
testq %rax, %rax
je 0x1dfe78
movq %rax, %r12
callq 0x11ac6c
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x11b1ff
cmpl $-0x1, %eax
je 0x1dfe95
movq %r12, 0x18(%rsp)
movq %r15, 0x10(%rsp)
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x20(%rsp)
movq %r13, %rdi
callq 0x11b0a1
leaq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %r13, 0x28(%rsp)
movq %r13, %rdi
callq 0x11b191
movq %rax, 0xa8(%rbx)
xorl %r14d, %r14d
movl $0x0, (%rsp)
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
xorl %r15d, %r15d
leaq 0x30(%rsp), %rdi
leaq 0x1e2510(%rip), %rsi    # 0x3c2120
callq 0x17470
testq %rax, %rax
je 0x1dfec2
movq %rax, %r12
movl %r13d, %eax
orb %r14b, %al
xorl %ebp, %ebp
testb $0x1, %al
je 0x1dfcc7
movq %r12, %rdi
leaq 0x19c689(%rip), %rsi    # 0x37c2c4
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
movq 0x8(%rsp), %rsi
cmpq $0x64, %rsi
setge %dl
cmpq $0x41, %rsi
setge %cl
cmpl $0x1, %eax
jne 0x1dfc75
testq %rsi, %rsi
js 0x1dfc75
andb %r13b, %dl
jne 0x1dfc75
movl %r13d, %eax
notb %al
orb %r14b, %al
andb %cl, %al
je 0x1dfca7
testb $0x1, %r13b
leaq 0x175822(%rip), %rdx    # 0x3554a2
leaq 0x1cb277(%rip), %rax    # 0x3aaefe
cmovneq %rax, %rdx
movq 0x38(%rbx), %rcx
movq 0x10(%rsp), %rdi
leaq 0x1d3769(%rip), %rsi    # 0x3b3404
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rax
testb $0x1, %r13b
je 0x1dfd4b
movl $0x64, %ecx
subq %rax, %rcx
movq %rcx, 0x28(%rbx)
jmp 0x1dfd72
testb $0x1, (%rsp)
je 0x1dfd35
movq %r12, %rdi
leaq 0x1d376e(%rip), %rsi    # 0x3b3445
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
je 0x1dfd05
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x1d3750(%rip), %rsi    # 0x3b3444
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
jne 0x1dfd35
movq 0x8(%rsp), %rax
xorl %ebp, %ebp
testq %rax, %rax
jns 0x1dfd2e
movq 0x10(%rsp), %rdi
leaq 0x1d3732(%rip), %rsi    # 0x3b344f
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rax
movq %rax, 0xb0(%rbx)
testb $0x1, %r15b
je 0x1dfd54
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x11ad62
xorl %r15d, %r15d
jmp 0x1dfd72
movq %rax, 0x30(%rbx)
xorl %r14d, %r14d
jmp 0x1dfd72
testb $0x1, 0x4(%rsp)
je 0x1dfd82
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x11ad62
xorl %r15d, %r15d
movl $0x0, 0x4(%rsp)
xorl %r13d, %r13d
testl %ebp, %ebp
je 0x1dfc04
jmp 0x1dffbb
movq %r12, %rdi
leaq 0x1d36e6(%rip), %rsi    # 0x3b3472
callq 0x17a40
testl %eax, %eax
je 0x1dfe3b
movq %r12, %rdi
leaq 0x1d36d3(%rip), %rsi    # 0x3b3476
callq 0x17a40
testl %eax, %eax
je 0x1dfe48
movq %r12, %rdi
leaq 0x1cb143(%rip), %rsi    # 0x3aaefd
callq 0x17a40
testl %eax, %eax
je 0x1dfe60
movq %r12, %rdi
leaq 0x1cb139(%rip), %rsi    # 0x3aaf0a
callq 0x17a40
testl %eax, %eax
je 0x1dfe70
movq %r12, %rdi
leaq 0x1d3693(%rip), %rsi    # 0x3b347b
callq 0x17a40
testl %eax, %eax
jne 0x1dfdfc
movb $0x1, 0x10(%rbx)
movl $0x0, (%rsp)
movq %r12, %rdi
leaq 0x1d367d(%rip), %rsi    # 0x3b3483
callq 0x17a40
testl %eax, %eax
jne 0x1dfe1a
movb $0x1, 0x11(%rbx)
movl $0x0, (%rsp)
movq %r12, %rdi
leaq 0x1cb569(%rip), %rsi    # 0x3ab38d
callq 0x17a40
testl %eax, %eax
sete %al
movl (%rsp), %ecx
orb %al, %cl
movl %ecx, (%rsp)
jmp 0x1dfd67
movb $0x1, %r15b
movl $0x0, 0x4(%rsp)
jmp 0x1dfe51
movb $0x1, %al
movl %eax, 0x4(%rsp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movl $0x0, (%rsp)
jmp 0x1dfd75
movb $0x1, %r13b
xorl %r15d, %r15d
movl $0x0, 0x4(%rsp)
jmp 0x1dfe54
movb $0x1, %r14b
xorl %r15d, %r15d
jmp 0x1dfe3e
movq 0x38(%rbx), %rdx
leaq 0x1d356a(%rip), %rsi    # 0x3b33ed
xorl %r14d, %r14d
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x1dffd5
movq 0x38(%rbx), %rdx
leaq 0x1d363f(%rip), %rsi    # 0x3b34df
xorl %r14d, %r14d
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
movq %r13, %rdi
callq 0x11bdbf
movq %r12, %rdi
callq 0x17800
jmp 0x1dffd5
movq (%rbx), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x1dff84
cmpq $0x0, 0x28(%rbx)
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %rbp
je 0x1dffa6
movq 0x28(%rsp), %rdi
callq 0x11bdbf
callq 0x11ac6c
movq %rax, %r14
movq %rax, %rdi
movq %rbp, %rsi
callq 0x11b1ff
cmpl $-0x1, %eax
je 0x1dfff9
movq %r14, %rdi
callq 0x11b0a1
movq %rax, %rdi
callq 0x1ba8da
movq %rax, %r12
movq %r14, %rdi
callq 0x11b132
movq %r14, %rdi
movq %rbp, %rsi
callq 0x11b1ff
cmpl $-0x1, %eax
je 0x1dff3e
testq %r12, %r12
je 0x1dff0e
movq %r14, %rdi
callq 0x11bdbf
testq %r12, %r12
je 0x1e0001
xorl %r14d, %r14d
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1ba11e
movq %rax, %r13
movq %rax, 0xa0(%rbx)
movq %r12, %rdi
callq 0x11c144
movq %rbp, %rdi
callq 0x17800
testq %r13, %r13
jne 0x1e0009
jmp 0x1dffd5
leaq 0x1d3509(%rip), %rsi    # 0x3b3494
movq 0x10(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
cmpq $0x0, 0x28(%rbx)
movq 0x18(%rsp), %r14
jne 0x1dffc0
movq 0x38(%rbx), %rdx
leaq 0x1d34f9(%rip), %rsi    # 0x3b34aa
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
movq 0x18(%rsp), %r14
movq 0x28(%rsp), %rdi
callq 0x11bdbf
movq %r14, %rdi
callq 0x17800
xorl %r14d, %r14d
movq %r14, %rdi
callq 0xefbe3
movq %rbx, %rdi
callq 0x1dfa04
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x11bdbf
movq %rbp, %rdi
callq 0x17800
callq 0xef0cd
movq %rax, %r14
movq %rax, %rdi
callq 0xf22f1
movq (%rbx), %rdi
callq 0x11b0a1
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0xef129
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x1dffd5
movq 0x8(%rbx), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x1e005f
movq 0x8(%rbx), %rdi
callq 0x11b0a1
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0xef129
jmp 0x1e006c
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0xea9be
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x1e00cc
movq %r14, %rdi
callq 0xefbe3
cmpq $0x0, 0x20(%rbx)
je 0x1e00de
callq 0x11ac6c
movq %rax, 0x40(%rbx)
movq $0x0, 0x48(%rbx)
movq 0x38(%rbx), %rdi
leaq 0x1c567d(%rip), %rsi    # 0x3a571d
callq 0x178b0
movq %rax, 0x50(%rbx)
testq %rax, %rax
jne 0x1dffe7
movq 0x38(%rbx), %rdx
leaq 0x1d3330(%rip), %rsi    # 0x3b33ed
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x1dffdd
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0xea375
jmp 0x1dffd5
callq 0x74375