// File: /workspace/github_c_makefile_star2_O2/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 0xc8245
cmpl $0x2, %edx
ja 0xc8245
movq %rcx, %rbx
testq %rcx, %rcx
je 0xc8245
movq %r8, %r12
leaq 0x8(%rsp), %rax
orq $-0x1, (%rax)
movl %edx, %ebp
xorl %r15d, %r15d
cmpb $0x0, 0x78(%rsp)
movq %rbp, %rax
cmovneq %r15, %rax
movq %rax, 0x30(%rsp)
pushq $-0x1
popq %r14
movq %rbp, %r13
movq %r14, %rax
cmpq %r15, %r12
je 0xc81f7
cmpq $-0x1, %rax
je 0xc818a
cmpb $0x2a, (%rbx,%r15)
jne 0xc81eb
leaq 0x2(%r13), %rax
cmpb $0x0, 0x78(%rsp)
cmovneq %r15, %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %rbx, %rcx
pushq $0x1
popq %r8
callq *0x28(%rsp)
orq $-0x1, 0x8(%rsp)
movq %r14, %rax
jmp 0xc81eb
cmpb $0x0, 0x1c(%rsp)
je 0xc81a5
movq 0x80(%rsp), %rax
testq %rax, %rax
je 0xc81c1
cmpb $0x4d, (%rax,%r15)
jmp 0xc81c6
testq %r15, %r15
je 0xc81d9
cmpb $0x2a, -0x1(%rbx,%r15)
movq %r14, %rax
jne 0xc81eb
cmpb $0x2a, (%rbx,%r15)
movq %r14, %rax
jne 0xc81cb
jmp 0xc81eb
cmpb $0x4d, (%rbx,%r15)
movq %r14, %rax
jne 0xc81eb
cmpb $0x0, 0x78(%rsp)
movq %r13, %rax
cmovneq %r15, %rax
jmp 0xc81e6
cmpb $0x2a, (%rbx)
movq %r14, %rax
je 0xc81eb
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
incq %r15
addq $0x3, %r13
jmp 0xc813b
cmpb $0x0, 0x70(%rsp)
jne 0xc8236
cmpq $-0x1, %rax
je 0xc8236
cmpb $0x0, 0x78(%rsp)
je 0xc8210
decq %r12
jmp 0xc821b
leaq (%r12,%r12,2), %rax
leaq (%rax,%rbp), %r12
decq %r12
leaq 0x8(%rsp), %rsi
movq %r12, 0x8(%rsi)
movq 0x20(%rsp), %rdi
movq %rbp, %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
movq 0x65d6c(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1e10(%rip), %rsi      # 0xca066
leaq 0x2d260(%rip), %rdx     # 0xf54bd
leaq 0x2d281(%rip), %rcx     # 0xf54e5
leaq 0x2d28c(%rip), %r8      # 0xf54f7
pushq $0x21
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
nop