void lp_min_lin_rat(int degen, float cw_vec[2], float ccw_vec[2],
                    float n_vec[2], float d_vec[2], float opt[2]) {
  float d_cw, d_ccw, n_cw, n_ccw;
  d_cw = ((cw_vec)[0] * (d_vec)[0] + (cw_vec)[1] * (d_vec)[1]);
  d_ccw = ((ccw_vec)[0] * (d_vec)[0] + (ccw_vec)[1] * (d_vec)[1]);
  n_cw = ((cw_vec)[0] * (n_vec)[0] + (cw_vec)[1] * (n_vec)[1]);
  n_ccw = ((ccw_vec)[0] * (n_vec)[0] + (ccw_vec)[1] * (n_vec)[1]);
  if (degen) {
    if (n_cw / d_cw < n_ccw / d_ccw) {
      opt[0] = cw_vec[0];
      opt[1] = cw_vec[1];
    } else {
      opt[0] = ccw_vec[0];
      opt[1] = ccw_vec[1];
    }
  } else if (((d_cw) >= 2 * 1.0e-7 || (d_cw) <= -2 * 1.0e-7) &&
             ((d_ccw) >= 2 * 1.0e-7 || (d_ccw) <= -2 * 1.0e-7)) {
    if (d_cw * d_ccw > 0.0) {
      if (n_cw / d_cw < n_ccw / d_ccw) {
        opt[0] = cw_vec[0];
        opt[1] = cw_vec[1];
      } else {
        opt[0] = ccw_vec[0];
        opt[1] = ccw_vec[1];
      }
    } else {
      if (d_cw > 0.0) {
        opt[0] = -d_vec[1];
        opt[1] = d_vec[0];
      } else {
        opt[0] = d_vec[1];
        opt[1] = -d_vec[0];
      }
    }
  } else if (((d_cw) >= 2 * 1.0e-7 || (d_cw) <= -2 * 1.0e-7)) {
    if (n_ccw * d_cw > 0.0) {
      opt[0] = cw_vec[0];
      opt[1] = cw_vec[1];
    } else {
      opt[0] = ccw_vec[0];
      opt[1] = ccw_vec[1];
    }
  } else if (((d_ccw) >= 2 * 1.0e-7 || (d_ccw) <= -2 * 1.0e-7)) {
    if (n_cw * d_ccw > 2 * 1.0e-7) {
      opt[0] = ccw_vec[0];
      opt[1] = ccw_vec[1];
    } else {
      opt[0] = cw_vec[0];
      opt[1] = cw_vec[1];
    }
  } else {
    if (((d_vec)[0] * (n_vec)[1] - (d_vec)[1] * (n_vec)[0]) > 0.0) {
      opt[0] = cw_vec[0];
      opt[1] = cw_vec[1];
    } else {
      opt[0] = ccw_vec[0];
      opt[1] = ccw_vec[1];
    }
  }
}


