void convert_color_temperature_to_xyz(float T, float *x, float *y, float *z) {
  double invT = 1.0 / T;
  double xc, yc;
  if (T <= 4000.0f) {
    xc = ((-0.2661239e9 * invT - 0.2343580e6) * invT + 0.8776956e3) * invT +
         0.179910;
  } else {
    xc = ((-3.0258469e9 * invT + 2.1070379e6) * invT + 0.2226347e3) * invT +
         0.240390;
  }
  if (T <= 2222.0f) {
    yc = ((-1.1063814 * xc - 1.34811020) * xc + 2.18555832) * xc - 0.20219683;
  } else if (T <= 4000.0f) {
    yc = ((-0.9549476 * xc - 1.37418593) * xc + 2.09137015) * xc - 0.16748867;
  } else {
    yc = ((3.0817580 * xc - 5.87338670) * xc + 3.75112997) * xc - 0.37001483;
  }
  *x = xc;
  *y = yc;
  *z = 1.0 - xc - yc;
}


x86 assembly (clang, -O0):
<convert_color_temperature_to_xyz>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  0xec9(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jb     1192 <convert_color_temperature_to_xyz+0x92>
movsd  -0x28(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeee(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11de <convert_color_temperature_to_xyz+0xde>
movsd  -0x28(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe58(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe3b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  0xe1e(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jb     1241 <convert_color_temperature_to_xyz+0x141>
movsd  -0x30(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    12f5 <convert_color_temperature_to_xyz+0x1f5>
movss  0xdb7(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jb     12a4 <convert_color_temperature_to_xyz+0x1a4>
movsd  -0x30(%rbp),%xmm0
movsd  0xe20(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdda(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    12f0 <convert_color_temperature_to_xyz+0x1f0>
movsd  -0x30(%rbp),%xmm0
movsd  0xdaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdab(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd86(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd69(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    12f5 <convert_color_temperature_to_xyz+0x1f5>
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movsd  0xce9(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_color_temperature_to_xyz>:
cvtss2sd %xmm0,%xmm2
movsd  0xef4(%rip),%xmm1
movapd %xmm1,%xmm3
divsd  %xmm2,%xmm3
movss  0xf8c(%rip),%xmm2
ucomiss %xmm0,%xmm2
jae    118f <convert_color_temperature_to_xyz+0x8f>
movsd  0xf1f(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xf1b(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xf17(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xf13(%rip),%xmm2
movss  0xf57(%rip),%xmm3
ucomiss %xmm0,%xmm3
jae    11f6 <convert_color_temperature_to_xyz+0xf6>
movsd  0xf22(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xf1e(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xf1a(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xf16(%rip),%xmm0
jmp    1222 <convert_color_temperature_to_xyz+0x122>
movsd  0xe71(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe6d(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe69(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe65(%rip),%xmm2
movss  0xee9(%rip),%xmm3
ucomiss %xmm0,%xmm3
jae    11f6 <convert_color_temperature_to_xyz+0xf6>
movsd  0xe58(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe54(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe50(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe4c(%rip),%xmm0
jmp    1222 <convert_color_temperature_to_xyz+0x122>
movsd  0xe6a(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe66(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe62(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe5e(%rip),%xmm0
xorps  %xmm3,%xmm3
cvtsd2ss %xmm2,%xmm3
movss  %xmm3,(%rdi)
xorps  %xmm3,%xmm3
cvtsd2ss %xmm0,%xmm3
movss  %xmm3,(%rsi)
subsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @convert_color_temperature_to_xyz(float %0, float* %1, float* %2, float* %3) {
%5 = alloca float
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca double
%10 = alloca double
%11 = alloca double
store float %0, float* %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%12 = load float, float* %5
%13 = fpext float %12 to double
%14 = fdiv double 1.000000e+00, %13
store double %14, double* %9
%15 = load float, float* %5
%16 = fcmp ole float %15, 4.000000e+03
br i1 %16, label %17, label %24
17: ; preds = %4
%18 = load double, double* %9
%19 = call double @llvm.fmuladd.f64(double 0xC1AFB974F8000000, double %18, double -2.343580e+05)
%20 = load double, double* %9
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double 0x408B6D9096BB98C8)
%22 = load double, double* %9
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double 1.799100e-01)
store double %23, double* %10
br label %31
24: ; preds = %4
%25 = load double, double* %9
%26 = call double @llvm.fmuladd.f64(double 0xC1E68B584E800000, double %25, double 0x4140134EF3333333)
%27 = load double, double* %9
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double 0x406BD44F765FD8AE)
%29 = load double, double* %9
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double 2.403900e-01)
store double %30, double* %10
br label %31
31: ; preds = %24, %17
%32 = load float, float* %5
%33 = fcmp ole float %32, 2.222000e+03
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = load double, double* %10
%36 = call double @llvm.fmuladd.f64(double 0xBFF1B3BCFB9E7170, double %35, double 0xBFF591DC004676DD)
%37 = load double, double* %10
%38 = call double @llvm.fmuladd.f64(double %36, double %37, double 0x40017C06001F34A4)
%39 = load double, double* %10
%40 = call double @llvm.fmuladd.f64(double %38, double %39, double 0xBFC9E195F21A393C)
store double %40, double* %11
br label %59
41: ; preds = %31
%42 = load float, float* %5
%43 = fcmp ole float %42, 4.000000e+03
br i1 %43, label %44, label %51
44: ; preds = %41
%45 = load double, double* %10
%46 = call double @llvm.fmuladd.f64(double 0xBFEE8EEE44EC991B, double %45, double 0xBFF5FCAA62BF92D3)
%47 = load double, double* %10
%48 = call double @llvm.fmuladd.f64(double %46, double %47, double 0x4000BB2045F0A519)
%49 = load double, double* %10
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double 0xBFC57044CC0CDE60)
store double %50, double* %11
br label %58
51: ; preds = %41
%52 = load double, double* %10
%53 = call double @llvm.fmuladd.f64(double 0x4008A770BD017DAF, double %52, double 0xC0177E5915450BA3)
%54 = load double, double* %10
%55 = call double @llvm.fmuladd.f64(double %53, double %54, double 0x400E02506E01904E)
%56 = load double, double* %10
%57 = call double @llvm.fmuladd.f64(double %55, double %56, double 0xBFD7AE52AE78A3D6)
store double %57, double* %11
br label %58
58: ; preds = %51, %44
br label %59
59: ; preds = %58, %34
%60 = load double, double* %10
%61 = fptrunc double %60 to float
%62 = load float*, float** %6
store float %61, float* %62
%63 = load double, double* %11
%64 = fptrunc double %63 to float
%65 = load float*, float** %7
store float %64, float* %65
%66 = load double, double* %10
%67 = fsub double 1.000000e+00, %66
%68 = load double, double* %11
%69 = fsub double %67, %68
%70 = fptrunc double %69 to float
%71 = load float*, float** %8
store float %70, float* %71
ret void
}

LLVM IR (-O2):
define void @convert_color_temperature_to_xyz(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = fpext float %0 to double
%6 = fdiv double 1.000000e+00, %5
%7 = fcmp ugt float %0, 4.000000e+03
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = tail call double @llvm.fmuladd.f64(double %6, double 0xC1AFB974F8000000, double -2.343580e+05)
%10 = tail call double @llvm.fmuladd.f64(double %9, double %6, double 0x408B6D9096BB98C8)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %6, double 1.799100e-01)
%12 = fcmp ugt float %0, 2.222000e+03
br i1 %12, label %23, label %18
13: ; preds = %4
%14 = tail call double @llvm.fmuladd.f64(double %6, double 0xC1E68B584E800000, double 0x4140134EF3333333)
%15 = tail call double @llvm.fmuladd.f64(double %14, double %6, double 0x406BD44F765FD8AE)
%16 = tail call double @llvm.fmuladd.f64(double %15, double %6, double 2.403900e-01)
%17 = fcmp ugt float %0, 2.222000e+03
br i1 %17, label %27, label %18
18: ; preds = %13, %8
%19 = phi double [ %16, %13 ], [ %11, %8 ]
%20 = tail call double @llvm.fmuladd.f64(double %19, double 0xBFF1B3BCFB9E7170, double 0xBFF591DC004676DD)
%21 = tail call double @llvm.fmuladd.f64(double %20, double %19, double 0x40017C06001F34A4)
%22 = tail call double @llvm.fmuladd.f64(double %21, double %19, double 0xBFC9E195F21A393C)
br label %31
23: ; preds = %8
%24 = tail call double @llvm.fmuladd.f64(double %11, double 0xBFEE8EEE44EC991B, double 0xBFF5FCAA62BF92D3)
%25 = tail call double @llvm.fmuladd.f64(double %24, double %11, double 0x4000BB2045F0A519)
%26 = tail call double @llvm.fmuladd.f64(double %25, double %11, double 0xBFC57044CC0CDE60)
br label %31
27: ; preds = %13
%28 = tail call double @llvm.fmuladd.f64(double %16, double 0x4008A770BD017DAF, double 0xC0177E5915450BA3)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %16, double 0x400E02506E01904E)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %16, double 0xBFD7AE52AE78A3D6)
br label %31
31: ; preds = %23, %27, %18
%32 = phi double [ %19, %18 ], [ %11, %23 ], [ %16, %27 ]
%33 = phi double [ %22, %18 ], [ %26, %23 ], [ %30, %27 ]
%34 = fptrunc double %32 to float
store float %34, float* %1
%35 = fptrunc double %33 to float
store float %35, float* %2
%36 = fsub double 1.000000e+00, %32
%37 = fsub double %36, %33
%38 = fptrunc double %37 to float
store float %38, float* %3
ret void
}