// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0xe5e90
cmpq $0x0, 0x50(%rsp)
je 0xe5e90
cmpq $0x0, 0x48(%rsp)
jne 0xe5ec8
movq 0xce141(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x781c5(%rip), %rsi     # 0x15e066
leaq 0x93797(%rip), %rdx     # 0x17963f
leaq 0x937ac(%rip), %rcx     # 0x17965b
leaq 0x93699(%rip), %r8      # 0x17954f
movl $0x87, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe5eca
jmp 0xe5ecc
cmpq $0x0, 0x40(%rsp)
je 0xe5f1c
movq 0x40(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xe5ee4
jmp 0xe5f1c
movq 0xce0ed(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x78171(%rip), %rsi     # 0x15e066
leaq 0x7874c(%rip), %rdx     # 0x15e648
leaq 0x93758(%rip), %rcx     # 0x17965b
leaq 0x93645(%rip), %r8      # 0x17954f
movl $0x88, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe5f1e
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1b720
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0xe5fbd
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1b320
movq %rax, %rdi
callq 0xb240
movl %eax, 0x28(%rsp)
cmpl $0x3, %eax
je 0xe5fa8
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1b320
movq 0x10(%rsp), %rdi
movq %rax, %rdx
movl 0x28(%rsp), %ecx
leaq 0x936e0(%rip), %rsi     # 0x179674
movb $0x0, %al
callq 0xc0d0
movl $0xfffffffe, 0x64(%rsp) # imm = 0xFFFFFFFE
jmp 0xe60cc
jmp 0xe5faa
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0xe5f27
jmp 0xe5fbf
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x40(%rsp), %r9
leaq 0x3f(%rsp), %rsi
leaq 0x3e(%rsp), %rdx
leaq 0x3d(%rsp), %rcx
leaq 0x38(%rsp), %r8
callq 0xdfd20
movl %eax, 0x2c(%rsp)
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe5ffb
jmp 0xe60b3
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1b720
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0xe60ae
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1b320
movq %rax, 0x20(%rsp)
movsbl 0x3f(%rsp), %eax
movq 0x20(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xe6099
movsbl 0x3e(%rsp), %eax
movq 0x20(%rsp), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0xe6099
movsbl 0x3d(%rsp), %eax
movq 0x20(%rsp), %rcx
movsbl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jne 0xe6099
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xdfb60
movq %rax, %rcx
subq $0x1, %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0xe60cc
jmp 0xe609b
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0xe6004
jmp 0xe5fbf
cmpl $-0x1, 0x2c(%rsp)
jne 0xe60c4
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0xe60cc
movl $0xfffffffe, 0x64(%rsp) # imm = 0xFFFFFFFE
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)