// File: /workspace/github_c_makefile_star2_O0/thegenemyers[P]DASCRUBBER/DASrealign.c
// Function: where
static inline int where(Finger *cur, int pos, int *acc)
{ int blen, *map;

  map  = cur->map;
  blen = cur->blen;
  if (blen == 0)
    { while (cur->cidx < cur->lidx && pos >= map[cur->cidx])
        { cur->dist += (map[cur->cidx-2] - cur->last) + map[cur->cidx-1];
          cur->last  = map[cur->cidx];
          cur->cidx += 3; 
        }
      if (pos <= map[cur->cidx-2])
        { if (pos < cur->last)
            return (-1);
          else
            { *acc = 0;
              return (cur->dist + (pos-cur->last));
            }
        }
      if (cur->cidx >= cur->lidx)
        return (-1);
      else
        { int ab, ae;
    
          ab = map[cur->cidx-2];
          ae = map[cur->cidx];
          if (pos-ab < ae-pos)
            *acc = pos-ab;
          else
            *acc = ae-pos;
          return (cur->dist + (ab-cur->last) + ((1.*(pos-ab))/(ae-ab)) * map[cur->cidx-1]);
        }
    }
  else
    { while (cur->cidx > cur->lidx && pos >= blen - map[cur->cidx])
        { cur->dist += ((blen - map[cur->cidx+2]) - cur->last) + map[cur->cidx+1];
          cur->last  = blen - map[cur->cidx];
          cur->cidx -= 3; 
        }
      if (pos <= blen - map[cur->cidx+2])
        { if (pos < cur->last)
            return (-1);
          else
            { *acc = 0;
              return (cur->dist + (pos-cur->last));
            }
        }
      if (cur->cidx <= cur->lidx)
        return (-1);
      else
        { int ab, ae;
    
          ab = blen - map[cur->cidx+2];
          ae = blen - map[cur->cidx];
          if (pos-ab < ae-pos)
            *acc = pos-ab;
          else
            *acc = ae-pos;
          return (cur->dist + (ab-cur->last) + ((1.*(pos-ab))/(ae-ab)) * map[cur->cidx+1]);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x4fc6
jmp 0x4e11
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl 0x4(%rdx), %ecx
movb %al, -0x41(%rbp)
jge 0x4e3c
movl -0x14(%rbp), %eax
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq (%rdx), %rdx
cmpl (%rcx,%rdx,4), %eax
setge %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x4e45
jmp 0x4ea1
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
subl 0xc(%rax), %ecx
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
subl $0x1, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x10(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x3, %ecx
movl %ecx, (%rax)
jmp 0x4e11
movl -0x14(%rbp), %eax
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
subl $0x2, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jg 0x4ef6
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x4ed1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x518e
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rdx
subl 0xc(%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x518e
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x4f11
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x518e
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl -0x14(%rbp), %eax
subl -0x34(%rbp), %eax
movl -0x38(%rbp), %ecx
subl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4f56
movl -0x14(%rbp), %ecx
subl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x4f62
movl -0x38(%rbp), %ecx
subl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl -0x34(%rbp), %ecx
movq -0x10(%rbp), %rdx
subl 0xc(%rdx), %ecx
addl %ecx, %eax
cvtsi2sd %eax, %xmm1
movl -0x14(%rbp), %eax
subl -0x34(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0x220ad(%rip), %xmm0    # 0x27038
mulsd %xmm2, %xmm0
movl -0x38(%rbp), %eax
subl -0x34(%rbp), %eax
cvtsi2sd %eax, %xmm2
divsd %xmm2, %xmm0
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x4(%rbp)
jmp 0x518e
jmp 0x4fc8
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl 0x4(%rdx), %ecx
movb %al, -0x42(%rbp)
jle 0x4ff8
movl -0x14(%rbp), %eax
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rsi
movslq (%rsi), %rsi
subl (%rdx,%rsi,4), %ecx
cmpl %ecx, %eax
setge %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
testb $0x1, %al
jne 0x5001
jmp 0x5063
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
addl $0x2, %edx
movslq %edx, %rdx
subl (%rax,%rdx,4), %ecx
movq -0x10(%rbp), %rax
subl 0xc(%rax), %ecx
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
addl $0x1, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x10(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdx
movslq (%rdx), %rdx
subl (%rax,%rdx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
subl $0x3, %ecx
movl %ecx, (%rax)
jmp 0x4fc8
movl -0x14(%rbp), %eax
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rsi
movl (%rsi), %esi
addl $0x2, %esi
movslq %esi, %rsi
subl (%rdx,%rsi,4), %ecx
cmpl %ecx, %eax
jg 0x50bd
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x5098
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x518e
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rdx
subl 0xc(%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x518e
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jg 0x50d8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x518e
movl -0x24(%rbp), %eax
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
addl $0x2, %edx
movslq %edx, %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x24(%rbp), %eax
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq (%rdx), %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, -0x40(%rbp)
movl -0x14(%rbp), %eax
subl -0x3c(%rbp), %eax
movl -0x40(%rbp), %ecx
subl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x5123
movl -0x14(%rbp), %ecx
subl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x512f
movl -0x40(%rbp), %ecx
subl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rdx
subl 0xc(%rdx), %ecx
addl %ecx, %eax
cvtsi2sd %eax, %xmm1
movl -0x14(%rbp), %eax
subl -0x3c(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0x21ee0(%rip), %xmm0    # 0x27038
mulsd %xmm2, %xmm0
movl -0x40(%rbp), %eax
subl -0x3c(%rbp), %eax
cvtsi2sd %eax, %xmm2
divsd %xmm2, %xmm0
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)