// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes-hpcorrect.c
// Function: gt_randomcodes_hpcorrect_correct_hmers
static inline void gt_randomcodes_hpcorrect_correct_hmers(
    const GtSeqnumrelpos *snrp, const GtUword *suffixes,
    GtUword nofsuffixes, GtRandomcodesHpcorrectData *sdata,
    GtUword clusternum)
{
  GtUword i, pos, relpos, seqnum, hpos, maxpos;
  uint8_t *values, consensus, value;
  bool rc = false;
  unsigned int *hdistri, maxuntrust =
     (unsigned int)sdata->cluster_size[clusternum] * sdata->maxuntrustp / 100U;
  for (i = 0; i < nofsuffixes; i++)
  {
    if (GT_RANDOMCODES_HPCORRECT_CLUSTERNUM(sdata, i) != clusternum)
      continue;
    relpos = gt_seqnumrelpos_decode_relpos(snrp, suffixes[i]);
    seqnum = gt_seqnumrelpos_decode_seqnum(snrp, suffixes[i]);
    maxpos = gt_encseq_seqlength(sdata->encseq, seqnum) - 1;
    rc = (seqnum >= sdata->nofreads);
    if (rc)
    {
      if (sdata->skip_rc)
        continue;
      seqnum = sdata->mirror_nofseqs - 1 - seqnum;
    }
    values = GT_RANDOMCODES_HPCORRECT_HMER(sdata, i);
    for (pos = sdata->frompos; pos <= sdata->topos; pos++)
    {
      hpos = rc ? maxpos - (relpos + pos) : relpos + pos;
      if (sdata->skip_read_ends && (hpos == 0 || hpos == maxpos))
        continue;
      consensus = sdata->consensus_hmer[pos];
      if (consensus == GT_HPLSTORE_UNDEF)
        continue;
      value = values[pos];
      if (consensus == value)
        continue;
      hdistri = sdata->hdistri + pos * GT_HPLSTORE_RANGE;
      if (hdistri[value] > maxuntrust)
        continue;
      if (consensus > value)
      {
        gt_file_xprintf(sdata->outfile, ""GT_WU"\t"GT_WU"\tI\t%u\n", seqnum,
                        hpos, (unsigned int)(consensus - value));
      }
      else
      {
        gt_assert(consensus < value);
        gt_file_xprintf(sdata->outfile, ""GT_WU"\t"GT_WU"\tD\t%u\n", seqnum,
                        hpos, (unsigned int)(value - consensus));
      }
    }
  }
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movb $0x0, 0x25(%rsp)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x60(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rsp), %rcx
imull 0x28(%rcx), %eax
movl $0x64, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, 0x14(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x70(%rsp), %rax
jae 0x344024
movq 0x68(%rsp), %rax
cmpq $0x0, 0x98(%rax)
je 0x343d55
movq 0x68(%rsp), %rax
movq 0x98(%rax), %rdi
movq 0x58(%rsp), %rsi
callq 0x28e550
movq %rax, 0x8(%rsp)
jmp 0x343d6f
movq 0x68(%rsp), %rax
movq 0x88(%rax), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x60(%rsp), %rax
je 0x343d80
jmp 0x344011
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x398350
movq %rax, 0x48(%rsp)
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x398330
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x32020
subq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x10(%rcx), %rax
setae %al
andb $0x1, %al
movb %al, 0x25(%rsp)
testb $0x1, 0x25(%rsp)
je 0x343e20
movq 0x68(%rsp), %rax
testb $0x1, 0x78(%rax)
je 0x343e09
jmp 0x344011
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
subq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x58(%rsp), %rcx
movq 0x68(%rsp), %rdx
imulq 0x48(%rdx), %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x70(%rcx), %rax
ja 0x34400f
testb $0x1, 0x25(%rsp)
je 0x343e81
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
addq 0x50(%rsp), %rcx
subq %rcx, %rax
movq %rax, (%rsp)
jmp 0x343e8f
movq 0x48(%rsp), %rax
addq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
testb $0x1, 0x60(%rax)
je 0x343ebc
cmpq $0x0, 0x38(%rsp)
je 0x343eb7
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x343ebc
jmp 0x343ffc
movq 0x68(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x50(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x27(%rsp)
movzbl 0x27(%rsp), %eax
cmpl $0xff, %eax
jne 0x343ee2
jmp 0x343ffc
movq 0x28(%rsp), %rax
movq 0x50(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x26(%rsp)
movzbl 0x27(%rsp), %eax
movzbl 0x26(%rsp), %ecx
cmpl %ecx, %eax
jne 0x343f06
jmp 0x343ffc
movq 0x68(%rsp), %rax
movq 0x58(%rax), %rax
imulq $0xff, 0x50(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movzbl 0x26(%rsp), %ecx
movl (%rax,%rcx,4), %eax
cmpl 0x14(%rsp), %eax
jbe 0x343f3c
jmp 0x343ffc
movzbl 0x27(%rsp), %eax
movzbl 0x26(%rsp), %ecx
cmpl %ecx, %eax
jle 0x343f7e
movq 0x68(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movzbl 0x27(%rsp), %r8d
movzbl 0x26(%rsp), %eax
subl %eax, %r8d
leaq 0x213709(%rip), %rsi    # 0x55767e
movb $0x0, %al
callq 0x30490
jmp 0x343ffa
jmp 0x343f80
movzbl 0x27(%rsp), %eax
movzbl 0x26(%rsp), %ecx
cmpl %ecx, %eax
jl 0x343fc6
movq 0x2b8033(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
leaq 0x1b75fe(%rip), %rsi    # 0x4fb59d
leaq 0x2136e6(%rip), %rdx    # 0x55768c
leaq 0x2136f1(%rip), %rcx    # 0x55769e
leaq 0x213428(%rip), %r8     # 0x5573dc
movl $0x302, %r9d            # imm = 0x302
movb $0x0, %al
callq 0x33960
callq 0x2f830
jmp 0x343fc8
movq 0x68(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movzbl 0x26(%rsp), %r8d
movzbl 0x27(%rsp), %eax
subl %eax, %r8d
leaq 0x2136d2(%rip), %rsi    # 0x5576c5
movb $0x0, %al
callq 0x30490
jmp 0x343ffc
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x343e4e
jmp 0x344011
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x343d19
addq $0x88, %rsp
retq
nopl (%rax)