// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/match_iterator_open.c
// Function: gt_match_iterator_open_next
static GtMatchIteratorStatus gt_match_iterator_open_next(GtMatchIterator *gmpi,
                                                         GtMatch **match,
                                                         GtError *err)
{
  GtUword columncount = 0;
  int readnums;
  GtWord storeinteger[GT_MATCHITER_READNUMS];
  int had_err = 0, i = 0;
  char buffer[BUFSIZ], seqid1[BUFSIZ], seqid2[BUFSIZ], matchtype;
  GtMatchIteratorOpen *mpi = gt_match_iterator_open_cast(gmpi);
  gt_assert(mpi);

  if (mpi->pvt->matchfilep) {
    while (true) {
      if (fgetc(mpi->pvt->matchfilep) == '#') {
        GT_UNUSED char *l = fgets(buffer, BUFSIZ, mpi->pvt->matchfilep);
        mpi->pvt->curpos++;
      } else break;
    }
    fseek(mpi->pvt->matchfilep, -1, SEEK_CUR);
    readnums = fscanf(mpi->pvt->matchfilep, " " GT_WD " %s " GT_WD " %c " GT_WD
                      " %s " GT_WD " %*d %*e " GT_WD " %*f\n",
                      &storeinteger[0],
                      seqid1,
                      &storeinteger[1],
                      &matchtype,
                      &storeinteger[2],
                      seqid2,
                      &storeinteger[3],
                      &storeinteger[4]);
    if (readnums == EOF)
      return GT_MATCHER_STATUS_END;
    if (readnums != GT_MATCHITER_READNUMS + 3)
    {
      GT_MATCHER_OPEN_CANNOTPARSELINE("invalid format");
      had_err = -1;
    }
  } else {
    while (true) {
      while ((buffer[i] = gt_file_xfgetc(mpi->pvt->gtmatchfilep)) != '\n') {
        if (buffer[i] == EOF)
          return GT_MATCHER_STATUS_END;
        i++;
      }
      buffer[i+1] = '\0';
      if (buffer[0] == '#') {
        mpi->pvt->curpos++;
        i = 0;
      } else break;
    }
    if (sscanf(buffer, " " GT_WD " %s " GT_WD " %*c " GT_WD " %s " GT_WD
               " %*d %*e " GT_WD " %*f\n",
               &storeinteger[0],
               seqid1,
               &storeinteger[1],
               &storeinteger[2],
               seqid2,
               &storeinteger[3],
               &storeinteger[4])
               != GT_MATCHITER_READNUMS + 2) {
      GT_MATCHER_OPEN_CANNOTPARSELINE("invalid format");
      had_err = -1;
    }
  }

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

  if (!had_err) {
    *match = gt_match_open_new(seqid1,
                               seqid2,
                               storeinteger[1],
                               storeinteger[1] + storeinteger[0] - 1,
                               storeinteger[3],
                               storeinteger[3] + storeinteger[2] - 1,
                               storeinteger[4],
                               matchtype == 'D' ? GT_MATCH_DIRECT :
                                                  GT_MATCH_REVERSE);
    mpi->pvt->curpos++;
    return GT_MATCHER_STATUS_OK;
  }
  else {
    return GT_MATCHER_STATUS_ERROR;
  }
}

