// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_shredder.c
// Function: gt_shredder_runner
static int gt_shredder_runner(GT_UNUSED int argc, const char **argv,
                              int parsed_args, void *tool_arguments,
                              GtError *err)
{
  ShredderArguments *arguments = tool_arguments;
  GtBioseqIterator *bsi;
  GtUword i;
  GtBioseq *bioseq;
  int had_err;
  GtStr *desc;

  gt_error_check(err);
  gt_assert(arguments);

  /* init */
  desc = gt_str_new();
  bsi = gt_bioseq_iterator_new(argc - parsed_args, argv + parsed_args);

  /* shredder */
  while (!(had_err = gt_bioseq_iterator_next(bsi, &bioseq, err)) && bioseq) {
    for (i = 0; i < arguments->coverage; i++) {
      GtShredder *shredder;
      GtUword fragment_offset,
              fragment_length;
      char *fragment;
      shredder = gt_shredder_new(bioseq, arguments->minlength,
                              arguments->maxlength);
      gt_shredder_set_overlap(shredder, arguments->overlap);
      gt_shredder_set_sample_probability(shredder,
                                         arguments->sample_probability);
      while ((fragment = gt_shredder_shred(shredder, &fragment_offset,
                                           &fragment_length, desc))) {
        if (arguments->clip_desc) {
          gt_str_clip_suffix(desc, ' ');
          gt_str_append_cstr(desc, "_");
          gt_str_append_uword(desc, fragment_offset);
          gt_str_append_cstr(desc, "_");
          gt_str_append_uword(desc, fragment_length);
          gt_str_append_cstr(desc, " [shreddered fragment]");
        }
        else {
          gt_str_append_cstr(desc, " [shreddered fragment]");
        }
        gt_fasta_show_entry(gt_str_get(desc), fragment, fragment_length,
                            arguments->width, arguments->outfp);
        gt_free(fragment);
      }
      gt_shredder_delete(shredder);
    }
    gt_bioseq_delete(bioseq);
  }

  /* free */
  gt_bioseq_iterator_delete(bsi);
  gt_str_delete(desc);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r15
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r12
movl %edi, %ebx
testq %r8, %r8
je 0x4d762
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0x4d937
movq %r15, 0x18(%rsp)
testq %r14, %r14
je 0x4d90d
callq 0xacb84
movq %rax, %r15
subl %ebp, %ebx
movslq %ebp, %rax
leaq (%r12,%rax,8), %rsi
movl %ebx, %edi
callq 0x5d64c
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rbp
leaq 0x10(%rsp), %r13
movq %r14, 0x28(%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
movq 0x18(%rsp), %rdx
callq 0x5d6eb
movl %eax, %ebx
testl %eax, %eax
jne 0x4d8ea
cmpq $0x0, (%rsp)
je 0x4d8ea
xorl %eax, %eax
cmpq 0x10(%r14), %rax
jae 0x4d8dc
movq %rax, 0x20(%rsp)
movq (%rsp), %rdi
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
callq 0x118b34
movq %rax, %rbx
movq 0x28(%r14), %rsi
movq %rax, %rdi
callq 0x118bcf
movsd 0x38(%r14), %xmm0
movq %rbx, %rdi
callq 0x118c10
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x118c95
testq %rax, %rax
je 0x4d8c7
movq %rax, %r12
cmpb $0x1, 0x40(%r14)
jne 0x4d87f
movq %r15, %rdi
pushq $0x20
popq %rsi
callq 0xad2df
movq %r15, %rdi
movq %rbx, %r14
movq %r13, %rbx
movq %rbp, %r13
leaq 0x32d1f0(%rip), %rbp    # 0x37aa34
movq %rbp, %rsi
callq 0xacbfb
movq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0xace26
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rbp
movq %rbx, %r13
movq %r14, %rbx
movq 0x28(%rsp), %r14
callq 0xacbfb
movq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0xace26
movq %r15, %rdi
leaq 0x2ad008(%rip), %rsi    # 0x2fa891
callq 0xacbfb
movq %r15, %rdi
callq 0xad1fa
movq 0x10(%rsp), %rdx
movq 0x8(%r14), %r8
movq 0x30(%r14), %rcx
movq %rax, %rdi
movq %r12, %rsi
callq 0x8c0bc
movq %r12, %rdi
leaq 0x2acd7c(%rip), %rsi    # 0x2fa634
movl $0x9a, %edx
callq 0x936f9
jmp 0x4d802
movq %rbx, %rdi
callq 0x118bba
movq 0x20(%rsp), %rax
incq %rax
jmp 0x4d7c5
movq (%rsp), %rdi
callq 0x5af87
jmp 0x4d79c
movq 0x8(%rsp), %rdi
callq 0x5d6c5
movq %r15, %rdi
callq 0xae103
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3ea654(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2976f5(%rip), %rsi    # 0x2e5013
leaq 0x2fad2e(%rip), %rdx    # 0x348653
leaq 0x2acf52(%rip), %rcx    # 0x2fa87e
leaq 0x2acd01(%rip), %r8     # 0x2fa634
pushq $0x79
jmp 0x4d95f
movq 0x3ea62a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2976cb(%rip), %rsi    # 0x2e5013
leaq 0x297870(%rip), %rdx    # 0x2e51bf
leaq 0x2acf28(%rip), %rcx    # 0x2fa87e
leaq 0x2accd7(%rip), %r8     # 0x2fa634
pushq $0x78
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nopl (%rax)