// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
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 0x6ad4b
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0xb1af2
movq %rax, %rbp
leaq 0x7(%rsp), %r13
leaq 0x14(%rsp), %r14
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0xb2013
testl %eax, %eax
jne 0x4993e
movl 0x14(%rsp), %eax
movq (%rbx,%rax,8), %rdi
movsbl 0x7(%rsp), %esi
callq 0xaced9
jmp 0x49915
movl %eax, %r15d
movq 0x8(%rsp), %rdi
callq 0x6a21c
movq %rbp, %rdi
callq 0xb217a
cmpl $-0x2, %r15d
jne 0x49961
pushq $-0x1
popq %rax
jmp 0x49a50
callq 0xacb84
leaq 0x31e83d(%rip), %rcx    # 0x3681aa
leaq 0x316a80(%rip), %rdx    # 0x3603f4
cmpb $0x0, 0x10(%rsp)
cmovneq %rcx, %rdx
movq %rdx, 0x8(%rsp)
movq %rax, %r13
xorl %ebp, %ebp
cmpq $0x3, %rbp
je 0x49a46
movq (%rbx,%rbp,8), %rdi
callq 0xad289
testq %rax, %rax
je 0x49a3e
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0xacbfb
movq %r13, %rdi
leaq 0x316762(%rip), %rsi    # 0x36011c
callq 0xacbfb
leaq 0x1(%rbp), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0xace26
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0xacbfb
movq %r13, %rdi
leaq 0x32eb1b(%rip), %rsi    # 0x378500
callq 0xacbfb
movq %r13, %rdi
callq 0xad1fa
movq %rax, %r14
movq (%rbx,%rbp,8), %rdi
callq 0xad1fa
movq %rax, %r15
movq (%rbx,%rbp,8), %rdi
callq 0xad289
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %r8
movq 0x10(%rcx), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x8c0bc
movq (%rbx,%rbp,8), %rdi
callq 0xad357
movq %r13, %rdi
callq 0xad357
movq %r12, %rbp
jmp 0x49987
incq %rbp
jmp 0x49987
movq %r13, %rdi
callq 0xae103
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop