// File: /workspace/github_c_makefile_star2_O3/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 0xc8b12
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0xc8d13
movq %r15, 0x8(%rsp)
testq %r14, %r14
je 0xc8d0e
callq 0x11ac6c
movq %rax, %r15
subl %ebp, %ebx
movslq %ebp, %rax
leaq (%r12,%rax,8), %rsi
movl %ebx, %edi
callq 0xd63a0
movq %rsp, %r12
movq %rax, 0x10(%rsp)
movq %rax, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %r13
movq %r13, %rdx
callq 0xd6416
movl %eax, %ebx
testl %eax, %eax
sete %al
movq (%r12), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc8ceb
movq %r13, %r12
leaq 0x30(%rsp), %rbp
leaq 0x18(%rsp), %r13
movq %r14, 0x28(%rsp)
cmpq $0x0, 0x10(%r14)
je 0xc8cc3
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq (%rsp), %rdi
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
callq 0x1746a8
movq %rax, %r12
movq 0x28(%r14), %rsi
movq %rax, %rdi
callq 0x17471a
movsd 0x38(%r14), %xmm0
movq %r12, %rdi
callq 0x17472a
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x174759
testq %rax, %rax
je 0xc8ca0
movq %rax, %rbx
cmpb $0x1, 0x40(%r14)
jne 0xc8c40
movq %r15, %rdi
movl $0x20, %esi
callq 0x11b0ed
movq %r15, %rdi
movq %r12, %r14
movq %r13, %r12
movq %rbp, %r13
leaq 0x311a0f(%rip), %rbp    # 0x3da614
movq %rbp, %rsi
callq 0x11acf3
movq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x11ae72
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rbp
movq %r12, %r13
movq %r14, %r12
movq 0x28(%rsp), %r14
callq 0x11acf3
movq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x11ae72
movq %r15, %rdi
leaq 0x291c6f(%rip), %rsi    # 0x35a8b9
callq 0x11acf3
movq %r15, %rdi
callq 0x11b0a1
movq 0x18(%rsp), %rdx
movq 0x8(%r14), %r8
movq 0x30(%r14), %rcx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xfe000
movq %rbx, %rdi
leaq 0x2919e3(%rip), %rsi    # 0x35a65c
movl $0x9a, %edx
callq 0x1045eb
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x174759
movq %rax, %rbx
testq %rax, %rax
jne 0xc8bde
movq %r12, %rdi
callq 0x174703
movq 0x20(%rsp), %rax
incq %rax
cmpq 0x10(%r14), %rax
jb 0xc8b8e
movq (%rsp), %rdi
movq 0x8(%rsp), %r12
callq 0xd491d
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
movq %r12, %rdx
callq 0xd6416
movl %eax, %ebx
testl %eax, %eax
jne 0xc8ceb
movq (%rsp), %rdi
testq %rdi, %rdi
jne 0xc8b81
movq 0x10(%rsp), %rdi
callq 0xd63ee
movq %r15, %rdi
callq 0x11bdbf
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x20184
callq 0x2014d