// Assembly:
pushq %rbx
subq $0x60b0, %rsp           # imm = 0x60B0
movq %rdi, 0x60a0(%rsp)
movq %rsi, 0x6098(%rsp)
movq %rdx, 0x6090(%rsp)
movq $0x0, 0x6088(%rsp)
movl $0x0, 0x604c(%rsp)
movl $0x0, 0x6048(%rsp)
callq 0x1aaa50
movq %rax, %rdi
movq 0x60a0(%rsp), %rsi
callq 0x1a79f0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x1aab2c
movq 0x4914a5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36b50e(%rip), %rsi    # 0x516013
leaq 0x3af0cb(%rip), %rdx    # 0x559bd7
leaq 0x3af0c8(%rip), %rcx    # 0x559bdb
leaq 0x3af06b(%rip), %r8     # 0x559b85
movl $0x46, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1aab2e
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x1aac9f
jmp 0x1aab44
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x19b50
cmpl $0x23, %eax
jne 0x1aab94
leaq 0x4040(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
movl $0x2000, %esi           # imm = 0x2000
callq 0x19b60
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x1aab96
jmp 0x1aab98
jmp 0x1aab44
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x197e0
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x6050(%rsp), %rdx
leaq 0x2040(%rsp), %rcx
leaq 0x6050(%rsp), %r8
addq $0x8, %r8
leaq 0x6050(%rsp), %rbx
addq $0x10, %rbx
leaq 0x40(%rsp), %r11
leaq 0x6050(%rsp), %r10
addq $0x18, %r10
leaq 0x6050(%rsp), %rax
addq $0x20, %rax
leaq 0x3aefe8(%rip), %rsi    # 0x559bf7
leaq 0x3f(%rsp), %r9
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x19db0
movl %eax, 0x6084(%rsp)
cmpl $-0x1, 0x6084(%rsp)
jne 0x1aac4f
movl $0x1, 0x60ac(%rsp)
jmp 0x1aaf63
cmpl $0x8, 0x6084(%rsp)
je 0x1aac9a
movq 0x6090(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdx
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
leaq 0x3aeb94(%rip), %rsi    # 0x559815
leaq 0x3aeba3(%rip), %r8     # 0x55982b
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x604c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1aadfd
jmp 0x1aaca1
jmp 0x1aaca3
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdi
callq 0xddb10
movslq 0x6048(%rsp), %rcx
movb %al, 0x4040(%rsp,%rcx)
movsbl %al, %eax
cmpl $0xa, %eax
je 0x1aad04
movslq 0x6048(%rsp), %rax
movsbl 0x4040(%rsp,%rax), %eax
cmpl $-0x1, %eax
jne 0x1aacf1
movl $0x1, 0x60ac(%rsp)
jmp 0x1aaf63
movl 0x6048(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6048(%rsp)
jmp 0x1aaca3
movl 0x6048(%rsp), %eax
addl $0x1, %eax
cltq
movb $0x0, 0x4040(%rsp,%rax)
movsbl 0x4040(%rsp), %eax
cmpl $0x23, %eax
jne 0x1aad45
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x0, 0x6048(%rsp)
jmp 0x1aad47
jmp 0x1aad4c
jmp 0x1aaca1
leaq 0x4040(%rsp), %rdi
leaq 0x6050(%rsp), %rdx
leaq 0x2040(%rsp), %rcx
leaq 0x6050(%rsp), %r8
addq $0x8, %r8
leaq 0x6050(%rsp), %r9
addq $0x10, %r9
leaq 0x40(%rsp), %r11
leaq 0x6050(%rsp), %r10
addq $0x18, %r10
leaq 0x6050(%rsp), %rax
addq $0x20, %rax
leaq 0x3aee82(%rip), %rsi    # 0x559c22
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x19770
cmpl $0x7, %eax
je 0x1aadfb
movq 0x6090(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdx
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
leaq 0x3aea33(%rip), %rsi    # 0x559815
leaq 0x3aea42(%rip), %r8     # 0x55982b
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x604c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1aadfd
movq $0x0, 0x6088(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x604c(%rsp)
movb %al, 0x27(%rsp)
jne 0x1aae29
cmpq $0x5, 0x6088(%rsp)
setb %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x1aae33
jmp 0x1aaeae
movq 0x6088(%rsp), %rax
cmpq $0x0, 0x6050(%rsp,%rax,8)
jge 0x1aae93
movq 0x6090(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdx
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq 0x6088(%rsp), %r8
addq $0x1, %r8
leaq 0x3ae9c0(%rip), %rsi    # 0x55983a
leaq 0x3ae9db(%rip), %r9     # 0x55985c
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x604c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1aae95
movq 0x6088(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x6088(%rsp)
jmp 0x1aae09
cmpl $0x0, 0x604c(%rsp)
jne 0x1aaf58
leaq 0x2040(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq 0x6058(%rsp), %rdx
movq 0x6058(%rsp), %rcx
addq 0x6050(%rsp), %rcx
subq $0x1, %rcx
movq 0x6068(%rsp), %r8
movq 0x6068(%rsp), %r9
addq 0x6060(%rsp), %r9
subq $0x1, %r9
movq 0x6070(%rsp), %r10
movsbl 0x3f(%rsp), %ebx
movl $0x1, %eax
xorl %r11d, %r11d
cmpl $0x44, %ebx
cmovel %r11d, %eax
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x1abc30
movq %rax, %rcx
movq 0x6098(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x0, 0x60ac(%rsp)
jmp 0x1aaf63
movl $0x2, 0x60ac(%rsp)
movl 0x60ac(%rsp), %eax
addq $0x60b0, %rsp           # imm = 0x60B0
popq %rbx
retq
nopw %cs:(%rax,%rax)