// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/match_iterator_blast.c
// Function: gt_match_iterator_blast_next
static GtMatchIteratorStatus gt_match_iterator_blast_next(GtMatchIterator *mi,
                                                          GtMatch **match,
                                                          GtError *err)
{
  gt_assert(mi);
  GtUword columncount = 0;
  GtWord storeinteger[GT_BLASTITER_READNUMS], tmp;
  double e_value;
  float bitscore, identity;
  bool reverse = false;
  char query_seq[BUFSIZ], db_seq[BUFSIZ], buffer[BUFSIZ];
  int had_err = 0, i = 0, readvalues = 0;
  GtMatchIteratorBlast *mib = gt_match_iterator_blast_cast(mi);

  if (mib->pvt->matchfilep) {
    if (!mib->pvt->process) {
      while (true) {
        if (fgetc(mib->pvt->matchfilep) == '#') {
          GT_UNUSED char *l = fgets(buffer, BUFSIZ, mib->pvt->matchfilep);
          mib->pvt->curpos++;
        } else break;
      }
    }
    if (!mib->pvt->process)
      fseek(mib->pvt->matchfilep, -1, SEEK_CUR);
    readvalues = fscanf(mib->pvt->matchfilep,
                        "%s %s %f " GT_WD " " GT_WD " " GT_WD " " GT_WD " "
                        GT_WD " " GT_WD " " GT_WD " %lg %f\n",
                        query_seq, db_seq, &identity,
                        &storeinteger[0], &storeinteger[5], &storeinteger[6],
                        &storeinteger[1], &storeinteger[2], &storeinteger[3],
                        &storeinteger[4], &e_value, &bitscore);
    if (readvalues == EOF)
      return GT_MATCHER_STATUS_END;
    if (readvalues != GT_BLASTITER_READVALUES)
    {
      GT_MATCHER_BLAST_CANNOTPARSELINE("invalid format");
      had_err = -1;
    }
  } else {
    while (true) {
      while ((buffer[i] = gt_file_xfgetc(mib->pvt->gtmatchfilep)) != '\n') {
        if (buffer[i] == EOF)
          return GT_MATCHER_STATUS_END;
        i++;
      }
      buffer[i+1] = '\0';
      if (buffer[0] == '#') {
        mib->pvt->curpos++;
        i = 0;
      } else break;
    }
    if ((readvalues = sscanf(buffer, "%s %s %f " GT_WD " " GT_WD " " GT_WD " "
                             GT_WD " " GT_WD " " GT_WD " " GT_WD " %lg " "%f\n",
                             query_seq, db_seq, &identity, &storeinteger[0],
                             &storeinteger[5], &storeinteger[6],
                             &storeinteger[1], &storeinteger[2],
                             &storeinteger[3], &storeinteger[4], &e_value,
                             &bitscore)) != GT_BLASTITER_READVALUES) {
      GT_MATCHER_BLAST_CANNOTPARSELINE("invalid format");
      had_err = -1;
    }
  }

  for (columncount = 0; !had_err &&
                        columncount < (GtUword) (GT_BLASTITER_READNUMS);
       columncount++) {
    if (storeinteger[columncount] < 0) {
         GT_MATCHER_BLAST_CANNOTPARSECOLUMN("non-negative integer expected");
          had_err = -1;
     }
   }

  if (!had_err) {
    if (storeinteger[1] > storeinteger[2]) {
      tmp = storeinteger[1];
      gt_assert(!reverse);
      reverse = true;
      storeinteger[1] = storeinteger[2];
      storeinteger[2] = tmp;
    }
    if (storeinteger[3] > storeinteger[4]) {
      tmp = storeinteger[3];
      gt_assert(!reverse);
      reverse = true;
      storeinteger[3] = storeinteger[4];
      storeinteger[4] = tmp;
    }
    *match = gt_match_blast_new_extended(query_seq,
                                         db_seq,
                                         storeinteger[1],
                                         storeinteger[2],
                                         storeinteger[3],
                                         storeinteger[4],
                                         e_value,
                                         bitscore,
                                         storeinteger[0],
                                         identity,
                                         storeinteger[5],
                                         storeinteger[6],
                                         reverse ? GT_MATCH_REVERSE
                                                 : GT_MATCH_DIRECT);
    mib->pvt->curpos++;
    return GT_MATCHER_STATUS_OK;
  }
  else
  {
    return GT_MATCHER_STATUS_ERROR;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60f8, %rsp           # imm = 0x60F8
movq %rdi, 0x60e8(%rsp)
movq %rsi, 0x60e0(%rsp)
movq %rdx, 0x60d8(%rsp)
cmpq $0x0, 0x60e8(%rsp)
jne 0x1a861c
movq 0x4939b5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36da1e(%rip), %rsi    # 0x516013
leaq 0x379551(%rip), %rdx    # 0x521b4d
leaq 0x3b11c8(%rip), %rcx    # 0x5597cb
leaq 0x3b10de(%rip), %r8     # 0x5596e8
movl $0x47, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1a861e
movq $0x0, 0x60d0(%rsp)
movb $0x0, 0x6077(%rsp)
movl $0x0, 0x6c(%rsp)
movl $0x0, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
callq 0x1a7c80
movq %rax, %rdi
movq 0x60e8(%rsp), %rsi
callq 0x1a79f0
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x1a8828
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x20(%rax)
jne 0x1a86dc
jmp 0x1a8689
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x19b50
cmpl $0x23, %eax
jne 0x1a86d6
leaq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
movl $0x2000, %esi           # imm = 0x2000
callq 0x19b60
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x1a86d8
jmp 0x1a86da
jmp 0x1a8689
jmp 0x1a86dc
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x20(%rax)
jne 0x1a8709
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x197e0
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x4070(%rsp), %rdx
leaq 0x2070(%rsp), %rcx
leaq 0x6090(%rsp), %r9
leaq 0x6090(%rsp), %r13
addq $0x28, %r13
leaq 0x6090(%rsp), %r12
addq $0x30, %r12
leaq 0x6090(%rsp), %r15
addq $0x8, %r15
leaq 0x6090(%rsp), %r14
addq $0x10, %r14
leaq 0x6090(%rsp), %rbx
addq $0x18, %rbx
leaq 0x6090(%rsp), %r11
addq $0x20, %r11
leaq 0x3b106b(%rip), %rsi    # 0x5597e8
leaq 0x6078(%rsp), %r8
leaq 0x6080(%rsp), %r10
leaq 0x607c(%rsp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movb $0x0, %al
callq 0x19db0
movl %eax, 0x64(%rsp)
cmpl $-0x1, 0x64(%rsp)
jne 0x1a87de
movl $0x1, 0x60f4(%rsp)
jmp 0x1a8c51
cmpl $0xc, 0x64(%rsp)
je 0x1a8823
movq 0x60d8(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdx
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
leaq 0x3b1008(%rip), %rsi    # 0x559815
leaq 0x3b1017(%rip), %r8     # 0x55982b
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1a89b2
jmp 0x1a882a
jmp 0x1a882c
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdi
callq 0xddb10
movslq 0x68(%rsp), %rcx
movb %al, 0x70(%rsp,%rcx)
movsbl %al, %eax
cmpl $0xa, %eax
je 0x1a887b
movslq 0x68(%rsp), %rax
movsbl 0x70(%rsp,%rax), %eax
cmpl $-0x1, %eax
jne 0x1a886e
movl $0x1, 0x60f4(%rsp)
jmp 0x1a8c51
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0x1a882c
movl 0x68(%rsp), %eax
addl $0x1, %eax
cltq
movb $0x0, 0x70(%rsp,%rax)
movsbl 0x70(%rsp), %eax
cmpl $0x23, %eax
jne 0x1a88b0
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x0, 0x68(%rsp)
jmp 0x1a88b2
jmp 0x1a88b7
jmp 0x1a882a
leaq 0x70(%rsp), %rdi
leaq 0x4070(%rsp), %rdx
leaq 0x2070(%rsp), %rcx
leaq 0x6090(%rsp), %r9
leaq 0x6090(%rsp), %r13
addq $0x28, %r13
leaq 0x6090(%rsp), %r12
addq $0x30, %r12
leaq 0x6090(%rsp), %r15
addq $0x8, %r15
leaq 0x6090(%rsp), %r14
addq $0x10, %r14
leaq 0x6090(%rsp), %rbx
addq $0x18, %rbx
leaq 0x6090(%rsp), %r11
addq $0x20, %r11
leaq 0x3b0ec5(%rip), %rsi    # 0x5597e8
leaq 0x6078(%rsp), %r8
leaq 0x6080(%rsp), %r10
leaq 0x607c(%rsp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movb $0x0, %al
callq 0x19770
movl %eax, 0x64(%rsp)
cmpl $0xc, %eax
je 0x1a89b0
movq 0x60d8(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdx
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
leaq 0x3b0e7b(%rip), %rsi    # 0x559815
leaq 0x3b0e8a(%rip), %r8     # 0x55982b
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1a89b2
movq $0x0, 0x60d0(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x6c(%rsp)
movb %al, 0x4f(%rsp)
jne 0x1a89db
cmpq $0x7, 0x60d0(%rsp)
setb %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x1a89e5
jmp 0x1a8a5d
movq 0x60d0(%rsp), %rax
cmpq $0x0, 0x6090(%rsp,%rax,8)
jge 0x1a8a42
movq 0x60d8(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdx
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq 0x60d0(%rsp), %r8
addq $0x1, %r8
leaq 0x3b0e0e(%rip), %rsi    # 0x55983a
leaq 0x3b0e29(%rip), %r9     # 0x55985c
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1a8a44
movq 0x60d0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60d0(%rsp)
jmp 0x1a89be
cmpl $0x0, 0x6c(%rsp)
jne 0x1a8c46
movq 0x6098(%rsp), %rax
cmpq 0x60a0(%rsp), %rax
jle 0x1a8af6
movq 0x6098(%rsp), %rax
movq %rax, 0x6088(%rsp)
testb $0x1, 0x6077(%rsp)
je 0x1a8acc
movq 0x493505(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36d56e(%rip), %rsi    # 0x516013
leaq 0x3b0dce(%rip), %rdx    # 0x55987a
leaq 0x3b0d18(%rip), %rcx    # 0x5597cb
leaq 0x3b0c2e(%rip), %r8     # 0x5596e8
movl $0x8f, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1a8ace
movb $0x1, 0x6077(%rsp)
movq 0x60a0(%rsp), %rax
movq %rax, 0x6098(%rsp)
movq 0x6088(%rsp), %rax
movq %rax, 0x60a0(%rsp)
movq 0x60a8(%rsp), %rax
cmpq 0x60b0(%rsp), %rax
jle 0x1a8b84
movq 0x60a8(%rsp), %rax
movq %rax, 0x6088(%rsp)
testb $0x1, 0x6077(%rsp)
je 0x1a8b5a
movq 0x493477(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36d4e0(%rip), %rsi    # 0x516013
leaq 0x3b0d40(%rip), %rdx    # 0x55987a
leaq 0x3b0c8a(%rip), %rcx    # 0x5597cb
leaq 0x3b0ba0(%rip), %r8     # 0x5596e8
movl $0x96, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1a8b5c
movb $0x1, 0x6077(%rsp)
movq 0x60b0(%rsp), %rax
movq %rax, 0x60a8(%rsp)
movq 0x6088(%rsp), %rax
movq %rax, 0x60b0(%rsp)
leaq 0x4070(%rsp), %rdi
leaq 0x2070(%rsp), %rsi
movq 0x6098(%rsp), %rdx
movq 0x60a0(%rsp), %rcx
movq 0x60a8(%rsp), %r8
movq 0x60b0(%rsp), %r9
movsd 0x6080(%rsp), %xmm0
movss 0x607c(%rsp), %xmm1
movq 0x6090(%rsp), %rbx
movss 0x6078(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
movq 0x60b8(%rsp), %r11
movq 0x60c0(%rsp), %r10
movb 0x6077(%rsp), %r14b
xorl %eax, %eax
movl $0x1, %ebp
testb $0x1, %r14b
cmovnel %ebp, %eax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x1a72a0
movq %rax, %rcx
movq 0x60e0(%rsp), %rax
movq %rcx, (%rax)
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x0, 0x60f4(%rsp)
jmp 0x1a8c51
movl $0x2, 0x60f4(%rsp)
movl 0x60f4(%rsp), %eax
addq $0x60f8, %rsp           # imm = 0x60F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)