// File: /workspace/github_c_makefile_star2_O2/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 0xacb84
movq %rax, %rbp
movq %rax, 0x40(%rsp)
callq 0xacb84
movq %rax, 0x38(%rsp)
movq %rax, 0x48(%rsp)
callq 0xacb84
movq %rax, 0x30(%rsp)
movq %rax, 0x50(%rsp)
testq %r12, %r12
je 0x4969f
movq %r12, %rdi
callq 0x89eb7
testb %al, %al
jne 0x49890
movq %rbp, 0x28(%rsp)
testq %r13, %r13
je 0x49862
callq 0xae154
movq %rax, %rbp
movslq %r14d, %r14
movslq %r15d, %r15
cmpq %r15, %r14
jge 0x496d1
movq (%rbx,%r14,8), %rsi
movq %rbp, %rdi
callq 0xae22f
incq %r14
jmp 0x496bb
movq %rbp, %rdi
movq %r12, %rsi
callq 0xa77c3
movq %rax, %r15
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x497fe
movq %r15, 0x20(%rsp)
movq %r15, %rdi
callq 0xa7103
xorl %r15d, %r15d
testq %rax, %rax
je 0x49803
movq %rax, %r14
leaq 0x10(%rsp), %rbx
testl %r15d, %r15d
jne 0x49813
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x8(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r12, %r8
callq 0xa62e5
testl %eax, %eax
je 0x49808
js 0x4980d
movq 0x8(%rsp), %rdx
cmpq $0x2, %rdx
ja 0x49761
movq 0x18(%rsp), %rsi
xorl %r15d, %r15d
leaq 0x2afbb0(%rip), %rdi    # 0x2f9305
pushq $0x3
popq %rdx
xorl %eax, %eax
callq 0xb2cd0
jmp 0x4970c
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rcx
movq %r12, (%rsp)
movq %r13, %rdi
leaq 0x40(%rsp), %r8
xorl %r9d, %r9d
callq 0x498c8
pushq $-0x1
popq %rcx
movl %ecx, %r15d
testl %eax, %eax
jne 0x4970c
xorl %r15d, %r15d
cmpb $0x1, 0x18(%r13)
jne 0x4970c
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x6c330
movq %rax, %rbx
movq 0x8(%rsp), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x111ab8
movl %eax, %r15d
testl %eax, %eax
jne 0x497e5
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r12, (%rsp)
movq %r13, %rdi
movq %rbx, %rsi
leaq 0x40(%rsp), %r8
pushq $0x1
popq %r9
callq 0x498c8
movl %eax, %r15d
movq %rbx, %rdi
leaq 0x2afa19(%rip), %rsi    # 0x2f9208
movl $0xc5, %edx
callq 0x936f9
jmp 0x49707
xorl %r14d, %r14d
jmp 0x4981b
xorl %r14d, %r14d
jmp 0x49816
xorl %r15d, %r15d
jmp 0x49813
pushq $-0x1
popq %rax
movl %eax, %r15d
movl %r15d, %ebx
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rdi
callq 0xae103
movq 0x38(%rsp), %rdi
callq 0xae103
movq 0x30(%rsp), %rdi
callq 0xae103
movq %rbp, %rdi
callq 0xae662
movq %r14, %rdi
callq 0xa6389
movq %r15, %rdi
callq 0xa76dc
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3ee6ff(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x29b7a0(%rip), %rsi    # 0x2e5013
leaq 0x2fedd9(%rip), %rdx    # 0x348653
leaq 0x2afa6d(%rip), %rcx    # 0x2f92ee
leaq 0x2af980(%rip), %r8     # 0x2f9208
movl $0x9d, %r9d
jmp 0x498bc
movq 0x3ee6d1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x29b772(%rip), %rsi    # 0x2e5013
leaq 0x29b917(%rip), %rdx    # 0x2e51bf
leaq 0x2afa3f(%rip), %rcx    # 0x2f92ee
leaq 0x2af952(%rip), %r8     # 0x2f9208
movl $0x9c, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390