void unrefract(double pr, double tr, double aa, double *ta) {
  double aadeg = ((aa)*180. / 3.141592653589793);
  if (aadeg < 14.5)
    unrefractLT15(pr, tr, aa, ta);
  else if (aadeg >= 15.5)
    unrefractGE15(pr, tr, aa, ta);
  else {
    double taLT, taGE, p;
    unrefractLT15(pr, tr, aa, &taLT);
    unrefractGE15(pr, tr, aa, &taGE);
    p = (aadeg - 14.5) / (15.5 - 14.5);
    *ta = taLT + (taGE - taLT) * p;
  }
}


x86 assembly (clang, -O0):
<unrefract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  0xecd(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9f(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    118b <unrefract+0x6b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    $0x3,%al
call   1030 <unrefractLT15@plt>
jmp    1240 <unrefract+0x120>
movsd  -0x28(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11c1 <unrefract+0xa1>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    $0x3,%al
call   1040 <unrefractGE15@plt>
jmp    123b <unrefract+0x11b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x30(%rbp),%rdi
mov    $0x3,%al
call   1030 <unrefractLT15@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x38(%rbp),%rdi
mov    $0x3,%al
call   1040 <unrefractGE15@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xdfe(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe12(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1240 <unrefract+0x120>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unrefract>:
push   %rbx
sub    $0x30,%rsp
movsd  0xed3(%rip),%xmm3
mulsd  %xmm2,%xmm3
divsd  0xecf(%rip),%xmm3
mov    %rdi,%rbx
movsd  0xecc(%rip),%xmm4
ucomisd %xmm3,%xmm4
jbe    1159 <unrefract+0x39>
mov    %rbx,%rdi
mov    $0x3,%al
add    $0x30,%rsp
pop    %rbx
jmp    1030 <unrefractLT15@plt>
ucomisd 0xeb7(%rip),%xmm3
jae    11d3 <unrefract+0xb3>
lea    0x28(%rsp),%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm3,0x18(%rsp)
mov    $0x3,%al
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <unrefractLT15@plt>
lea    0x20(%rsp),%rdi
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x3,%al
call   1040 <unrefractGE15@plt>
movsd  0x18(%rsp),%xmm2
addsd  0xe6f(%rip),%xmm2
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x30,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x3,%al
add    $0x30,%rsp
pop    %rbx
jmp    1040 <unrefractGE15@plt>

LLVM IR (-O0):
define void @unrefract(double %0, double %1, double %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double* %3, double** %8
%13 = load double, double* %7
%14 = fmul double %13, 1.800000e+02
%15 = fdiv double %14, 0x400921FB54442D18
store double %15, double* %9
%16 = load double, double* %9
%17 = fcmp olt double %16, 1.450000e+01
br i1 %17, label %18, label %24
18: ; preds = %4
%19 = load double, double* %5
%20 = load double, double* %6
%21 = load double, double* %7
%22 = load double*, double** %8
%23 = call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractLT15 to i32 (double, double, double, double*, ...)*)(double %19, double %20, double %21, double* %22)
br label %53
24: ; preds = %4
%25 = load double, double* %9
%26 = fcmp oge double %25, 1.550000e+01
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load double, double* %5
%29 = load double, double* %6
%30 = load double, double* %7
%31 = load double*, double** %8
%32 = call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractGE15 to i32 (double, double, double, double*, ...)*)(double %28, double %29, double %30, double* %31)
br label %52
33: ; preds = %24
%34 = load double, double* %5
%35 = load double, double* %6
%36 = load double, double* %7
%37 = call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractLT15 to i32 (double, double, double, double*, ...)*)(double %34, double %35, double %36, double* %10)
%38 = load double, double* %5
%39 = load double, double* %6
%40 = load double, double* %7
%41 = call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractGE15 to i32 (double, double, double, double*, ...)*)(double %38, double %39, double %40, double* %11)
%42 = load double, double* %9
%43 = fsub double %42, 1.450000e+01
%44 = fdiv double %43, 1.000000e+00
store double %44, double* %12
%45 = load double, double* %10
%46 = load double, double* %11
%47 = load double, double* %10
%48 = fsub double %46, %47
%49 = load double, double* %12
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double %45)
%51 = load double*, double** %8
store double %50, double* %51
br label %52
52: ; preds = %33, %27
br label %53
53: ; preds = %52, %18
ret void
}

LLVM IR (-O2):
define void @unrefract(double %0, double %1, double %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = fmul double %2, 1.800000e+02
%8 = fdiv double %7, 0x400921FB54442D18
%9 = fcmp olt double %8, 1.450000e+01
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractLT15 to i32 (double, double, double, double*, ...)*)(double %0, double %1, double %2, double* %3)
br label %26
12: ; preds = %4
%13 = fcmp ult double %8, 1.550000e+01
br i1 %13, label %16, label %14
14: ; preds = %12
%15 = tail call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractGE15 to i32 (double, double, double, double*, ...)*)(double %0, double %1, double %2, double* %3)
br label %26
16: ; preds = %12
%17 = bitcast double* %5 to i8*
%18 = bitcast double* %6 to i8*
%19 = call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractLT15 to i32 (double, double, double, double*, ...)*)(double %0, double %1, double %2, double* %5)
%20 = call i32 (double, double, double, double*, ...) bitcast (i32 (...)* @unrefractGE15 to i32 (double, double, double, double*, ...)*)(double %0, double %1, double %2, double* %6)
%21 = fadd double %8, -1.450000e+01
%22 = load double, double* %5
%23 = load double, double* %6
%24 = fsub double %23, %22
%25 = call double @llvm.fmuladd.f64(double %24, double %21, double %22)
store double %25, double* %3
br label %26
26: ; preds = %14, %16, %10
ret void
}