// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movl %edi, 0x84(%rsp)
movq %rsi, 0x78(%rsp)
movl %edx, 0x74(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x6e6fb
movq 0x60(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x6e6c3
jmp 0x6e6fb
movq 0x5cd8d6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4a793f(%rip), %rsi    # 0x516013
leaq 0x4a7ae4(%rip), %rdx    # 0x5161bf
leaq 0x4bd349(%rip), %rcx    # 0x52ba2b
leaq 0x4bd0f8(%rip), %r8     # 0x52b7e1
movl $0x78, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6e6fd
jmp 0x6e6ff
cmpq $0x0, 0x58(%rsp)
jne 0x6e73f
movq 0x5cd892(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4a78fb(%rip), %rsi    # 0x516013
leaq 0x50c440(%rip), %rdx    # 0x57ab5f
leaq 0x4bd305(%rip), %rcx    # 0x52ba2b
leaq 0x4bd0b4(%rip), %r8     # 0x52b7e1
movl $0x79, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6e741
callq 0x11d4a0
movq %rax, 0x30(%rsp)
movl 0x84(%rsp), %edi
subl 0x74(%rsp), %edi
movq 0x78(%rsp), %rsi
movslq 0x74(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x88690
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rdx
leaq 0x40(%rsp), %rsi
callq 0x88790
movl %eax, %ecx
movl %ecx, 0x3c(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
jne 0x6e7a3
cmpq $0x0, 0x40(%rsp)
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x6e7b0
jmp 0x6e930
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x6e921
movq 0x40(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x58(%rsp), %rax
movq 0x20(%rax), %rdx
callq 0x1d7960
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x28(%rax), %rsi
callq 0x1d7a60
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rax
movsd 0x38(%rax), %xmm0
callq 0x1d7ad0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rcx
leaq 0x20(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x1d7ba0
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x6e904
movq 0x58(%rsp), %rax
testb $0x1, 0x40(%rax)
je 0x6e8aa
movq 0x30(%rsp), %rdi
movl $0x20, %esi
callq 0x11e050
movq 0x30(%rsp), %rdi
leaq 0x53df66(%rip), %rsi    # 0x5ac7c9
callq 0x11d550
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x11d930
movq 0x30(%rsp), %rdi
leaq 0x53df46(%rip), %rsi    # 0x5ac7c9
callq 0x11d550
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x11d930
movq 0x30(%rsp), %rdi
leaq 0x4bd19b(%rip), %rsi    # 0x52ba3e
callq 0x11d550
jmp 0x6e8bb
movq 0x30(%rsp), %rdi
leaq 0x4bd188(%rip), %rsi    # 0x52ba3e
callq 0x11d550
movq 0x30(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x58(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x58(%rsp), %rax
movq 0x8(%rax), %r8
callq 0xdbd10
movq 0x10(%rsp), %rdi
leaq 0x4bceec(%rip), %rsi    # 0x52b7e1
movl $0x9a, %edx
callq 0xe88c0
jmp 0x6e815
movq 0x28(%rsp), %rdi
callq 0x1d7a30
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x6e7b9
movq 0x40(%rsp), %rdi
callq 0x84960
jmp 0x6e771
movq 0x50(%rsp), %rdi
callq 0x88750
movq 0x30(%rsp), %rdi
callq 0x11f560
movl 0x3c(%rsp), %eax
addq $0x88, %rsp
retq