// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/ft-eoplist.c
// Function: gt_eoplist_reader_next_cigar
bool gt_eoplist_reader_next_cigar(GtCigarOp *cigar_op,
                                  GtEoplistReader *eoplist_reader,
                                  bool distinguish_mismatch_match)
{
  if (eoplist_reader->currenteop == NULL ||
      eoplist_reader->currenteop == eoplist_reader->endeoplist)
  {
    return false;
  }
  gt_assert(eoplist_reader->difference == 1 ||
            eoplist_reader->difference == -1);
  cigar_op->eoptype = GtUndefinedOp;
  cigar_op->iteration = 0;
  while (true)
  {
    if (cigar_op->iteration > 0)
    {
      switch (*eoplist_reader->currenteop)
      {
        case FT_EOPCODE_DELETION:
          gt_assert(cigar_op->eoptype != GtUndefinedOp);
          if (cigar_op->eoptype == GtDeletionOp)
          {
            cigar_op->iteration++; /* Add another consecutive deletion */
            eoplist_reader->currenteop += eoplist_reader->difference;
            break;
          }
          return true;
        case FT_EOPCODE_INSERTION:
          gt_assert(cigar_op->eoptype != GtUndefinedOp);
          if (cigar_op->eoptype == GtInsertionOp)
          {
            cigar_op->iteration++; /* Add another consecutive insertion */
            eoplist_reader->currenteop += eoplist_reader->difference;
            break;
          }
          return true;
       case FT_EOPCODE_MISMATCH:
          gt_assert(cigar_op->eoptype != GtUndefinedOp);
          if (distinguish_mismatch_match)
          {
            if (cigar_op->eoptype == GtMismatchOp)
            {
              cigar_op->iteration++; /* Add another consecutive mismatch */
              eoplist_reader->currenteop += eoplist_reader->difference;
              break;
            }
            return true;
          }
          if (cigar_op->eoptype == GtMatchOp)
          {
            cigar_op->iteration++; /* Add another consecutive match */
            eoplist_reader->currenteop += eoplist_reader->difference;
            break;
          }
          return true;
       default:
          if (cigar_op->eoptype == GtMatchOp)
          {
            gt_assert(*eoplist_reader->currenteop < FT_EOPCODE_MAXMATCHES);
            cigar_op->iteration += (1UL + *eoplist_reader->currenteop);
            eoplist_reader->currenteop += eoplist_reader->difference;
          } else
          {
            return true;
          }
      }
    } else
    {
      switch (*eoplist_reader->currenteop)
      {
        case FT_EOPCODE_DELETION:
          cigar_op->eoptype = GtDeletionOp;
          cigar_op->iteration = 1UL;
          break;
        case FT_EOPCODE_INSERTION:
          cigar_op->eoptype = GtInsertionOp;
          cigar_op->iteration = 1UL;
          break;
        case FT_EOPCODE_MISMATCH:
          cigar_op->eoptype
            = distinguish_mismatch_match ? GtMismatchOp : GtMatchOp;
          cigar_op->iteration = 1UL;
          break;
        default:
          cigar_op->eoptype = GtMatchOp;
          cigar_op->iteration = (1UL + *eoplist_reader->currenteop);
          break;
      }
      eoplist_reader->currenteop += eoplist_reader->difference;
    }
    if (eoplist_reader->currenteop == eoplist_reader->endeoplist)
    {
      return true;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rsi), %rax
testq %rax, %rax
je 0x3181cf
movq 0x8(%rsi), %rcx
cmpq %rcx, %rax
je 0x3181cf
movslq 0x10(%rsi), %r8
cmpq $-0x1, %r8
je 0x318066
cmpl $0x1, %r8d
jne 0x3181f9
movl $0x4, (%rdi)
movq $0x0, 0x8(%rdi)
movzbl %dl, %r9d
xorl $0x3, %r9d
movl $0x4, %r11d
xorl %r10d, %r10d
movl $0x4, %ebx
movl $0x4, %ebp
movl $0x4, %r14d
movzbl (%rax), %r15d
testq %r10, %r10
je 0x3180ca
cmpq $0xfd, %r15
je 0x318116
cmpl $0xff, %r15d
je 0x318108
cmpl $0xfe, %r15d
jne 0x31813d
testl %ebx, %ebx
jne 0x3181e8
incq %r10
jmp 0x3180fc
cmpq $0xfd, %r15
je 0x318173
cmpl $0xff, %r15d
je 0x31814f
cmpl $0xfe, %r15d
jne 0x31818a
movl $0x0, (%rdi)
xorl %r11d, %r11d
movl $0x1, %r10d
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r14d, %r14d
jmp 0x3181b8
cmpl $0x1, %ebp
jne 0x3181dc
incq %r10
jmp 0x318166
cmpl $0x4, %r14d
je 0x3181f4
testb %dl, %dl
je 0x3181a9
cmpl $0x2, %r14d
jne 0x3181cb
incq %r10
movl $0x2, %r14d
jmp 0x3181b8
cmpl $0x3, %r11d
jne 0x3181cb
addq %r15, %r10
incq %r10
jmp 0x318197
movl $0x1, (%rdi)
movl $0x1, %r11d
movl $0x1, %r10d
movl $0x1, %ebx
movl $0x1, %ebp
movl $0x1, %r14d
jmp 0x3181b8
movl %r9d, (%rdi)
movl $0x1, %r10d
movl %r9d, %r11d
movl %r9d, %ebx
movl %r9d, %ebp
movl %r9d, %r14d
jmp 0x3181b8
movl $0x3, (%rdi)
movzbl (%rax), %r10d
incq %r10
movl $0x3, %r11d
movl $0x3, %ebx
movl $0x3, %ebp
jmp 0x3181b2
cmpl $0x3, %r14d
jne 0x3181cb
incq %r10
movl $0x3, %r14d
movq %r10, 0x8(%rdi)
addq %r8, %rax
movq %rax, (%rsi)
cmpq %rcx, %rax
jne 0x318095
movb $0x1, %al
jmp 0x3181d1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
cmpl $0x4, %ebp
jne 0x3181d1
callq 0x91b9c
movb $0x1, %al
cmpl $0x4, %ebx
jne 0x3181d1
callq 0x91bd5
callq 0x91b63
callq 0x91c0e