// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_seqtranslate.c
// Function: gt_seqtranslate_do_translation
static int gt_seqtranslate_do_translation(GtTranslateArguments *arguments,
                                       const char *sequence,
                                       GtUword length,
                                       const char *desc,
                                       GtStr **translations,
                                       bool rev,
                                       GtError *err)
{
  GtTranslator *tr;
  GT_UNUSED GtTranslatorStatus trst;
  GtCodonIterator *ci;
  char translated;
  int had_err = 0;
  GtStr *str;
  unsigned int frame,
               i;

  ci = gt_codon_iterator_simple_new(sequence, length, err);
  tr = gt_translator_new(ci);
  trst = gt_translator_next(tr, &translated, &frame, err);
  while (trst == GT_TRANSLATOR_OK) {
    gt_str_append_char(translations[frame], translated);
    trst = gt_translator_next(tr, &translated, &frame, err);
  }
  gt_codon_iterator_delete(ci);
  gt_translator_delete(tr);
  if (trst == GT_TRANSLATOR_ERROR)
    return -1;
  str = gt_str_new();
  for (i = 0; i < 3; i++) {
    if (gt_str_length(translations[i]) > 0) {
      gt_str_append_cstr(str, desc);
      gt_str_append_cstr(str, " (");
      gt_str_append_uword(str, i+1);
      gt_str_append_cstr(str, rev ? "-" : "+");
      gt_str_append_cstr(str, ")");
      gt_fasta_show_entry(gt_str_get(str), gt_str_get(translations[i]),
                          gt_str_length(translations[i]),
                          arguments->fasta_width, arguments->outfp);
      gt_str_reset(translations[i]);
      gt_str_reset(str);
    }
  }
  gt_str_delete(str);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movq %r8, %rbx
movq %rcx, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x60(%rsp), %r12
movq %rsi, %rdi
movq %rdx, %rsi
movq %r12, %rdx
callq 0xe74a9
movq %rax, %r14
movq %rax, %rdi
callq 0x124477
movq %rax, %r13
leaq 0x3(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
movq %r12, %r15
movq %r12, %rcx
callq 0x1247fd
testl %eax, %eax
je 0xc761f
movl %eax, %r12d
jmp 0xc7665
movq %r14, 0x10(%rsp)
movl %ebp, 0x8(%rsp)
leaq 0x3(%rsp), %r14
leaq 0x4(%rsp), %rbp
movl 0x4(%rsp), %eax
movq (%rbx,%rax,8), %rdi
movsbl 0x3(%rsp), %esi
callq 0x120ba5
movq %r13, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x1247fd
testl %eax, %eax
je 0xc7632
movl %eax, %r12d
movl 0x8(%rsp), %ebp
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xe6b9a
movq %r13, %rdi
callq 0x1248e1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x2, %r12d
movq 0x18(%rsp), %r15
je 0xc7767
callq 0x1208f8
leaq 0x309e3d(%rip), %rcx    # 0x3d14d2
leaq 0x301f88(%rip), %rdx    # 0x3c9624
testb %bpl, %bpl
cmovneq %rcx, %rdx
movq %rdx, 0x8(%rsp)
movq %rax, %r13
movl $0x1, %ebp
movq -0x8(%rbx,%rbp,8), %rdi
callq 0x120d4c
testq %rax, %rax
je 0xc7750
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0x12097f
movq %r13, %rdi
leaq 0x301c72(%rip), %rsi    # 0x3c934c
callq 0x12097f
movq %r13, %rdi
movq %rbp, %rsi
callq 0x120af4
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x12097f
movq %r13, %rdi
leaq 0x31a134(%rip), %rsi    # 0x3e1835
callq 0x12097f
movq %r13, %rdi
callq 0x120d23
movq %rax, %r14
movq -0x8(%rbx,%rbp,8), %rdi
callq 0x120d23
movq %rax, %r12
movq -0x8(%rbx,%rbp,8), %rdi
callq 0x120d4c
movq 0x8(%r15), %r8
movq 0x10(%r15), %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x102ec0
movq -0x8(%rbx,%rbp,8), %rdi
callq 0x120db4
movq %r13, %rdi
callq 0x120db4
incq %rbp
cmpq $0x4, %rbp
jne 0xc76b0
movq %r13, %rdi
callq 0x121b03
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop