// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_convertseq.c
// Function: gt_convertseq_runner
static int gt_convertseq_runner(int argc, const char **argv, int parsed_args,
                              void *tool_arguments, GtError *err)
{
  GtConvertseqArguments *arguments = tool_arguments;
  int had_err = 0, i;
  GtFilelengthvalues *flv;
  GtSeqIterator *seqit;
  GtSequenceBuffer *sb = NULL;
  GtStrArray *files;
  const GtUchar *sequence;
  char *desc;
  GtUword len, j;
  off_t totalsize;
  gt_error_check(err);
  gt_assert(arguments != NULL);

  files = gt_str_array_new();
  for (i = parsed_args; i < argc; i++)
  {
    gt_str_array_add_cstr(files, argv[i]);
  }
  totalsize = gt_files_estimate_total_size(files);

  flv = gt_calloc((size_t) gt_str_array_size(files),
                  sizeof (GtFilelengthvalues));

  sb = gt_sequence_buffer_new_guess_type(files, err);
  if (!sb) {
    had_err = -1;
  }
  if (!had_err) {
    gt_sequence_buffer_set_filelengthtab(sb, flv);
    /* read input using seqiterator */
    seqit = gt_seq_iterator_sequence_buffer_new_with_buffer(sb);
    if (arguments->verbose)
    {
      gt_progressbar_start(gt_seq_iterator_getcurrentcounter(seqit,
                                                           (GtUint64)
                                                           totalsize),
                           (GtUint64) totalsize);
    }
    while (true)
    {
      GtUchar *seq = NULL;
      desc = NULL;
      j = 0UL;
      had_err = gt_seq_iterator_next(seqit, &sequence, &len, &desc, err);
      if (had_err != 1)
        break;
      if (arguments->revcomp) {
        GtUchar *newseq = gt_calloc((size_t) len+1, sizeof (GtUchar));
        memcpy(newseq, sequence, (size_t) len*sizeof (GtUchar));
        had_err = gt_reverse_complement((char*) newseq, len, err);
        if (had_err)
          break;
        seq = newseq;
      } else seq = (GtUchar*) sequence;

      if (!arguments->showseq) {
        bool in_wildcard = false;
        gt_file_xprintf(arguments->outfp, ">%s\n", desc);
        for (i = 0; (GtUword) i < len; i++) {
          if (arguments->reduce_wc_dna) {
            switch (seq[i]) {
              case 'a':
              case 'A':
              case 'c':
              case 'C':
              case 'g':
              case 'G':
              case 't':
              case 'u':
              case 'T':
              case 'U':
                in_wildcard = false;
                gt_file_xfputc((int) seq[i], arguments->outfp);
                j++;
                break;
              default:
                if (!in_wildcard) {
                  in_wildcard = true;
                  if (isupper((int) seq[i]))
                    gt_file_xfputc((int) 'N', arguments->outfp);
                  else
                    gt_file_xfputc((int) 'n', arguments->outfp);
                  j++;
                }
            }
          }
          else if (arguments->reduce_wc_prot) {
            switch (seq[i]) {
              case 'X':
              case 'B':
              case 'Z':
                if (!in_wildcard) {
                  in_wildcard = true;
                  gt_file_xfputc((int) 'N', arguments->outfp);
                  j++;
                }
                break;
              case 'x':
              case 'b':
              case 'z':
                if (!in_wildcard) {
                  in_wildcard = true;
                  gt_file_xfputc((int) 'n', arguments->outfp);
                  j++;
                }
                break;
              default:
                in_wildcard = false;
                gt_file_xfputc((int) seq[i], arguments->outfp);
                j++;
            }
          }
          else {
            gt_file_xfputc((int) seq[i], arguments->outfp);
            j++;
          }
          if (arguments->fastawidth > 0 && j % arguments->fastawidth == 0) {
            j = 0;
            gt_file_xprintf(arguments->outfp, "\n");
          }
        }
        if (arguments->fastawidth == 0 || len % arguments->fastawidth != 0)
            gt_file_xprintf(arguments->outfp, "\n");
      }
      if (arguments->revcomp) {
        gt_free(seq);
      }
    }
    if (arguments->showflv) {
      for (j=0;j<gt_str_array_size(files);j++) {
        fprintf(stderr, "file "GT_WU" (%s): "GT_WU"/"GT_WU"\n",
               j,
               gt_str_array_get(files, j),
               (GtUword) flv[j].length,
               (GtUword) flv[j].effectivelength);
      }
    }
    if (arguments->verbose)
    {
      gt_progressbar_stop();
    }
    gt_sequence_buffer_delete(sb);
    gt_seq_iterator_delete(seqit);
  }
  gt_str_array_delete(files);
  gt_free(flv);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r15
movq %rcx, %r14
movl %edx, %ebx
movq %rsi, %r12
movl %edi, %r13d
testq %r8, %r8
je 0xa173a
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0xa1ae5
movq %r15, 0x38(%rsp)
testq %r14, %r14
je 0xa1ae0
callq 0x11be10
movq %rax, %rbp
cmpl %r13d, %ebx
jge 0xa176f
movslq %ebx, %rbx
movslq %r13d, %r15
movq (%r12,%rbx,8), %rsi
movq %rbp, %rdi
callq 0x11bee9
incq %rbx
cmpq %rbx, %r15
jne 0xa175b
movq %rbp, %rdi
callq 0xff877
movq %rax, %r12
movq %rbp, %rdi
callq 0x11c131
leaq 0x2a887f(%rip), %rdx    # 0x34a008
movl $0x10, %esi
movq %rax, %rdi
movl $0x88, %ecx
callq 0x10436a
movq %rax, %r13
movq %rbp, %rdi
movq 0x38(%rsp), %r15
movq %r15, %rsi
callq 0x115472
testq %rax, %rax
movq %rbp, %rbx
je 0xa1a69
movq %rax, %rdi
movq %r13, %rsi
movq %rax, %rbp
callq 0x115641
movq %rbp, 0x40(%rsp)
movq %rbp, %rdi
callq 0x114f43
movq %rax, %rbp
cmpb $0x1, 0x5(%r14)
jne 0xa17f5
movq %rbp, %rdi
movq %r12, %rsi
callq 0x11435e
movq %rax, %rdi
movq %r12, %rsi
callq 0x10ba28
leaq 0x18(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbp, 0x10(%rsp)
movq %rbp, %rdi
movq %r15, %r8
callq 0x11433d
cmpl $0x1, %eax
jne 0xa1a70
movq %r13, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq 0x10(%rsp), %rbx
cmpb $0x1, 0x2(%r14)
jne 0xa1886
movq 0x8(%rsp), %rdi
incq %rdi
movl $0x1, %esi
leaq 0x2a87ba(%rip), %rdx    # 0x34a008
movl $0xa2, %ecx
callq 0x10436a
movq %rax, %r13
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rax, %rdi
callq 0x17660
movq 0x8(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x16eef8
testl %eax, %eax
je 0xa188b
jmp 0xa1a5b
movq 0x20(%rsp), %r13
cmpb $0x0, 0x4(%r14)
jne 0xa1a14
movq 0x18(%r14), %rdi
movq 0x18(%rsp), %rdx
leaq 0x2a892d(%rip), %rsi    # 0x34a1d3
xorl %eax, %eax
callq 0xfee51
cmpq $0x0, 0x8(%rsp)
je 0xa19e3
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpb $0x1, (%r14)
jne 0xa1901
movzbl (%r13,%rbx), %r12d
leal -0x41(%r12), %eax
cmpl $0x34, %eax
ja 0xa1969
movabsq $0x18004500180045, %rcx # imm = 0x18004500180045
btq %rax, %rcx
jae 0xa1969
movq 0x18(%r14), %rsi
movl %r12d, %edi
callq 0xff0af
incq %rbp
xorl %r15d, %r15d
jmp 0xa199d
movzbl (%r13,%rbx), %edi
cmpb $0x1, 0x1(%r14)
jne 0xa194a
leal -0x42(%rdi), %eax
cmpl $0x38, %eax
ja 0xa19da
movl $0x1400001, %ecx        # imm = 0x1400001
btq %rax, %rcx
jb 0xa1958
movabsq $0x140000100000000, %rcx # imm = 0x140000100000000
btq %rax, %rcx
jae 0xa19da
testb $0x1, %r15b
jne 0xa199d
movq 0x18(%r14), %rsi
movl $0x6e, %edi
jmp 0xa1992
movq 0x18(%r14), %rsi
callq 0xff0af
incq %rbp
jmp 0xa199d
testb $0x1, %r15b
jne 0xa199d
movq 0x18(%r14), %rsi
movl $0x4e, %edi
jmp 0xa1992
testb $0x1, %r15b
jne 0xa199d
callq 0x17870
movq (%rax), %rax
movl %r12d, %ecx
movzwl (%rax,%rcx,2), %eax
xorl %edi, %edi
btl $0x8, %eax
setae %dil
movq 0x18(%r14), %rsi
shll $0x5, %edi
orl $0x4e, %edi
callq 0xff0af
incq %rbp
movb $0x1, %r15b
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0xa19c7
movq %rbp, %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0xa19c7
movq 0x18(%r14), %rdi
leaq 0x31e6e1(%rip), %rsi    # 0x3c009f
xorl %eax, %eax
callq 0xfee51
xorl %ebp, %ebp
incq %rbx
movq 0x8(%rsp), %rax
cmpq %rbx, %rax
ja 0xa18c0
jmp 0xa19e5
movq 0x18(%r14), %rsi
jmp 0xa18f1
xorl %eax, %eax
movq 0x8(%r14), %rcx
testq %rcx, %rcx
movq 0x38(%rsp), %r15
movq 0x10(%rsp), %rbx
je 0xa1a02
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
je 0xa1a14
movq 0x18(%r14), %rdi
leaq 0x31e692(%rip), %rsi    # 0x3c009f
xorl %eax, %eax
callq 0xfee51
cmpb $0x1, 0x2(%r14)
jne 0xa1a2f
movq %r13, %rdi
leaq 0x2a85e3(%rip), %rsi    # 0x34a008
movl $0xf0, %edx
callq 0x1045eb
movq $0x0, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r15, %r8
callq 0x11433d
cmpl $0x1, %eax
je 0xa1833
movl %eax, %ebp
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r13
jmp 0xa1a72
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xa1aa6
movl %eax, %ebp
cmpb $0x1, 0x3(%r14)
jne 0xa1a86
movq %rbx, %rdi
callq 0x11c131
testq %rax, %rax
jne 0xa1ad3
cmpb $0x1, 0x5(%r14)
jne 0xa1a92
callq 0x10bf8a
movq 0x40(%rsp), %rdi
callq 0x1153e9
movq 0x10(%rsp), %rdi
callq 0x11437f
movq %rbx, %rdi
callq 0x11c144
leaq 0x2a8553(%rip), %rsi    # 0x34a008
movq %r13, %rdi
movl $0x104, %edx            # imm = 0x104
callq 0x1045eb
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r13, %rsi
callq 0x199d9
jmp 0xa1a86
callq 0x19a4b
callq 0x199a2
nop