// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %r8, %r13
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r12
movl %edi, %ebx
testq %r8, %r8
je 0xcad3a
movq %r13, %rdi
callq 0x101a9a
testb %al, %al
jne 0xcaf38
testq %r14, %r14
je 0xcaf33
callq 0x1208f8
movq %rax, %r15
subl %ebp, %ebx
movslq %ebp, %rax
leaq (%r12,%rax,8), %rsi
movl %ebx, %edi
callq 0xd89fc
leaq 0x8(%rsp), %rsi
movq %rax, 0x10(%rsp)
movq %rax, %rdi
movq %r13, %rdx
callq 0xd8a72
movl %eax, %ebx
testl %eax, %eax
jne 0xcaf10
movq %r13, 0x28(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0xcaf10
leaq 0x40(%rsp), %rbp
leaq 0x20(%rsp), %r13
leaq 0x298b91(%rip), %r12    # 0x36392d
movq %r14, 0x38(%rsp)
cmpq $0x0, 0x10(%r14)
je 0xcaee0
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %rdi
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
callq 0x17caa4
movq %rax, %rbx
movq 0x28(%r14), %rsi
movq %rax, %rdi
callq 0x17cb16
movsd 0x38(%r14), %xmm0
movq %rbx, %rdi
callq 0x17cb26
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x17cb55
testq %rax, %rax
je 0xcaec4
movq %rax, %rbx
cmpb $0x1, 0x40(%r14)
jne 0xcae66
movq %r15, %rdi
movl $0x20, %esi
callq 0x120d6f
movq %r15, %rdi
movq %r12, %r14
movq %r13, %r12
movq %rbp, %r13
leaq 0x318f3e(%rip), %rbp    # 0x3e3d69
movq %rbp, %rsi
callq 0x12097f
movq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x120af4
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rbp
movq %r12, %r13
movq %r14, %r12
movq 0x38(%rsp), %r14
callq 0x12097f
movq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x120af4
movq %r15, %rdi
movq %r12, %rsi
callq 0x12097f
movq %r15, %rdi
callq 0x120d23
movq 0x20(%rsp), %rdx
movq 0x8(%r14), %r8
movq 0x30(%r14), %rcx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x102ec0
movq %rbx, %rdi
leaq 0x298835(%rip), %rsi    # 0x3636d0
movl $0x9a, %edx
callq 0x109670
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x17cb55
movq %rax, %rbx
testq %rax, %rax
jne 0xcae04
movq 0x18(%rsp), %rdi
callq 0x17caff
movq 0x30(%rsp), %rax
incq %rax
cmpq 0x10(%r14), %rax
jb 0xcadae
movq 0x8(%rsp), %rdi
callq 0xd6f28
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0xd8a72
movl %eax, %ebx
testl %eax, %eax
jne 0xcaf10
cmpq $0x0, 0x8(%rsp)
jne 0xcada1
movq 0x10(%rsp), %rdi
callq 0xd8a4a
movq %r15, %rdi
callq 0x121b03
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x20580
callq 0x20549
nopl (%rax)