// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/hpol_processor.c
// Function: gt_hpol_processor_output_stats
static void gt_hpol_processor_output_stats(GtAlignedSegment *as,
    GtUword r_hpos, GtUword coverage, GtUword r_hlen,
    GtUword r_supp, GtUword s_hlen, GtUword a_hlen,
    GtUword a_supp, char s_char, double s_q_ave,
    GtUword c_len, GtFile *outfp)
{
  GtUword i, pos, s_hpos = 0, s_offset, s_q_bef, s_q_aft, s_q_value,
                s_q_min, s_q_max, s_q_range, s_q_first, s_q_last = 0, s_hend,
                s_mapq;
  char *s_qual, *q, edit, s_or;
  const char *s_id;
  gt_assert(r_hlen != s_hlen);
  edit = r_hlen > s_hlen ? 'I' : 'D';
  gt_assert(coverage > 0);
  r_supp = r_supp * 100 / coverage;
  a_supp = a_supp * 100 / coverage;
  s_id = gt_aligned_segment_description(as);
  s_mapq = gt_aligned_segment_mapping_quality(as);
  q = gt_aligned_segment_qual(as);
  gt_assert(s_hlen > 0);
  s_hpos = gt_aligned_segment_orig_seqpos_for_refpos(as, r_hpos);
  s_offset = gt_aligned_segment_offset_for_refpos(as, r_hpos);
  s_qual = gt_malloc(sizeof (*s_qual) * (s_hlen + 1UL));
  s_q_bef = GT_UNDEF_UWORD;
  for (i = s_offset; i > 0; /**/)
  {
    i--;
    if (q[i] != GT_UNDEF_CHAR)
    {
      s_q_bef = GT_HPOL_PROCESSOR_QUAL(q[i]);
      break;
    }
  }
  gt_assert(s_q_bef != GT_UNDEF_UWORD);
  s_q_min = ULONG_MAX;
  s_q_max = 0;
  s_q_first = GT_UNDEF_UWORD;
  if (!gt_aligned_segment_is_reverse(as))
  {
    for (i = s_offset, pos = 0; pos < s_hlen; i++)
    {
      if (q[i] != GT_UNDEF_CHAR)
      {
        s_qual[pos] = q[i];
        pos++;
        s_q_value = GT_HPOL_PROCESSOR_QUAL(q[i]);
        if (s_q_value < s_q_min)
          s_q_min = s_q_value;
        if (s_q_value > s_q_max)
          s_q_max = s_q_value;
        if (s_q_first == GT_UNDEF_UWORD)
          s_q_first = s_q_value;
        s_q_last = s_q_value;
      }
    }
  }
  else
  {
    for (i = s_offset, pos = s_hlen; pos > 0; i++)
    {
      if (q[i] != GT_UNDEF_CHAR)
      {
        s_qual[pos - 1UL] = q[i];
        pos--;
        s_q_value = GT_HPOL_PROCESSOR_QUAL(q[i]);
        if (s_q_value < s_q_min)
          s_q_min = s_q_value;
        if (s_q_value > s_q_max)
          s_q_max = s_q_value;
        if (s_q_first == GT_UNDEF_UWORD)
          s_q_first = s_q_value;
        s_q_last = s_q_value;
      }
    }
  }
  s_qual[s_hlen] = '\0';
  s_q_aft = GT_UNDEF_UWORD;
  for (/**/; i < gt_aligned_segment_length(as); i++)
  {
    if (q[i] != GT_UNDEF_CHAR)
    {
      s_q_aft = GT_HPOL_PROCESSOR_QUAL(q[i]);
      break;
    }
  }
  gt_assert(s_q_aft != GT_UNDEF_UWORD);
  gt_assert(s_q_min < ULONG_MAX);
  gt_assert(s_q_max >= s_q_min);
  s_q_range = s_q_max - s_q_min + 1UL;
  /* convert to 1-based coordinates */
  r_hpos++;
  s_hpos++;
  /* handle reverse alignments */
  if (gt_aligned_segment_is_reverse(as))
  {
    /* complement char */
    GtError *err = gt_error_new();
    (void)gt_complement(&s_char, s_char, err);
    gt_error_delete(err);
    /* correct coords on s */
    s_hend = s_hpos;
    s_hpos = s_hpos - s_hlen + 1UL;
    s_or = '-';
    /* swap q values */
    s_q_value = s_q_aft;
    s_q_aft = s_q_bef;
    s_q_bef = s_q_value;
    s_q_value = s_q_last;
    s_q_last = s_q_first;
    s_q_first = s_q_value;
  }
  else
  {
    s_hend = s_hpos + s_hlen - 1UL;
    s_or = '+';
  }
  gt_file_xprintf(outfp,
                  GT_WU "\t%c\t" GT_WU "\t" GT_WU "\t%c\t%c\t" GT_WU "\t" GT_WU
                  "\t" GT_WU "\t" GT_WU "\t" GT_WU "\t" GT_WU "\t" GT_WU "\t"
                  GT_WU "\t" GT_WU "\t" GT_WU "\t" GT_WU "\t%.2f\t" GT_WU "\t"
                  GT_WU "\t" GT_WU "\t" GT_WU "\t%s\t%s\n",
                  r_hpos, edit, s_hpos, s_hend, s_char, s_or, c_len, coverage,
                  r_hlen, r_supp, s_hlen, a_hlen, a_supp, s_mapq, s_q_bef,
                  s_q_first, s_q_min, s_q_ave, s_q_max, s_q_range, s_q_last,
                  s_q_aft, s_qual, s_id);
  gt_free(s_qual);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, (%rsp)
cmpq %r9, %rcx
je 0x15b859
movq %rdx, %r15
movq %r8, 0x50(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %r9, 0x8(%rsp)
testq %rdx, %rdx
je 0x15b85e
movq %rcx, %r12
movq %rsi, %r14
movq (%rsp), %r13
movq %r13, %rdi
callq 0x30469f
movq %rax, 0x70(%rsp)
movq %r13, %rdi
callq 0x304433
movq %rax, %rbp
movq %r13, %rdi
callq 0x304462
movq %rax, %rbx
movq %r13, %rdi
movq %r14, %rsi
callq 0x304526
movq %rax, 0x18(%rsp)
movq %r13, %rdi
movq %r14, 0x48(%rsp)
movq %r14, %rsi
callq 0x3044c1
movq %rax, %r13
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rdi
leaq 0x23146f(%rip), %rsi    # 0x38c979
movl $0x19f, %edx            # imm = 0x19F
callq 0x1092b2
movq %r13, %rcx
movq %r13, %rdx
subq $0x1, %rdx
jb 0x15b535
movsbq -0x1(%rbx,%rcx), %r14
movq %rdx, %rcx
cmpq $0x7f, %r14
je 0x15b51a
addq $-0x21, %r14
jmp 0x15b53c
movq $-0x1, %r14
movq %rax, 0x30(%rsp)
cmpq $-0x1, %r14
je 0x15b863
movq (%rsp), %rdi
callq 0x3044b2
testb %al, %al
movq %r15, 0x68(%rsp)
movq %r12, 0x60(%rsp)
movq %rbp, 0x58(%rsp)
je 0x15b5c9
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
movq 0x30(%rsp), %rsi
je 0x15b625
movq $-0x1, %rdi
xorl %ebp, %ebp
movq %rdx, %rax
xorl %r15d, %r15d
movq $-0x1, %r12
movb (%rbx,%r13), %cl
cmpb $0x7f, %cl
je 0x15b5bf
movb %cl, -0x1(%rsi,%rax)
decq %rax
movsbq (%rbx,%r13), %rbp
addq $-0x21, %rbp
cmpq %r12, %rbp
cmovbq %rbp, %r12
cmpq %r15, %rbp
cmovaq %rbp, %r15
cmpq $-0x1, %rdi
cmoveq %rbp, %rdi
incq %r13
testq %rax, %rax
jne 0x15b590
jmp 0x15b638
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
movq 0x30(%rsp), %rsi
je 0x15b625
movq $-0x1, %rdi
xorl %eax, %eax
xorl %ebp, %ebp
xorl %r15d, %r15d
movq $-0x1, %r12
movb (%rbx,%r13), %cl
cmpb $0x7f, %cl
je 0x15b61b
movb %cl, (%rsi,%rax)
incq %rax
movsbq (%rbx,%r13), %rbp
addq $-0x21, %rbp
cmpq %r12, %rbp
cmovbq %rbp, %r12
cmpq %r15, %rbp
cmovaq %rbp, %r15
cmpq $-0x1, %rdi
cmoveq %rbp, %rdi
incq %r13
cmpq %rdx, %rax
jb 0x15b5ed
jmp 0x15b638
movq $-0x1, %r12
xorl %r15d, %r15d
movq $-0x1, %rdi
xorl %ebp, %ebp
movq %rdi, 0x28(%rsp)
movb $0x0, (%rsi,%rdx)
movq (%rsp), %rdi
callq 0x304482
movq $-0x1, %rcx
cmpq %rax, %r13
jae 0x15b682
movsbq (%rbx,%r13), %rax
cmpq $0x7f, %rax
jne 0x15b67b
incq %r13
movq (%rsp), %rdi
callq 0x304482
cmpq %rax, %r13
jb 0x15b656
movq $-0x1, %rcx
jmp 0x15b682
addq $-0x21, %rax
movq %rax, %rcx
cmpq $-0x1, %rcx
movq 0x18(%rsp), %r13
je 0x15b868
cmpq $-0x1, %r12
je 0x15b86d
movq %rcx, 0x20(%rsp)
movq %r15, %rbx
subq %r12, %rbx
jb 0x15b872
leaq 0x1(%r13), %rax
movq %rax, 0x38(%rsp)
movq (%rsp), %rdi
callq 0x3044b2
testb %al, %al
je 0x15b730
callq 0x1019b4
movq %rax, (%rsp)
leaq 0xc0(%rsp), %rdi
movsbl (%rdi), %esi
movq %rax, %rdx
callq 0x301930
movq (%rsp), %rdi
callq 0x101b35
movq 0x8(%rsp), %r10
subq %r10, %r13
addq $0x2, %r13
movl $0x2d, %eax
movq %rax, (%rsp)
movq %r14, 0x40(%rsp)
movq %rbp, 0x18(%rsp)
movq 0x38(%rsp), %r9
movq %r13, %r8
movsd 0x10(%rsp), %xmm0
movq 0x48(%rsp), %rcx
movq 0xd0(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0xb8(%rsp), %rax
jmp 0x15b787
movq 0x8(%rsp), %r10
addq %r10, %r13
movl $0x2b, %eax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %r14, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rbp, 0x28(%rsp)
movq %r13, %r9
movsd 0x10(%rsp), %xmm0
movq 0x48(%rsp), %rcx
movq 0xd0(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0xb8(%rsp), %rax
movq 0x38(%rsp), %r8
incq %rcx
incq %rbx
imulq $0x64, %rax, %rax
xorl %edx, %edx
movq 0x68(%rsp), %r14
divq %r14
movq %rax, 0x10(%rsp)
imulq $0x64, %rsi, %rax
xorl %edx, %edx
divq %r14
movq %rax, %r11
xorl %eax, %eax
movq %rcx, %rdx
movq 0x60(%rsp), %r13
cmpq %r10, %r13
seta %al
leal (%rax,%rax,4), %ecx
addl $0x44, %ecx
movsbl 0xc0(%rsp), %eax
movq %rax, 0x8(%rsp)
subq $0x8, %rsp
leaq 0x231b91(%rip), %rsi    # 0x38d36b
movb $0x1, %al
pushq 0x78(%rsp)
movq 0x40(%rsp), %rbp
pushq %rbp
pushq 0x58(%rsp)
pushq 0x48(%rsp)
pushq %rbx
pushq %r15
pushq %r12
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq 0xa8(%rsp)
pushq 0x68(%rsp)
pushq 0x110(%rsp)
pushq %r10
pushq %r11
pushq %r13
pushq %r14
pushq 0x150(%rsp)
pushq 0x90(%rsp)
pushq 0xa0(%rsp)
callq 0x103d21
addq $0xa0, %rsp
leaq 0x23113c(%rip), %rsi    # 0x38c979
movq %rbp, %rdi
movl $0x206, %edx            # imm = 0x206
callq 0x109670
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x49af4
callq 0x49abb
callq 0x49a82
callq 0x49a49
callq 0x49a10
callq 0x499d7