void ComputeHueQuadrature(double h, double *H, double *e) {
  double e_tab[] = {0.8, 0.7, 1.0, 1.2};
  double H_tab[] = {0, 100, 200, 300};
  int p1, p2;
  double e1, e2, h1, h2;
  if (h >= 20.14 && h < 90.0) {
    p1 = 0;
    p2 = 1;
  } else if (h >= 90.0 && h < 164.25) {
    p1 = 1;
    p2 = 2;
  } else if (h >= 164.25 && h < 237.53) {
    p1 = 2;
    p2 = 3;
  } else {
    p1 = 3;
    p2 = 0;
  }
  e1 = e_tab[p1];
  e2 = e_tab[p2];
  h1 = H_tab[p1];
  h2 = H_tab[p2];
  *e = e1 + ((e2 - e1) * (h - h1) / (h2 - h1));
  *H = h1 + (100. * (h - h1) / e1) / ((h - h1) / e1 + (h2 - h) / e2);
}


x86 assembly (clang, -O0):
<ComputeHueQuadrature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0xf14(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xf11(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xf0e(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xf0b(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xf08(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xf05(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xf02(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeff(%rip),%rax
mov    %rax,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe86(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11aa <ComputeHueQuadrature+0xaa>
movsd  0xe7c(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11aa <ComputeHueQuadrature+0xaa>
movl   $0x0,-0x64(%rbp)
movl   $0x1,-0x68(%rbp)
jmp    123c <ComputeHueQuadrature+0x13c>
movsd  -0x8(%rbp),%xmm0
movsd  0xe51(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11e7 <ComputeHueQuadrature+0xe7>
movsd  0xe47(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11e7 <ComputeHueQuadrature+0xe7>
movl   $0x1,-0x64(%rbp)
movl   $0x2,-0x68(%rbp)
jmp    1237 <ComputeHueQuadrature+0x137>
movsd  -0x8(%rbp),%xmm0
movsd  0xe1c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1224 <ComputeHueQuadrature+0x124>
movsd  0xe12(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1224 <ComputeHueQuadrature+0x124>
movl   $0x2,-0x64(%rbp)
movl   $0x3,-0x68(%rbp)
jmp    1232 <ComputeHueQuadrature+0x132>
movl   $0x3,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
jmp    1237 <ComputeHueQuadrature+0x137>
jmp    123c <ComputeHueQuadrature+0x13c>
movslq -0x64(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movslq -0x68(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
movslq -0x64(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movslq -0x68(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
subsd  -0x70(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x80(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x88(%rbp),%xmm2
ff
subsd  -0x80(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x80(%rbp),%xmm2
movsd  0xd54(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  -0x70(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x80(%rbp),%xmm2
divsd  -0x70(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm3
ff
subsd  -0x8(%rbp),%xmm3
divsd  -0x78(%rbp),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComputeHueQuadrature>:
ucomisd 0xef8(%rip),%xmm0
jb     1121 <ComputeHueQuadrature+0x21>
movsd  0xef6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1121 <ComputeHueQuadrature+0x21>
xor    %eax,%eax
mov    $0x1,%ecx
jmp    116c <ComputeHueQuadrature+0x6c>
ucomisd 0xedf(%rip),%xmm0
jb     1145 <ComputeHueQuadrature+0x45>
movsd  0xedd(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1145 <ComputeHueQuadrature+0x45>
mov    $0x1,%eax
mov    $0x2,%ecx
jmp    116c <ComputeHueQuadrature+0x6c>
ucomisd 0xec3(%rip),%xmm0
setae  %al
movsd  0xec0(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
lea    (%rax,%rax,2),%rcx
xor    $0x3,%rax
lea    0xebd(%rip),%rdx
movsd  (%rdx,%rax,8),%xmm1
movsd  (%rdx,%rcx,8),%xmm3
lea    0xecc(%rip),%rdx
movsd  (%rdx,%rax,8),%xmm2
movsd  (%rdx,%rcx,8),%xmm4
movapd %xmm4,%xmm5
subsd  %xmm0,%xmm4
divsd  %xmm3,%xmm4
subsd  %xmm1,%xmm3
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm3
subsd  %xmm2,%xmm5
divsd  %xmm5,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,(%rsi)
movsd  0xe62(%rip),%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm1,%xmm3
divsd  %xmm1,%xmm0
addsd  %xmm0,%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%rdi)
ret

LLVM IR (-O0):
@__const.ComputeHueQuadrature.e_tab = [4 x double] [double 8.000000e-01, double 0x3FE6666666666666, double 1.000000e+00, double 1.200000e+00]
@__const.ComputeHueQuadrature.H_tab = [4 x double] [double 0.000000e+00, double 1.000000e+02, double 2.000000e+02, double 3.000000e+02]
define void @ComputeHueQuadrature(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca [4 x double]
%8 = alloca [4 x double]
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%15 = bitcast [4 x double]* %7 to i8*
%16 = bitcast [4 x double]* %8 to i8*
%17 = load double, double* %4
%18 = fcmp oge double %17, 2.014000e+01
br i1 %18, label %19, label %23
19: ; preds = %3
%20 = load double, double* %4
%21 = fcmp olt double %20, 9.000000e+01
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 0, i32* %9
store i32 1, i32* %10
br label %40
23: ; preds = %19, %3
%24 = load double, double* %4
%25 = fcmp oge double %24, 9.000000e+01
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load double, double* %4
%28 = fcmp olt double %27, 1.642500e+02
br i1 %28, label %29, label %30
29: ; preds = %26
store i32 1, i32* %9
store i32 2, i32* %10
br label %39
30: ; preds = %26, %23
%31 = load double, double* %4
%32 = fcmp oge double %31, 1.642500e+02
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = load double, double* %4
%35 = fcmp olt double %34, 2.375300e+02
br i1 %35, label %36, label %37
36: ; preds = %33
store i32 2, i32* %9
store i32 3, i32* %10
br label %38
37: ; preds = %33, %30
store i32 3, i32* %9
store i32 0, i32* %10
br label %38
38: ; preds = %37, %36
br label %39
39: ; preds = %38, %29
br label %40
40: ; preds = %39, %22
%41 = load i32, i32* %9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 %42
%44 = load double, double* %43
store double %44, double* %11
%45 = load i32, i32* %10
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 %46
%48 = load double, double* %47
store double %48, double* %12
%49 = load i32, i32* %9
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 %50
%52 = load double, double* %51
store double %52, double* %13
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 %54
%56 = load double, double* %55
store double %56, double* %14
%57 = load double, double* %11
%58 = load double, double* %12
%59 = load double, double* %11
%60 = fsub double %58, %59
%61 = load double, double* %4
%62 = load double, double* %13
%63 = fsub double %61, %62
%64 = fmul double %60, %63
%65 = load double, double* %14
%66 = load double, double* %13
%67 = fsub double %65, %66
%68 = fdiv double %64, %67
%69 = fadd double %57, %68
%70 = load double*, double** %6
store double %69, double* %70
%71 = load double, double* %13
%72 = load double, double* %4
%73 = load double, double* %13
%74 = fsub double %72, %73
%75 = fmul double 1.000000e+02, %74
%76 = load double, double* %11
%77 = fdiv double %75, %76
%78 = load double, double* %4
%79 = load double, double* %13
%80 = fsub double %78, %79
%81 = load double, double* %11
%82 = fdiv double %80, %81
%83 = load double, double* %14
%84 = load double, double* %4
%85 = fsub double %83, %84
%86 = load double, double* %12
%87 = fdiv double %85, %86
%88 = fadd double %82, %87
%89 = fdiv double %77, %88
%90 = fadd double %71, %89
%91 = load double*, double** %5
store double %90, double* %91
ret void
}

LLVM IR (-O2):
@__const.ComputeHueQuadrature.e_tab = [4 x double] [double 8.000000e-01, double 0x3FE6666666666666, double 1.000000e+00, double 1.200000e+00]
@__const.ComputeHueQuadrature.H_tab = [4 x double] [double 0.000000e+00, double 1.000000e+02, double 2.000000e+02, double 3.000000e+02]
define void @ComputeHueQuadrature(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = fcmp oge double %0, 2.014000e+01
%5 = fcmp olt double %0, 9.000000e+01
%6 = and i1 %4, %5
br i1 %6, label %17, label %7
7: ; preds = %3
%8 = fcmp oge double %0, 9.000000e+01
%9 = fcmp olt double %0, 1.642500e+02
%10 = and i1 %8, %9
br i1 %10, label %17, label %11
11: ; preds = %7
%12 = fcmp oge double %0, 1.642500e+02
%13 = fcmp olt double %0, 2.375300e+02
%14 = and i1 %12, %13
%15 = select i1 %14, i64 3, i64 0
%16 = select i1 %14, i64 2, i64 3
br label %17
17: ; preds = %11, %7, %3
%18 = phi i64 [ 1, %3 ], [ 2, %7 ], [ %15, %11 ]
%19 = phi i64 [ 0, %3 ], [ 1, %7 ], [ %16, %11 ]
%20 = getelementptr inbounds [4 x double], [4 x double]* @__const.ComputeHueQuadrature.e_tab, i64 0, i64 %19
%21 = load double, double* %20
%22 = getelementptr inbounds [4 x double], [4 x double]* @__const.ComputeHueQuadrature.e_tab, i64 0, i64 %18
%23 = load double, double* %22
%24 = getelementptr inbounds [4 x double], [4 x double]* @__const.ComputeHueQuadrature.H_tab, i64 0, i64 %19
%25 = load double, double* %24
%26 = getelementptr inbounds [4 x double], [4 x double]* @__const.ComputeHueQuadrature.H_tab, i64 0, i64 %18
%27 = load double, double* %26
%28 = fsub double %23, %21
%29 = fsub double %0, %25
%30 = fmul double %28, %29
%31 = fsub double %27, %25
%32 = fdiv double %30, %31
%33 = fadd double %21, %32
store double %33, double* %2
%34 = fmul double %29, 1.000000e+02
%35 = fdiv double %34, %21
%36 = fdiv double %29, %21
%37 = fsub double %27, %0
%38 = fdiv double %37, %23
%39 = fadd double %36, %38
%40 = fdiv double %35, %39
%41 = fadd double %25, %40
store double %41, double* %1
ret void
}