// File: /workspace/github_c_makefile_star2_O3/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 0x11ac6c
movq %rax, %rbp
movq %rax, 0x40(%rsp)
callq 0x11ac6c
movq %rax, 0x38(%rsp)
movq %rax, 0x48(%rsp)
callq 0x11ac6c
movq %rax, 0x30(%rsp)
movq %rax, 0x50(%rsp)
testq %r12, %r12
je 0xc5278
movq %r12, %rdi
callq 0xfcc32
testb %al, %al
jne 0xc5435
movq %rbp, 0x28(%rsp)
testq %r13, %r13
je 0xc5430
callq 0x11be10
movq %rax, %rbp
cmpl %r15d, %r14d
jge 0xc52ad
movslq %r14d, %r14
movslq %r15d, %r15
movq (%rbx,%r14,8), %rsi
movq %rbp, %rdi
callq 0x11bee9
incq %r14
cmpq %r14, %r15
jne 0xc5299
movq %rbp, %rdi
movq %r12, %rsi
callq 0x115472
movq %rax, %rbx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xc53e0
movq %rbx, %rdi
callq 0x114f43
testq %rax, %rax
je 0xc53e0
movq %rax, %r14
movq %rbx, 0x20(%rsp)
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r12, %r8
callq 0x11433d
testl %eax, %eax
je 0xc542b
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
js 0xc53e3
movq 0x8(%rsp), %rdx
cmpq $0x2, %rdx
ja 0xc533c
movq 0x10(%rsp), %rsi
xorl %r15d, %r15d
leaq 0x294002(%rip), %rdi    # 0x35932d
movl $0x3, %edx
xorl %eax, %eax
callq 0x11f68c
jmp 0xc53d5
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rcx
movq %r12, (%rsp)
movq %r13, %rdi
leaq 0x40(%rsp), %r8
xorl %r9d, %r9d
callq 0xc543a
testl %eax, %eax
jne 0xc53e3
xorl %r15d, %r15d
cmpb $0x1, 0x18(%r13)
jne 0xc53d5
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xe42d3
movq %rax, %rbx
movq 0x8(%rsp), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x16eef8
movl %eax, %r15d
testl %eax, %eax
jne 0xc53bc
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r12, (%rsp)
movq %r13, %rdi
movq %rbx, %rsi
leaq 0x40(%rsp), %r8
movl $0x1, %r9d
callq 0xc543a
movl %eax, %r15d
movq %rbx, %rdi
leaq 0x293e6a(%rip), %rsi    # 0x359230
movl $0xc5, %edx
callq 0x1045eb
movq 0x20(%rsp), %rbx
testl %r15d, %r15d
je 0xc52e3
jmp 0xc53e3
xorl %r14d, %r14d
movq 0x28(%rsp), %rdi
callq 0x11bdbf
movq 0x38(%rsp), %rdi
callq 0x11bdbf
movq 0x30(%rsp), %rdi
callq 0x11bdbf
movq %rbp, %rdi
callq 0x11c144
movq %r14, %rdi
callq 0x11437f
movq %rbx, %rdi
callq 0x1153e9
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0xc53e3
callq 0x1f578
callq 0x1f53f