// File: /workspace/github_c_makefile_star2_O3/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), %r15
movq %rsi, %rdi
movq %rdx, %rsi
movq %r15, %rdx
callq 0xe2fdd
movq %rax, %r14
movq %rax, %rdi
callq 0x11e737
movq %rax, %r13
leaq 0x3(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
movq %r15, %rcx
callq 0x11ea96
testl %eax, %eax
je 0xc5497
movl %eax, %r12d
jmp 0xc54dd
movl %ebp, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x3(%rsp), %r14
leaq 0x4(%rsp), %rbp
movl 0x4(%rsp), %eax
movq (%rbx,%rax,8), %rdi
movsbl 0x3(%rsp), %esi
callq 0x11af23
movq %r13, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x11ea96
testl %eax, %eax
je 0xc54aa
movl %eax, %r12d
movq 0x10(%rsp), %r14
movl 0x8(%rsp), %ebp
movq %r14, %rdi
callq 0xe26c6
movq %r13, %rdi
callq 0x11eb7a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x2, %r12d
je 0xc55e1
callq 0x11ac6c
leaq 0x3028a2(%rip), %rcx    # 0x3c7daa
leaq 0x2faa95(%rip), %rdx    # 0x3bffa4
testb %bpl, %bpl
cmovneq %rcx, %rdx
movq %rdx, 0x8(%rsp)
movq %rax, %r13
xorl %ebp, %ebp
movq (%rbx,%rbp,8), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0xc55ca
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0x11acf3
movq %r13, %rdi
leaq 0x2fa783(%rip), %rsi    # 0x3bfccc
callq 0x11acf3
leaq 0x1(%rbp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x11ae72
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x11acf3
movq %r13, %rdi
leaq 0x312b6c(%rip), %rsi    # 0x3d80e0
callq 0x11acf3
movq %r13, %rdi
callq 0x11b0a1
movq %rax, %r14
movq (%rbx,%rbp,8), %rdi
callq 0x11b0a1
movq %rax, %r12
movq (%rbx,%rbp,8), %rdi
callq 0x11b0ca
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %r8
movq 0x10(%rcx), %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xfe000
movq (%rbx,%rbp,8), %rdi
callq 0x11b132
movq %r13, %rdi
callq 0x11b132
movq %r15, %rbp
jmp 0xc55cd
incq %rbp
cmpq $0x3, %rbp
jne 0xc5520
movq %r13, %rdi
callq 0x11bdbf
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq