// File: /workspace/github_c_makefile_star2_O3/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, %r15
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r12
movl %edi, %ebx
testq %r8, %r8
je 0xc57cf
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0xc5aed
testq %r14, %r14
je 0xc5ae8
movq %r15, 0x18(%rsp)
movq 0x10(%r14), %rdi
callq 0x160c28
movq %rax, 0x20(%rsp)
cmpb $0x0, (%r14)
je 0xc5914
callq 0x11be10
movq %rax, %r13
cmpl %ebx, %ebp
jge 0xc581b
movslq %ebp, %r15
movslq %ebx, %rbx
movq (%r12,%r15,8), %rsi
movq %r13, %rdi
callq 0x11bee9
incq %r15
cmpq %r15, %rbx
jne 0xc5807
movq %r13, %rdi
callq 0xff877
movq %rax, %r12
movq %r13, %rdi
movq 0x18(%rsp), %r15
movq %r15, %rsi
callq 0x114f10
testq %rax, %rax
movq %r13, 0x10(%rsp)
je 0xc5a60
movq %rax, %rbx
cmpb $0x1, 0x1(%r14)
jne 0xc5864
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11435e
movq %rax, %rdi
movq %r12, %rsi
callq 0x10ba28
leaq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x38(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %r8
callq 0x11433d
cmpl $0x1, %eax
jne 0xc5a73
movl $0x1, %ebp
movq $0x0, 0x8(%rsp)
leaq 0x28(%rsp), %r12
leaq 0x38(%rsp), %r13
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movzbl 0x2(%r14), %ecx
movq 0x20(%rsp), %rdi
movq %r15, %r8
callq 0x160e50
testl %eax, %eax
je 0xc58cf
cmpl $-0x1, %eax
je 0xc5a83
incq 0x8(%rsp)
jmp 0xc58eb
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x8(%r14), %rcx
movq 0x20(%r14), %r8
callq 0xfe000
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x11433d
incq %rbp
cmpl $0x1, %eax
je 0xc589f
decq %rbp
xorl %r13d, %r13d
jmp 0xc5a89
cmpl %ebx, %ebp
jge 0xc5acc
movslq %ebp, %rax
movslq %ebx, %rcx
movq %rcx, 0x40(%rsp)
movq %rax, %rbx
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
movq 0x18(%rsp), %r15
movq %r12, 0x48(%rsp)
movq (%r12,%rbx,8), %rdi
movq %r15, %rsi
callq 0xd4388
testq %rax, %rax
je 0xc5a59
movq %rax, %r12
movq %rax, %rdi
callq 0xd4fc8
testq %rax, %rax
je 0xc5a34
movq %rbx, 0x50(%rsp)
movq %rbp, 0x10(%rsp)
xorl %ebx, %ebx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd4b0d
movq %rax, %rbp
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd4ba3
movzbl 0x2(%r14), %ecx
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq %r15, %r8
callq 0x160e50
movl %eax, %r13d
cmpl $-0x1, %eax
je 0xc59e3
testl %r13d, %r13d
jne 0xc59e8
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd4bb7
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd4ba3
movq 0x8(%r14), %rcx
movq 0x20(%r14), %r8
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0xfe000
jmp 0xc59ed
xorl %r15d, %r15d
jmp 0xc59f3
incq 0x8(%rsp)
xorl %r13d, %r13d
movb $0x1, %r15b
movq %rbp, %rdi
leaq 0x29396b(%rip), %rsi    # 0x359368
movl $0x8c, %edx
callq 0x1045eb
incq %rbx
movq %r12, %rdi
callq 0xd4fc8
testb %r15b, %r15b
movq 0x18(%rsp), %r15
je 0xc5a25
cmpq %rax, %rbx
jb 0xc5974
movq 0x10(%rsp), %rbp
addq %rbx, %rbp
movq 0x50(%rsp), %rbx
jmp 0xc5a37
xorl %r13d, %r13d
movq %r12, %rdi
callq 0xd491d
testl %r13d, %r13d
jne 0xc5aa7
incq %rbx
cmpq 0x40(%rsp), %rbx
movq 0x48(%rsp), %r12
jl 0xc593f
jmp 0xc5aa7
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xc5ab1
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
jmp 0xc5a9d
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
jmp 0xc5a89
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpb $0x1, 0x1(%r14)
jne 0xc5a95
callq 0x10bf8a
movq %rbx, %rdi
callq 0x11437f
movq 0x10(%rsp), %rdi
callq 0x11c144
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %r13d, %r13d
je 0xc5ad7
movq 0x20(%rsp), %rdi
callq 0x160e04
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x1f61f
xorl %ebx, %ebx
jmp 0xc5ab1
callq 0x1f691
callq 0x1f5e8
nop