// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movl 0x50(%rsp), %r10d
cmpl $0x2, %r10d
jne 0x31e591
xorl %eax, %eax
jmp 0x31e744
movq 0x58(%rsp), %rax
cmpl $0x1, %r10d
setne %r10b
testq %rax, %rax
sete %r11b
orb %r10b, %r11b
jne 0x31e5c8
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 0x31e58a
movq 0x70(%rsp), %r11
movq 0x68(%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 0x31e753
movq %rsi, %rax
cmpq %r11, %rsi
je 0x31e710
movl %edi, 0xc(%rsp)
testb %dil, %dil
movl $0x18, %eax
movq $-0x18, %rbx
cmovneq %rax, %rbx
movq %rsi, %r15
subq 0x60(%rsp), %r15
movl $0x33333333, %r12d      # imm = 0x33333333
movq %rsi, %rax
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
movl $0x55555555, %r10d      # imm = 0x55555555
movl $0xf0f0f0f, %r8d        # imm = 0xF0F0F0F
movl 0x8(%rax), %r14d
cmpq %rdx, %r14
ja 0x31e6fa
movq %r15, %rbp
sarq $0x3, %rbp
imulq %rdi, %rbp
leaq (%r14,%rbp), %r13
cmpq %rcx, %r13
ja 0x31e6fa
addl %r14d, %r14d
addq %r14, %rbp
cmpq %r9, %rbp
jb 0x31e6fa
movq (%rax), %r14
andq 0x78(%rsp), %r14
movl %r14d, %ebp
shrl %ebp
andl %r10d, %ebp
movl %r14d, %r13d
subl %ebp, %r13d
movl %r13d, %ebp
andl %r12d, %ebp
shrl $0x2, %r13d
andl %r12d, %r13d
addl %ebp, %r13d
movl %r13d, %ebp
shrl $0x4, %ebp
addl %r13d, %ebp
andl %r8d, %ebp
imull $0x1010101, %ebp, %ebp  # imm = 0x1010101
shrl $0x18, %ebp
movq %r14, %r13
shrq $0x20, %r13
shrq $0x21, %r14
andl %r10d, %r14d
subl %r14d, %r13d
movl %r13d, %r14d
andl %r12d, %r14d
shrl $0x2, %r13d
andl %r12d, %r13d
addl %r14d, %r13d
movl %r13d, %r14d
shrl $0x4, %r14d
addl %r13d, %r14d
andl %r8d, %r14d
imull $0x1010101, %r14d, %r14d # imm = 0x1010101
shrl $0x18, %r14d
addl %ebp, %r14d
movzbl 0x10(%rax), %r13d
imulq 0x10(%rsp), %r13
shrq $0x7, %r13
cmpq %r14, %r13
jbe 0x31e70c
addq %rbx, %rax
addq %rbx, %r15
cmpq %r11, %rax
jne 0x31e63b
movq %r11, %rax
movl 0xc(%rsp), %edi
testb %dil, %dil
je 0x31e72c
subq %rsi, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
jmp 0x31e744
subq %rax, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq %rsi, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x93579