// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_seqcorrect.c
// Function: gt_seqcorrect_correct
static bool gt_seqcorrect_correct(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 iteration;
  unsigned int bucketkey_kmersize;
  GtUword cumulative_nofcorrections = 0;
  GtRandomcodesCorrectData **data_array = NULL;

  data_array = gt_malloc(sizeof (*data_array) * threads);
  gt_log_log("correction 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);
  gt_logger_log(verbose_logger, "%u iterations will be run",
      arguments->iterations);

  for (iteration = 1U; iteration <= arguments->iterations && !haserr;
      iteration++)
  {
    unsigned int threadcount;
    GtUword nofkmergroups = 0, nofkmeritvs = 0, nofcorrections = 0,
                  nofkmers = 0;

    gt_logger_log(verbose_logger, "iteration %u will now start...",
        iteration);

    for (threadcount = 0; !haserr && threadcount < threads; threadcount++)
    {
      data_array[threadcount] = gt_randomcodes_correct_data_new(encseq,
          arguments->correction_kmersize, arguments->trusted_count,
          gt_str_get(arguments->encseqinput),
          GT_SEQCORRECT_CORRECTIONSLIST_FILESUFFIX, threadcount, err);
      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_correct_process_bucket,
            NULL,
            data_array,
            verbose_logger,
            timer,
            err) != 0)
            {
              haserr = true;
            }
    }
    for (threadcount = 0; threadcount < threads; threadcount++)
    {
      if (!haserr) {
        gt_randomcodes_correct_data_collect_stats(data_array[threadcount],
            threadcount, &nofkmergroups, &nofkmeritvs, &nofkmers,
            &nofcorrections);
      }
      gt_randomcodes_correct_data_delete(data_array[threadcount]);
    }
    cumulative_nofcorrections += nofcorrections;

    gt_logger_log(verbose_logger, "[iteration %u] "
        "total number of k-mers: "GT_WU"", iteration, nofkmers);
    gt_logger_log(verbose_logger, "[iteration %u] "
        "number of different k-mers: "GT_WU"", iteration, nofkmeritvs);
    gt_logger_log(verbose_logger, "[iteration %u] "
        "number of different k-1-mers: "GT_WU"", iteration, nofkmergroups);
    gt_logger_log(verbose_logger, "[iteration %u] "
        "number of kmer corrections: "GT_WU"", iteration, nofcorrections);

    if (!haserr) {
      gt_logger_log(verbose_logger, "[iteration %u] apply corrections...",
          iteration);
      if (gt_seqcorrect_apply_corrections(encseq,
            gt_str_get(arguments->encseqinput), threads, err) != 0) {
        haserr = true;
      }
    }
  }
  gt_logger_log(verbose_logger, "total corrections: "GT_WU"",
      cumulative_nofcorrections);
  gt_free(data_array);
  return haserr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movq %rdx, 0x120(%rsp)
