// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes-hpcorrect.c
// Function: gt_randomcodes_hpcorrect_compute_consensus_for_pos
static inline uint8_t gt_randomcodes_hpcorrect_compute_consensus_for_pos(
    GtUword pos, GtUword nofsuffixes,
    GtRandomcodesHpcorrectData *sdata, GtUword clusternum)
{
  GtUword i;
  unsigned int maxfreq = 0;
  uint8_t value, consensus = GT_HPLSTORE_UNDEF;
  unsigned int mintrust = (unsigned int)sdata->cluster_size[clusternum] *
    sdata->mintrustp / 100U;
  unsigned int *hdistri = sdata->hdistri + pos * GT_HPLSTORE_RANGE;
  for (i = 0; (uint8_t)i < GT_HPLSTORE_RANGE; i++)
    hdistri[i] = 0;
  for (i = 0; i < nofsuffixes; i++)
  {
    if (GT_RANDOMCODES_HPCORRECT_CLUSTERNUM(sdata, i) == clusternum)
    {
      value = GT_RANDOMCODES_HPCORRECT_HMER(sdata, i)[pos];
      hdistri[value]++;
      if (hdistri[value] > maxfreq)
      {
        consensus = value;
        maxfreq = hdistri[value];
      }
      else if (hdistri[value] == maxfreq)
      {
        consensus = GT_HPLSTORE_UNDEF;
      }
    }
  }
  if (maxfreq < mintrust)
    consensus = GT_HPLSTORE_UNDEF;
  return consensus;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movl $0x0, 0x1c(%rsp)
movb $-0x1, 0x1a(%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rsp), %rcx
imull 0x2c(%rcx), %eax
movl $0x64, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x58(%rax), %rax
imulq $0xff, 0x40(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
movzbl %al, %eax
cmpl $0xff, %eax
jge 0x3440d4
movq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x3440a4
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x3441d9
movq 0x30(%rsp), %rax
cmpq $0x0, 0x98(%rax)
je 0x344118
movq 0x30(%rsp), %rax
movq 0x98(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x28e550
movq %rax, (%rsp)
jmp 0x344131
movq 0x30(%rsp), %rax
movq 0x88(%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x3441c4
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rdx
imulq 0x48(%rdx), %rcx
addq %rcx, %rax
movq 0x40(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x1b(%rsp)
movq 0x8(%rsp), %rax
movzbl 0x1b(%rsp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0x8(%rsp), %rax
movzbl 0x1b(%rsp), %ecx
movl (%rax,%rcx,4), %eax
cmpl 0x1c(%rsp), %eax
jbe 0x3441a8
movb 0x1b(%rsp), %al
movb %al, 0x1a(%rsp)
movq 0x8(%rsp), %rax
movzbl 0x1b(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1c(%rsp)
jmp 0x3441c2
movq 0x8(%rsp), %rax
movzbl 0x1b(%rsp), %ecx
movl (%rax,%rcx,4), %eax
cmpl 0x1c(%rsp), %eax
jne 0x3441c0
movb $-0x1, 0x1a(%rsp)
jmp 0x3441c2
jmp 0x3441c4
jmp 0x3441c6
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x3440dd
movl 0x1c(%rsp), %eax
cmpl 0x14(%rsp), %eax
jae 0x3441e8
movb $-0x1, 0x1a(%rsp)
movb 0x1a(%rsp), %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)