#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 *);
double fit_line(int *xp, int *yp, int npts) {
  int i;
  double x, y, n;
  double del, a, b, var;
  double sx = 0.0, sy = 0.0, sxx = 0.0, sxy = 0.0, syy = 0.0;
  if (npts == 2)
    return (0.0);
  n = (double)npts;
  if ((((xp[npts - 1] - xp[0]) > 0) ? ((xp[npts - 1] - xp[0]))
                                    : (-(xp[npts - 1] - xp[0]))) >=
      (((yp[npts - 1] - yp[0]) > 0) ? ((yp[npts - 1] - yp[0]))
                                    : (-(yp[npts - 1] - yp[0])))) {
    for (i = 0; i < npts; ++i) {
      x = (double)xp[i];
      y = (double)yp[i];
      sx += x;
      sy += y;
      sxx += x * x;
      sxy += x * y;
      syy += y * y;
    }
  } else {
    for (i = 0; i < npts; ++i) {
      y = (double)xp[i];
      x = (double)yp[i];
      sx += x;
      sy += y;
      sxx += x * x;
      sxy += x * y;
      syy += y * y;
    }
  }
  del = n * sxx - sx * sx;
  if (del == 0.0)
    printf("Error - div by zero in fit_line\n");
  a = (sxx * sy - sx * sxy) / del;
  b = (n * sxy - sx * sy) / del;
  var =
      (syy + n * a * a + sxx * b * b - 2.0 * (a * sy + b * sxy - a * b * sx)) /
      (n - 2);
  return (var);
}


