// File: /workspace/github_c_makefile_star2_O2/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)
movq %rdx, %r10
movl 0x50(%rsp), %edx
cmpl $0x2, %edx
jne 0x2bf2ae
xorl %eax, %eax
jmp 0x2bf407
movq 0x58(%rsp), %rax
cmpl $0x1, %edx
setne %dl
testq %rax, %rax
sete %r11b
orb %dl, %r11b
jne 0x2bf2e1
movq 0x10(%rax), %rax
leaq 0x1(%rax), %rdx
cmpq %rsi, %rdx
setb %dl
addq $0x1e, %rax
cmpq %rsi, %rax
setae %al
testb %al, %dl
jne 0x2bf2a7
movq 0x70(%rsp), %r11
movq 0x68(%rsp), %r8
xorl %eax, %eax
xorl %edx, %edx
cmpq %r11, %r8
setae %al
setbe %dl
testb %dil, %dil
cmovnel %eax, %edx
testb %dl, %dl
jne 0x2bf416
movl %edi, 0xc(%rsp)
testb %dil, %dil
pushq $0x18
popq %r14
pushq $-0x18
popq %r15
cmovneq %r14, %r15
movq %r8, %rbx
subq 0x60(%rsp), %rbx
movl $0x33333333, %r13d      # imm = 0x33333333
movq %r8, %rsi
movl $0x55555555, %r12d      # imm = 0x55555555
movl $0xf0f0f0f, %ebp        # imm = 0xF0F0F0F
cmpq %r11, %rsi
je 0x2bf3ed
movl 0x8(%rsi), %edi
cmpq %r10, %rdi
ja 0x2bf3df
movq %rbx, %rax
cqto
idivq %r14
leaq (%rax,%rdi), %rdx
cmpq %rcx, %rdx
ja 0x2bf3df
addl %edi, %edi
addq %rdi, %rax
cmpq %r9, %rax
jb 0x2bf3df
movq (%rsi), %rax
andq 0x78(%rsp), %rax
movl %eax, %edx
shrl %edx
andl %r12d, %edx
movl %eax, %edi
subl %edx, %edi
movl %edi, %edx
andl %r13d, %edx
shrl $0x2, %edi
andl %r13d, %edi
addl %edx, %edi
movl %edi, %edx
shrl $0x4, %edx
addl %edi, %edx
andl %ebp, %edx
imull $0x1010101, %edx, %edx  # imm = 0x1010101
shrl $0x18, %edx
movq %rax, %rdi
shrq $0x20, %rdi
shrq $0x21, %rax
andl %r12d, %eax
subl %eax, %edi
movl %edi, %eax
andl %r13d, %eax
shrl $0x2, %edi
andl %r13d, %edi
addl %eax, %edi
movl %edi, %eax
shrl $0x4, %eax
addl %edi, %eax
andl %ebp, %eax
imull $0x1010101, %eax, %eax  # imm = 0x1010101
shrl $0x18, %eax
addl %edx, %eax
movzbl 0x10(%rsi), %edx
imulq 0x10(%rsp), %rdx
shrq $0x7, %rdx
cmpq %rax, %rdx
jbe 0x2bf3ea
addq %r15, %rsi
addq %r15, %rbx
jmp 0x2bf335
movq %rsi, %r11
cmpb $0x0, 0xc(%rsp)
je 0x2bf3fc
subq %r8, %r11
movq %r11, %rax
jmp 0x2bf402
subq %r11, %r8
movq %r8, %rax
cqto
idivq %r14
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x178b4b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x25bec(%rip), %rsi     # 0x2e5013
leaq 0xc4e87(%rip), %rdx     # 0x3842b5
leaq 0xc4eb4(%rip), %rcx     # 0x3842e9
leaq 0xc4ad6(%rip), %r8      # 0x383f12
movl $0x20e, %r9d            # imm = 0x20E
xorl %eax, %eax
callq 0x17a50
callq 0x17390