#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double fabs(float);
float find_pitch(float *, float *, int, int, int);
float sqrt(float);
float v_inner(float *, float *, int);
float frac_pch(float sig_in[], float *pcorr, float fpitch, int range, int pmin,
               int pmax, int lmin) {
  int length, cbegin, lower, upper, ipitch;
  float c0_0, c0_T, c0_T1, cT_T, cT_T1, cT1_T1, c0_Tm1;
  float frac, frac1;
  float corr, denom;
  if (range > 0) {
    ipitch = fpitch + 0.5;
    lower = ipitch - range;
    upper = ipitch + range;
    if (upper > pmax)
      upper = pmax;
    if (lower < pmin)
      lower = pmin;
    if (lower < 0.75 * ipitch)
      lower = 0.75 * ipitch;
    length = ipitch;
    if (length < lmin)
      length = lmin;
    fpitch = find_pitch(sig_in, &corr, lower, upper, length);
  }
  ipitch = fpitch + 0.5;
  if (ipitch >= pmax)
    ipitch = pmax - 1;
  length = ipitch;
  if (length < lmin)
    length = lmin;
  cbegin = -((length + ipitch) / 2);
  c0_T = v_inner(&sig_in[cbegin], &sig_in[cbegin + ipitch], length);
  c0_T1 = v_inner(&sig_in[cbegin], &sig_in[cbegin + ipitch + 1], length);
  c0_Tm1 = v_inner(&sig_in[cbegin], &sig_in[cbegin + ipitch - 1], length);
  if (c0_Tm1 > c0_T1) {
    c0_T1 = c0_T;
    c0_T = c0_Tm1;
    ipitch--;
  }
  cT_T1 =
      v_inner(&sig_in[cbegin + ipitch], &sig_in[cbegin + ipitch + 1], length);
  c0_0 = v_inner(&sig_in[cbegin], &sig_in[cbegin], length);
  cT_T = v_inner(&sig_in[cbegin + ipitch], &sig_in[cbegin + ipitch], length);
  cT1_T1 = v_inner(&sig_in[cbegin + ipitch + 1], &sig_in[cbegin + ipitch + 1],
                   length);
  denom = c0_T1 * (cT_T - cT_T1) + c0_T * (cT1_T1 - cT_T1);
  if (fabs(denom) > 0.01)
    frac = (c0_T1 * cT_T - c0_T * cT_T1) / denom;
  else
    frac = 0.5;
  if (frac > 2.0)
    frac = 2.0;
  if (frac < -1.0)
    frac = -1.0;
  fpitch = ipitch + frac;
  if (fpitch > pmax)
    fpitch = pmax;
  if (fpitch < pmin)
    fpitch = pmin;
  frac = fpitch - ipitch;
  frac1 = 1.0 - frac;
  denom = c0_0 * (frac1 * frac1 * cT_T + 2 * frac * frac1 * cT_T1 +
                  frac * frac * cT1_T1);
  denom = sqrt(denom);
  if (fabs(denom) > 0.01)
    *pcorr = (frac1 * c0_T + frac * c0_T1) / denom;
  else
    *pcorr = 0.0;
  return (fpitch);
}


