// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_seqcorrect.c
// Function: gt_seqcorrect_find_seldom
static bool gt_seqcorrect_find_seldom(GtSeqcorrectArguments *arguments,
    GtEncseq *encseq, GtLogger *verbose_logger, GtTimer *timer, GtError *err)
{
  bool haserr = false;
#ifdef GT_THREADS_ENABLED
    const unsigned int threads = gt_jobs;
#else
  const unsigned int threads = 1U;
#endif
  unsigned int bucketkey_kmersize;
  GtRandomcodesFindSeldomData **data_array = NULL;
  unsigned int threadcount;
  GtUword nofseldomkmers = 0;
  GtBitsequence **seldom_reads = NULL;
  GtUword nofreads = GT_DIV2(gt_encseq_num_of_sequences(encseq));
  size_t seldomsize = GT_NUMOFINTSFORBITS(nofreads);

  data_array = gt_malloc(sizeof (*data_array) * threads);
  seldom_reads = gt_malloc(sizeof (**seldom_reads) * threads);
  gt_log_log("seldom finder kmersize=%u", arguments->correction_kmersize);
  haserr = gt_seqcorrect_bucketkey_kmersize(arguments,
      &bucketkey_kmersize, err);
  gt_logger_log(verbose_logger, "%u threads will be used",
      threads);

  for (threadcount = 0; !haserr && threadcount < threads; threadcount++)
  {
    GT_INITBITTAB(seldom_reads[threadcount], nofreads);
    data_array[threadcount] = gt_randomcodes_find_seldom_data_new(encseq,
        arguments->correction_kmersize, arguments->trusted_count,
        seldom_reads[threadcount]);
    if ((data_array[threadcount]) == NULL)
    {
      haserr = true;
    }
  }
  if (!haserr)
  {
    if (storerandomcodes_getencseqkmers_twobitencoding(encseq,
          bucketkey_kmersize,
          arguments->numofparts,
          arguments->maximumspace,
          arguments->usemaxdepth ? arguments->correction_kmersize : 0,
          arguments->correction_kmersize,
          arguments->usefirstcodes,
          arguments->samplingfactor,
          arguments->checksuftab,
          arguments->onlyaccum,
          arguments->onlyallrandomcodes,
          arguments->addbscache_depth,
          0,
          arguments->radixlarge ? false : true,
          arguments->radixparts,
          gt_randomcodes_find_seldom_process_bucket,
          NULL,
          data_array,
          verbose_logger,
          timer,
          err) != 0)
          {
            haserr = true;
          }
  }
  for (threadcount = 0; threadcount < threads; threadcount++)
  {
    if (!haserr) {
      gt_randomcodes_find_seldom_data_collect_stats(data_array[threadcount],
          threadcount, &nofseldomkmers);
    }
    gt_randomcodes_find_seldom_data_delete(data_array[threadcount]);
    if (threadcount > 0)
    {
      size_t pos;
      for (pos = 0; pos < seldomsize; pos++)
        seldom_reads[0][pos] |= seldom_reads[threadcount][pos];
      gt_free(seldom_reads[threadcount]);
    }
  }

  if (!haserr)
  {
    GtStr *filename = gt_str_clone(arguments->encseqinput);
    gt_logger_log(verbose_logger, "total seldom k-mers: "GT_WU"",
                  nofseldomkmers);
    gt_str_append_cstr(filename, GT_SEQCORRECT_SELDOMREADS_FILESUFFIX);
    if (gt_cntlist_show(seldom_reads[0], nofreads, gt_str_get(filename),
          false, err) != 0)
    {
      haserr = true;
    }
    gt_str_delete(filename);
  }

  gt_free(data_array);
  gt_free(seldom_reads[0]);
  gt_free(seldom_reads);

  return haserr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movq %rcx, 0x128(%rsp)
movq %r8, 0x120(%rsp)
movb $0x0, 0x11f(%rsp)
leaq 0x5d9b00(%rip), %rax    # 0x63d378
movl (%rax), %eax
movl %eax, 0x118(%rsp)
movq $0x0, 0x108(%rsp)
movq $0x0, 0xf8(%rsp)
movq $0x0, 0xf0(%rsp)
movq 0x138(%rsp), %rdi
callq 0xa9d50
shrq %rax
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rax
shrq $0x6, %rax
cmpq $0x0, %rax
jne 0x638de
movl $0x1, %eax
movq %rax, 0xc0(%rsp)
jmp 0x638fa
movq 0xe8(%rsp), %rax
subq $0x1, %rax
shrq $0x6, %rax
addq $0x1, %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movl 0x118(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x4c55d5(%rip), %rsi    # 0x528ef3
movl $0x259, %edx            # imm = 0x259
callq 0xe80f0
movq %rax, 0x108(%rsp)
movl 0x118(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x4c55af(%rip), %rsi    # 0x528ef3
movl $0x25a, %edx            # imm = 0x25A
callq 0xe80f0
movq %rax, 0xf0(%rsp)
movq 0x140(%rsp), %rax
movl 0xc(%rax), %esi
leaq 0x4c5cf8(%rip), %rdi    # 0x529660
movb $0x0, %al
callq 0xe7740
movq 0x140(%rsp), %rdi
movq 0x120(%rsp), %rdx
leaq 0x114(%rsp), %rsi
callq 0x63f40
andb $0x1, %al
movb %al, 0x11f(%rsp)
movq 0x130(%rsp), %rdi
movl 0x118(%rsp), %edx
leaq 0x4c5a77(%rip), %rsi    # 0x529422
movb $0x0, %al
callq 0xe7cd0
movl $0x0, 0x104(%rsp)
xorl %eax, %eax
testb $0x1, 0x11f(%rsp)
movb %al, 0xbf(%rsp)
jne 0x639e8
movl 0x104(%rsp), %eax
cmpl 0x118(%rsp), %eax
setb %al
movb %al, 0xbf(%rsp)
movb 0xbf(%rsp), %al
testb $0x1, %al
jne 0x639f8
jmp 0x63b24
movq 0xe8(%rsp), %rax
shrq $0x6, %rax
cmpq $0x0, %rax
jne 0x63a19
movl $0x1, %eax
movq %rax, 0xb0(%rsp)
jmp 0x63a35
movq 0xe8(%rsp), %rax
subq $0x1, %rax
shrq $0x6, %rax
addq $0x1, %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rsi
shlq $0x3, %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0x4c5497(%rip), %rdx    # 0x528ef3
movl $0x263, %ecx            # imm = 0x263
callq 0xe8540
movq %rax, %rdx
movq 0xf0(%rsp), %rax
movl 0x104(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0xf0(%rsp), %rax
movl 0x104(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movq 0xd8(%rsp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x19360
movq 0x138(%rsp), %rdi
movq 0x140(%rsp), %rax
movl 0xc(%rax), %esi
movq 0x140(%rsp), %rax
movl 0x14(%rax), %edx
movq 0xf0(%rsp), %rax
movl 0x104(%rsp), %ecx
movq (%rax,%rcx,8), %rcx
callq 0x26c130
movq %rax, %rdx
movq 0x108(%rsp), %rax
movl 0x104(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x108(%rsp), %rax
movl 0x104(%rsp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x63b0c
movb $0x1, 0x11f(%rsp)
jmp 0x63b0e
movl 0x104(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x104(%rsp)
jmp 0x639bd
testb $0x1, 0x11f(%rsp)
jne 0x63cf4
movq 0x138(%rsp), %rax
movq %rax, 0x98(%rsp)
movl 0x114(%rsp), %eax
movl %eax, 0xa0(%rsp)
movq 0x140(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0xa4(%rsp)
movq 0x140(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0x140(%rsp), %rax
testb $0x1, 0x7(%rax)
je 0x63b98
movq 0x140(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0x94(%rsp)
jmp 0x63ba3
xorl %eax, %eax
movl %eax, 0x94(%rsp)
jmp 0x63ba3
movl 0x94(%rsp), %r8d
movq 0x140(%rsp), %rax
movl 0xc(%rax), %r9d
movq 0x140(%rsp), %rax
movb (%rax), %r10b
movq 0x140(%rsp), %rax
movl 0x10(%rax), %r15d
movq 0x140(%rsp), %rax
movb 0x6(%rax), %r11b
movq 0x140(%rsp), %rax
movb 0x3(%rax), %bl
movq 0x140(%rsp), %rax
movb 0x4(%rax), %bpl
movq 0x140(%rsp), %rax
movl 0x20(%rax), %r12d
movq 0x140(%rsp), %rax
movb 0x5(%rax), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %r14b
movq 0x140(%rsp), %rax
movl 0x1c(%rax), %r13d
movq 0x108(%rsp), %rcx
movq 0x130(%rsp), %rdx
movq 0x128(%rsp), %rsi
movq 0x120(%rsp), %rdi
xorl %eax, %eax
movq %rsp, %rax
movq %rax, 0x88(%rsp)
movq %rdi, 0x70(%rax)
movq 0x98(%rsp), %rdi
movq %rsi, 0x68(%rax)
movl 0xa0(%rsp), %esi
movq %rdx, 0x60(%rax)
movl 0xa4(%rsp), %edx
movq %rcx, 0x58(%rax)
leaq 0x20829e(%rip), %rcx    # 0x26bf20
movq %rcx, 0x48(%rax)
movq 0xa8(%rsp), %rcx
movl %r13d, 0x40(%rax)
movl %r12d, 0x28(%rax)
movl %r15d, 0x8(%rax)
movzbl %r14b, %r14d
andl $0x1, %r14d
movl %r14d, 0x38(%rax)
movzbl %bpl, %ebp
andl $0x1, %ebp
movl %ebp, 0x20(%rax)
movzbl %bl, %ebx
andl $0x1, %ebx
movl %ebx, 0x18(%rax)
movzbl %r11b, %r11d
andl $0x1, %r11d
movl %r11d, 0x10(%rax)
movzbl %r10b, %r10d
andl $0x1, %r10d
movl %r10d, (%rax)
movq $0x0, 0x50(%rax)
movq $0x0, 0x30(%rax)
callq 0x26c9d0
cmpl $0x0, %eax
je 0x63cf2
movb $0x1, 0x11f(%rsp)
jmp 0x63cf4
movl $0x0, 0x104(%rsp)
movl 0x104(%rsp), %eax
cmpl 0x118(%rsp), %eax
jae 0x63e14
testb $0x1, 0x11f(%rsp)
jne 0x63d44
movq 0x108(%rsp), %rax
movl 0x104(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movl 0x104(%rsp), %esi
leaq 0xf8(%rsp), %rdx
callq 0x26c200
movq 0x108(%rsp), %rax
movl 0x104(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x26c250
cmpl $0x0, 0x104(%rsp)
jbe 0x63dfc
movq $0x0, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
cmpq 0xe0(%rsp), %rax
jae 0x63dd8
movq 0xf0(%rsp), %rax
movl 0x104(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq 0xd0(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0xf0(%rsp), %rax
movq (%rax), %rax
movq 0xd0(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0xd0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xd0(%rsp)
jmp 0x63d76
movq 0xf0(%rsp), %rax
movl 0x104(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x4c5101(%rip), %rsi    # 0x528ef3
movl $0x293, %edx            # imm = 0x293
callq 0xe88c0
jmp 0x63dfe
movl 0x104(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x104(%rsp)
jmp 0x63cff
testb $0x1, 0x11f(%rsp)
jne 0x63ed3
movq 0x140(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x11e280
movq %rax, 0xc8(%rsp)
movq 0x130(%rsp), %rdi
movq 0xf8(%rsp), %rdx
leaq 0x4c5828(%rip), %rsi    # 0x52967a
movb $0x0, %al
callq 0xe7cd0
movq 0xc8(%rsp), %rdi
leaq 0x4c582b(%rip), %rsi    # 0x529693
callq 0x11d550
movq 0xf0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x78(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x11dee0
movq 0x78(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq %rax, %rdx
movq 0x120(%rsp), %r8
xorl %ecx, %ecx
callq 0x275100
cmpl $0x0, %eax
je 0x63ec6
movb $0x1, 0x11f(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x11f560
movq 0x108(%rsp), %rdi
leaq 0x4c5011(%rip), %rsi    # 0x528ef3
movl $0x2a5, %edx            # imm = 0x2A5
callq 0xe88c0
movq 0xf0(%rsp), %rax
movq (%rax), %rdi
leaq 0x4c4ff5(%rip), %rsi    # 0x528ef3
movl $0x2a6, %edx            # imm = 0x2A6
callq 0xe88c0
movq 0xf0(%rsp), %rdi
leaq 0x4c4fdc(%rip), %rsi    # 0x528ef3
movl $0x2a7, %edx            # imm = 0x2A7
callq 0xe88c0
movb 0x11f(%rsp), %al
andb $0x1, %al
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)