// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/hpol_processor.c
// Function: gt_hpol_processor_determine_alternative_consensus
static void gt_hpol_processor_determine_alternative_consensus(
    GtHpolProcessor *hpp, char c, GtUword r_hstart, GtUword r_hlen,
    GtUword *c_s_hlen, GtUword *c_support, GtUword *piled,
    GtUword *r_hlen_support)
{
  GtUword *occ;
  GtDlistelem *dlistelem;
  GtUword s_hlen_max = r_hlen << 1, i;
  *c_support = 0;
  *piled = 0;
  occ = gt_calloc((size_t)(s_hlen_max + 1UL), sizeof (*occ));
  for (dlistelem = gt_dlist_first(gt_aligned_segments_pile_get(hpp->asp));
      dlistelem != NULL; dlistelem = gt_dlistelem_next(dlistelem))
  {
    GtAlignedSegment *as;
    GtUword left, right, s_hlen;
    char *s;
    as = gt_dlistelem_get_data(dlistelem);
#ifdef GG_DEBUG
    if (gt_aligned_segment_has_indels(as))
      gt_aligned_segment_assign_refregion_chars(as, hpp->encseq);
#endif
    left = gt_aligned_segment_offset_for_refpos(as, r_hstart);
    right = gt_aligned_segment_offset_for_refpos(as, r_hstart + r_hlen);
    if (left == GT_UNDEF_UWORD || right == GT_UNDEF_UWORD)
      continue;
    (*piled)++;
    right--;
    s = gt_aligned_segment_seq(as);
    s_hlen = gt_hpol_processor_determine_hlen_forwards(s, NULL, left, right, c,
        NULL, NULL);
    occ[GT_MIN(s_hlen, s_hlen_max)]++;
  }
  *r_hlen_support = occ[r_hlen];
  *c_s_hlen = 0;
  *c_support = occ[0];
  for (i = 0; i <= s_hlen_max; i++)
  {
    if (i != r_hlen && occ[i] > *c_support)
    {
      *c_support = occ[i];
      *c_s_hlen = i;
    }
  }
  gt_free(occ);
}

// Assembly:
subq $0x98, %rsp
movb %sil, %al
movq 0xa8(%rsp), %rsi
movq 0xa0(%rsp), %rsi
movq %rdi, 0x90(%rsp)
movb %al, 0x8f(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movq %r9, 0x68(%rsp)
movq 0x78(%rsp), %rax
shlq %rax
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rax
movq $0x0, (%rax)
movq 0xa0(%rsp), %rax
movq $0x0, (%rax)
movq 0x50(%rsp), %rdi
addq $0x1, %rdi
movl $0x8, %esi
leaq 0x3c5ed3(%rip), %rdx    # 0x555d00
movl $0x2fe, %ecx            # imm = 0x2FE
callq 0xe83c0
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x129be0
movq %rax, %rdi
callq 0xa5f40
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x18ff74
movq 0x58(%rsp), %rdi
callq 0xa60d0
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x488450
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq 0x80(%rsp), %rsi
addq 0x78(%rsp), %rsi
callq 0x488450
movq %rax, 0x30(%rsp)
cmpq $-0x1, 0x38(%rsp)
je 0x18feb8
cmpq $-0x1, 0x30(%rsp)
jne 0x18febd
jmp 0x18ff60
movq 0xa0(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x30(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdi
callq 0x488210
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rsi
movsbl 0x8f(%rsp), %r8d
movq $0x0, (%rsp)
callq 0x190340
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x50(%rsp), %rax
jae 0x18ff40
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x18ff4a
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x58(%rsp), %rdi
callq 0xa6120
movq %rax, 0x58(%rsp)
jmp 0x18fe5a
movq 0x60(%rsp), %rax
movq 0x78(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, (%rax)
movq 0x70(%rsp), %rax
movq $0x0, (%rax)
movq 0x60(%rsp), %rax
movq (%rax), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
ja 0x190017
movq 0x48(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x190005
movq 0x60(%rsp), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rsp), %rcx
cmpq (%rcx), %rax
jbe 0x190005
movq 0x60(%rsp), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, (%rax)
jmp 0x190007
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x18ffb2
movq 0x60(%rsp), %rdi
leaq 0x3c5cdd(%rip), %rsi    # 0x555d00
movl $0x320, %edx            # imm = 0x320
callq 0xe88c0
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)