#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 */
int /*<<< orphan*/ printf(char *);
float pclin_innerproduct(float *pdx1, float *pf1, int n1, float *pdx2,
                         float *pf2, int n2, float offset) {
  float dx1, dx2;
  float f1, f2;
  float step;
  float slope1, slope2;
  int i1, i2;
  int inii1;
  float sum;
  int i;
  if (offset < 0.0)
    return 0.0;
  offset += pdx2[0];
  i1 = 1;
  dx1 = pdx1[1];
  for (i2 = 0; offset >= 0.0; i2++)
    offset -= pdx2[i2 % n2];
  dx2 = -offset;
  i2--;
  f1 = pf1[0];
  f2 = pf2[(i2 - 1) % n2];
  slope1 = (pf1[i1] - f1) / dx1;
  slope2 = (pf2[(i2 % n2)] - f2) / pdx2[i2 % n2];
  if (dx1 < 0.0000002)
    printf("hhhdx1\n");
  if (pdx2[i2 % n2] < 0.0000002)
    printf("hhhpdx2[i2]\n");
  inii1 = i1;
  sum = 0.0;
  while (1) {
    step = dx1 < dx2 ? dx1 : dx2;
    sum += step * (f1 * f2 + step * (0.5 * (f1 * slope2 + f2 * slope1) +
                                     step * 0.3333333 * slope1 * slope2));
    if (sum > 1000000)
      printf("khhh\n");
    if (sum == (1.0 / 0.0))
      printf("khhhnan\n");
    if (dx1 < dx2) {
      {
        dx2 -= dx1;
        f2 += slope2 * dx1;
        f1 = pf1[i1 % n1];
        i1++;
        i = i1 % n1;
        dx1 = pdx1[i];
        slope1 = (pf1[i] - f1) / dx1;
        if ((dx1 < 0.00002) && (dx1 > -0.00002)) {
          printf("slope overflow\n");
          return 0.0;
        }
      }
    } else {
      {
        dx1 -= dx2;
        f1 += slope1 * dx2;
        f2 = pf2[i2 % n2];
        i2++;
        i = i2 % n2;
        dx2 = pdx2[i];
        slope2 = (pf2[i] - f2) / dx2;
        if ((dx2 < 0.00002) && (dx2 > -0.00002)) {
          printf("slope overflow\n");
          return 0.0;
        }
      }
    }
    if (i1 == n1 + inii1)
      return sum;
  }
}


