// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_sequniq.c
// Function: gt_sequniq_runner
static int gt_sequniq_runner(int argc, const char **argv, int parsed_args,
                             void *tool_arguments, GtError *err)
{
  GtSequniqArguments *arguments = tool_arguments;
  GtUint64 duplicates = 0, num_of_sequences = 0;
  int i, had_err = 0;
  GtMD5Set *md5set;

  gt_error_check(err);
  gt_assert(arguments);
  md5set = gt_md5set_new(arguments->nofseqs);
  if (!arguments->seqit) {
    GtUword j;
    GtBioseq *bs;

    for (i = parsed_args; !had_err && i < argc; i++) {
      if (!(bs = gt_bioseq_new(argv[i], err)))
        had_err = -1;
      if (!had_err) {
        GtMD5SetStatus retval;
        for (j = 0; j < gt_bioseq_number_of_sequences(bs) && !had_err; j++) {
          char *seq = gt_bioseq_get_sequence(bs, j);
          retval = gt_md5set_add_sequence(md5set, seq,
                                          gt_bioseq_get_sequence_length(bs, j),
                                          arguments->rev, err);
          if (retval == GT_MD5SET_NOT_FOUND)
            gt_fasta_show_entry(gt_bioseq_get_description(bs, j), seq,
                                gt_bioseq_get_sequence_length(bs, j),
                                arguments->width, arguments->outfp);
          else if (retval != GT_MD5SET_ERROR)
            duplicates++;
          else
            had_err = -1;
          num_of_sequences++;
          gt_free(seq);
        }
        gt_bioseq_delete(bs);
      }
    }
  }
  else {
    GtSeqIterator *seqit;
    GtStrArray *files;
    off_t totalsize;
    const GtUchar *sequence;
    char *desc;
    GtUword len;

    files = gt_str_array_new();
    for (i = parsed_args; i < argc; i++)
      gt_str_array_add_cstr(files, argv[i]);
    totalsize = gt_files_estimate_total_size(files);
    seqit = gt_seq_iterator_sequence_buffer_new(files, err);
    if (!seqit)
      had_err = -1;
    if (!had_err) {
      if (arguments->verbose) {
        gt_progressbar_start(gt_seq_iterator_getcurrentcounter(seqit,
                                                          (GtUint64) totalsize),
                             (GtUint64) totalsize);
      }
      while (!had_err) {
        GtMD5SetStatus retval;
        if ((gt_seq_iterator_next(seqit, &sequence, &len, &desc, err)) != 1)
          break;

        retval = gt_md5set_add_sequence(md5set, (const char*) sequence, len,
                                        arguments->rev, err);
        if (retval == GT_MD5SET_NOT_FOUND)
          gt_fasta_show_entry(desc, (const char*) sequence, len,
                              arguments->width, arguments->outfp);
        else if (retval != GT_MD5SET_ERROR)
          duplicates++;
        else
          had_err = -1;
        num_of_sequences++;
      }
      if (arguments->verbose)
        gt_progressbar_stop();
      gt_seq_iterator_delete(seqit);
    }
    gt_str_array_delete(files);
  }

  /* show statistics */
  if (!had_err) {
    fprintf(stderr,
            "# "GT_WU" out of "GT_WU" sequences have been removed (%.3f%%)\n",
            (GtUword)duplicates, (GtUword)num_of_sequences,
            ((double) duplicates / (double)num_of_sequences) * 100.0);
  }

  gt_md5set_delete(md5set);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r12
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r13
movl %edi, %ebx
testq %r8, %r8
je 0xc7957
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0xc7c53
testq %r14, %r14
je 0xc7c4e
movq 0x10(%r14), %rdi
callq 0x1689d4
cmpb $0x0, (%r14)
movq %rax, 0x20(%rsp)
movq %r12, 0x28(%rsp)
je 0xc7aa1
callq 0x121b54
cmpl %ebx, %ebp
movq %rax, 0x18(%rsp)
jge 0xc79ad
movslq %ebp, %r15
movslq %ebx, %rbx
movq (%r13,%r15,8), %rsi
movq 0x18(%rsp), %rdi
callq 0x121c30
movq 0x18(%rsp), %rax
incq %r15
cmpq %r15, %rbx
jne 0xc7991
movq %rax, %r15
movq %rax, %rdi
callq 0x104779
movq %rax, %rbx
movq %r15, %rdi
movq %r12, %rsi
callq 0x11a648
testq %rax, %rax
je 0xc7bfa
movq %rax, %r12
cmpb $0x1, 0x1(%r14)
jne 0xc79ef
movq %r12, %rdi
movq %rbx, %rsi
callq 0x119a32
movq %rax, %rdi
movq %rbx, %rsi
callq 0x110c6c
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rbx
testl %ebp, %ebp
jne 0xc7a88
movq %r12, %rdi
leaq 0x38(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq %rbx, %r8
callq 0x119a11
movl %eax, %r13d
cmpl $0x1, %eax
jne 0xc7a82
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movzbl 0x2(%r14), %ecx
movq %r15, %rdi
movq %rbx, %r8
callq 0x168c00
cmpl $-0x1, %eax
je 0xc7a74
testl %eax, %eax
jne 0xc7a78
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x8(%r14), %rcx
movq 0x20(%r14), %r8
callq 0x102ec0
jmp 0xc7a7d
movl %eax, %ebp
jmp 0xc7a7d
incq 0x10(%rsp)
incq 0x8(%rsp)
cmpl $0x1, %r13d
je 0xc7a0d
cmpb $0x1, 0x1(%r14)
jne 0xc7a94
callq 0x111189
movq %r12, %rdi
callq 0x119a53
jmp 0xc7c16
movq %rax, %r15
cmpl %ebx, %ebp
jge 0xc7be4
movslq %ebp, %rax
movslq %ebx, %rcx
movq %rcx, 0x18(%rsp)
movq %rax, %rbx
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq %r13, 0x48(%rsp)
movq (%r13,%rbx,8), %rdi
movq %r12, %rsi
callq 0xd69c0
testq %rax, %rax
je 0xc7bba
movq %rax, %r13
movq %rax, %rdi
callq 0xd75d2
testq %rax, %rax
je 0xc7bc1
movq %rbx, 0x40(%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd7118
movq %rax, %r12
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd71ae
movzbl 0x2(%r14), %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
movq 0x28(%rsp), %r8
callq 0x168c00
cmpl $-0x1, %eax
je 0xc7b74
testl %eax, %eax
jne 0xc7b78
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd71c2
movq %rax, %r15
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd71ae
movq 0x8(%r14), %rcx
movq 0x20(%r14), %r8
movq %r15, %rdi
movq 0x20(%rsp), %r15
movq %r12, %rsi
movq %rax, %rdx
callq 0x102ec0
jmp 0xc7b7d
movl %eax, %ebp
jmp 0xc7b7d
incq 0x10(%rsp)
movq %r12, %rdi
leaq 0x29a831(%rip), %rsi    # 0x3623b8
movl $0x8c, %edx
callq 0x109670
incq %rbx
movq %r13, %rdi
callq 0xd75d2
cmpq %rax, %rbx
jae 0xc7ba9
testl %ebp, %ebp
je 0xc7b04
addq %rbx, 0x8(%rsp)
movq 0x28(%rsp), %r12
movq 0x40(%rsp), %rbx
jmp 0xc7bc3
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xc7bcb
xorl %ebp, %ebp
movq %r13, %rdi
callq 0xd6f28
testl %ebp, %ebp
movq 0x48(%rsp), %r13
jne 0xc7c20
incq %rbx
cmpq 0x18(%rsp), %rbx
jl 0xc7ad1
jmp 0xc7c20
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0xc7c20
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %rdi
callq 0x121e8b
testl %ebp, %ebp
je 0xc7c3d
movq %r15, %rdi
callq 0x168bb4
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1f9a9
jmp 0xc7c24
callq 0x1fa1b
callq 0x1f972