// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/orf.c
// Function: gt_determine_ORFs
void gt_determine_ORFs(GtORFProcessor orf_processor, void *data,
                       unsigned int framenum, const char *frame,
                       GtUword framelen, bool start_codon,
                       bool final_stop_codon, bool framepos,
                       const char *start_codons)
{
  GtUword i;
  GtRange orf;
  gt_assert(orf_processor && framenum <= 2 && frame);
  orf.start = GT_UNDEF_UWORD;
  for (i = 0; i < framelen; i++) {
    if (orf.start == GT_UNDEF_UWORD) {
      if (start_codon) {
        if (start_codons ? start_codons[i] == GT_START_AMINO
                         : frame[i] == GT_START_AMINO)
          orf.start = framepos ? i : i * GT_CODON_LENGTH + framenum;
      }
      else {
        if (i) {
          if (frame[i-1] == GT_STOP_AMINO && frame[i] != GT_STOP_AMINO)
            orf.start = framepos ? i : i * GT_CODON_LENGTH + framenum;
        }
        else {
          if (frame[i] != GT_STOP_AMINO)
            orf.start = framepos ? 0 : framenum;
        }
      }
    }
    else {
      if (frame[i] == GT_STOP_AMINO) {
        orf.end = framepos ? i : i * GT_CODON_LENGTH + framenum + 2;
        orf_processor(data, &orf, framenum, frame, true);
        orf.start = GT_UNDEF_UWORD;
      }
    }
  }
  if (!final_stop_codon) {
    if (orf.start != GT_UNDEF_UWORD) {
      orf.end = framepos ? framelen - 1
                         : (framelen - 1) * GT_CODON_LENGTH + framenum + 2;
      orf_processor(data, &orf, framenum, frame, false);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0x1c(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, 0x28(%rsp)
testq %rdi, %rdi
je 0xdee64
cmpl $0x2, %edx
ja 0xdee64
movq %rcx, %rbx
testq %rcx, %rcx
je 0xdee64
movq %r8, %r12
movq $-0x1, 0x8(%rsp)
movl %edx, %r14d
testq %r8, %r8
je 0xdee14
movq 0x80(%rsp), %rbp
xorl %r15d, %r15d
cmpb $0x0, 0x78(%rsp)
movq %r14, %rax
cmovneq %r15, %rax
movq %rax, 0x30(%rsp)
movq %r14, %r13
cmpq $-0x1, 0x8(%rsp)
je 0xdedb4
cmpb $0x2a, (%rbx,%r15)
jne 0xdee04
leaq 0x2(%r13), %rax
cmpb $0x0, 0x78(%rsp)
cmovneq %r15, %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
movq %rbx, %rcx
movl $0x1, %r8d
callq *0x28(%rsp)
movq $-0x1, 0x8(%rsp)
jmp 0xdee04
cmpb $0x0, 0x1c(%rsp)
je 0xdedca
testq %rbp, %rbp
je 0xdede0
cmpb $0x4d, (%rbp,%r15)
je 0xdede7
jmp 0xdee04
testq %r15, %r15
je 0xdedf5
cmpb $0x2a, -0x1(%rbx,%r15)
jne 0xdee04
cmpb $0x2a, (%rbx,%r15)
jne 0xdede7
jmp 0xdee04
cmpb $0x4d, (%rbx,%r15)
jne 0xdee04
cmpb $0x0, 0x78(%rsp)
movq %r13, %rax
cmovneq %r15, %rax
jmp 0xdedff
cmpb $0x2a, (%rbx)
je 0xdee04
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
incq %r15
addq $0x3, %r13
cmpq %r15, %r12
jne 0xded6a
cmpb $0x0, 0x70(%rsp)
jne 0xdee55
cmpq $-0x1, 0x8(%rsp)
je 0xdee55
cmpb $0x0, 0x78(%rsp)
je 0xdee2f
decq %r12
jmp 0xdee3a
leaq (%r12,%r12,2), %rax
leaq (%r14,%rax), %r12
decq %r12
leaq 0x8(%rsp), %rsi
movq %r12, 0x8(%rsi)
movq 0x20(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq *0x28(%rsp)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x348ca
nopl (%rax)