x86 assembly (clang, -O0):
<frac_pch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    122b <frac_pch+0xeb>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11ad <frac_pch+0x6d>
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11bf <frac_pch+0x7f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
cvtsi2sdl -0x30(%rbp),%xmm1
cvtsi2sdl -0x38(%rbp),%xmm2
movsd  0xe37(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    11f7 <frac_pch+0xb7>
cvtsi2sdl -0x38(%rbp),%xmm1
movsd  0xe1c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    120f <frac_pch+0xcf>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%r8d
lea    -0x60(%rbp),%rsi
call   1060 <find_pitch@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdc4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     125c <frac_pch+0x11c>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1274 <frac_pch+0x134>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    -0x38(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%edx
call   1040 <v_inner@plt>
movss  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%edx
call   1040 <v_inner@plt>
movss  %xmm0,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%edx
call   1040 <v_inner@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm0
ucomiss -0x44(%rbp),%xmm0
jbe    134a <frac_pch+0x20a>
movss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%edx
call   1040 <v_inner@plt>
movss  %xmm0,-0x4c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%edx
call   1040 <v_inner@plt>
movss  %xmm0,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%edx
call   1040 <v_inner@plt>
movss  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%edx
call   1040 <v_inner@plt>
movss  %xmm0,-0x50(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm2
subss  -0x4c(%rbp),%xmm2
movss  -0x40(%rbp),%xmm1
movss  -0x50(%rbp),%xmm3
subss  -0x4c(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x64(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  0xbb8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    149a <frac_pch+0x35a>
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm2
movss  -0x40(%rbp),%xmm1
mulss  -0x4c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
divss  -0x64(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
jmp    14a7 <frac_pch+0x367>
movss  0xb8e(%rip),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x58(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb60(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14cf <frac_pch+0x38f>
movss  0xb6a(%rip),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x58(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb40(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14f7 <frac_pch+0x3b7>
movss  0xb46(%rip),%xmm0
movss  %xmm0,-0x58(%rbp)
cvtsi2ssl -0x38(%rbp),%xmm0
addss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jbe    1523 <frac_pch+0x3e3>
cvtsi2ssl -0x20(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1540 <frac_pch+0x400>
cvtsi2ssl -0x1c(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x38(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x58(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xac4(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm2
mulss  -0x5c(%rbp),%xmm2
movss  -0x48(%rbp),%xmm3
movss  0xaa7(%rip),%xmm1
mulss  -0x58(%rbp),%xmm1
mulss  -0x5c(%rbp),%xmm1
mulss  -0x4c(%rbp),%xmm1
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  -0x58(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
movss  -0x50(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x64(%rbp),%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0x64(%rbp)
movss  -0x64(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  0xa2b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    161d <frac_pch+0x4dd>
movss  -0x5c(%rbp),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  -0x44(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
divss  -0x64(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
jmp    1628 <frac_pch+0x4e8>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frac_pch>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%r13d
mov    %r8d,%ebx
mov    %rsi,0x10(%rsp)
mov    %rdi,%r14
test   %edx,%edx
mov    %ecx,0xc(%rsp)
jle    11be <frac_pch+0x7e>
mov    %edx,%ebp
cvtss2sd %xmm0,%xmm0
addsd  0xe8e(%rip),%xmm0
cvttsd2si %xmm0,%r8d
mov    %r8d,%eax
sub    %edx,%eax
add    %r8d,%ebp
cmp    %ebx,%ebp
cmovg  %ebx,%ebp
cmp    %ecx,%eax
cmovl  %ecx,%eax
cvtsi2sd %eax,%xmm1
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  0xe6b(%rip),%xmm0
ucomisd %xmm1,%xmm0
cvttsd2si %xmm0,%edx
cmovbe %eax,%edx
cmp    %r13d,%r8d
cmovl  %r13d,%r8d
lea    0x34(%rsp),%rsi
mov    %r14,%rdi
mov    %ebp,%ecx
call   1060 <find_pitch@plt>
cvtss2sd %xmm0,%xmm0
addsd  0xe36(%rip),%xmm0
cvttsd2si %xmm0,%eax
lea    -0x1(%rbx),%r12d
mov    %rbx,0x28(%rsp)
cmp    %ebx,%eax
cmovl  %eax,%r12d
cmp    %r13d,%r12d
cmovge %r12d,%r13d
lea    (%r12,%r13,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%eax
neg    %eax
cltq
lea    (%r14,%rax,4),%r15
mov    %r12d,%eax
sub    %ebx,%eax
movslq %eax,%rbp
lea    (%r14,%rbp,4),%rsi
mov    %r15,%rdi
mov    %r13d,%edx
call   1040 <v_inner@plt>
movss  %xmm0,0x4(%rsp)
lea    (%r14,%rbp,4),%rsi
add    $0x4,%rsi
mov    %r15,%rdi
mov    %r13d,%edx
call   1040 <v_inner@plt>
movss  %xmm0,0x8(%rsp)
mov    %r14,0x18(%rsp)
lea    (%r14,%rbp,4),%rsi
add    $0xfffffffffffffffc,%rsi
mov    %r15,%rdi
mov    %r13d,%edx
call   1040 <v_inner@plt>
movss  0x8(%rsp),%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %cl
ja     1260 <frac_pch+0x120>
mov    0x10(%rsp),%rbp
jmp    1277 <frac_pch+0x137>
mov    0x10(%rsp),%rbp
movss  0x4(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
mov    %cl,%al
sub    %eax,%r12d
mov    %r12d,%eax
sub    %ebx,%eax
cltq
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%r14
lea    (%rcx,%rax,4),%rbx
add    $0x4,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
call   1040 <v_inner@plt>
movss  %xmm0,0x18(%rsp)
mov    %r15,%rdi
mov    %r15,%rsi
mov    %r13d,%edx
call   1040 <v_inner@plt>
movss  %xmm0,0x24(%rsp)
mov    %r14,%rdi
mov    %r14,%rsi
mov    %r13d,%edx
call   1040 <v_inner@plt>
movss  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
call   1040 <v_inner@plt>
movss  0x10(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
subss  %xmm2,%xmm1
movss  %xmm0,0x20(%rsp)
subss  %xmm2,%xmm0
mulss  0x4(%rsp),%xmm0
mulss  0x8(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x30(%rsp)
movaps %xmm1,%xmm0
call   1030 <fabs@plt>
ucomisd 0xcf2(%rip),%xmm0
jbe    135d <frac_pch+0x21d>
movss  0x18(%rsp),%xmm4
movaps %xmm4,%xmm1
mulss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm2
movss  0x10(%rsp),%xmm5
mulss  %xmm5,%xmm2
subss  %xmm1,%xmm2
divss  0x30(%rsp),%xmm2
mov    %rbp,%rbx
mov    0xc(%rsp),%eax
mov    0x28(%rsp),%rcx
movss  0x24(%rsp),%xmm0
jmp    1383 <frac_pch+0x243>
movss  0xcb3(%rip),%xmm2
mov    %rbp,%rbx
mov    0xc(%rsp),%eax
mov    0x28(%rsp),%rcx
movss  0x24(%rsp),%xmm0
movss  0x18(%rsp),%xmm4
movss  0x10(%rsp),%xmm5
movss  0x20(%rsp),%xmm8
movss  0xc8a(%rip),%xmm1
minss  %xmm2,%xmm1
movss  0xc82(%rip),%xmm3
maxss  %xmm1,%xmm3
xorps  %xmm1,%xmm1
cvtsi2ss %r12d,%xmm1
addss  %xmm1,%xmm3
xorps  %xmm2,%xmm2
cvtsi2ss %ecx,%xmm2
minss  %xmm3,%xmm2
cvtsi2ss %eax,%xmm6
maxss  %xmm2,%xmm6
movaps %xmm6,%xmm3
subss  %xmm1,%xmm3
movss  0xc54(%rip),%xmm7
subss  %xmm3,%xmm7
movaps %xmm7,%xmm2
mulss  %xmm7,%xmm2
movaps %xmm3,%xmm1
addss  %xmm3,%xmm1
mulss  %xmm7,%xmm1
mulss  %xmm1,%xmm4
mulss  %xmm5,%xmm2
addss  %xmm4,%xmm2
movaps %xmm3,%xmm1
mulss  %xmm3,%xmm1
mulss  %xmm8,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
movss  %xmm6,0x18(%rsp)
movss  %xmm7,0x10(%rsp)
movss  %xmm3,0xc(%rsp)
jb     1426 <frac_pch+0x2e6>
sqrtss %xmm0,%xmm0
jmp    142b <frac_pch+0x2eb>
call   1050 <sqrt@plt>
movss  %xmm0,0x28(%rsp)
call   1030 <fabs@plt>
ucomisd 0xbd2(%rip),%xmm0
xorps  %xmm1,%xmm1
jbe    1465 <frac_pch+0x325>
movss  0x8(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
mulss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
divss  0x28(%rsp),%xmm1
movss  %xmm1,(%rbx)
movss  0x18(%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @frac_pch(float* %0, float* %1, float %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
store float* %0, float** %8
store float* %1, float** %9
store float %2, float* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%31 = load i32, i32* %11
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %80
33: ; preds = %7
%34 = load float, float* %10
%35 = fpext float %34 to double
%36 = fadd double %35, 5.000000e-01
%37 = fptosi double %36 to i32
store i32 %37, i32* %19
%38 = load i32, i32* %19
%39 = load i32, i32* %11
%40 = sub nsw i32 %38, %39
store i32 %40, i32* %17
%41 = load i32, i32* %19
%42 = load i32, i32* %11
%43 = add nsw i32 %41, %42
store i32 %43, i32* %18
%44 = load i32, i32* %18
%45 = load i32, i32* %13
%46 = icmp sgt i32 %44, %45
br i1 %46, label %47, label %49
47: ; preds = %33
%48 = load i32, i32* %13
store i32 %48, i32* %18
br label %49
49: ; preds = %47, %33
%50 = load i32, i32* %17
%51 = load i32, i32* %12
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %55
53: ; preds = %49
%54 = load i32, i32* %12
store i32 %54, i32* %17
br label %55
55: ; preds = %53, %49
%56 = load i32, i32* %17
%57 = sitofp i32 %56 to double
%58 = load i32, i32* %19
%59 = sitofp i32 %58 to double
%60 = fmul double 7.500000e-01, %59
%61 = fcmp olt double %57, %60
br i1 %61, label %62, label %67
62: ; preds = %55
%63 = load i32, i32* %19
%64 = sitofp i32 %63 to double
%65 = fmul double 7.500000e-01, %64
%66 = fptosi double %65 to i32
store i32 %66, i32* %17
br label %67
67: ; preds = %62, %55
%68 = load i32, i32* %19
store i32 %68, i32* %15
%69 = load i32, i32* %15
%70 = load i32, i32* %14
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %74
72: ; preds = %67
%73 = load i32, i32* %14
store i32 %73, i32* %15
br label %74
74: ; preds = %72, %67
%75 = load float*, float** %8
%76 = load i32, i32* %17
%77 = load i32, i32* %18
%78 = load i32, i32* %15
%79 = call float @find_pitch(float* %75, float* %29, i32 %76, i32 %77, i32 %78)
store float %79, float* %10
br label %80
80: ; preds = %74, %7
%81 = load float, float* %10
%82 = fpext float %81 to double
%83 = fadd double %82, 5.000000e-01
%84 = fptosi double %83 to i32
store i32 %84, i32* %19
%85 = load i32, i32* %19
%86 = load i32, i32* %13
%87 = icmp sge i32 %85, %86
br i1 %87, label %88, label %91
88: ; preds = %80
%89 = load i32, i32* %13
%90 = sub nsw i32 %89, 1
store i32 %90, i32* %19
br label %91
91: ; preds = %88, %80
%92 = load i32, i32* %19
store i32 %92, i32* %15
%93 = load i32, i32* %15
%94 = load i32, i32* %14
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %98
96: ; preds = %91
%97 = load i32, i32* %14
store i32 %97, i32* %15
br label %98
98: ; preds = %96, %91
%99 = load i32, i32* %15
%100 = load i32, i32* %19
%101 = add nsw i32 %99, %100
%102 = sdiv i32 %101, 2
%103 = sub nsw i32 0, %102
store i32 %103, i32* %16
%104 = load float*, float** %8
%105 = load i32, i32* %16
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds float, float* %104, i64 %106
%108 = load float*, float** %8
%109 = load i32, i32* %16
%110 = load i32, i32* %19
%111 = add nsw i32 %109, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds float, float* %108, i64 %112
%114 = load i32, i32* %15
%115 = call float @v_inner(float* %107, float* %113, i32 %114)
store float %115, float* %21
%116 = load float*, float** %8
%117 = load i32, i32* %16
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds float, float* %116, i64 %118
%120 = load float*, float** %8
%121 = load i32, i32* %16
%122 = load i32, i32* %19
%123 = add nsw i32 %121, %122
%124 = add nsw i32 %123, 1
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds float, float* %120, i64 %125
%127 = load i32, i32* %15
%128 = call float @v_inner(float* %119, float* %126, i32 %127)
store float %128, float* %22
%129 = load float*, float** %8
%130 = load i32, i32* %16
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds float, float* %129, i64 %131
%133 = load float*, float** %8
%134 = load i32, i32* %16
%135 = load i32, i32* %19
%136 = add nsw i32 %134, %135
%137 = sub nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds float, float* %133, i64 %138
%140 = load i32, i32* %15
%141 = call float @v_inner(float* %132, float* %139, i32 %140)
store float %141, float* %26
%142 = load float, float* %26
%143 = load float, float* %22
%144 = fcmp ogt float %142, %143
br i1 %144, label %145, label %150
145: ; preds = %98
%146 = load float, float* %21
store float %146, float* %22
%147 = load float, float* %26
store float %147, float* %21
%148 = load i32, i32* %19
%149 = add nsw i32 %148, -1
store i32 %149, i32* %19
br label %150
150: ; preds = %145, %98
%151 = load float*, float** %8
%152 = load i32, i32* %16
%153 = load i32, i32* %19
%154 = add nsw i32 %152, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds float, float* %151, i64 %155
%157 = load float*, float** %8
%158 = load i32, i32* %16
%159 = load i32, i32* %19
%160 = add nsw i32 %158, %159
%161 = add nsw i32 %160, 1
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds float, float* %157, i64 %162
%164 = load i32, i32* %15
%165 = call float @v_inner(float* %156, float* %163, i32 %164)
store float %165, float* %24
%166 = load float*, float** %8
%167 = load i32, i32* %16
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds float, float* %166, i64 %168
%170 = load float*, float** %8
%171 = load i32, i32* %16
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds float, float* %170, i64 %172
%174 = load i32, i32* %15
%175 = call float @v_inner(float* %169, float* %173, i32 %174)
store float %175, float* %20
%176 = load float*, float** %8
%177 = load i32, i32* %16
%178 = load i32, i32* %19
%179 = add nsw i32 %177, %178
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds float, float* %176, i64 %180
%182 = load float*, float** %8
%183 = load i32, i32* %16
%184 = load i32, i32* %19
%185 = add nsw i32 %183, %184
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds float, float* %182, i64 %186
%188 = load i32, i32* %15
%189 = call float @v_inner(float* %181, float* %187, i32 %188)
store float %189, float* %23
%190 = load float*, float** %8
%191 = load i32, i32* %16
%192 = load i32, i32* %19
%193 = add nsw i32 %191, %192
%194 = add nsw i32 %193, 1
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds float, float* %190, i64 %195
%197 = load float*, float** %8
%198 = load i32, i32* %16
%199 = load i32, i32* %19
%200 = add nsw i32 %198, %199
%201 = add nsw i32 %200, 1
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds float, float* %197, i64 %202
%204 = load i32, i32* %15
%205 = call float @v_inner(float* %196, float* %203, i32 %204)
store float %205, float* %25
%206 = load float, float* %22
%207 = load float, float* %23
%208 = load float, float* %24
%209 = fsub float %207, %208
%210 = load float, float* %21
%211 = load float, float* %25
%212 = load float, float* %24
%213 = fsub float %211, %212
%214 = fmul float %210, %213
%215 = call float @llvm.fmuladd.f32(float %206, float %209, float %214)
store float %215, float* %30
%216 = load float, float* %30
%217 = call double @fabs(float %216)
%218 = fcmp ogt double %217, 1.000000e-02
br i1 %218, label %219, label %229
219: ; preds = %150
%220 = load float, float* %22
%221 = load float, float* %23
%222 = load float, float* %21
%223 = load float, float* %24
%224 = fmul float %222, %223
%225 = fneg float %224
%226 = call float @llvm.fmuladd.f32(float %220, float %221, float %225)
%227 = load float, float* %30
%228 = fdiv float %226, %227
store float %228, float* %27
br label %230
229: ; preds = %150
store float 5.000000e-01, float* %27
br label %230
230: ; preds = %229, %219
%231 = load float, float* %27
%232 = fpext float %231 to double
%233 = fcmp ogt double %232, 2.000000e+00
br i1 %233, label %234, label %235
234: ; preds = %230
store float 2.000000e+00, float* %27
br label %235
235: ; preds = %234, %230
%236 = load float, float* %27
%237 = fpext float %236 to double
%238 = fcmp olt double %237, -1.000000e+00
br i1 %238, label %239, label %240
239: ; preds = %235
store float -1.000000e+00, float* %27
br label %240
240: ; preds = %239, %235
%241 = load i32, i32* %19
%242 = sitofp i32 %241 to float
%243 = load float, float* %27
%244 = fadd float %242, %243
store float %244, float* %10
%245 = load float, float* %10
%246 = load i32, i32* %13
%247 = sitofp i32 %246 to float
%248 = fcmp ogt float %245, %247
br i1 %248, label %249, label %252
249: ; preds = %240
%250 = load i32, i32* %13
%251 = sitofp i32 %250 to float
store float %251, float* %10
br label %252
252: ; preds = %249, %240
%253 = load float, float* %10
%254 = load i32, i32* %12
%255 = sitofp i32 %254 to float
%256 = fcmp olt float %253, %255
br i1 %256, label %257, label %260
257: ; preds = %252
%258 = load i32, i32* %12
%259 = sitofp i32 %258 to float
store float %259, float* %10
br label %260
260: ; preds = %257, %252
%261 = load float, float* %10
%262 = load i32, i32* %19
%263 = sitofp i32 %262 to float
%264 = fsub float %261, %263
store float %264, float* %27
%265 = load float, float* %27
%266 = fpext float %265 to double
%267 = fsub double 1.000000e+00, %266
%268 = fptrunc double %267 to float
store float %268, float* %28
%269 = load float, float* %20
%270 = load float, float* %28
%271 = load float, float* %28
%272 = fmul float %270, %271
%273 = load float, float* %23
%274 = load float, float* %27
%275 = fmul float 2.000000e+00, %274
%276 = load float, float* %28
%277 = fmul float %275, %276
%278 = load float, float* %24
%279 = fmul float %277, %278
%280 = call float @llvm.fmuladd.f32(float %272, float %273, float %279)
%281 = load float, float* %27
%282 = load float, float* %27
%283 = fmul float %281, %282
%284 = load float, float* %25
%285 = call float @llvm.fmuladd.f32(float %283, float %284, float %280)
%286 = fmul float %269, %285
store float %286, float* %30
%287 = load float, float* %30
%288 = call float @sqrt(float %287)
store float %288, float* %30
%289 = load float, float* %30
%290 = call double @fabs(float %289)
%291 = fcmp ogt double %290, 1.000000e-02
br i1 %291, label %292, label %302
292: ; preds = %260
%293 = load float, float* %28
%294 = load float, float* %21
%295 = load float, float* %27
%296 = load float, float* %22
%297 = fmul float %295, %296
%298 = call float @llvm.fmuladd.f32(float %293, float %294, float %297)
%299 = load float, float* %30
%300 = fdiv float %298, %299
%301 = load float*, float** %9
store float %300, float* %301
br label %304
302: ; preds = %260
%303 = load float*, float** %9
store float 0.000000e+00, float* %303
br label %304
304: ; preds = %302, %292
%305 = load float, float* %10
ret float %305
}

LLVM IR (-O2):
define float @frac_pch(float* %0, float* nocapture writeonly %1, float %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca float
%9 = bitcast float* %8 to i8*
%10 = icmp sgt i32 %3, 0
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = fpext float %2 to double
%13 = fadd double %12, 5.000000e-01
%14 = fptosi double %13 to i32
%15 = sub nsw i32 %14, %3
%16 = add nsw i32 %14, %3
%17 = icmp sgt i32 %16, %5
%18 = select i1 %17, i32 %5, i32 %16
%19 = icmp slt i32 %15, %4
%20 = select i1 %19, i32 %4, i32 %15
%21 = sitofp i32 %20 to double
%22 = sitofp i32 %14 to double
%23 = fmul double %22, 7.500000e-01
%24 = fcmp ogt double %23, %21
%25 = fptosi double %23 to i32
%26 = select i1 %24, i32 %25, i32 %20
%27 = icmp slt i32 %14, %6
%28 = select i1 %27, i32 %6, i32 %14
%29 = call float @find_pitch(float* %0, float* %8, i32 %26, i32 %18, i32 %28)
br label %30
30: ; preds = %11, %7
%31 = phi float [ %29, %11 ], [ %2, %7 ]
%32 = fpext float %31 to double
%33 = fadd double %32, 5.000000e-01
%34 = fptosi double %33 to i32
%35 = icmp slt i32 %34, %5
%36 = add nsw i32 %5, -1
%37 = select i1 %35, i32 %34, i32 %36
%38 = icmp slt i32 %37, %6
%39 = select i1 %38, i32 %6, i32 %37
%40 = add nsw i32 %39, %37
%41 = sdiv i32 %40, -2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds float, float* %0, i64 %42
%44 = add nsw i32 %41, %37
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds float, float* %0, i64 %45
%47 = call float @v_inner(float* %43, float* %46, i32 %39)
%48 = add nsw i32 %44, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float, float* %0, i64 %49
%51 = call float @v_inner(float* %43, float* %50, i32 %39)
%52 = add nsw i32 %44, -1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds float, float* %0, i64 %53
%55 = call float @v_inner(float* %43, float* %54, i32 %39)
%56 = fcmp ogt float %55, %51
%57 = select i1 %56, float %55, float %47
%58 = select i1 %56, float %47, float %51
%59 = sext i1 %56 to i32
%60 = add nsw i32 %37, %59
%61 = add nsw i32 %41, %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds float, float* %0, i64 %62
%64 = add nsw i32 %61, 1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds float, float* %0, i64 %65
%67 = call float @v_inner(float* %63, float* %66, i32 %39)
%68 = call float @v_inner(float* %43, float* %43, i32 %39)
%69 = call float @v_inner(float* %63, float* %63, i32 %39)
%70 = call float @v_inner(float* %66, float* %66, i32 %39)
%71 = fsub float %69, %67
%72 = fsub float %70, %67
%73 = fmul float %57, %72
%74 = call float @llvm.fmuladd.f32(float %58, float %71, float %73)
%75 = call double @fabs(float %74)
%76 = fcmp ogt double %75, 1.000000e-02
br i1 %76, label %77, label %82
77: ; preds = %30
%78 = fneg float %57
%79 = fmul float %67, %78
%80 = call float @llvm.fmuladd.f32(float %58, float %69, float %79)
%81 = fdiv float %80, %74
br label %82
82: ; preds = %30, %77
%83 = phi float [ %81, %77 ], [ 5.000000e-01, %30 ]
%84 = fcmp ogt float %83, 2.000000e+00
%85 = select i1 %84, float 2.000000e+00, float %83
%86 = fcmp olt float %85, -1.000000e+00
%87 = select i1 %86, float -1.000000e+00, float %85
%88 = sitofp i32 %60 to float
%89 = fadd float %87, %88
%90 = sitofp i32 %5 to float
%91 = fcmp ogt float %89, %90
%92 = select i1 %91, float %90, float %89
%93 = sitofp i32 %4 to float
%94 = fcmp olt float %92, %93
%95 = select i1 %94, float %93, float %92
%96 = fsub float %95, %88
%97 = fsub float 1.000000e+00, %96
%98 = fmul float %97, %97
%99 = fmul float %96, 2.000000e+00
%100 = fmul float %99, %97
%101 = fmul float %67, %100
%102 = call float @llvm.fmuladd.f32(float %98, float %69, float %101)
%103 = fmul float %96, %96
%104 = call float @llvm.fmuladd.f32(float %103, float %70, float %102)
%105 = fmul float %68, %104
%106 = call float @sqrt(float %105)
%107 = call double @fabs(float %106)
%108 = fcmp ogt double %107, 1.000000e-02
br i1 %108, label %109, label %113
109: ; preds = %82
%110 = fmul float %58, %96
%111 = call float @llvm.fmuladd.f32(float %97, float %57, float %110)
%112 = fdiv float %111, %106
br label %113
113: ; preds = %82, %109
%114 = phi float [ %112, %109 ], [ 0.000000e+00, %82 ]
store float %114, float* %1
ret float %95
}