// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_seqfilter.c
// Function: gt_seqfilter_runner
static int gt_seqfilter_runner(int argc, const char **argv, int parsed_args,
                               void *tool_arguments, GtError *err)
{
  SeqFilterArguments *arguments = tool_arguments;
  GtBioseqIterator *bsi;
  GtBioseq *bioseq;
  GtUint64 passed = 0, filtered = 0, num_of_sequences = 0, steps = 0;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(tool_arguments);

  bsi = gt_bioseq_iterator_new(argc - parsed_args, argv + parsed_args);

  while (!(had_err = gt_bioseq_iterator_next(bsi, &bioseq, err)) &&
         bioseq != NULL) {
    GtUword i;
    GtUint64 current_num = gt_bioseq_number_of_sequences(bioseq);
    for (i = 0;
         i < current_num &&
         (arguments->maxseqnum == GT_UNDEF_UWORD ||
          passed + 1 <= arguments->maxseqnum);
         i++) {
      char *seq;
      if ((arguments->step == 1 ||
           steps + 1 == arguments->step) &&
          (arguments->sample_prob == 1.0 ||
           gt_rand_0_to_1() <= arguments->sample_prob) &&
          (arguments->minlength == GT_UNDEF_UWORD ||
           gt_bioseq_get_sequence_length(bioseq, i) >= arguments->minlength) &&
          (arguments->maxlength == GT_UNDEF_UWORD ||
           gt_bioseq_get_sequence_length(bioseq, i) <= arguments->maxlength) &&
          (!arguments->nowildcards ||
           !gt_bioseq_seq_has_wildcards(bioseq, i))) {
        seq = gt_bioseq_get_sequence(bioseq, i);
        gt_fasta_show_entry(gt_bioseq_get_description(bioseq, i),
                            seq,
                            gt_bioseq_get_sequence_length(bioseq, i),
                            arguments->width, arguments->outfp);
        gt_free(seq);
        passed++;
      }
      else {
        filtered++;
      }
      steps = (steps + 1 == arguments->step) ? 0 : steps + 1;
    }
    filtered += current_num - i;
    num_of_sequences += current_num;
    gt_bioseq_delete(bioseq);
  }

  /* show statistics */
  if (!had_err) {
    gt_assert(passed + filtered == num_of_sequences);
    fprintf(stderr, "# " GT_LLU " out of " GT_LLU
            " sequences have been removed (%.3f%%)\n",
            filtered, num_of_sequences,
            ((double) filtered / num_of_sequences) * 100.0);
  }

  gt_bioseq_iterator_delete(bsi);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r15
movq %rcx, %r13
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %ebx
testq %r8, %r8
je 0x471cc
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0x47495
movq %r15, 0x28(%rsp)
testq %r13, %r13
je 0x47443
subl %ebp, %ebx
movslq %ebp, %rax
leaq (%r14,%rax,8), %rsi
movl %ebx, %edi
callq 0x5d64c
movq %rax, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x5d6eb
movl %eax, %ebx
testl %eax, %eax
jne 0x473a5
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x473a5
callq 0x5ba79
movq %rax, %rdx
xorl %ebx, %ebx
movq %rax, 0x10(%rsp)
cmpq %rbx, %rdx
je 0x4737d
movq 0x18(%r13), %rax
cmpq $-0x1, %rax
setne %cl
leaq 0x1(%rbp), %r14
cmpq %rax, %r14
seta %al
testb %al, %cl
jne 0x47380
movq 0x28(%r13), %rax
incq %r12
cmpq $0x1, %rax
je 0x47277
cmpq %rax, %r12
jne 0x472fa
movsd 0x38(%r13), %xmm0
ucomisd 0x29efa3(%rip), %xmm0   # 0x2e6228
jne 0x47289
jnp 0x4729f
callq 0x9576b
movq 0x10(%rsp), %rdx
movsd 0x38(%r13), %xmm1
ucomisd %xmm0, %xmm1
jb 0x472fa
cmpq $-0x1, 0x20(%r13)
je 0x472be
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b2f1
movq 0x10(%rsp), %rdx
cmpq 0x20(%r13), %rax
jb 0x472fa
cmpq $-0x1, 0x10(%r13)
je 0x472dd
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b2f1
movq 0x10(%rsp), %rdx
cmpq 0x10(%r13), %rax
ja 0x472fa
cmpb $0x1, 0x40(%r13)
jne 0x47312
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b730
movq 0x10(%rsp), %rdx
testb %al, %al
je 0x47312
incq %r15
cmpq 0x28(%r13), %r12
movl $0x0, %eax
cmoveq %rax, %r12
incq %rbx
jmp 0x4723b
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b1f9
movq %rax, %rbp
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b338
movq %r15, 0x30(%rsp)
movq %rax, %r15
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b2f1
movq (%r13), %r8
movq 0x30(%r13), %rcx
movq %r15, %rdi
movq 0x30(%rsp), %r15
movq %rbp, %rsi
movq %rax, %rdx
callq 0x8c0bc
movq %rbp, %rdi
leaq 0x2b1244(%rip), %rsi    # 0x2f85ad
movl $0xa3, %edx
callq 0x936f9
movq 0x10(%rsp), %rdx
movq %r14, %rbp
jmp 0x472fd
movq %rdx, %rbx
movq 0x18(%rsp), %rcx
movq %rdx, %rax
subq %rbx, %rax
addq %rax, %r15
addq %rdx, %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rsp), %rdi
callq 0x5af87
jmp 0x47200
testl %ebx, %ebx
je 0x473c4
movq 0x20(%rsp), %rdi
callq 0x5d6c5
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq %r15, %rbp
movq 0x3f0b9a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
movq 0x18(%rsp), %rcx
cmpq %rcx, %rbp
jne 0x47471
movq %r15, %xmm1
movq 0x2a04f4(%rip), %xmm2   # 0x2e78e0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2a04f8(%rip), %xmm3   # 0x2e78f0
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rcx, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
mulsd 0x2a23b3(%rip), %xmm0   # 0x2e97e0
leaq 0x2b139b(%rip), %rsi    # 0x2f87cf
movq %r15, %rdx
movb $0x1, %al
callq 0x17a50
jmp 0x473a9
movq 0x3f0b1e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x29dbbf(%rip), %rsi    # 0x2e5013
leaq 0x2aadaf(%rip), %rdx    # 0x2f220a
leaq 0x2b1333(%rip), %rcx    # 0x2f8795
leaq 0x2b1144(%rip), %r8     # 0x2f85ad
movl $0x86, %r9d
jmp 0x474c1
leaq 0x29db9b(%rip), %rsi    # 0x2e5013
leaq 0x2b132a(%rip), %rdx    # 0x2f87a9
leaq 0x2b130f(%rip), %rcx    # 0x2f8795
leaq 0x2b1120(%rip), %r8     # 0x2f85ad
movl $0xb2, %r9d
jmp 0x474c1
movq 0x3f0acc(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x29db6d(%rip), %rsi    # 0x2e5013
leaq 0x29dd12(%rip), %rdx    # 0x2e51bf
leaq 0x2b12e1(%rip), %rcx    # 0x2f8795
leaq 0x2b10f2(%rip), %r8     # 0x2f85ad
movl $0x85, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nopl (%rax)