// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_seq.c
// Function: gt_seq_runner
static int gt_seq_runner(int argc, const char **argv, int parsed_args,
                         void *tool_arguments, GtError *err)
{
  SeqArguments *arguments = tool_arguments;
  GtBioseq *bioseq;
  int arg = parsed_args, had_err = 0;
  gt_error_check(err);
  gt_assert(tool_arguments);

  while (!had_err && arg < argc) {
    /* bioseq construction */
    if (arguments->recreate)
      bioseq = gt_bioseq_new_recreate(argv[arg], err);
    else
      bioseq = gt_bioseq_new(argv[arg], err);
    if (!bioseq)
      had_err = -1;

    /* output */
    if (!had_err && arguments->showfasta)
      gt_bioseq_show_as_fasta(bioseq, arguments->width, arguments->outfp);

    if (!had_err && (arguments->showseqnum != GT_UNDEF_UWORD ||
                     arguments->showseqlength != GT_UNDEF_UWORD ||
                     gt_str_length(arguments->showseqnum_inputfile) > 0))
    {
      GtUword maxseqnum = gt_bioseq_number_of_sequences(bioseq);
      if (arguments->seqnum_from_0)
      {
        gt_assert(maxseqnum > 0);
        maxseqnum--;
      }
      if (arguments->showseqnum != GT_UNDEF_UWORD ||
          arguments->showseqlength != GT_UNDEF_UWORD)
      {
        if ((arguments->showseqnum != GT_UNDEF_UWORD &&
             arguments->showseqnum > maxseqnum) ||
            (arguments->showseqlength != GT_UNDEF_UWORD &&
             arguments->showseqlength > maxseqnum))
        {
          gt_error_set(err, "argument '" GT_WU "' to option '-showseq%s' "
                            "is too large. The largest possible number is '"
                            GT_WU "'",
                     arguments->showseqnum,
                     arguments->showseqnum != GT_UNDEF_UWORD ? "num"
                                                             : "length",
                     maxseqnum);
          had_err = -1;
        }
        if (!had_err) {
          if (arguments->showseqnum != GT_UNDEF_UWORD)
          {
            gt_bioseq_show_sequence_as_fasta(bioseq,
                                             arguments->seqnum_from_0
                                               ? arguments->showseqnum
                                               : arguments->showseqnum - 1,
                                             arguments->width,
                                             arguments->outfp);
          } else
          {
            GtUword seqnum = arguments->seqnum_from_0
                               ? arguments->showseqlength
                               : arguments->showseqlength - 1;
            gt_file_xprintf(arguments->outfp,GT_WU "\n",
                            gt_bioseq_get_sequence_length(bioseq, seqnum));
          }
        }
      } else
      {
        FILE *fpin;

        gt_assert(gt_str_length(arguments->showseqnum_inputfile) > 0);
        if (strcmp(gt_str_get(arguments->showseqnum_inputfile),"-") == 0)
        {
          fpin = stdin;
        } else
        {
          fpin = gt_efopen(gt_str_get(arguments->showseqnum_inputfile),
                           "rb",err);
        }
        if (fpin == NULL)
        {
          had_err = -1;
        } else
        {
          GtWord seqnum_input;
          while (fscanf(fpin,GT_WD,&seqnum_input) == 1)
          {
            if (seqnum_input < 0 ||
                (!arguments->seqnum_from_0 && seqnum_input == 0) ||
                (GtUword) seqnum_input > maxseqnum)
            {
              gt_error_set(err, "sequence number '" GT_WD "' is not in range "
                                "[%d," GT_WU "]",
                                 seqnum_input,
                                 arguments->seqnum_from_0 ? 0 : 1,
                                 maxseqnum);
              had_err = -1;
            }
            if (!had_err)
            {
              gt_bioseq_show_sequence_as_fasta(bioseq,
                                           arguments->seqnum_from_0
                                             ? (GtUword) seqnum_input
                                             : (GtUword) seqnum_input - 1,
                                           arguments->width, arguments->outfp);
            }
          }
          if (strcmp(gt_str_get(arguments->showseqnum_inputfile),"-") == 0)
          {
            fclose(fpin);
          }
        }
      }
    }

    if (!had_err && arguments->gc_content)
      gt_bioseq_show_gc_content(bioseq, arguments->outfp);

    if (!had_err && arguments->stat)
      gt_bioseq_show_stat(bioseq, arguments->outfp);

    if (!had_err && arguments->seqlengthdistri)
      gt_bioseq_show_seqlengthdistri(bioseq, arguments->outfp);

    /* free */
    gt_bioseq_delete(bioseq);

    arg++;
  }

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r13
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, 0x20(%rsp)
movl %edi, %r15d
testq %r8, %r8
je 0xc1742
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0xc1a4e
testq %r14, %r14
je 0xc1a49
xorl %r12d, %r12d
cmpl %r15d, %ebp
jge 0xc1a2d
movslq %ebp, %rbx
movslq %r15d, %rax
movq %rax, 0x18(%rsp)
movq %r13, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq (%rax,%rbx,8), %rdi
cmpb $0x1, (%r14)
jne 0xc1780
movq %r13, %rsi
callq 0xd48ab
jmp 0xc1788
movq %r13, %rsi
callq 0xd4388
movq %rax, %rbp
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xc19fc
cmpb $0x1, 0x1(%r14)
jne 0xc17b1
movq 0x18(%r14), %rsi
movq 0x30(%r14), %rdx
movq %rbp, %rdi
callq 0xd5077
cmpq $-0x1, 0x8(%r14)
jne 0xc17d1
cmpq $-0x1, 0x10(%r14)
jne 0xc17d1
movq 0x20(%r14), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0xc19c0
movq %rbp, %rdi
callq 0xd4fc8
movq %rax, %r13
movb 0x5(%r14), %al
cmpb $0x1, %al
jne 0xc17f0
testq %r13, %r13
je 0xc1a3f
decq %r13
movq 0x8(%r14), %rdx
cmpq $-0x1, %rdx
je 0xc183f
leaq 0x2c3672(%rip), %rcx    # 0x384e73
cmpq %r13, %rdx
ja 0xc1859
movq 0x10(%r14), %rsi
cmpq $-0x1, %rsi
je 0xc181c
leaq 0x2c365c(%rip), %rcx    # 0x384e73
cmpq %r13, %rsi
ja 0xc1859
xorb $0x1, %al
movzbl %al, %eax
subq %rax, %rdx
movq 0x18(%r14), %rax
movq 0x30(%r14), %rcx
movq %rbp, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xd511a
jmp 0xc19c0
movq 0x10(%r14), %rsi
cmpq $-0x1, %rsi
je 0xc1874
leaq 0x2ffbdd(%rip), %rcx    # 0x3c142d
cmpq %r13, %rsi
jbe 0xc1998
movq 0x8(%rsp), %rdi
leaq 0x2964d8(%rip), %rsi    # 0x357d3d
movq %r13, %r8
xorl %eax, %eax
callq 0xfcb67
jmp 0xc19fc
movq 0x20(%r14), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0xc1a44
movq 0x20(%r14), %rdi
callq 0x11b0a1
cmpb $0x2d, (%rax)
jne 0xc189e
cmpb $0x0, 0x1(%rax)
je 0xc1a1e
movq 0x20(%r14), %rdi
callq 0x11b0a1
movq %rax, %rdi
leaq 0x2e3e6c(%rip), %rsi    # 0x3a571d
movq 0x8(%rsp), %rdx
callq 0xe754c
movq %rax, %r15
testq %r15, %r15
je 0xc19fc
xorl %r12d, %r12d
movq %r15, %rdi
leaq 0x2ba9f0(%rip), %rsi    # 0x37c2c4
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x17ea0
cmpl $0x1, %eax
jne 0xc1975
xorl %r12d, %r12d
movq 0x10(%rsp), %rdx
movzbl 0x5(%r14), %ecx
testq %rdx, %rdx
js 0xc1937
movl %ecx, %eax
xorb $0x1, %al
testq %rdx, %rdx
sete %sil
testb %al, %sil
jne 0xc1937
cmpq %r13, %rdx
ja 0xc1937
testl %r12d, %r12d
jne 0xc1956
xorq $0x1, %rcx
subq %rcx, %rdx
movq 0x18(%r14), %rax
movq 0x30(%r14), %rcx
movq %rbp, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xd511a
xorl %r12d, %r12d
jmp 0xc1956
xorl $0x1, %ecx
movq 0x8(%rsp), %rdi
leaq 0x296483(%rip), %rsi    # 0x357dc9
movq %r13, %r8
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r15, %rdi
leaq 0x2ba964(%rip), %rsi    # 0x37c2c4
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x17ea0
cmpl $0x1, %eax
je 0xc18ec
movq 0x20(%r14), %rdi
callq 0x11b0a1
cmpb $0x2d, (%rax)
jne 0xc1991
cmpb $0x0, 0x1(%rax)
jne 0xc1991
movq %r15, %rdi
callq 0x17800
testl %r12d, %r12d
jne 0xc19fc
jmp 0xc19c0
xorb $0x1, %al
movzbl %al, %eax
subq %rax, %rsi
movq 0x30(%r14), %r15
movq %rbp, %rdi
callq 0xd4ba3
movq %r15, %rdi
leaq 0x28f072(%rip), %rsi    # 0x350a28
movq %rax, %rdx
xorl %eax, %eax
callq 0xfee51
cmpb $0x1, 0x2(%r14)
jne 0xc19d3
movq 0x30(%r14), %rsi
movq %rbp, %rdi
callq 0xd51ad
cmpb $0x1, 0x3(%r14)
jne 0xc19e6
movq 0x30(%r14), %rsi
movq %rbp, %rdi
callq 0xd52e6
xorl %r12d, %r12d
cmpb $0x1, 0x4(%r14)
jne 0xc19fc
movq 0x30(%r14), %rsi
movq %rbp, %rdi
callq 0xd53af
movq %rbp, %rdi
callq 0xd491d
testl %r12d, %r12d
jne 0xc1a2d
incq %rbx
cmpq 0x18(%rsp), %rbx
movq 0x8(%rsp), %r13
jl 0xc1767
jmp 0xc1a2d
movq 0x3f74fb(%rip), %rax    # 0x4b8f20
movq (%rax), %r15
jmp 0xc18be
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1ebd8
callq 0x1eb9f
callq 0x1ec11
callq 0x1eb66
nop