x86 assembly (clang, -O0):
<lp_min_lin_rat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x28(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x28(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     124c <lp_min_lin_rat+0x14c>
movss  -0x3c(%rbp),%xmm1
divss  -0x34(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
divss  -0x38(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1225 <lp_min_lin_rat+0x125>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    1247 <lp_min_lin_rat+0x147>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    15a9 <lp_min_lin_rat+0x4a9>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xda3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1282 <lp_min_lin_rat+0x182>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd90(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     13c1 <lp_min_lin_rat+0x2c1>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd6d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    12b8 <lp_min_lin_rat+0x1b8>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd5a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     13c1 <lp_min_lin_rat+0x2c1>
movss  -0x34(%rbp),%xmm0
mulss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    133e <lp_min_lin_rat+0x23e>
movss  -0x3c(%rbp),%xmm1
divss  -0x34(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
divss  -0x38(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1317 <lp_min_lin_rat+0x217>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    1339 <lp_min_lin_rat+0x239>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    13bc <lp_min_lin_rat+0x2bc>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1388 <lp_min_lin_rat+0x288>
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    13b7 <lp_min_lin_rat+0x2b7>
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    13bc <lp_min_lin_rat+0x2bc>
jmp    15a4 <lp_min_lin_rat+0x4a4>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc2e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    13f7 <lp_min_lin_rat+0x2f7>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc1b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1460 <lp_min_lin_rat+0x360>
movss  -0x40(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1439 <lp_min_lin_rat+0x339>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    145b <lp_min_lin_rat+0x35b>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    159f <lp_min_lin_rat+0x49f>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb8f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1496 <lp_min_lin_rat+0x396>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb7c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1504 <lp_min_lin_rat+0x404>
movss  -0x3c(%rbp),%xmm0
mulss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb54(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14dd <lp_min_lin_rat+0x3dd>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    14ff <lp_min_lin_rat+0x3ff>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    159a <lp_min_lin_rat+0x49a>
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm2
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulss  (%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1573 <lp_min_lin_rat+0x473>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    1595 <lp_min_lin_rat+0x495>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    159a <lp_min_lin_rat+0x49a>
jmp    159f <lp_min_lin_rat+0x49f>
jmp    15a4 <lp_min_lin_rat+0x4a4>
jmp    15a9 <lp_min_lin_rat+0x4a9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lp_min_lin_rat>:
movss  (%rsi),%xmm8
movss  (%r8),%xmm11
movss  0x4(%r8),%xmm2
movss  (%rdx),%xmm9
movss  0x4(%rsi),%xmm0
movaps %xmm0,%xmm1
unpcklps %xmm2,%xmm1
movss  0x4(%rdx),%xmm5
movaps %xmm2,%xmm6
unpcklps %xmm5,%xmm6
mulps  %xmm1,%xmm6
movaps %xmm8,%xmm1
unpcklps %xmm9,%xmm1
movaps %xmm11,%xmm4
shufps $0x0,%xmm11,%xmm4
mulps  %xmm1,%xmm4
addps  %xmm6,%xmm4
movss  (%rcx),%xmm6
movss  0x4(%rcx),%xmm3
unpcklps %xmm5,%xmm0
movaps %xmm3,%xmm7
shufps $0x0,%xmm3,%xmm7
mulps  %xmm0,%xmm7
movaps %xmm6,%xmm5
shufps $0x0,%xmm6,%xmm5
mulps  %xmm1,%xmm5
addps  %xmm7,%xmm5
test   %edi,%edi
je     1190 <lp_min_lin_rat+0x90>
divps  %xmm4,%xmm5
movaps %xmm5,%xmm0
shufps $0x55,%xmm5,%xmm0
ucomiss %xmm5,%xmm0
jbe    120c <lp_min_lin_rat+0x10c>
movss  %xmm8,(%r9)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%r9)
ret
xorps  %xmm1,%xmm1
cvtss2sd %xmm4,%xmm1
movaps %xmm4,%xmm0
shufps $0x55,%xmm4,%xmm0
xorps  %xmm7,%xmm7
cvtss2sd %xmm0,%xmm7
movsd  0xe52(%rip),%xmm12
ucomisd %xmm12,%xmm7
setb   %cl
movsd  0xe49(%rip),%xmm10
ucomisd %xmm7,%xmm10
setb   %al
and    %cl,%al
ucomisd %xmm12,%xmm1
jae    11f4 <lp_min_lin_rat+0xf4>
ucomisd %xmm1,%xmm10
jae    11f4 <lp_min_lin_rat+0xf4>
test   %al,%al
je     124d <lp_min_lin_rat+0x14d>
mulss  %xmm2,%xmm6
mulss  %xmm3,%xmm11
subss  %xmm6,%xmm11
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm11
ja     117f <lp_min_lin_rat+0x7f>
jmp    120c <lp_min_lin_rat+0x10c>
test   %al,%al
je     121d <lp_min_lin_rat+0x11d>
shufps $0x55,%xmm5,%xmm5
mulss  %xmm5,%xmm4
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm4
ja     117f <lp_min_lin_rat+0x7f>
movss  %xmm9,(%r9)
movss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%r9)
ret
movaps %xmm4,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
ja     116c <lp_min_lin_rat+0x6c>
ucomiss %xmm0,%xmm4
jbe    1268 <lp_min_lin_rat+0x168>
xorps  0xdd4(%rip),%xmm2
movss  %xmm2,(%r9)
movss  (%r8),%xmm0
movss  %xmm0,0x4(%r9)
ret
mulss  %xmm0,%xmm5
xorps  %xmm0,%xmm0
cvtss2sd %xmm5,%xmm0
ucomisd 0xda0(%rip),%xmm0
jbe    117f <lp_min_lin_rat+0x7f>
jmp    120c <lp_min_lin_rat+0x10c>
movss  %xmm2,(%r9)
movss  (%r8),%xmm0
xorps  0xd97(%rip),%xmm0
movss  %xmm0,0x4(%r9)
ret

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

LLVM IR (-O2):
define void @lp_min_lin_rat(i32 %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4, float* writeonly %5) {
%7 = load float, float* %1
%8 = load float, float* %4
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = getelementptr inbounds float, float* %4, i64 1
%12 = load float, float* %11
%13 = load float, float* %2
%14 = getelementptr inbounds float, float* %2, i64 1
%15 = load float, float* %14
%16 = insertelement <2 x float> poison, float %10, i64 0
%17 = insertelement <2 x float> %16, float %12, i64 1
%18 = insertelement <2 x float> poison, float %12, i64 0
%19 = insertelement <2 x float> %18, float %15, i64 1
%20 = fmul <2 x float> %17, %19
%21 = insertelement <2 x float> poison, float %7, i64 0
%22 = insertelement <2 x float> %21, float %13, i64 1
%23 = insertelement <2 x float> poison, float %8, i64 0
%24 = shufflevector <2 x float> %23, <2 x float> poison, <2 x i32> zeroinitializer
%25 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %22, <2 x float> %24, <2 x float> %20)
%26 = load float, float* %3
%27 = getelementptr inbounds float, float* %3, i64 1
%28 = load float, float* %27
%29 = insertelement <2 x float> %16, float %15, i64 1
%30 = insertelement <2 x float> poison, float %28, i64 0
%31 = shufflevector <2 x float> %30, <2 x float> poison, <2 x i32> zeroinitializer
%32 = fmul <2 x float> %29, %31
%33 = insertelement <2 x float> poison, float %26, i64 0
%34 = shufflevector <2 x float> %33, <2 x float> poison, <2 x i32> zeroinitializer
%35 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %22, <2 x float> %34, <2 x float> %32)
%36 = icmp eq i32 %0, 0
br i1 %36, label %46, label %37
37: ; preds = %6
%38 = fdiv <2 x float> %35, %25
%39 = extractelement <2 x float> %38, i64 0
%40 = extractelement <2 x float> %38, i64 1
%41 = fcmp olt float %39, %40
br i1 %41, label %42, label %44
42: ; preds = %37
store float %7, float* %5
%43 = load float, float* %9
br label %106
44: ; preds = %37
store float %13, float* %5
%45 = load float, float* %14
br label %106
46: ; preds = %6
%47 = extractelement <2 x float> %25, i64 0
%48 = fpext float %47 to double
%49 = fcmp ult double %48, 2.000000e-07
%50 = fcmp ugt double %48, -2.000000e-07
%51 = and i1 %49, %50
%52 = extractelement <2 x float> %25, i64 1
%53 = fpext float %52 to double
%54 = fcmp ult double %53, 2.000000e-07
%55 = fcmp ugt double %53, -2.000000e-07
%56 = and i1 %54, %55
br i1 %51, label %87, label %57
57: ; preds = %46
br i1 %56, label %78, label %58
58: ; preds = %57
%59 = fmul float %47, %52
%60 = fcmp ogt float %59, 0.000000e+00
br i1 %60, label %61, label %70
61: ; preds = %58
%62 = fdiv <2 x float> %35, %25
%63 = extractelement <2 x float> %62, i64 0
%64 = extractelement <2 x float> %62, i64 1
%65 = fcmp olt float %63, %64
br i1 %65, label %66, label %68
66: ; preds = %61
store float %7, float* %5
%67 = load float, float* %9
br label %106
68: ; preds = %61
store float %13, float* %5
%69 = load float, float* %14
br label %106
70: ; preds = %58
%71 = fcmp ogt float %47, 0.000000e+00
br i1 %71, label %72, label %75
72: ; preds = %70
%73 = fneg float %12
store float %73, float* %5
%74 = load float, float* %4
br label %106
75: ; preds = %70
store float %12, float* %5
%76 = load float, float* %4
%77 = fneg float %76
br label %106
78: ; preds = %57
%79 = shufflevector <2 x float> %35, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%80 = fmul <2 x float> %25, %79
%81 = extractelement <2 x float> %80, i64 0
%82 = fcmp ogt float %81, 0.000000e+00
br i1 %82, label %83, label %85
83: ; preds = %78
store float %7, float* %5
%84 = load float, float* %9
br label %106
85: ; preds = %78
store float %13, float* %5
%86 = load float, float* %14
br label %106
87: ; preds = %46
br i1 %56, label %97, label %88
88: ; preds = %87
%89 = extractelement <2 x float> %35, i64 0
%90 = fmul float %52, %89
%91 = fpext float %90 to double
%92 = fcmp ogt double %91, 2.000000e-07
br i1 %92, label %93, label %95
93: ; preds = %88
store float %13, float* %5
%94 = load float, float* %14
br label %106
95: ; preds = %88
store float %7, float* %5
%96 = load float, float* %9
br label %106
97: ; preds = %87
%98 = fneg float %12
%99 = fmul float %26, %98
%100 = tail call float @llvm.fmuladd.f32(float %8, float %28, float %99)
%101 = fcmp ogt float %100, 0.000000e+00
br i1 %101, label %102, label %104
102: ; preds = %97
store float %7, float* %5
%103 = load float, float* %9
br label %106
104: ; preds = %97
store float %13, float* %5
%105 = load float, float* %14
br label %106
106: ; preds = %72, %75, %66, %68, %95, %93, %104, %102, %83, %85, %42, %44
%107 = phi float [ %74, %72 ], [ %77, %75 ], [ %67, %66 ], [ %69, %68 ], [ %96, %95 ], [ %94, %93 ], [ %105, %104 ], [ %103, %102 ], [ %84, %83 ], [ %86, %85 ], [ %43, %42 ], [ %45, %44 ]
%108 = getelementptr inbounds float, float* %5, i64 1
store float %107, float* %108
ret void
}