movq %rcx, 0x118(%rsp)
movq %r8, 0x110(%rsp)
movb $0x0, 0x10f(%rsp)
leaq 0x5da1a0(%rip), %rax    # 0x63d378
movl (%rax), %eax
movl %eax, 0x108(%rsp)
movq $0x0, 0xf8(%rsp)
movq $0x0, 0xf0(%rsp)
movl 0x108(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x4c5ce6(%rip), %rsi    # 0x528ef3
movl $0x1ec, %edx            # imm = 0x1EC
callq 0xe80f0
movq %rax, 0xf0(%rsp)
movq 0x130(%rsp), %rax
movl 0xc(%rax), %esi
leaq 0x4c61da(%rip), %rdi    # 0x52940b
movb $0x0, %al
callq 0xe7740
movq 0x130(%rsp), %rdi
movq 0x110(%rsp), %rdx
leaq 0x100(%rsp), %rsi
callq 0x63f40
andb $0x1, %al
movb %al, 0x10f(%rsp)
movq 0x120(%rsp), %rdi
movl 0x108(%rsp), %edx
leaq 0x4c61ae(%rip), %rsi    # 0x529422
movb $0x0, %al
callq 0xe7cd0
movq 0x120(%rsp), %rdi
movq 0x130(%rsp), %rax
movl 0x28(%rax), %edx
leaq 0x4c61a5(%rip), %rsi    # 0x52943a
movb $0x0, %al
callq 0xe7cd0
movl $0x1, 0x104(%rsp)
movl 0x104(%rsp), %ecx
movq 0x130(%rsp), %rdx
xorl %eax, %eax
cmpl 0x28(%rdx), %ecx
movb %al, 0xc7(%rsp)
ja 0x632d4
movb 0x10f(%rsp), %al
xorb $-0x1, %al
movb %al, 0xc7(%rsp)
movb 0xc7(%rsp), %al
testb $0x1, %al
jne 0x632e4
jmp 0x637dd
movq $0x0, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc8(%rsp)
movq 0x120(%rsp), %rdi
movl 0x104(%rsp), %edx
leaq 0x4c612a(%rip), %rsi    # 0x529454
movb $0x0, %al
callq 0xe7cd0
movl $0x0, 0xec(%rsp)
xorl %eax, %eax
testb $0x1, 0x10f(%rsp)
movb %al, 0xc6(%rsp)
jne 0x63367
movl 0xec(%rsp), %eax
cmpl 0x108(%rsp), %eax
setb %al
movb %al, 0xc6(%rsp)
movb 0xc6(%rsp), %al
testb $0x1, %al
jne 0x63377
jmp 0x63441
movq 0x128(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x130(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0xbc(%rsp)
movq 0x130(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0xc0(%rsp)
movq 0x130(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x11dee0
movq 0xb0(%rsp), %rdi
movl 0xbc(%rsp), %esi
movl 0xc0(%rsp), %edx
movq %rax, %rcx
movl 0xec(%rsp), %r9d
movq 0x110(%rsp), %rax
leaq 0x4c6087(%rip), %r8     # 0x529473
movq %rax, (%rsp)
callq 0x26bae0
movq %rax, %rdx
movq 0xf0(%rsp), %rax
movl 0xec(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0xf0(%rsp), %rax
movl 0xec(%rsp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x63429
movb $0x1, 0x10f(%rsp)
jmp 0x6342b
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x6333c
testb $0x1, 0x10f(%rsp)
jne 0x63611
movq 0x128(%rsp), %rax
movq %rax, 0x98(%rsp)
movl 0x100(%rsp), %eax
movl %eax, 0xa0(%rsp)
movq 0x130(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0xa4(%rsp)
movq 0x130(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0x130(%rsp), %rax
testb $0x1, 0x7(%rax)
je 0x634b5
movq 0x130(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0x94(%rsp)
jmp 0x634c0
xorl %eax, %eax
movl %eax, 0x94(%rsp)
jmp 0x634c0
movl 0x94(%rsp), %r8d
movq 0x130(%rsp), %rax
movl 0xc(%rax), %r9d
movq 0x130(%rsp), %rax
movb (%rax), %r10b
movq 0x130(%rsp), %rax
movl 0x10(%rax), %r15d
movq 0x130(%rsp), %rax
movb 0x6(%rax), %r11b
movq 0x130(%rsp), %rax
movb 0x3(%rax), %bl
movq 0x130(%rsp), %rax
movb 0x4(%rax), %bpl
movq 0x130(%rsp), %rax
movl 0x20(%rax), %r12d
movq 0x130(%rsp), %rax
movb 0x5(%rax), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %r14b
movq 0x130(%rsp), %rax
movl 0x1c(%rax), %r13d
movq 0xf0(%rsp), %rcx
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rsi
movq 0x110(%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 0x207fb1(%rip), %rcx    # 0x26b550
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 0x6360f
movb $0x1, 0x10f(%rsp)
jmp 0x63611
movl $0x0, 0xec(%rsp)
movl 0xec(%rsp), %eax
cmpl 0x108(%rsp), %eax
jae 0x636a3
testb $0x1, 0x10f(%rsp)
jne 0x63675
movq 0xf0(%rsp), %rax
movl 0xec(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movl 0xec(%rsp), %esi
leaq 0xe0(%rsp), %rdx
leaq 0xd8(%rsp), %rcx
leaq 0xc8(%rsp), %r8
leaq 0xd0(%rsp), %r9
callq 0x26be10
movq 0xf0(%rsp), %rax
movl 0xec(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x26bda0
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x6361c
movq 0xd0(%rsp), %rax
addq 0xf8(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x120(%rsp), %rdi
movl 0x104(%rsp), %edx
movq 0xc8(%rsp), %rcx
leaq 0x4c5d9f(%rip), %rsi    # 0x529478
movb $0x0, %al
callq 0xe7cd0
movq 0x120(%rsp), %rdi
movl 0x104(%rsp), %edx
movq 0xd8(%rsp), %rcx
leaq 0x4c5da5(%rip), %rsi    # 0x5294a3
movb $0x0, %al
callq 0xe7cd0
movq 0x120(%rsp), %rdi
movl 0x104(%rsp), %edx
movq 0xe0(%rsp), %rcx
leaq 0x4c5daf(%rip), %rsi    # 0x5294d2
movb $0x0, %al
callq 0xe7cd0
movq 0x120(%rsp), %rdi
movl 0x104(%rsp), %edx
movq 0xd0(%rsp), %rcx
leaq 0x4c5dbb(%rip), %rsi    # 0x529503
movb $0x0, %al
callq 0xe7cd0
testb $0x1, 0x10f(%rsp)
jne 0x637c5
movq 0x120(%rsp), %rdi
movl 0x104(%rsp), %edx
leaq 0x4c5dc3(%rip), %rsi    # 0x529532
movb $0x0, %al
callq 0xe7cd0
movq 0x128(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x130(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x11dee0
movq 0x80(%rsp), %rdi
movq %rax, %rsi
movl 0x108(%rsp), %edx
movq 0x110(%rsp), %rcx
callq 0x64100
cmpl $0x0, %eax
je 0x637c3
movb $0x1, 0x10f(%rsp)
jmp 0x637c5
jmp 0x637c7
movl 0x104(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x104(%rsp)
jmp 0x632a7
movq 0x120(%rsp), %rdi
movq 0xf8(%rsp), %rdx
leaq 0x4c5d62(%rip), %rsi    # 0x529556
movb $0x0, %al
callq 0xe7cd0
movq 0xf0(%rsp), %rdi
leaq 0x4c56e9(%rip), %rsi    # 0x528ef3
movl $0x244, %edx            # imm = 0x244
callq 0xe88c0
movb 0x10f(%rsp), %al
andb $0x1, %al
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop