// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rdi, %r14
leaq 0x1d36b3(%rip), %rsi    # 0x3bc9f0
movl $0xc0, %edi
movl $0x5f, %edx
callq 0x1092b2
movq %rax, %r15
movq %rax, %rbx
callq 0x1208f8
movq %rax, (%r15)
callq 0x1208f8
movq %rax, 0x8(%r15)
movw $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r15)
movups %xmm0, 0x28(%r15)
movq %r14, %rdi
callq 0x120d23
movq %rax, 0x38(%r15)
xorl %r14d, %r14d
movq %r14, 0x40(%r15)
movq %r14, 0x50(%r15)
callq 0x1c3820
movq %rax, 0x78(%r15)
movq $-0x1, 0x68(%r15)
movaps 0x1d363a(%rip), %xmm0   # 0x3bc9e0
movups %xmm0, 0x58(%r15)
movq %r14, 0x70(%r15)
movq %r14, 0x80(%r15)
movq $0x32, 0xb0(%r15)
movq %r14, 0xa8(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%r15)
movups %xmm0, 0x98(%r15)
movq 0x38(%r15), %rdi
leaq 0x17aae3(%rip), %rsi    # 0x363ec9
callq 0x178b0
testq %rax, %rax
movq %r12, 0x18(%rsp)
movq %rax, 0x20(%rsp)
je 0x1e96dd
movq %rax, %r14
callq 0x1208f8
movq %rax, %r13
movq %rax, %rdi
movq %r14, %rsi
callq 0x120e88
cmpl $-0x1, %eax
je 0x1e96f9
movq %r13, %rdi
callq 0x120d23
leaq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %r13, 0x28(%rsp)
movq %r13, %rdi
callq 0x120e13
movq %rax, 0xa8(%rbx)
movl $0x0, 0x4(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movl $0x0, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x1e23de(%rip), %rsi    # 0x3cb848
callq 0x17470
testq %rax, %rax
je 0x1e971d
movq %rax, %r14
testb $0x1, %bpl
jne 0x1e948b
testb $0x1, %r13b
je 0x1e9532
xorl %r12d, %r12d
movq %r14, %rdi
leaq 0x19c19c(%rip), %rsi    # 0x385634
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
setne %al
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
sets %dl
cmpq $0x64, %rcx
setge %sil
andb %bpl, %sil
orb %al, %dl
orb %sil, %dl
cmpq $0x41, %rcx
setge %al
andb %r13b, %al
orb %dl, %al
cmpb $0x1, %al
jne 0x1e9508
testb $0x1, %bpl
leaq 0x174ff2(%rip), %rdx    # 0x35e4d2
leaq 0x1cb027(%rip), %rax    # 0x3b450e
cmovneq %rax, %rdx
movq 0x38(%rbx), %rcx
movq 0x18(%rsp), %rdi
leaq 0x1d3529(%rip), %rsi    # 0x3bca24
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rax
testb $0x1, %bpl
je 0x1e9526
movl $0x64, %ecx
subq %rax, %rcx
movq %rcx, 0x28(%rbx)
xorl %ebp, %ebp
jmp 0x1e96c0
movq %rax, 0x30(%rbx)
xorl %r13d, %r13d
jmp 0x1e96c0
xorl %r12d, %r12d
testb $0x1, 0x4(%rsp)
je 0x1e95a5
movq %r14, %rdi
leaq 0x1d351f(%rip), %rsi    # 0x3bca65
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
je 0x1e9575
xorl %r12d, %r12d
movq %r14, %rdi
leaq 0x1d3500(%rip), %rsi    # 0x3bca64
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
jne 0x1e95a5
xorl %r12d, %r12d
cmpq $0x0, 0x10(%rsp)
jns 0x1e9599
movq 0x18(%rsp), %rdi
leaq 0x1d34e3(%rip), %rsi    # 0x3bca6f
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rax
movq %rax, 0xb0(%rbx)
testb $0x1, 0xc(%rsp)
je 0x1e95c4
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x1209e4
movl $0x0, 0xc(%rsp)
jmp 0x1e96c0
testb $0x1, 0x8(%rsp)
je 0x1e95e4
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x1209e4
movl $0x0, 0x8(%rsp)
jmp 0x1e96c0
movq %r14, %rdi
leaq 0x1d34a4(%rip), %rsi    # 0x3bca92
callq 0x17a40
testl %eax, %eax
je 0x1e96a0
movq %r14, %rdi
leaq 0x1d3491(%rip), %rsi    # 0x3bca96
callq 0x17a40
testl %eax, %eax
je 0x1e96a8
movq %r14, %rdi
leaq 0x1caef1(%rip), %rsi    # 0x3b450d
callq 0x17a40
testl %eax, %eax
je 0x1e96b0
movq %r14, %rdi
leaq 0x1caee7(%rip), %rsi    # 0x3b451a
callq 0x17a40
testl %eax, %eax
je 0x1e96b5
movq %r14, %rdi
leaq 0x1d3455(%rip), %rsi    # 0x3bca9b
callq 0x17a40
testl %eax, %eax
jne 0x1e965b
movb $0x1, 0x10(%rbx)
movl $0x0, 0x4(%rsp)
movq %r14, %rdi
leaq 0x1d343e(%rip), %rsi    # 0x3bcaa3
callq 0x17a40
testl %eax, %eax
jne 0x1e967a
movb $0x1, 0x11(%rbx)
movl $0x0, 0x4(%rsp)
movq %r14, %rdi
leaq 0x1cb319(%rip), %rsi    # 0x3b499d
callq 0x17a40
testl %eax, %eax
movl 0x4(%rsp), %eax
movzbl %al, %eax
movl $0x1, %ecx
cmovel %ecx, %eax
movl %eax, 0x4(%rsp)
jmp 0x1e96c0
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x1e96b8
movb $0x1, %al
movl %eax, 0x8(%rsp)
jmp 0x1e96b8
movb $0x1, %bpl
jmp 0x1e96b8
movb $0x1, %r13b
movl $0x0, 0x4(%rsp)
testl %r12d, %r12d
je 0x1e945e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r13
jmp 0x1e9772
movq 0x38(%rbx), %rdx
leaq 0x1d3325(%rip), %rsi    # 0x3bca0d
xorl %ebp, %ebp
movq %r12, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x1e9813
movq 0x38(%rbx), %rdx
leaq 0x1d33fb(%rip), %rsi    # 0x3bcaff
xorl %ebp, %ebp
movq %r12, %rdi
xorl %eax, %eax
callq 0x1019cf
movq %r13, %rdi
callq 0x121b03
jmp 0x1e9813
movq (%rbx), %rdi
callq 0x120d4c
xorl %ebp, %ebp
testq %rax, %rax
movq 0x18(%rsp), %r14
jne 0x1e9747
leaq 0x1d337c(%rip), %rsi    # 0x3bcab4
movq %r14, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x0, 0x28(%rbx)
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r13
jne 0x1e9772
movq 0x38(%rbx), %rdx
leaq 0x1d3367(%rip), %rsi    # 0x3bcaca
movq %r14, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r13, %rdi
callq 0x121b03
testl %ebp, %ebp
je 0x1e9785
xorl %ebp, %ebp
jmp 0x1e9813
callq 0x1208f8
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x120e88
movb $0x1, %bpl
cmpl $-0x1, %eax
je 0x1e97db
movq %r14, %rdi
callq 0x120d23
movq %rax, %rdi
callq 0x1c362a
movq %rax, %r13
movq %r14, %rdi
callq 0x120db4
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0x120e88
testq %r13, %r13
sete %r12b
cmpl $-0x1, %eax
je 0x1e97e1
testq %r13, %r13
je 0x1e97a0
jmp 0x1e97e1
xorl %r13d, %r13d
movb $0x1, %r12b
movq %r14, %rdi
callq 0x121b03
testb %r12b, %r12b
jne 0x1e9813
movq %r13, %rdi
xorl %esi, %esi
movq 0x18(%rsp), %rdx
callq 0x1c2dbd
movq %rax, 0xa0(%rbx)
testq %rax, %rax
setne %bpl
movq %r13, %rdi
callq 0x121e8b
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1e9822
callq 0x17800
testb %bpl, %bpl
movq 0x18(%rsp), %r12
je 0x1e985e
callq 0xf36ef
movq %rax, %r14
movq %rax, %rdi
callq 0xf6932
movq (%rbx), %rdi
callq 0x120d23
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xf374b
movq %rax, 0x18(%rbx)
testq %rax, %rax
setne %al
jmp 0x1e9863
xorl %r14d, %r14d
xorl %eax, %eax
testb %al, %al
je 0x1e98ff
addq $0x18, %r15
movq 0x8(%rbx), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x1e9896
movq 0x8(%rbx), %rdi
callq 0x120d23
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xf374b
jmp 0x1e989e
movq (%r15), %rdi
callq 0xeef4f
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x1e98f7
movq %r14, %rdi
callq 0xf424d
cmpq $0x0, 0x20(%rbx)
je 0x1e9923
callq 0x1208f8
movq %rax, 0x40(%rbx)
movq $0x0, 0x48(%rbx)
movq 0x38(%rbx), %rdi
leaq 0x1c53ed(%rip), %rsi    # 0x3aecbf
callq 0x178b0
movq %rax, 0x50(%rbx)
testq %rax, %rax
jne 0x1e9911
movq 0x38(%rbx), %rdx
leaq 0x1d3122(%rip), %rsi    # 0x3bca0d
movq %r12, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x1e9907
movq (%r15), %rdi
callq 0xee90c
movq %r14, %rdi
callq 0xf424d
movq %rbx, %rdi
callq 0x1e925c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x76002