double theta(double j1, double j2, int pflag) {
  double T;
  double t;
  double theta;
  switch (pflag) {
  case (0):
    T = (j1 - ((2433282.42345905) +
               ((1850) - 1950.0) * ((36524.21987817305) / 100.0))) /
        (36524.21987817305);
    t = (j2 - j1) / (36524.21987817305);
    theta = (-0.042);
    theta *= t;
    theta += (-0.426);
    theta *= t;
    theta += (2004.682 + ((T - 0.5) * (-0.853)));
    theta *= t;
    break;
  case (1):
    T = (j1 - ((2433282.42345905) +
               ((1850) - 1950.0) * ((36524.21987817305) / 100.0))) /
        (36524.21987817305);
    t = (j2 - j1) / (36524.21987817305);
    theta = (-0.04180);
    theta *= t;
    theta += (-0.4265 + (T * (-0.00037)));
    theta *= t;
    theta += (2005.112 + (T * (-0.8529 + (T * (-0.00037)))));
    theta *= t;
    break;
  case (2):
    T = (j1 - ((2433282.42345905) +
               ((1850) - 1950.0) * ((36524.21987817305) / 100.0))) /
        (36524.21987817305);
    t = (j2 - j1) / (36524.21987817305);
    theta = (-0.041802);
    theta *= t;
    theta += (-0.42647 + (T * (-0.000365)));
    theta *= t;
    theta += (2005.1125 + (T * (-0.85294 + (T * (-0.000365)))));
    theta *= t;
    break;
  case (3):
    T = (j1 - ((2433282.42345905) +
               ((1850) - 1950.0) * ((36524.21987817305) / 100.0))) /
        (36524.21987817305);
    t = (j2 - j1) / (36524.21987817305);
    theta = (-0.0418);
    theta *= t;
    theta += (-0.4266 + ((T - 0.5) * (-0.00032)));
    theta *= t;
    theta += (2004.684 + ((T - 0.5) * (-0.8532 + ((T - 0.5) * (-0.000317)))));
    theta *= t;
    break;
  case (4):
  default:
    T = (j1 - (2451545.0)) / (36525.0);
    t = (j2 - j1) / (36525.0);
    theta = (-0.041833);
    theta *= t;
    theta += (-0.42665 + (T * (-0.000217)));
    theta *= t;
    theta += (2004.3109 + (T * (-0.85330 + (T * (-0.000217)))));
    theta *= t;
    break;
  }
  theta = (((((theta) / 3600.0)) * ((3.14159265358979323846) / 180.0)));
  return (theta);
}


