// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movl %r9d, %eax
movq %rcx, 0x30(%rsp)
movl %edx, 0x3c(%rsp)
movq %rsi, %r9
movq 0x30(%rsp), %rsi
movq %rdi, %r10
movl 0x3c(%rsp), %edi
movb %al, %dl
movq 0xa0(%rsp), %rax
movb 0x98(%rsp), %al
movb 0x90(%rsp), %cl
movq %r10, 0x80(%rsp)
movq %r9, 0x78(%rsp)
movl %edi, 0x74(%rsp)
movq %rsi, 0x68(%rsp)
movq %r8, 0x60(%rsp)
andb $0x1, %dl
movb %dl, 0x5f(%rsp)
andb $0x1, %cl
movb %cl, 0x5e(%rsp)
andb $0x1, %al
movb %al, 0x5d(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x159d93
cmpl $0x2, 0x74(%rsp)
ja 0x159d93
cmpq $0x0, 0x68(%rsp)
jne 0x159dcb
movq 0x5a23e(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x42c2(%rip), %rsi      # 0x15e066
leaq 0x352d2(%rip), %rdx     # 0x18f07d
leaq 0x352f3(%rip), %rcx     # 0x18f0a5
leaq 0x352fe(%rip), %r8      # 0x18f0b7
movl $0x21, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x159dcd
movq $-0x1, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x60(%rsp), %rax
jae 0x159f95
cmpq $-0x1, 0x40(%rsp)
jne 0x159f0a
testb $0x1, 0x5f(%rsp)
je 0x159e6c
cmpq $0x0, 0xa0(%rsp)
je 0x159e25
movq 0xa0(%rsp), %rax
movq 0x50(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x4d, %eax
je 0x159e38
jmp 0x159e67
movq 0x68(%rsp), %rax
movq 0x50(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x4d, %eax
jne 0x159e67
testb $0x1, 0x5d(%rsp)
je 0x159e4b
movq 0x50(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x159e5d
imulq $0x3, 0x50(%rsp), %rax
movl 0x74(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x159f08
cmpq $0x0, 0x50(%rsp)
je 0x159ecf
movq 0x68(%rsp), %rax
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2a, %eax
jne 0x159ecd
movq 0x68(%rsp), %rax
movq 0x50(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2a, %eax
je 0x159ecd
testb $0x1, 0x5d(%rsp)
je 0x159eb1
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x159ec3
imulq $0x3, 0x50(%rsp), %rax
movl 0x74(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x159f06
movq 0x68(%rsp), %rax
movq 0x50(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2a, %eax
je 0x159f04
testb $0x1, 0x5d(%rsp)
je 0x159ef1
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0x159ef9
movl 0x74(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, %eax
movq %rax, 0x40(%rsp)
jmp 0x159f06
jmp 0x159f08
jmp 0x159f80
movq 0x68(%rsp), %rax
movq 0x50(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2a, %eax
jne 0x159f7e
testb $0x1, 0x5d(%rsp)
je 0x159f30
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x159f46
imulq $0x3, 0x50(%rsp), %rax
movl 0x74(%rsp), %ecx
addq %rcx, %rax
addq $0x2, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rdi
movl 0x74(%rsp), %ecx
movl %ecx, %edx
movq 0x68(%rsp), %rcx
leaq 0x40(%rsp), %rsi
movl $0x1, %r8d
callq *%rax
movq $-0x1, 0x40(%rsp)
jmp 0x159f80
jmp 0x159f82
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x159ddf
testb $0x1, 0x5e(%rsp)
jne 0x15a006
cmpq $-0x1, 0x40(%rsp)
je 0x15a004
testb $0x1, 0x5d(%rsp)
je 0x159fbb
movq 0x60(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x159fd8
movq 0x60(%rsp), %rax
subq $0x1, %rax
imulq $0x3, %rax, %rax
movl 0x74(%rsp), %ecx
addq %rcx, %rax
addq $0x2, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rdi
movl 0x74(%rsp), %ecx
movl %ecx, %edx
movq 0x68(%rsp), %rcx
leaq 0x40(%rsp), %rsi
xorl %r8d, %r8d
callq *%rax
jmp 0x15a006
addq $0x88, %rsp
retq
nop