// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/ft-front-prune.c
// Function: trim_front
static GtUword trim_front(bool upward,
                          GtUword distance,
                          GtUword ulen,
                          GtUword vlen,
                          GtUword minmatchpercentage128,
                          GtUword minlenfrommaxdiff,
                          GtTrimmingStrategy trimstrategy,
                          const GtFtPolished_point *best_polished_point,
                          const GtFtFrontvalue *midfront,
                          const GtFtFrontvalue *from,
                          const GtFtFrontvalue *stop,
                          uint64_t max_history_mask,
                          bool showfrontinfo)
{
  const GtFtFrontvalue *frontptr;
  const int step = upward ? +1 : -1;

  if (trimstrategy == GT_OUTSENSE_TRIM_NEVER ||
      (trimstrategy == GT_OUTSENSE_TRIM_ON_NEW_PP &&
       best_polished_point != NULL &&
       best_polished_point->distance + 1 < distance &&
       best_polished_point->distance + 30 >= distance))
  {
    return 0;
  }
  gt_assert ((upward && from < stop) || (!upward && stop < from));
  for (frontptr = from; frontptr != stop; frontptr += step)
  {
    if (frontptr->row <= ulen &&
        frontptr->row + GT_FRONT_DIAGONAL(frontptr) <= vlen &&
        !trimthisentry(frontptr->row,
                       GT_FRONT_DIAGONAL(frontptr),
                       frontptr,
                       minmatchpercentage128,
                       minlenfrommaxdiff,
                       max_history_mask,
                       distance,
                       showfrontinfo))
    {
      break;
    }
  }
  if (upward)
  {
    return (GtUword) (frontptr - from);
  }
  return (GtUword) (from - frontptr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x40(%rsp), %r10d
cmpl $0x2, %r10d
jne 0x32897e
xorl %eax, %eax
jmp 0x328b1b
movq 0x48(%rsp), %rax
cmpl $0x1, %r10d
setne %r10b
testq %rax, %rax
sete %r11b
orb %r10b, %r11b
jne 0x3289b5
movq 0x10(%rax), %rax
leaq 0x1(%rax), %r10
cmpq %rsi, %r10
setb %r10b
addq $0x1e, %rax
cmpq %rsi, %rax
setae %al
testb %al, %r10b
jne 0x328977
movq 0x60(%rsp), %r11
movq 0x58(%rsp), %rsi
xorl %eax, %eax
xorl %r10d, %r10d
cmpq %r11, %rsi
setae %al
setbe %r10b
testb %dil, %dil
cmovnel %eax, %r10d
testb %r10b, %r10b
jne 0x328b2a
movabsq $-0x5555555555555555, %r10 # imm = 0xAAAAAAAAAAAAAAAB
movq %rsi, %rax
cmpq %r11, %rsi
je 0x328afb
movq 0x68(%rsp), %rbx
testb %dil, %dil
movl $0x18, %eax
movq $-0x18, %r14
cmovneq %rax, %r14
movq %rsi, %r15
subq 0x50(%rsp), %r15
movdqa 0xc4834(%rip), %xmm0    # 0x3ed250
movdqa 0xc483c(%rip), %xmm1    # 0x3ed260
movdqa 0xc4844(%rip), %xmm2    # 0x3ed270
movdqa 0xc484c(%rip), %xmm3    # 0x3ed280
movq %rsi, %rax
movl 0x8(%rax), %r12d
cmpq %rdx, %r12
ja 0x328aec
movq %r15, %r13
sarq $0x3, %r13
imulq %r10, %r13
leaq (%r12,%r13), %rbp
cmpq %rcx, %rbp
ja 0x328aec
addl %r12d, %r12d
addq %r12, %r13
cmpq %r9, %r13
jb 0x328aec
movq (%rax), %r12
andq %rbx, %r12
movd %r12d, %xmm4
shrq $0x20, %r12
movd %r12d, %xmm5
punpckldq %xmm4, %xmm5    # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
movdqa %xmm5, %xmm4
psrld $0x1, %xmm4
pand %xmm0, %xmm4
psubd %xmm4, %xmm5
movdqa %xmm5, %xmm4
pand %xmm1, %xmm4
psrld $0x2, %xmm5
pand %xmm1, %xmm5
paddd %xmm4, %xmm5
movdqa %xmm5, %xmm4
psrld $0x4, %xmm4
paddd %xmm5, %xmm4
pand %xmm2, %xmm4
pshufd $0xf5, %xmm4, %xmm5     # xmm5 = xmm4[1,1,3,3]
pmuludq %xmm3, %xmm5
pmuludq %xmm3, %xmm4
psrld $0x18, %xmm4
psrld $0x18, %xmm5
paddd %xmm4, %xmm5
movd %xmm5, %r12d
movzbl 0x10(%rax), %r13d
imulq %r8, %r13
shrq $0x7, %r13
cmpq %r12, %r13
jbe 0x328afb
addq %r14, %rax
addq %r14, %r15
cmpq %r11, %rax
jne 0x328a37
testb %dil, %dil
je 0x328b0d
subq %rsi, %rax
sarq $0x3, %rax
imulq %r10, %rax
jmp 0x328b1b
subq %rax, %rsi
sarq $0x3, %rsi
imulq %r10, %rsi
movq %rsi, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x95537