// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
testq %rdi, %rdi
je 0xdf575
cmpl $0x2, %edx
ja 0xdf575
movq %rcx, %rbx
testq %rcx, %rcx
je 0xdf575
movq %r8, %r12
movq $-0x1, (%rsp)
testq %r8, %r8
je 0xdf566
movl %r9d, %ebp
movl %edx, %r14d
xorl %r15d, %r15d
cmpb $0x0, 0x68(%rsp)
movq %r14, %rax
cmovneq %r15, %rax
movq %rax, 0x20(%rsp)
movq $-0x1, %rax
movq %r14, %r13
movq $-0x1, %rcx
cmpq $-0x1, %rcx
je 0xdf4b0
cmpb $0x2a, (%rbx,%r15)
jne 0xdf519
leaq 0x2(%r13), %rax
cmpb $0x0, 0x68(%rsp)
cmovneq %r15, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movl $0x1, %r8d
callq *0x18(%rsp)
movq $-0x1, (%rsp)
movq $-0x1, %rax
movq $-0x1, %rcx
jmp 0xdf519
testb %bpl, %bpl
je 0xdf4cf
movq 0x70(%rsp), %rdx
movq $-0x1, %rcx
testq %rdx, %rdx
je 0xdf4ec
cmpb $0x4d, (%rdx,%r15)
je 0xdf4f3
jmp 0xdf519
movq $-0x1, %rcx
testq %r15, %r15
je 0xdf508
cmpb $0x2a, -0x1(%rbx,%r15)
jne 0xdf519
cmpb $0x2a, (%rbx,%r15)
jne 0xdf4f3
jmp 0xdf519
cmpb $0x4d, (%rbx,%r15)
jne 0xdf519
cmpb $0x0, 0x68(%rsp)
movq %r13, %rax
cmovneq %r15, %rax
movq %rax, (%rsp)
movq %rax, %rcx
jmp 0xdf519
cmpb $0x2a, (%rbx)
je 0xdf519
movq 0x20(%rsp), %rcx
movq %rcx, (%rsp)
movq %rcx, %rax
incq %r15
addq $0x3, %r13
cmpq %r15, %r12
jne 0xdf45d
cmpb $0x0, 0x60(%rsp)
jne 0xdf566
cmpq $-0x1, %rax
je 0xdf566
cmpb $0x0, 0x68(%rsp)
je 0xdf542
decq %r12
jmp 0xdf54d
leaq (%r12,%r12,2), %rax
leaq (%r14,%rax), %r12
decq %r12
movq %rsp, %rsi
movq %r12, 0x8(%rsi)
movq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq *0x18(%rsp)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3427b
nop