// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/translator.c
// Function: gt_translator_find_codon
GtTranslatorStatus gt_translator_find_codon(GtTranslator *translator,
                                            GtStrArray *codons,
                                            GtUword *pos,
                                            GtError *err)
{
  char n1, n2, n3;
  unsigned int frame;
  GtUword i;
  GtCodonIteratorStatus retval;
  gt_assert(translator && codons && pos);
  gt_error_check(err);

  for (i = 0; i<gt_str_array_size(codons); i++) {
    int len;
    if ((len = (int) strlen(gt_str_array_get(codons, i))) != GT_CODON_LENGTH) {
      gt_error_set(err, "invalid codon length for codon %s: %d",
                   gt_str_array_get(codons, i), len);
      return GT_TRANSLATOR_ERROR;
    }
  }

  while (!(retval =
             gt_codon_iterator_next(translator->ci,
                                    &n1, &n2, &n3, &frame, err))) {
    for (i = 0; i<gt_str_array_size(codons); i++) {
      const char *codon;
      codon = gt_str_array_get(codons, i);
      if (n1 == codon[0] && n2 == codon[1] && n3 == codon[2]) {
        *pos = gt_codon_iterator_current_position(translator->ci)-1;
        return GT_TRANSLATOR_OK;
      }
    }
  }
  if (retval == GT_CODON_ITERATOR_END)
    return GT_TRANSLATOR_END;
  else
    return GT_TRANSLATOR_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x87301
movq %rsi, %r15
testq %rsi, %rsi
je 0x87301
movq %rdx, %rbp
testq %rdx, %rdx
je 0x87301
movq %rcx, %rbx
movq %rdi, %r12
testq %rcx, %rcx
je 0x8720f
movq %rbx, %rdi
callq 0xc103
testb %al, %al
jne 0x8732f
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x157f4
cmpq %rax, %r14
jae 0x87240
movq %r15, %rdi
movq %r14, %rsi
callq 0x1555e
movq %rax, %rdi
callq 0xb260
movq %rax, %r13
cmpl $0x3, %r13d
jne 0x872ad
incq %r14
jmp 0x87212
movq %rbp, 0x8(%rsp)
leaq 0x5(%rsp), %r14
leaq 0x14(%rsp), %r13
movq 0x10(%r12), %rdi
leaq 0x7(%rsp), %rsi
leaq 0x6(%rsp), %rdx
movq %r14, %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0x8330c
testl %eax, %eax
jne 0x872fa
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x157f4
cmpq %rax, %rbp
jae 0x8724f
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1555e
movb 0x7(%rsp), %cl
cmpb (%rax), %cl
jne 0x872a8
movb 0x6(%rsp), %cl
cmpb 0x1(%rax), %cl
jne 0x872a8
movb 0x5(%rsp), %cl
cmpb 0x2(%rax), %cl
je 0x872d4
incq %rbp
jmp 0x87276
movq %r15, %rdi
movq %r14, %rsi
callq 0x1555e
leaq 0x5d25d(%rip), %rsi     # 0xe451c
movq %rbx, %rdi
movq %rax, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xc007
pushq $-0x2
popq %rax
jmp 0x872eb
movq 0x10(%r12), %rdi
callq 0x83219
decq %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %eax
jne 0x872cf
jmp 0x872eb
movq 0xa6cb0(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x42d54(%rip), %rsi     # 0xca066
leaq 0x5d1ce(%rip), %rdx     # 0xe44e7
leaq 0x5d1e3(%rip), %rcx     # 0xe4503
leaq 0x5d0d0(%rip), %r8      # 0xe43f7
movl $0x87, %r9d
jmp 0x8735b
movq 0xa6c82(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x42d26(%rip), %rsi     # 0xca066
leaq 0x43312(%rip), %rdx     # 0xca659
leaq 0x5d1b5(%rip), %rcx     # 0xe4503
leaq 0x5d0a2(%rip), %r8      # 0xe43f7
movl $0x88, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300