x86 assembly (clang, -O0):
<theta>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x38(%rbp)
sub    $0x4,%rax
ja     14bd <theta+0x3bd>
mov    -0x38(%rbp),%rax
lea    0xfcb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  -0x8(%rbp),%xmm0
movsd  0xefd(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xf2d(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xf09(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe5b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1597 <theta+0x497>
movsd  -0x8(%rbp),%xmm0
movsd  0xe3c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe28(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xe0d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdf4(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe1b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1f(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xde0(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xddc(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdbc(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1597 <theta+0x497>
movsd  -0x8(%rbp),%xmm0
movsd  0xd5d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd49(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xd2e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xd4d(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xd14(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd18(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xcd9(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcd5(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcb5(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1597 <theta+0x497>
movsd  -0x8(%rbp),%xmm0
movsd  0xc7e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xc6a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xc4f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xc36(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xbfd(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xbf9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbf5(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xbbb(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xbaa(%rip),%xmm2
subsd  %xmm2,%xmm1
movsd  0xb8e(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xb8a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb6a(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1597 <theta+0x497>
jmp    14bd <theta+0x3bd>
movsd  -0x8(%rbp),%xmm0
movsd  0xc16(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xc02(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xbe7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xbce(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xb95(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb99(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xb5a(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xb56(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb36(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xb4c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xb38(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<theta>:
cmp    $0x3,%edi
ja     1170 <theta+0x70>
mov    %edi,%eax
lea    0xfea(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
subsd  %xmm0,%xmm1
addsd  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm1
movsd  0xf55(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf51(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xec5(%rip),%xmm0
mulsd  0xf45(%rip),%xmm0
addsd  0xf45(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
jmp    1311 <theta+0x211>
subsd  %xmm0,%xmm1
addsd  0xf34(%rip),%xmm0
movsd  0xf34(%rip),%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm1
movsd  0xf2c(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0xf28(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  0xf24(%rip),%xmm4
addsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm1,%xmm4
addsd  0xf18(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xf14(%rip),%xmm3
jmp    128b <theta+0x18b>
subsd  %xmm0,%xmm1
addsd  0xe23(%rip),%xmm0
movsd  0xe23(%rip),%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm1
movsd  0xe1b(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0xe6f(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  0xe6b(%rip),%xmm4
addsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm1,%xmm4
addsd  0xe5f(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xe5b(%rip),%xmm3
jmp    128b <theta+0x18b>
subsd  %xmm0,%xmm1
addsd  0xdc5(%rip),%xmm0
movsd  0xdc5(%rip),%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm1
movsd  0xdf5(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0xdf1(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  0xded(%rip),%xmm4
addsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm1,%xmm4
addsd  0xde1(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xddd(%rip),%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
jmp    1311 <theta+0x211>
subsd  %xmm0,%xmm1
addsd  0xd5b(%rip),%xmm0
movsd  0xd5b(%rip),%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm1
movsd  0xd53(%rip),%xmm2
addsd  0xd53(%rip),%xmm0
movsd  0xd53(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xd4f(%rip),%xmm3
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movsd  0xd43(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xd3f(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xd3b(%rip),%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
divsd  0xdcf(%rip),%xmm0
mulsd  0xdcf(%rip),%xmm0
ret

LLVM IR (-O0):
define double @theta(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
switch i32 %10, label %120 [
i32 0, label %11
i32 1, label %35
i32 2, label %62
i32 3, label %89
i32 4, label %119
]
11: ; preds = %3
%12 = load double, double* %4
%13 = fsub double %12, 0x4142492B1A0EF02C
%14 = fdiv double %13, 0x40E1D587093DF34B
store double %14, double* %7
%15 = load double, double* %5
%16 = load double, double* %4
%17 = fsub double %15, %16
%18 = fdiv double %17, 0x40E1D587093DF34B
store double %18, double* %8
store double -4.200000e-02, double* %9
%19 = load double, double* %8
%20 = load double, double* %9
%21 = fmul double %20, %19
store double %21, double* %9
%22 = load double, double* %9
%23 = fadd double %22, -4.260000e-01
store double %23, double* %9
%24 = load double, double* %8
%25 = load double, double* %9
%26 = fmul double %25, %24
store double %26, double* %9
%27 = load double, double* %7
%28 = fsub double %27, 5.000000e-01
%29 = call double @llvm.fmuladd.f64(double %28, double 0xBFEB4BC6A7EF9DB2, double 0x409F52BA5E353F7D)
%30 = load double, double* %9
%31 = fadd double %30, %29
store double %31, double* %9
%32 = load double, double* %8
%33 = load double, double* %9
%34 = fmul double %33, %32
store double %34, double* %9
br label %147
35: ; preds = %3
%36 = load double, double* %4
%37 = fsub double %36, 0x4142492B1A0EF02C
%38 = fdiv double %37, 0x40E1D587093DF34B
store double %38, double* %7
%39 = load double, double* %5
%40 = load double, double* %4
%41 = fsub double %39, %40
%42 = fdiv double %41, 0x40E1D587093DF34B
store double %42, double* %8
store double -4.180000e-02, double* %9
%43 = load double, double* %8
%44 = load double, double* %9
%45 = fmul double %44, %43
store double %45, double* %9
%46 = load double, double* %7
%47 = call double @llvm.fmuladd.f64(double %46, double -3.700000e-04, double -4.265000e-01)
%48 = load double, double* %9
%49 = fadd double %48, %47
store double %49, double* %9
%50 = load double, double* %8
%51 = load double, double* %9
%52 = fmul double %51, %50
store double %52, double* %9
%53 = load double, double* %7
%54 = load double, double* %7
%55 = call double @llvm.fmuladd.f64(double %54, double -3.700000e-04, double 0xBFEB4AF4F0D844D0)
%56 = call double @llvm.fmuladd.f64(double %53, double %55, double 0x409F5472B020C49C)
%57 = load double, double* %9
%58 = fadd double %57, %56
store double %58, double* %9
%59 = load double, double* %8
%60 = load double, double* %9
%61 = fmul double %60, %59
store double %61, double* %9
br label %147
62: ; preds = %3
%63 = load double, double* %4
%64 = fsub double %63, 0x4142492B1A0EF02C
%65 = fdiv double %64, 0x40E1D587093DF34B
store double %65, double* %7
%66 = load double, double* %5
%67 = load double, double* %4
%68 = fsub double %66, %67
%69 = fdiv double %68, 0x40E1D587093DF34B
store double %69, double* %8
store double -4.180200e-02, double* %9
%70 = load double, double* %8
%71 = load double, double* %9
%72 = fmul double %71, %70
store double %72, double* %9
%73 = load double, double* %7
%74 = call double @llvm.fmuladd.f64(double %73, double -3.650000e-04, double -4.264700e-01)
%75 = load double, double* %9
%76 = fadd double %75, %74
store double %76, double* %9
%77 = load double, double* %8
%78 = load double, double* %9
%79 = fmul double %78, %77
store double %79, double* %9
%80 = load double, double* %7
%81 = load double, double* %7
%82 = call double @llvm.fmuladd.f64(double %81, double -3.650000e-04, double -8.529400e-01)
%83 = call double @llvm.fmuladd.f64(double %80, double %82, double 0x409F547333333333)
%84 = load double, double* %9
%85 = fadd double %84, %83
store double %85, double* %9
%86 = load double, double* %8
%87 = load double, double* %9
%88 = fmul double %87, %86
store double %88, double* %9
br label %147
89: ; preds = %3
%90 = load double, double* %4
%91 = fsub double %90, 0x4142492B1A0EF02C
%92 = fdiv double %91, 0x40E1D587093DF34B
store double %92, double* %7
%93 = load double, double* %5
%94 = load double, double* %4
%95 = fsub double %93, %94
%96 = fdiv double %95, 0x40E1D587093DF34B
store double %96, double* %8
store double -4.180000e-02, double* %9
%97 = load double, double* %8
%98 = load double, double* %9
%99 = fmul double %98, %97
store double %99, double* %9
%100 = load double, double* %7
%101 = fsub double %100, 5.000000e-01
%102 = call double @llvm.fmuladd.f64(double %101, double -3.200000e-04, double -4.266000e-01)
%103 = load double, double* %9
%104 = fadd double %103, %102
store double %104, double* %9
%105 = load double, double* %8
%106 = load double, double* %9
%107 = fmul double %106, %105
store double %107, double* %9
%108 = load double, double* %7
%109 = fsub double %108, 5.000000e-01
%110 = load double, double* %7
%111 = fsub double %110, 5.000000e-01
%112 = call double @llvm.fmuladd.f64(double %111, double -3.170000e-04, double 0xBFEB4D6A161E4F76)
%113 = call double @llvm.fmuladd.f64(double %109, double %112, double 0x409F52BC6A7EF9DB)
%114 = load double, double* %9
%115 = fadd double %114, %113
store double %115, double* %9
%116 = load double, double* %8
%117 = load double, double* %9
%118 = fmul double %117, %116
store double %118, double* %9
br label %147
119: ; preds = %3
br label %120
120: ; preds = %3, %119
%121 = load double, double* %4
%122 = fsub double %121, 0x4142B42C80000000
%123 = fdiv double %122, 3.652500e+04
store double %123, double* %7
%124 = load double, double* %5
%125 = load double, double* %4
%126 = fsub double %124, %125
%127 = fdiv double %126, 3.652500e+04
store double %127, double* %8
store double -4.183300e-02, double* %9
%128 = load double, double* %8
%129 = load double, double* %9
%130 = fmul double %129, %128
store double %130, double* %9
%131 = load double, double* %7
%132 = call double @llvm.fmuladd.f64(double %131, double -2.170000e-04, double -4.266500e-01)
%133 = load double, double* %9
%134 = fadd double %133, %132
store double %134, double* %9
%135 = load double, double* %8
%136 = load double, double* %9
%137 = fmul double %136, %135
store double %137, double* %9
%138 = load double, double* %7
%139 = load double, double* %7
%140 = call double @llvm.fmuladd.f64(double %139, double -2.170000e-04, double -8.533000e-01)
%141 = call double @llvm.fmuladd.f64(double %138, double %140, double 0x409F513E5C91D14E)
%142 = load double, double* %9
%143 = fadd double %142, %141
store double %143, double* %9
%144 = load double, double* %8
%145 = load double, double* %9
%146 = fmul double %145, %144
store double %146, double* %9
br label %147
147: ; preds = %120, %89, %62, %35, %11
%148 = load double, double* %9
%149 = fdiv double %148, 3.600000e+03
%150 = fmul double %149, 0x3F91DF46A2529D39
store double %150, double* %9
%151 = load double, double* %9
ret double %151
}

LLVM IR (-O2):
define double @theta(double %0, double %1, i32 %2) {
switch i32 %2, label %56 [
i32 0, label %4
i32 1, label %16
i32 2, label %29
i32 3, label %42
]
4: ; preds = %3
%5 = fadd double %0, 0xC142492B1A0EF02C
%6 = fdiv double %5, 0x40E1D587093DF34B
%7 = fsub double %1, %0
%8 = fdiv double %7, 0x40E1D587093DF34B
%9 = fmul double %8, 4.200000e-02
%10 = fsub double -4.260000e-01, %9
%11 = fmul double %8, %10
%12 = fadd double %6, -5.000000e-01
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0xBFEB4BC6A7EF9DB2, double 0x409F52BA5E353F7D)
%14 = fadd double %13, %11
%15 = fmul double %8, %14
br label %69
16: ; preds = %3
%17 = fadd double %0, 0xC142492B1A0EF02C
%18 = fdiv double %17, 0x40E1D587093DF34B
%19 = fsub double %1, %0
%20 = fdiv double %19, 0x40E1D587093DF34B
%21 = fmul double %20, 4.180000e-02
%22 = tail call double @llvm.fmuladd.f64(double %18, double -3.700000e-04, double -4.265000e-01)
%23 = fsub double %22, %21
%24 = fmul double %20, %23
%25 = tail call double @llvm.fmuladd.f64(double %18, double -3.700000e-04, double 0xBFEB4AF4F0D844D0)
%26 = tail call double @llvm.fmuladd.f64(double %18, double %25, double 0x409F5472B020C49C)
%27 = fadd double %26, %24
%28 = fmul double %20, %27
br label %69
29: ; preds = %3
%30 = fadd double %0, 0xC142492B1A0EF02C
%31 = fdiv double %30, 0x40E1D587093DF34B
%32 = fsub double %1, %0
%33 = fdiv double %32, 0x40E1D587093DF34B
%34 = fmul double %33, 4.180200e-02
%35 = tail call double @llvm.fmuladd.f64(double %31, double -3.650000e-04, double -4.264700e-01)
%36 = fsub double %35, %34
%37 = fmul double %33, %36
%38 = tail call double @llvm.fmuladd.f64(double %31, double -3.650000e-04, double -8.529400e-01)
%39 = tail call double @llvm.fmuladd.f64(double %31, double %38, double 0x409F547333333333)
%40 = fadd double %39, %37
%41 = fmul double %33, %40
br label %69
42: ; preds = %3
%43 = fadd double %0, 0xC142492B1A0EF02C
%44 = fdiv double %43, 0x40E1D587093DF34B
%45 = fsub double %1, %0
%46 = fdiv double %45, 0x40E1D587093DF34B
%47 = fmul double %46, 4.180000e-02
%48 = fadd double %44, -5.000000e-01
%49 = tail call double @llvm.fmuladd.f64(double %48, double -3.200000e-04, double -4.266000e-01)
%50 = fsub double %49, %47
%51 = fmul double %46, %50
%52 = tail call double @llvm.fmuladd.f64(double %48, double -3.170000e-04, double 0xBFEB4D6A161E4F76)
%53 = tail call double @llvm.fmuladd.f64(double %48, double %52, double 0x409F52BC6A7EF9DB)
%54 = fadd double %53, %51
%55 = fmul double %46, %54
br label %69
56: ; preds = %3
%57 = fadd double %0, 0xC142B42C80000000
%58 = fdiv double %57, 3.652500e+04
%59 = fsub double %1, %0
%60 = fdiv double %59, 3.652500e+04
%61 = fmul double %60, 4.183300e-02
%62 = tail call double @llvm.fmuladd.f64(double %58, double -2.170000e-04, double -4.266500e-01)
%63 = fsub double %62, %61
%64 = fmul double %60, %63
%65 = tail call double @llvm.fmuladd.f64(double %58, double -2.170000e-04, double -8.533000e-01)
%66 = tail call double @llvm.fmuladd.f64(double %58, double %65, double 0x409F513E5C91D14E)
%67 = fadd double %66, %64
%68 = fmul double %60, %67
br label %69
69: ; preds = %56, %42, %29, %16, %4
%70 = phi double [ %68, %56 ], [ %55, %42 ], [ %41, %29 ], [ %28, %16 ], [ %15, %4 ]
%71 = fdiv double %70, 3.600000e+03
%72 = fmul double %71, 0x3F91DF46A2529D39
ret double %72
}