x86 assembly (clang, -O0):
<pclin_innerproduct>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    115a <pclin_innerproduct+0x4a>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    163a <pclin_innerproduct+0x52a>
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
addss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movl   $0x1,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x3c(%rbp)
movl   $0x0,-0x5c(%rbp)
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11d5 <pclin_innerproduct+0xc5>
mov    -0x28(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x34(%rbp)
mov    -0x70(%rbp),%rax
movslq %edx,%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x38(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1188 <pclin_innerproduct+0x78>
movss  -0x38(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x5c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x5c(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x34(%rbp)
mov    -0x88(%rbp),%rax
movslq %edx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x44(%rbp),%xmm0
divss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x34(%rbp)
mov    -0x80(%rbp),%rax
movslq %edx,%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x34(%rbp)
mov    -0x78(%rbp),%rax
movslq %edx,%rcx
divss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd68(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12ae <pclin_innerproduct+0x19e>
lea    0xd8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x34(%rbp)
mov    -0x90(%rbp),%rax
movslq %edx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd25(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12f1 <pclin_innerproduct+0x1e1>
lea    0xd50(%rip),%rdi
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
mov    %eax,-0x60(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1324 <pclin_innerproduct+0x214>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x94(%rbp)
ff
jmp    1331 <pclin_innerproduct+0x221>
movss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x94(%rbp),%xmm0
ff
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x44(%rbp),%xmm1
mulss  -0x48(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x4c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x44(%rbp),%xmm3
movss  -0x54(%rbp),%xmm5
movss  -0x48(%rbp),%xmm4
mulss  -0x50(%rbp),%xmm4
mulss  %xmm5,%xmm3
addss  %xmm4,%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x4c(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
movsd  0xc81(%rip),%xmm5
mulsd  %xmm5,%xmm4
movss  -0x50(%rbp),%xmm5
cvtss2sd %xmm5,%xmm5
mulsd  %xmm5,%xmm4
movss  -0x54(%rbp),%xmm5
cvtss2sd %xmm5,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xc53(%rip),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movss  -0x64(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x64(%rbp),%xmm0
movss  0xc44(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1401 <pclin_innerproduct+0x2f1>
lea    0xc4d(%rip),%rdi
call   1030 <printf@plt>
movss  -0x64(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc06(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    142e <pclin_innerproduct+0x31e>
jp     142e <pclin_innerproduct+0x31e>
lea    0xc26(%rip),%rdi
call   1030 <printf@plt>
movss  -0x3c(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    152b <pclin_innerproduct+0x41b>
movss  -0x3c(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x54(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x48(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x58(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    -0xa0(%rbp),%rax
movslq %edx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x68(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x44(%rbp),%xmm0
divss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb38(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1526 <pclin_innerproduct+0x416>
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb25(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1526 <pclin_innerproduct+0x416>
lea    0xb44(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    163a <pclin_innerproduct+0x52a>
jmp    1615 <pclin_innerproduct+0x505>
movss  -0x40(%rbp),%xmm1
movss  -0x3c(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x50(%rbp),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x44(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x34(%rbp)
mov    -0xa8(%rbp),%rax
movslq %edx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x34(%rbp)
mov    %edx,-0x68(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x68(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x68(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x48(%rbp),%xmm0
divss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xa4e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1610 <pclin_innerproduct+0x500>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa3b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1610 <pclin_innerproduct+0x500>
lea    0xa5a(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    163a <pclin_innerproduct+0x52a>
jmp    1615 <pclin_innerproduct+0x505>
mov    -0x58(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    -0x60(%rbp),%ecx
cmp    %ecx,%eax
jne    1635 <pclin_innerproduct+0x525>
movss  -0x64(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    163a <pclin_innerproduct+0x52a>
jmp    12ff <pclin_innerproduct+0x1ef>
movss  -0x4(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pclin_innerproduct>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8,0x28(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rdi,0x18(%rsp)
xorps  %xmm6,%xmm6
ucomiss %xmm0,%xmm6
ja     147e <pclin_innerproduct+0x36e>
mov    %r9d,%ebx
mov    %rcx,%r15
mov    %rsi,%r13
addss  (%rcx),%xmm0
mov    0x18(%rsp),%rax
movss  0x4(%rax),%xmm4
xor    %ecx,%ecx
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1173 <pclin_innerproduct+0x63>
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%eax
cltd
idiv   %ebx
subss  (%r15,%rdx,4),%xmm0
add    $0x1,%ecx
ucomiss %xmm1,%xmm0
jae    1160 <pclin_innerproduct+0x50>
xorps  0xe86(%rip),%xmm0
lea    -0x1(%rcx),%ebp
movss  0x0(%r13),%xmm5
movss  0x4(%r13),%xmm1
movss  %xmm1,0x4(%rsp)
add    $0xfffffffe,%ecx
mov    %ecx,%eax
cltd
idiv   %ebx
movslq %edx,%rax
mov    0x28(%rsp),%rcx
movss  (%rcx,%rax,4),%xmm3
mov    %ebp,%eax
cltd
idiv   %ebx
movslq %edx,%r14
movss  (%rcx,%r14,4),%xmm1
movss  %xmm1,(%rsp)
movss  (%r15,%r14,4),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm4,%xmm1
movsd  0xe44(%rip),%xmm6
ucomisd %xmm1,%xmm6
movss  %xmm2,0x10(%rsp)
movaps %xmm2,%xmm1
movaps %xmm0,0x30(%rsp)
movss  %xmm4,0x14(%rsp)
movss  %xmm5,0xc(%rsp)
movss  %xmm3,0x8(%rsp)
jbe    1223 <pclin_innerproduct+0x113>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe0a(%rip),%xmm6
movss  0x8(%rsp),%xmm3
movss  0xc(%rsp),%xmm5
movss  0x14(%rsp),%xmm4
movaps 0x30(%rsp),%xmm0
movss  (%r15,%r14,4),%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm5,%xmm2
movss  %xmm2,0x4(%rsp)
movss  (%rsp),%xmm2
subss  %xmm3,%xmm2
movss  %xmm2,(%rsp)
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm6
jbe    126e <pclin_innerproduct+0x15e>
lea    0xe0a(%rip),%rdi
call   1030 <puts@plt>
movss  0x8(%rsp),%xmm3
movss  0xc(%rsp),%xmm5
movss  0x14(%rsp),%xmm4
movaps 0x30(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
divss  %xmm4,%xmm1
movss  %xmm1,0x4(%rsp)
movss  (%rsp),%xmm1
divss  0x10(%rsp),%xmm1
movss  %xmm1,(%rsp)
mov    0x20(%rsp),%rax
lea    0x1(%rax),%r14d
xorpd  %xmm6,%xmm6
mov    $0x1,%r12d
jmp    12bc <pclin_innerproduct+0x1ac>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps %xmm1,%xmm5
cmp    %r14d,%r12d
je     147e <pclin_innerproduct+0x36e>
movss  %xmm4,0x14(%rsp)
movaps %xmm4,%xmm1
movaps %xmm0,0x30(%rsp)
minss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movaps %xmm5,%xmm1
mulss  %xmm3,%xmm1
cvtss2sd %xmm1,%xmm1
movss  %xmm3,0x8(%rsp)
movaps %xmm3,%xmm2
movss  0x4(%rsp),%xmm4
mulss  %xmm4,%xmm2
movss  %xmm5,0xc(%rsp)
movaps %xmm5,%xmm3
movss  (%rsp),%xmm5
mulss  %xmm5,%xmm3
addss  %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
movaps %xmm0,%xmm3
mulsd  0xcfd(%rip),%xmm3
cvtss2sd %xmm4,%xmm4
mulsd  %xmm3,%xmm4
xorps  %xmm3,%xmm3
cvtss2sd %xmm5,%xmm3
mulsd  %xmm4,%xmm3
mulsd  0xcea(%rip),%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm6,%xmm1
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm6,%xmm6
cvtsd2ss %xmm2,%xmm6
ucomiss 0xcd9(%rip),%xmm6
movss  %xmm6,0x10(%rsp)
jbe    1379 <pclin_innerproduct+0x269>
lea    0xce9(%rip),%rdi
call   1030 <puts@plt>
movss  0x10(%rsp),%xmm6
ucomiss 0xcbc(%rip),%xmm6
jb     1394 <pclin_innerproduct+0x284>
lea    0xcc6(%rip),%rdi
call   1030 <puts@plt>
movss  0x10(%rsp),%xmm6
movaps 0x30(%rsp),%xmm0
movss  0x14(%rsp),%xmm4
ucomiss %xmm4,%xmm0
jbe    1400 <pclin_innerproduct+0x2f0>
subss  %xmm4,%xmm0
mulss  (%rsp),%xmm4
movaps %xmm4,%xmm3
addss  0x8(%rsp),%xmm3
mov    %r12d,%eax
cltd
mov    0x20(%rsp),%rcx
idiv   %ecx
movslq %edx,%rax
movss  0x0(%r13,%rax,4),%xmm1
add    $0x1,%r12d
mov    %r12d,%eax
cltd
idiv   %ecx
movslq %edx,%rax
mov    0x18(%rsp),%rcx
movss  (%rcx,%rax,4),%xmm4
movss  0x0(%r13,%rax,4),%xmm2
subss  %xmm1,%xmm2
divss  %xmm4,%xmm2
movss  %xmm2,0x4(%rsp)
xorps  %xmm2,%xmm2
cvtss2sd %xmm4,%xmm2
jmp    144f <pclin_innerproduct+0x33f>
subss  %xmm0,%xmm4
mulss  0x4(%rsp),%xmm0
movaps %xmm0,%xmm1
addss  0xc(%rsp),%xmm1
mov    %ebp,%eax
cltd
idiv   %ebx
movslq %edx,%rax
mov    0x28(%rsp),%rcx
movss  (%rcx,%rax,4),%xmm3
add    $0x1,%ebp
mov    %ebp,%eax
cltd
idiv   %ebx
movslq %edx,%rax
movss  (%r15,%rax,4),%xmm0
movss  (%rcx,%rax,4),%xmm2
subss  %xmm3,%xmm2
divss  %xmm0,%xmm2
movss  %xmm2,(%rsp)
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movsd  0xbd1(%rip),%xmm5
ucomisd %xmm2,%xmm5
jbe    12b0 <pclin_innerproduct+0x1a0>
ucomisd 0xbc7(%rip),%xmm2
jbe    12b0 <pclin_innerproduct+0x1a0>
lea    0xbca(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm6,%xmm6
movaps %xmm6,%xmm0
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@str.5 = [15 x i8] c"slope overflow\00"
@str.6 = [8 x i8] c"khhhnan\00"
@str.7 = [5 x i8] c"khhh\00"
@str.8 = [12 x i8] c"hhhpdx2[i2]\00"
@str.9 = [7 x i8] c"hhhdx1\00"
define float @pclin_innerproduct(float* nocapture %0, float* nocapture %1, i32 %2, float* nocapture %3, float* nocapture %4, i32 %5, float %6) {
%8 = fcmp olt float %6, 0.000000e+00
br i1 %8, label %150, label %9
9: ; preds = %7
%10 = load float, float* %3
%11 = fadd float %10, %6
%12 = getelementptr inbounds float, float* %0, i64 1
%13 = load float, float* %12
%14 = fcmp ult float %11, 0.000000e+00
br i1 %14, label %25, label %15
15: ; preds = %9, %15
%16 = phi i32 [ %23, %15 ], [ 0, %9 ]
%17 = phi float [ %22, %15 ], [ %11, %9 ]
%18 = srem i32 %16, %5
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds float, float* %3, i64 %19
%21 = load float, float* %20
%22 = fsub float %17, %21
%23 = add nuw nsw i32 %16, 1
%24 = fcmp ult float %22, 0.000000e+00
br i1 %24, label %25, label %15
25: ; preds = %15, %9
%26 = phi float [ %11, %9 ], [ %22, %15 ]
%27 = phi i32 [ 0, %9 ], [ %23, %15 ]
%28 = fneg float %26
%29 = add nsw i32 %27, -1
%30 = load float, float* %1
%31 = add nsw i32 %27, -2
%32 = srem i32 %31, %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %4, i64 %33
%35 = load float, float* %34
%36 = getelementptr inbounds float, float* %1, i64 1
%37 = load float, float* %36
%38 = fsub float %37, %30
%39 = fdiv float %38, %13
%40 = srem i32 %29, %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds float, float* %4, i64 %41
%43 = load float, float* %42
%44 = fsub float %43, %35
%45 = getelementptr inbounds float, float* %3, i64 %41
%46 = load float, float* %45
%47 = fdiv float %44, %46
%48 = fpext float %13 to double
%49 = fcmp olt double %48, 2.000000e-07
br i1 %49, label %50, label %53
50: ; preds = %25
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.9, i64 0, i64 0))
%52 = load float, float* %45
br label %53
53: ; preds = %50, %25
%54 = phi float [ %52, %50 ], [ %46, %25 ]
%55 = fpext float %54 to double
%56 = fcmp olt double %55, 2.000000e-07
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.8, i64 0, i64 0))
br label %59
59: ; preds = %57, %53
%60 = add nsw i32 %2, 1
br label %61
61: ; preds = %137, %59
%62 = phi float [ %13, %59 ], [ %138, %137 ]
%63 = phi float [ %28, %59 ], [ %139, %137 ]
%64 = phi float [ %30, %59 ], [ %140, %137 ]
%65 = phi float [ %35, %59 ], [ %141, %137 ]
%66 = phi float [ %39, %59 ], [ %142, %137 ]
%67 = phi float [ %47, %59 ], [ %143, %137 ]
%68 = phi i32 [ 1, %59 ], [ %144, %137 ]
%69 = phi i32 [ %29, %59 ], [ %145, %137 ]
%70 = phi float [ 0.000000e+00, %59 ], [ %88, %137 ]
%71 = fcmp olt float %62, %63
%72 = select i1 %71, float %62, float %63
%73 = fpext float %72 to double
%74 = fmul float %64, %65
%75 = fpext float %74 to double
%76 = fmul float %65, %66
%77 = tail call float @llvm.fmuladd.f32(float %64, float %67, float %76)
%78 = fpext float %77 to double
%79 = fmul double %73, 0x3FD55555318ABC87
%80 = fpext float %66 to double
%81 = fmul double %79, %80
%82 = fpext float %67 to double
%83 = fmul double %81, %82
%84 = tail call double @llvm.fmuladd.f64(double %78, double 5.000000e-01, double %83)
%85 = tail call double @llvm.fmuladd.f64(double %73, double %84, double %75)
%86 = fpext float %70 to double
%87 = tail call double @llvm.fmuladd.f64(double %73, double %85, double %86)
%88 = fptrunc double %87 to float
%89 = fcmp ogt float %88, 1.000000e+06
br i1 %89, label %90, label %92
90: ; preds = %61
%91 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.7, i64 0, i64 0))
br label %92
92: ; preds = %90, %61
%93 = fcmp oeq float %88, 0x7FF0000000000000
br i1 %93, label %94, label %96
94: ; preds = %92
%95 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0))
br label %96
96: ; preds = %94, %92
br i1 %71, label %97, label %117
97: ; preds = %96
%98 = fsub float %63, %62
%99 = tail call float @llvm.fmuladd.f32(float %67, float %62, float %65)
%100 = srem i32 %68, %2
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds float, float* %1, i64 %101
%103 = load float, float* %102
%104 = add nsw i32 %68, 1
%105 = srem i32 %104, %2
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds float, float* %0, i64 %106
%108 = load float, float* %107
%109 = getelementptr inbounds float, float* %1, i64 %106
%110 = load float, float* %109
%111 = fsub float %110, %103
%112 = fdiv float %111, %108
%113 = fpext float %108 to double
%114 = fcmp olt double %113, 2.000000e-05
%115 = fcmp ogt double %113, -2.000000e-05
%116 = and i1 %114, %115
br i1 %116, label %147, label %137
117: ; preds = %96
%118 = fsub float %62, %63
%119 = tail call float @llvm.fmuladd.f32(float %66, float %63, float %64)
%120 = srem i32 %69, %5
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds float, float* %4, i64 %121
%123 = load float, float* %122
%124 = add nsw i32 %69, 1
%125 = srem i32 %124, %5
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds float, float* %3, i64 %126
%128 = load float, float* %127
%129 = getelementptr inbounds float, float* %4, i64 %126
%130 = load float, float* %129
%131 = fsub float %130, %123
%132 = fdiv float %131, %128
%133 = fpext float %128 to double
%134 = fcmp olt double %133, 2.000000e-05
%135 = fcmp ogt double %133, -2.000000e-05
%136 = and i1 %134, %135
br i1 %136, label %147, label %137
137: ; preds = %117, %97
%138 = phi float [ %108, %97 ], [ %118, %117 ]
%139 = phi float [ %98, %97 ], [ %128, %117 ]
%140 = phi float [ %103, %97 ], [ %119, %117 ]
%141 = phi float [ %99, %97 ], [ %123, %117 ]
%142 = phi float [ %112, %97 ], [ %66, %117 ]
%143 = phi float [ %67, %97 ], [ %132, %117 ]
%144 = phi i32 [ %104, %97 ], [ %68, %117 ]
%145 = phi i32 [ %69, %97 ], [ %124, %117 ]
%146 = icmp eq i32 %144, %60
br i1 %146, label %150, label %61
147: ; preds = %117, %97
%148 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0), %97 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0), %117 ]
%149 = tail call i32 @puts(i8* dereferenceable(1) %148)
br label %150
150: ; preds = %137, %147, %7
%151 = phi float [ 0.000000e+00, %7 ], [ 0.000000e+00, %147 ], [ %88, %137 ]
ret float %151
}