// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/ft-front-prune.c
// Function: ft_update_trace_and_polished
static void ft_update_trace_and_polished(
                                      GtFtPolished_point *best_polished_point,
                                      GtFrontTrace *front_trace,
                                      const GtFtPolishing_info *pol_info,
                                      GtUword distance,
                                      GtUword trimleft,
                                      GtFtFrontvalue *midfront,
                                      GtFtFrontvalue *lowfront,
                                      GtFtFrontvalue *highfront,
                                      GT_UNUSED bool showfrontinfo)
{
  const GtFtFrontvalue *frontptr;

  for (frontptr = lowfront; frontptr <= highfront; frontptr++)
  {
    GtUword alignedlen = GT_MULT2(frontptr->row) + GT_FRONT_DIAGONAL(frontptr);

    gt_assert(GT_FRONT_DIAGONAL(frontptr) >= 0 ||
              frontptr->row >= -GT_FRONT_DIAGONAL(frontptr));
    if (alignedlen > best_polished_point->alignedlen)
    {
      uint64_t filled_matchhistory_bits = frontptr->matchhistory_bits;

      if (frontptr->matchhistory_size < pol_info->pol_size)
      {
        const int shift = pol_info->pol_size - frontptr->matchhistory_size;
        const uint64_t fill_bits = ((uint64_t) 1 << shift) - 1;
        filled_matchhistory_bits |= (fill_bits << frontptr->matchhistory_size);
      }
      if  (GT_HISTORY_IS_POLISHED(pol_info,filled_matchhistory_bits))
      {
        best_polished_point->alignedlen = alignedlen;
        best_polished_point->row = frontptr->row;
        best_polished_point->distance = distance;
        best_polished_point->trimleft = trimleft;
        best_polished_point->max_mismatches
          = (GtUword) frontptr->max_mismatches;
      }
    }
    if (front_trace != NULL)
    {
      front_trace_add_trace(front_trace,frontptr->backreference,
                            frontptr->localmatch_count);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x58(%rsp), %rbp
movq 0x50(%rsp), %rbx
cmpq %rbp, %rbx
ja 0x31e867
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq %rbx, %r14
subq %r9, %r14
movl 0x8(%rbx), %edx
movq %r14, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
cmpq $-0x18, %r14
jg 0x31e7bf
movq %rsi, %rax
negq %rax
cmpq %rax, %rdx
jl 0x31e876
leal (%rdx,%rdx), %eax
addq %rax, %rsi
cmpq (%r13), %rsi
jbe 0x31e842
movq (%rbx), %rdi
movzbl 0x10(%rbx), %eax
movq 0x10(%r15), %rcx
cmpq %rax, %rcx
jbe 0x31e7f2
subl %eax, %ecx
movq $-0x1, %r8
shlq %cl, %r8
notq %r8
movl %eax, %ecx
shlq %cl, %r8
orq %r8, %rdi
movq 0x18(%r15), %r8
movq 0x30(%r15), %rax
movq %r8, %r9
andq %rdi, %r9
cmpw $0x0, 0x2(%rax,%r9,4)
js 0x31e842
movb 0x8(%r15), %cl
shrq %cl, %rdi
movswl (%rax,%r9,4), %ecx
andq %r8, %rdi
movswl 0x2(%rax,%rdi,4), %eax
addl %ecx, %eax
js 0x31e842
movq %rsi, (%r13)
movq %rdx, 0x8(%r13)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%r13)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%r13)
movl 0x14(%rbx), %eax
movq %rax, 0x20(%r13)
testq %r12, %r12
je 0x31e856
movzbl 0x11(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r12, %rdi
callq 0x31a257
addq $0x18, %rbx
addq $0x18, %r14
cmpq %rbp, %rbx
jbe 0x31e792
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x935b2