// File: /workspace/github_c_makefile_star2_O2/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 0x1c59aa(%rip), %rsi    # 0x353830
pushq $0x5f
popq %rdx
movl $0xc0, %edi
callq 0x93160
movq %rax, %rbx
callq 0xacb84
movq %rax, (%rbx)
callq 0xacb84
movq %rax, 0x8(%rbx)
andw $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x28(%rbx)
movq %r14, %rdi
callq 0xad1fa
movq %rax, 0x38(%rbx)
andq $0x0, 0x40(%rbx)
andq $0x0, 0x50(%rbx)
callq 0x169e40
movq %rax, 0x78(%rbx)
orq $-0x1, 0x68(%rbx)
movaps 0x1c593e(%rip), %xmm0   # 0x353820
movups %xmm0, 0x58(%rbx)
andq $0x0, 0x70(%rbx)
andq $0x0, 0x80(%rbx)
movq $0x32, 0xb0(%rbx)
andq $0x0, 0xa8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movq 0x38(%rbx), %rdi
leaq 0x16cf0b(%rip), %rsi    # 0x2fae2d
callq 0x17860
testq %rax, %rax
je 0x18e25d
movq %rax, %r12
callq 0xacb84
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0xad4de
cmpl $-0x1, %eax
je 0x18e27a
movq %r12, 0x20(%rsp)
movq %r15, 0x10(%rsp)
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x18(%rsp)
movq %r13, %rdi
callq 0xad1fa
leaq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %r13, 0x28(%rsp)
movq %r13, %rdi
callq 0xad442
movq %rax, 0xa8(%rbx)
xorl %ecx, %ecx
movl $0x0, (%rsp)
movl $0x0, 0x4(%rsp)
xorl %r15d, %r15d
xorl %edx, %edx
xorl %r13d, %r13d
testl %r13d, %r13d
jne 0x18e2e7
movl %edx, %ebp
movl %ecx, %r14d
leaq 0x30(%rsp), %rdi
leaq 0x1d4574(%rip), %rsi    # 0x362530
callq 0x17450
testq %rax, %rax
je 0x18e2a4
movq %rax, %r12
movl %r15d, %eax
orb %r14b, %al
xorl %r13d, %r13d
testb $0x1, %al
je 0x18e071
movq %r12, %rdi
leaq 0x18e6e7(%rip), %rsi    # 0x31c6cf
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x177b0
movq 0x8(%rsp), %rsi
cmpq $0x64, %rsi
setge %dl
cmpq $0x41, %rsi
setge %cl
cmpl $0x1, %eax
jne 0x18e022
testq %rsi, %rsi
js 0x18e022
andb %r15b, %dl
jne 0x18e022
movl %r15d, %eax
notb %al
orb %r14b, %al
andb %cl, %al
je 0x18e053
testb $0x1, %r15b
leaq 0x167485(%rip), %rdx    # 0x2f54b2
leaq 0x1bd277(%rip), %rax    # 0x34b2ab
cmovneq %rax, %rdx
movq 0x38(%rbx), %rcx
movq 0x10(%rsp), %rdi
leaq 0x1c581c(%rip), %rsi    # 0x353864
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
movq 0x8(%rsp), %rax
testb $0x1, %r15b
je 0x18e0fa
pushq $0x64
popq %rcx
subq %rax, %rcx
movq %rcx, 0x28(%rbx)
jmp 0x18e125
testb $0x1, %bpl
je 0x18e0e0
movq %r12, %rdi
leaq 0x1c5824(%rip), %rsi    # 0x3538a5
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x177b0
cmpl $0x1, %eax
je 0x18e0b0
xorl %r13d, %r13d
movq %r12, %rdi
leaq 0x1c5805(%rip), %rsi    # 0x3538a4
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x177b0
cmpl $0x1, %eax
jne 0x18e0e0
movq 0x8(%rsp), %rax
xorl %r13d, %r13d
testq %rax, %rax
jns 0x18e0d9
movq 0x10(%rsp), %rdi
leaq 0x1c57e6(%rip), %rsi    # 0x3538af
xorl %eax, %eax
callq 0x89dbb
movq 0x8(%rsp), %rax
pushq $-0x1
popq %r13
movq %rax, 0xb0(%rbx)
testb $0x1, (%rsp)
je 0x18e103
movq (%rbx), %rdi
movq %r12, %rsi
callq 0xacc8b
movl $0x0, (%rsp)
jmp 0x18e125
movq %rax, 0x30(%rbx)
xorl %r14d, %r14d
jmp 0x18e125
testb $0x1, 0x4(%rsp)
je 0x18e132
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xacc8b
movl $0x0, (%rsp)
movl $0x0, 0x4(%rsp)
xorl %r15d, %r15d
movl %r14d, %ecx
movl %ebp, %edx
jmp 0x18dfa2
movq %r12, %rdi
leaq 0x1c5796(%rip), %rsi    # 0x3538d2
callq 0x179e0
movb $0x1, %cl
movl %ecx, (%rsp)
movl $0x0, 0x4(%rsp)
movl $0x0, %r15d
movl %r14d, %ecx
movl $0x0, %edx
testl %eax, %eax
je 0x18dfa2
movq %r12, %rdi
leaq 0x1c5768(%rip), %rsi    # 0x3538d6
callq 0x179e0
movb $0x1, %cl
movl %ecx, 0x4(%rsp)
movl $0x0, (%rsp)
movl $0x0, %r15d
movl %r14d, %ecx
movl $0x0, %edx
testl %eax, %eax
je 0x18dfa2
movq %r12, %rdi
leaq 0x1bd10a(%rip), %rsi    # 0x34b2aa
callq 0x179e0
movb $0x1, %r15b
movl $0x0, (%rsp)
movl $0x0, 0x4(%rsp)
movl %r14d, %ecx
movl $0x0, %edx
testl %eax, %eax
je 0x18dfa2
movq %r12, %rdi
leaq 0x1bd0e6(%rip), %rsi    # 0x34b2b7
callq 0x179e0
movb $0x1, %cl
movl $0x0, (%rsp)
movl $0x0, 0x4(%rsp)
movl $0x0, %r15d
movl $0x0, %edx
testl %eax, %eax
je 0x18dfa2
movq %r12, %rdi
leaq 0x1c56d7(%rip), %rsi    # 0x3538db
callq 0x179e0
testl %eax, %eax
jne 0x18e213
movb $0x1, 0x10(%rbx)
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x1c56c6(%rip), %rsi    # 0x3538e3
callq 0x179e0
testl %eax, %eax
jne 0x18e22c
movb $0x1, 0x11(%rbx)
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x1bd4bc(%rip), %rsi    # 0x34b6f2
callq 0x179e0
testl %eax, %eax
sete %dl
orb %bpl, %dl
movl $0x0, (%rsp)
movl $0x0, 0x4(%rsp)
xorl %r15d, %r15d
movl %r14d, %ecx
jmp 0x18dfa2
movq 0x38(%rbx), %rdx
leaq 0x1c55e5(%rip), %rsi    # 0x35384d
xorl %r14d, %r14d
movq %r15, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0x18e305
movq 0x38(%rbx), %rdx
leaq 0x1c56ba(%rip), %rsi    # 0x35393f
xorl %r14d, %r14d
movq %r15, %rdi
xorl %eax, %eax
callq 0x89dbb
movq %r13, %rdi
callq 0xae103
movq %r12, %rdi
callq 0x177c0
jmp 0x18e305
movq (%rbx), %rdi
callq 0xad289
xorl %ebp, %ebp
testq %rax, %rax
jne 0x18e2c9
leaq 0x1c563a(%rip), %rsi    # 0x3538f4
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
cmpq $0x0, 0x28(%rbx)
jne 0x18e2ea
movq 0x38(%rbx), %rdx
leaq 0x1c562f(%rip), %rsi    # 0x35390a
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq 0x28(%rsp), %rdi
callq 0xae103
testl %ebp, %ebp
je 0x18e329
movq 0x20(%rsp), %rdi
callq 0x177c0
xorl %r14d, %r14d
movq %r14, %rdi
callq 0x79f01
movq %rbx, %rdi
callq 0x18ddac
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
callq 0xacb84
movq %rax, %r14
movq 0x10(%rsp), %r15
movq 0x20(%rsp), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0xad4de
cmpl $-0x1, %eax
je 0x18e370
testq %r12, %r12
jne 0x18e370
movq %r14, %rdi
callq 0xad1fa
movq %rax, %rdi
callq 0x169bdb
movq %rax, %r12
movq %r14, %rdi
callq 0xad357
jmp 0x18e33e
movq %r14, %rdi
callq 0xae103
testq %r12, %r12
je 0x18e3b1
xorl %r14d, %r14d
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x169261
movq %rax, %r13
movq %rax, 0xa0(%rbx)
movq %r12, %rdi
callq 0xae662
movq %rbp, %rdi
callq 0x177c0
testq %r13, %r13
jne 0x18e3b9
jmp 0x18e305
movq %rbp, %rdi
callq 0x177c0
callq 0x791cd
movq %rax, %r14
movq %rax, %rdi
callq 0x7cee0
movq (%rbx), %rdi
callq 0xad1fa
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x7921d
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x18e305
movq 0x8(%rbx), %rdi
callq 0xad289
testq %rax, %rax
je 0x18e413
movq 0x8(%rbx), %rdi
callq 0xad1fa
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x7921d
jmp 0x18e420
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x73cbe
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x18e47d
movq %r14, %rdi
callq 0x79f01
cmpq $0x0, 0x20(%rbx)
je 0x18e48f
callq 0xacb84
movq %rax, 0x40(%rbx)
andq $0x0, 0x48(%rbx)
movq 0x38(%rbx), %rdi
leaq 0x1b764c(%rip), %rsi    # 0x345a9d
callq 0x17860
movq %rax, 0x50(%rbx)
testq %rax, %rax
jne 0x18e317
movq 0x38(%rbx), %rdx
leaq 0x1c53df(%rip), %rsi    # 0x35384d
movq %r15, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0x18e30d
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x735fd
jmp 0x18e305
movq 0x2a9ad2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x156b73(%rip), %rsi    # 0x2e5013
leaq 0x1c54a9(%rip), %rdx    # 0x353950
leaq 0x1c54b8(%rip), %rcx    # 0x353966
leaq 0x1c537b(%rip), %r8     # 0x353830
movl $0x137, %r9d            # imm = 0x137
xorl %eax, %eax
callq 0x17a50
callq 0x17390