x86 assembly (clang, -O0):
<fit_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jne    1165 <fit_line+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1546 <fit_line+0x436>
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
cmp    $0x0,%eax
jle    11af <fit_line+0x9f>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x84(%rbp)
jmp    11cf <fit_line+0xbf>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
cmp    $0x0,%eax
jle    121b <fit_line+0x10b>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x8c(%rbp)
jmp    123b <fit_line+0x12b>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
sub    (%rax),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x8c(%rbp),%ecx
cmp    %ecx,%eax
jl     130b <fit_line+0x1fb>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1306 <fit_line+0x1f6>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1256 <fit_line+0x146>
jmp    13c7 <fit_line+0x2b7>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13c2 <fit_line+0x2b2>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1312 <fit_line+0x202>
jmp    13c7 <fit_line+0x2b7>
movsd  -0x38(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1423 <fit_line+0x313>
jp     1423 <fit_line+0x313>
lea    0xbea(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xad1(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fit_line>:
xorpd  %xmm0,%xmm0
cmp    $0x2,%edx
je     13be <fit_line+0x2ae>
sub    $0x58,%rsp
cvtsi2sd %edx,%xmm8
movslq %edx,%r9
mov    -0x4(%rdi,%r9,4),%ecx
mov    (%rdi),%r8d
sub    %r8d,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
mov    -0x4(%rsi,%r9,4),%r10d
mov    (%rsi),%r9d
sub    %r9d,%r10d
mov    %r10d,%ecx
neg    %ecx
cmovs  %r10d,%ecx
cmp    %ecx,%eax
jae    11f7 <fit_line+0xe7>
test   %edx,%edx
jle    129c <fit_line+0x18c>
movd   %r8d,%xmm0
movd   %r9d,%xmm1
punpckldq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm6
movapd %xmm6,%xmm1
unpcklpd %xmm6,%xmm1
mulpd  %xmm6,%xmm1
pxor   %xmm0,%xmm0
addpd  %xmm1,%xmm0
movapd %xmm6,%xmm1
unpckhpd %xmm6,%xmm1
mulsd  %xmm1,%xmm1
xorpd  %xmm5,%xmm5
addsd  %xmm1,%xmm5
cmp    $0x1,%edx
je     12a8 <fit_line+0x198>
mov    %edx,%eax
mov    $0x1,%ecx
nopl   0x0(%rax)
movapd %xmm0,%xmm3
movss  (%rdi,%rcx,4),%xmm1
movss  (%rsi,%rcx,4),%xmm2
unpcklps %xmm1,%xmm2
cvtdq2pd %xmm2,%xmm2
addpd  %xmm2,%xmm6
movapd %xmm2,%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
addpd  %xmm3,%xmm0
unpckhpd %xmm2,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm5
add    $0x1,%rcx
cmp    %rcx,%rax
jne    11b0 <fit_line+0xa0>
jmp    1292 <fit_line+0x182>
test   %edx,%edx
jle    129c <fit_line+0x18c>
movd   %r9d,%xmm0
movd   %r8d,%xmm1
punpckldq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm6
movapd %xmm6,%xmm1
unpcklpd %xmm6,%xmm1
mulpd  %xmm6,%xmm1
pxor   %xmm0,%xmm0
addpd  %xmm1,%xmm0
movapd %xmm6,%xmm1
unpckhpd %xmm6,%xmm1
mulsd  %xmm1,%xmm1
xorpd  %xmm5,%xmm5
addsd  %xmm1,%xmm5
cmp    $0x1,%edx
je     12a8 <fit_line+0x198>
mov    %edx,%eax
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm0,%xmm3
movss  (%rsi,%rcx,4),%xmm1
movss  (%rdi,%rcx,4),%xmm2
unpcklps %xmm1,%xmm2
cvtdq2pd %xmm2,%xmm2
addpd  %xmm2,%xmm6
movapd %xmm2,%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
addpd  %xmm3,%xmm0
unpckhpd %xmm2,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm5
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1250 <fit_line+0x140>
addpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
jmp    12a8 <fit_line+0x198>
xorpd  %xmm0,%xmm0
xorpd  %xmm5,%xmm5
xorpd  %xmm6,%xmm6
movapd 0xd4f(%rip),%xmm9
xorpd  %xmm6,%xmm9
movapd %xmm6,%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm8,%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm1,%xmm4
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm4
jne    132f <fit_line+0x21f>
jp     132f <fit_line+0x21f>
lea    0xd3a(%rip),%rdi
movsd  %xmm8,0x18(%rsp)
movapd %xmm6,0x40(%rsp)
movapd %xmm0,0x30(%rsp)
movsd  %xmm5,0x10(%rsp)
movapd %xmm9,0x20(%rsp)
movsd  %xmm4,0x8(%rsp)
call   1030 <puts@plt>
movsd  0x8(%rsp),%xmm4
movapd 0x20(%rsp),%xmm9
movsd  0x10(%rsp),%xmm5
movapd 0x30(%rsp),%xmm0
movapd 0x40(%rsp),%xmm6
movsd  0x18(%rsp),%xmm8
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
movapd %xmm1,%xmm3
mulsd  %xmm9,%xmm3
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
movapd %xmm0,%xmm2
mulsd  %xmm7,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm4,%xmm2
mulsd  %xmm7,%xmm9
movapd %xmm8,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm9,%xmm3
divsd  %xmm4,%xmm3
movapd %xmm2,%xmm4
mulsd  %xmm8,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm7
addsd  %xmm1,%xmm7
mulsd  %xmm2,%xmm3
mulsd  %xmm6,%xmm3
subsd  %xmm3,%xmm7
addsd  %xmm7,%xmm7
subsd  %xmm7,%xmm0
addsd  0xc5b(%rip),%xmm8
divsd  %xmm8,%xmm0
add    $0x58,%rsp
ret

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

LLVM IR (-O2):
@str = [32 x i8] c"Error - div by zero in fit_line\00"
define double @fit_line(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 2
br i1 %4, label %118, label %5
5: ; preds = %3
%6 = sitofp i32 %2 to double
%7 = add nsw i32 %2, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %0
%12 = sub nsw i32 %10, %11
%13 = tail call i32 @llvm.abs.i32(i32 %12, i1 true)
%14 = getelementptr inbounds i32, i32* %1, i64 %8
%15 = load i32, i32* %14
%16 = load i32, i32* %1
%17 = sub nsw i32 %15, %16
%18 = tail call i32 @llvm.abs.i32(i32 %17, i1 true)
%19 = icmp ult i32 %13, %18
%20 = icmp sgt i32 %2, 0
br i1 %19, label %32, label %21
21: ; preds = %5
br i1 %20, label %22, label %85
22: ; preds = %21
%23 = zext i32 %2 to i64
%24 = insertelement <2 x i32> poison, i32 %11, i64 0
%25 = insertelement <2 x i32> %24, i32 %16, i64 1
%26 = sitofp <2 x i32> %25 to <2 x double>
%27 = shufflevector <2 x double> %26, <2 x double> undef, <2 x i32> zeroinitializer
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %27, <2 x double> %26, <2 x double> zeroinitializer)
%29 = extractelement <2 x double> %26, i64 1
%30 = tail call double @llvm.fmuladd.f64(double %29, double %29, double 0.000000e+00)
%31 = icmp eq i32 %2, 1
br i1 %31, label %85, label %43
32: ; preds = %5
br i1 %20, label %33, label %85
33: ; preds = %32
%34 = zext i32 %2 to i64
%35 = insertelement <2 x i32> poison, i32 %16, i64 0
%36 = insertelement <2 x i32> %35, i32 %11, i64 1
%37 = sitofp <2 x i32> %36 to <2 x double>
%38 = shufflevector <2 x double> %37, <2 x double> undef, <2 x i32> zeroinitializer
%39 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %37, <2 x double> zeroinitializer)
%40 = extractelement <2 x double> %37, i64 1
%41 = tail call double @llvm.fmuladd.f64(double %40, double %40, double 0.000000e+00)
%42 = icmp eq i32 %2, 1
br i1 %42, label %85, label %62
43: ; preds = %22, %43
%44 = phi i64 [ %60, %43 ], [ 1, %22 ]
%45 = phi double [ %59, %43 ], [ %30, %22 ]
%46 = phi <2 x double> [ %57, %43 ], [ %28, %22 ]
%47 = phi <2 x double> [ %55, %43 ], [ %26, %22 ]
%48 = getelementptr inbounds i32, i32* %0, i64 %44
%49 = load i32, i32* %48
%50 = getelementptr inbounds i32, i32* %1, i64 %44
%51 = load i32, i32* %50
%52 = insertelement <2 x i32> poison, i32 %49, i64 0
%53 = insertelement <2 x i32> %52, i32 %51, i64 1
%54 = sitofp <2 x i32> %53 to <2 x double>
%55 = fadd <2 x double> %47, %54
%56 = shufflevector <2 x double> %54, <2 x double> undef, <2 x i32> zeroinitializer
%57 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %56, <2 x double> %54, <2 x double> %46)
%58 = extractelement <2 x double> %54, i64 1
%59 = tail call double @llvm.fmuladd.f64(double %58, double %58, double %45)
%60 = add nuw nsw i64 %44, 1
%61 = icmp eq i64 %60, %23
br i1 %61, label %83, label %43
62: ; preds = %33, %62
%63 = phi i64 [ %79, %62 ], [ 1, %33 ]
%64 = phi double [ %78, %62 ], [ %41, %33 ]
%65 = phi <2 x double> [ %76, %62 ], [ %39, %33 ]
%66 = phi <2 x double> [ %74, %62 ], [ %37, %33 ]
%67 = getelementptr inbounds i32, i32* %0, i64 %63
%68 = load i32, i32* %67
%69 = getelementptr inbounds i32, i32* %1, i64 %63
%70 = load i32, i32* %69
%71 = insertelement <2 x i32> poison, i32 %70, i64 0
%72 = insertelement <2 x i32> %71, i32 %68, i64 1
%73 = sitofp <2 x i32> %72 to <2 x double>
%74 = fadd <2 x double> %66, %73
%75 = shufflevector <2 x double> %73, <2 x double> undef, <2 x i32> zeroinitializer
%76 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %75, <2 x double> %73, <2 x double> %65)
%77 = extractelement <2 x double> %73, i64 1
%78 = tail call double @llvm.fmuladd.f64(double %77, double %77, double %64)
%79 = add nuw nsw i64 %63, 1
%80 = icmp eq i64 %79, %34
br i1 %80, label %81, label %62
81: ; preds = %62
%82 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %75, <2 x double> %73, <2 x double> %65)
br label %85
83: ; preds = %43
%84 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %56, <2 x double> %54, <2 x double> %46)
br label %85
85: ; preds = %83, %81, %22, %33, %21, %32
%86 = phi double [ 0.000000e+00, %32 ], [ 0.000000e+00, %21 ], [ %41, %33 ], [ %30, %22 ], [ %78, %81 ], [ %59, %83 ]
%87 = phi <2 x double> [ zeroinitializer, %32 ], [ zeroinitializer, %21 ], [ %39, %33 ], [ %28, %22 ], [ %82, %81 ], [ %84, %83 ]
%88 = phi <2 x double> [ zeroinitializer, %32 ], [ zeroinitializer, %21 ], [ %37, %33 ], [ %26, %22 ], [ %74, %81 ], [ %55, %83 ]
%89 = extractelement <2 x double> %88, i64 0
%90 = fneg double %89
%91 = fmul double %89, %90
%92 = extractelement <2 x double> %87, i64 0
%93 = tail call double @llvm.fmuladd.f64(double %6, double %92, double %91)
%94 = fcmp oeq double %93, 0.000000e+00
br i1 %94, label %95, label %97
95: ; preds = %85
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %97
97: ; preds = %95, %85
%98 = extractelement <2 x double> %87, i64 1
%99 = fmul double %98, %90
%100 = extractelement <2 x double> %88, i64 1
%101 = tail call double @llvm.fmuladd.f64(double %92, double %100, double %99)
%102 = fdiv double %101, %93
%103 = fmul double %100, %90
%104 = tail call double @llvm.fmuladd.f64(double %6, double %98, double %103)
%105 = fdiv double %104, %93
%106 = fmul double %102, %6
%107 = tail call double @llvm.fmuladd.f64(double %106, double %102, double %86)
%108 = fmul double %92, %105
%109 = tail call double @llvm.fmuladd.f64(double %108, double %105, double %107)
%110 = fmul double %98, %105
%111 = tail call double @llvm.fmuladd.f64(double %102, double %100, double %110)
%112 = fneg double %102
%113 = fmul double %105, %112
%114 = tail call double @llvm.fmuladd.f64(double %113, double %89, double %111)
%115 = tail call double @llvm.fmuladd.f64(double %114, double -2.000000e+00, double %109)
%116 = fadd double %6, -2.000000e+00
%117 = fdiv double %115, %116
br label %118
118: ; preds = %3, %97
%119 = phi double [ %117, %97 ], [ 0.000000e+00, %3 ]
ret double %119
}