// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_seqtranslate.c
// Function: gt_seqtranslate_runner
static int gt_seqtranslate_runner(int argc, const char **argv, int parsed_args,
                              void *tool_arguments, GT_UNUSED GtError *err)
{
  GtTranslateArguments *arguments = tool_arguments;
  GtSeqIterator *si = NULL;
  GtSequenceBuffer *sb = NULL;
  GtStrArray *infiles;
  int had_err = 0,
      rval,
      i;
  GtStr *translations[3];
  translations[0] = gt_str_new();
  translations[1] = gt_str_new();
  translations[2] = gt_str_new();

  gt_error_check(err);
  gt_assert(arguments);

  infiles = gt_str_array_new();
  for (i = parsed_args; i < argc; i++) {
    gt_str_array_add_cstr(infiles, argv[i]);
  }
  sb = gt_sequence_buffer_new_guess_type(infiles, err);
  if (!sb)
    had_err = -1;
  if (!had_err) {
    si = gt_seq_iterator_sequence_buffer_new_with_buffer(sb);
    if (!si)
      had_err = -1;
  }
  if (!had_err) {
    char *desc;
    const GtUchar *sequence;
    GtUword len;
    while (!had_err && (rval = gt_seq_iterator_next(si,
                                                   &sequence,
                                                   &len, &desc, err))) {
      if (rval < 0) {
        had_err = -1;
        break;
      }
      if (len < GT_CODON_LENGTH) {
        gt_warning("sequence '%s' is shorter than codon length of %d, skipping",
                   desc, GT_CODON_LENGTH);
      } else {
        had_err = gt_seqtranslate_do_translation(arguments, (char*) sequence,
                                                 len, desc,
                                                 translations, false, err);
        if (!had_err && arguments->reverse) {
          char *revseq = gt_cstr_dup_nt((char*) sequence, len);
          had_err = gt_reverse_complement(revseq, len, err);
          if (!had_err) {
            had_err = gt_seqtranslate_do_translation(arguments, revseq, len,
                                                  desc, translations, true,
                                                  err);
          }
          gt_free(revseq);
        }
      }
    }
  }
  gt_str_delete(translations[0]);
  gt_str_delete(translations[1]);
  gt_str_delete(translations[2]);
  gt_str_array_delete(infiles);
  gt_seq_iterator_delete(si);
  gt_sequence_buffer_delete(sb);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r12
movq %rcx, %r13
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %r15d
callq 0x1208f8
movq %rax, %rbp
movq %rax, 0x40(%rsp)
callq 0x1208f8
movq %rax, 0x38(%rsp)
movq %rax, 0x48(%rsp)
callq 0x1208f8
movq %rax, 0x30(%rsp)
movq %rax, 0x50(%rsp)
testq %r12, %r12
je 0xc7400
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0xc75ba
movq %rbp, 0x28(%rsp)
testq %r13, %r13
je 0xc75b5
callq 0x121b54
movq %rax, %rbp
cmpl %r15d, %r14d
jge 0xc7435
movslq %r14d, %r14
movslq %r15d, %r15
movq (%rbx,%r14,8), %rsi
movq %rbp, %rdi
callq 0x121c30
incq %r14
cmpq %r14, %r15
jne 0xc7421
movq %rbp, %rdi
movq %r12, %rsi
callq 0x11abe6
movq %rax, %r15
testq %rax, %rax
je 0xc745b
movq %r15, %rdi
callq 0x11a67b
movq %rax, %r14
testq %rax, %rax
setne %al
jmp 0xc7460
xorl %eax, %eax
xorl %r14d, %r14d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0xc756e
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r12, %r8
callq 0x119a11
testl %eax, %eax
je 0xc7565
js 0xc7569
movq 0x8(%rsp), %rdx
cmpq $0x2, %rdx
ja 0xc74bf
movq 0x10(%rsp), %rsi
xorl %ebx, %ebx
leaq 0x29aecf(%rip), %rdi    # 0x36237d
movl $0x3, %edx
xorl %eax, %eax
callq 0x125448
jmp 0xc755b
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rcx
movq %r12, (%rsp)
movq %r13, %rdi
leaq 0x40(%rsp), %r8
xorl %r9d, %r9d
callq 0xc75bf
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0xc755b
xorl %ebx, %ebx
cmpb $0x1, 0x18(%r13)
jne 0xc755b
movq %r15, 0x20(%rsp)
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xe87a3
movq %rax, %r15
movq 0x8(%rsp), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x177290
movl %eax, %ebx
testl %eax, %eax
jne 0xc7542
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r12, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %r8
movl $0x1, %r9d
callq 0xc75bf
movl %eax, %ebx
movq %r15, %rdi
leaq 0x29ad34(%rip), %rsi    # 0x362280
movl $0xc5, %edx
callq 0x109670
movq 0x20(%rsp), %r15
testl %ebx, %ebx
je 0xc746d
jmp 0xc756e
xorl %ebx, %ebx
jmp 0xc756e
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rdi
callq 0x121b03
movq 0x38(%rsp), %rdi
callq 0x121b03
movq 0x30(%rsp), %rdi
callq 0x121b03
movq %rbp, %rdi
callq 0x121e8b
movq %r14, %rdi
callq 0x119a53
movq %r15, %rdi
callq 0x11ab5d
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1f902
callq 0x1f8c9