void spectrum_to_xyz(double (*spec_intens)(double wavelength), double *x,
                     double *y, double *z) {
  int i;
  double lambda, X = 0, Y = 0, Z = 0, XYZ;
  static double cie_colour_match[81][3] = {
      {0.0014, 0.0000, 0.0065}, {0.0022, 0.0001, 0.0105},
      {0.0042, 0.0001, 0.0201}, {0.0076, 0.0002, 0.0362},
      {0.0143, 0.0004, 0.0679}, {0.0232, 0.0006, 0.1102},
      {0.0435, 0.0012, 0.2074}, {0.0776, 0.0022, 0.3713},
      {0.1344, 0.0040, 0.6456}, {0.2148, 0.0073, 1.0391},
      {0.2839, 0.0116, 1.3856}, {0.3285, 0.0168, 1.6230},
      {0.3483, 0.0230, 1.7471}, {0.3481, 0.0298, 1.7826},
      {0.3362, 0.0380, 1.7721}, {0.3187, 0.0480, 1.7441},
      {0.2908, 0.0600, 1.6692}, {0.2511, 0.0739, 1.5281},
      {0.1954, 0.0910, 1.2876}, {0.1421, 0.1126, 1.0419},
      {0.0956, 0.1390, 0.8130}, {0.0580, 0.1693, 0.6162},
      {0.0320, 0.2080, 0.4652}, {0.0147, 0.2586, 0.3533},
      {0.0049, 0.3230, 0.2720}, {0.0024, 0.4073, 0.2123},
      {0.0093, 0.5030, 0.1582}, {0.0291, 0.6082, 0.1117},
      {0.0633, 0.7100, 0.0782}, {0.1096, 0.7932, 0.0573},
      {0.1655, 0.8620, 0.0422}, {0.2257, 0.9149, 0.0298},
      {0.2904, 0.9540, 0.0203}, {0.3597, 0.9803, 0.0134},
      {0.4334, 0.9950, 0.0087}, {0.5121, 1.0000, 0.0057},
      {0.5945, 0.9950, 0.0039}, {0.6784, 0.9786, 0.0027},
      {0.7621, 0.9520, 0.0021}, {0.8425, 0.9154, 0.0018},
      {0.9163, 0.8700, 0.0017}, {0.9786, 0.8163, 0.0014},
      {1.0263, 0.7570, 0.0011}, {1.0567, 0.6949, 0.0010},
      {1.0622, 0.6310, 0.0008}, {1.0456, 0.5668, 0.0006},
      {1.0026, 0.5030, 0.0003}, {0.9384, 0.4412, 0.0002},
      {0.8544, 0.3810, 0.0002}, {0.7514, 0.3210, 0.0001},
      {0.6424, 0.2650, 0.0000}, {0.5419, 0.2170, 0.0000},
      {0.4479, 0.1750, 0.0000}, {0.3608, 0.1382, 0.0000},
      {0.2835, 0.1070, 0.0000}, {0.2187, 0.0816, 0.0000},
      {0.1649, 0.0610, 0.0000}, {0.1212, 0.0446, 0.0000},
      {0.0874, 0.0320, 0.0000}, {0.0636, 0.0232, 0.0000},
      {0.0468, 0.0170, 0.0000}, {0.0329, 0.0119, 0.0000},
      {0.0227, 0.0082, 0.0000}, {0.0158, 0.0057, 0.0000},
      {0.0114, 0.0041, 0.0000}, {0.0081, 0.0029, 0.0000},
      {0.0058, 0.0021, 0.0000}, {0.0041, 0.0015, 0.0000},
      {0.0029, 0.0010, 0.0000}, {0.0020, 0.0007, 0.0000},
      {0.0014, 0.0005, 0.0000}, {0.0010, 0.0004, 0.0000},
      {0.0007, 0.0002, 0.0000}, {0.0005, 0.0002, 0.0000},
      {0.0003, 0.0001, 0.0000}, {0.0002, 0.0001, 0.0000},
      {0.0002, 0.0001, 0.0000}, {0.0001, 0.0000, 0.0000},
      {0.0001, 0.0000, 0.0000}, {0.0001, 0.0000, 0.0000},
      {0.0000, 0.0000, 0.0000}};
  for (i = 0, lambda = 380; lambda < 780.1; i++, lambda += 5) {
    double Me;
    Me = (*spec_intens)(lambda);
    X += Me * cie_colour_match[i][0];
    Y += Me * cie_colour_match[i][1];
    Z += Me * cie_colour_match[i][2];
  }
  XYZ = (X + Y + Z);
  *x = X / XYZ;
  *y = Y / XYZ;
  *z = Z / XYZ;
}


x86 assembly (clang, -O0):
<spectrum_to_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x24(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xebc(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1210 <spectrum_to_xyz+0x110>
mov    -0x8(%rbp),%rax
movsd  -0x30(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movslq -0x24(%rbp),%rcx
lea    0x2eb9(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x58(%rbp),%xmm0
movslq -0x24(%rbp),%rcx
lea    0x2e8c(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x58(%rbp),%xmm0
movslq -0x24(%rbp),%rcx
lea    0x2e5e(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movsd  0xe0f(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1144 <spectrum_to_xyz+0x44>
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spectrum_to_xyz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
xorpd  %xmm2,%xmm2
xorpd  %xmm3,%xmm3
movsd  0xed6(%rip),%xmm0
mov    $0x8,%ebx
lea    0xeda(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  %xmm3,0x8(%rsp)
movapd %xmm2,0x10(%rsp)
movsd  (%rsp),%xmm0
call   *%r13
movsd  0x8(%rsp),%xmm3
movapd 0x10(%rsp),%xmm2
movsd  -0x8(%rbx,%rbp,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm3
movupd (%rbx,%rbp,1),%xmm1
unpcklpd %xmm0,%xmm0
mulpd  %xmm1,%xmm0
addpd  %xmm0,%xmm2
movsd  (%rsp),%xmm0
addsd  0xe77(%rip),%xmm0
add    $0x18,%rbx
cmp    $0x7a0,%rbx
jne    1140 <spectrum_to_xyz+0x40>
movapd %xmm3,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm3
movsd  %xmm3,(%r12)
divsd  %xmm0,%xmm2
movsd  %xmm2,(%r15)
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@spectrum_to_xyz.cie_colour_match = internal global [81 x [3 x double]] [[3 x double] [double 1.400000e-03, double 0.000000e+00, double 0x3F7A9FBE76C8B439], [3 x double] [double 2.200000e-03, double 1.000000e-04, double 1.050000e-02], [3 x double] [double 4.200000e-03, double 1.000000e-04, double 2.010000e-02], [3 x double] [double 0x3F7F212D77318FC5, double 2.000000e-04, double 3.620000e-02], [3 x double] [double 1.430000e-02, double 4.000000e-04, double 6.790000e-02], [3 x double] [double 2.320000e-02, double 6.000000e-04, double 1.102000e-01], [3 x double] [double 4.350000e-02, double 1.200000e-03, double 2.074000e-01], [3 x double] [double 7.760000e-02, double 2.200000e-03, double 3.713000e-01], [3 x double] [double 1.344000e-01, double 4.000000e-03, double 0x3FE4A8C154C985F0], [3 x double] [double 2.148000e-01, double 7.300000e-03, double 1.039100e+00], [3 x double] [double 2.839000e-01, double 1.160000e-02, double 1.385600e+00], [3 x double] [double 3.285000e-01, double 1.680000e-02, double 1.623000e+00], [3 x double] [double 3.483000e-01, double 2.300000e-02, double 1.747100e+00], [3 x double] [double 3.481000e-01, double 2.980000e-02, double 1.782600e+00], [3 x double] [double 3.362000e-01, double 3.800000e-02, double 1.772100e+00], [3 x double] [double 3.187000e-01, double 4.800000e-02, double 1.744100e+00], [3 x double] [double 2.908000e-01, double 6.000000e-02, double 1.669200e+00], [3 x double] [double 2.511000e-01, double 7.390000e-02, double 1.528100e+00], [3 x double] [double 1.954000e-01, double 0x3FB74BC6A7EF9DB2, double 1.287600e+00], [3 x double] [double 1.421000e-01, double 1.126000e-01, double 1.041900e+00], [3 x double] [double 9.560000e-02, double 1.390000e-01, double 0x3FEA04189374BC6A], [3 x double] [double 5.800000e-02, double 1.693000e-01, double 6.162000e-01], [3 x double] [double 3.200000e-02, double 2.080000e-01, double 4.652000e-01], [3 x double] [double 1.470000e-02, double 2.586000e-01, double 3.533000e-01], [3 x double] [double 4.900000e-03, double 3.230000e-01, double 2.720000e-01], [3 x double] [double 2.400000e-03, double 4.073000e-01, double 2.123000e-01], [3 x double] [double 9.300000e-03, double 5.030000e-01, double 1.582000e-01], [3 x double] [double 2.910000e-02, double 6.082000e-01, double 1.117000e-01], [3 x double] [double 6.330000e-02, double 7.100000e-01, double 7.820000e-02], [3 x double] [double 1.096000e-01, double 7.932000e-01, double 5.730000e-02], [3 x double] [double 1.655000e-01, double 8.620000e-01, double 4.220000e-02], [3 x double] [double 2.257000e-01, double 9.149000e-01, double 2.980000e-02], [3 x double] [double 2.904000e-01, double 0x3FEE872B020C49BA, double 2.030000e-02], [3 x double] [double 3.597000e-01, double 0x3FEF5E9E1B089A02, double 1.340000e-02], [3 x double] [double 4.334000e-01, double 0x3FEFD70A3D70A3D7, double 0x3F81D14E3BCD35A8], [3 x double] [double 5.121000e-01, double 1.000000e+00, double 5.700000e-03], [3 x double] [double 5.945000e-01, double 0x3FEFD70A3D70A3D7, double 3.900000e-03], [3 x double] [double 6.784000e-01, double 9.786000e-01, double 2.700000e-03], [3 x double] [double 0x3FE8631F8A0902DE, double 0x3FEE76C8B4395810, double 2.100000e-03], [3 x double] [double 8.425000e-01, double 0x3FED4AF4F0D844D0, double 1.800000e-03], [3 x double] [double 9.163000e-01, double 8.700000e-01, double 1.700000e-03], [3 x double] [double 9.786000e-01, double 8.163000e-01, double 1.400000e-03], [3 x double] [double 1.026300e+00, double 7.570000e-01, double 1.100000e-03], [3 x double] [double 1.056700e+00, double 6.949000e-01, double 1.000000e-03], [3 x double] [double 1.062200e+00, double 6.310000e-01, double 8.000000e-04], [3 x double] [double 1.045600e+00, double 5.668000e-01, double 6.000000e-04], [3 x double] [double 1.002600e+00, double 5.030000e-01, double 3.000000e-04], [3 x double] [double 9.384000e-01, double 4.412000e-01, double 2.000000e-04], [3 x double] [double 8.544000e-01, double 3.810000e-01, double 2.000000e-04], [3 x double] [double 7.514000e-01, double 3.210000e-01, double 1.000000e-04], [3 x double] [double 6.424000e-01, double 2.650000e-01, double 0.000000e+00], [3 x double] [double 5.419000e-01, double 2.170000e-01, double 0.000000e+00], [3 x double] [double 4.479000e-01, double 1.750000e-01, double 0.000000e+00], [3 x double] [double 3.608000e-01, double 1.382000e-01, double 0.000000e+00], [3 x double] [double 2.835000e-01, double 1.070000e-01, double 0.000000e+00], [3 x double] [double 2.187000e-01, double 8.160000e-02, double 0.000000e+00], [3 x double] [double 1.649000e-01, double 6.100000e-02, double 0.000000e+00], [3 x double] [double 1.212000e-01, double 4.460000e-02, double 0.000000e+00], [3 x double] [double 8.740000e-02, double 3.200000e-02, double 0.000000e+00], [3 x double] [double 6.360000e-02, double 2.320000e-02, double 0.000000e+00], [3 x double] [double 4.680000e-02, double 1.700000e-02, double 0.000000e+00], [3 x double] [double 3.290000e-02, double 1.190000e-02, double 0.000000e+00], [3 x double] [double 2.270000e-02, double 8.200000e-03, double 0.000000e+00], [3 x double] [double 1.580000e-02, double 5.700000e-03, double 0.000000e+00], [3 x double] [double 1.140000e-02, double 4.100000e-03, double 0.000000e+00], [3 x double] [double 8.100000e-03, double 2.900000e-03, double 0.000000e+00], [3 x double] [double 5.800000e-03, double 2.100000e-03, double 0.000000e+00], [3 x double] [double 4.100000e-03, double 1.500000e-03, double 0.000000e+00], [3 x double] [double 2.900000e-03, double 1.000000e-03, double 0.000000e+00], [3 x double] [double 2.000000e-03, double 7.000000e-04, double 0.000000e+00], [3 x double] [double 1.400000e-03, double 5.000000e-04, double 0.000000e+00], [3 x double] [double 1.000000e-03, double 4.000000e-04, double 0.000000e+00], [3 x double] [double 7.000000e-04, double 2.000000e-04, double 0.000000e+00], [3 x double] [double 5.000000e-04, double 2.000000e-04, double 0.000000e+00], [3 x double] [double 3.000000e-04, double 1.000000e-04, double 0.000000e+00], [3 x double] [double 2.000000e-04, double 1.000000e-04, double 0.000000e+00], [3 x double] [double 2.000000e-04, double 1.000000e-04, double 0.000000e+00], [3 x double] [double 1.000000e-04, double 0.000000e+00, double 0.000000e+00], [3 x double] [double 1.000000e-04, double 0.000000e+00, double 0.000000e+00], [3 x double] [double 1.000000e-04, double 0.000000e+00, double 0.000000e+00], [3 x double] zeroinitializer]
define void @spectrum_to_xyz(double (double)* %0, double* %1, double* %2, double* %3) {
%5 = alloca double (double)*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double (double)* %0, double (double)** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store i32 0, i32* %9
store double 3.800000e+02, double* %10
br label %16
16: ; preds = %47, %4
%17 = load double, double* %10
%18 = fcmp olt double %17, 7.801000e+02
br i1 %18, label %19, label %52
19: ; preds = %16
%20 = load double (double)*, double (double)** %5
%21 = load double, double* %10
%22 = call double %20(double %21)
store double %22, double* %15
%23 = load double, double* %15
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [81 x [3 x double]], [81 x [3 x double]]* @spectrum_to_xyz.cie_colour_match, i64 0, i64 %25
%27 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 0, i64 0
%28 = load double, double* %27
%29 = load double, double* %11
%30 = call double @llvm.fmuladd.f64(double %23, double %28, double %29)
store double %30, double* %11
%31 = load double, double* %15
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [81 x [3 x double]], [81 x [3 x double]]* @spectrum_to_xyz.cie_colour_match, i64 0, i64 %33
%35 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 1
%36 = load double, double* %35
%37 = load double, double* %12
%38 = call double @llvm.fmuladd.f64(double %31, double %36, double %37)
store double %38, double* %12
%39 = load double, double* %15
%40 = load i32, i32* %9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [81 x [3 x double]], [81 x [3 x double]]* @spectrum_to_xyz.cie_colour_match, i64 0, i64 %41
%43 = getelementptr inbounds [3 x double], [3 x double]* %42, i64 0, i64 2
%44 = load double, double* %43
%45 = load double, double* %13
%46 = call double @llvm.fmuladd.f64(double %39, double %44, double %45)
store double %46, double* %13
br label %47
47: ; preds = %19
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 1
store i32 %49, i32* %9
%50 = load double, double* %10
%51 = fadd double %50, 5.000000e+00
store double %51, double* %10
br label %16
52: ; preds = %16
%53 = load double, double* %11
%54 = load double, double* %12
%55 = fadd double %53, %54
%56 = load double, double* %13
%57 = fadd double %55, %56
store double %57, double* %14
%58 = load double, double* %11
%59 = load double, double* %14
%60 = fdiv double %58, %59
%61 = load double*, double** %6
store double %60, double* %61
%62 = load double, double* %12
%63 = load double, double* %14
%64 = fdiv double %62, %63
%65 = load double*, double** %7
store double %64, double* %65
%66 = load double, double* %13
%67 = load double, double* %14
%68 = fdiv double %66, %67
%69 = load double*, double** %8
store double %68, double* %69
ret void
}

LLVM IR (-O2):
@spectrum_to_xyz.cie_colour_match = internal unnamed_addr constant [81 x [3 x double]] [[3 x double] [double 1.400000e-03, double 0.000000e+00, double 0x3F7A9FBE76C8B439], [3 x double] [double 2.200000e-03, double 1.000000e-04, double 1.050000e-02], [3 x double] [double 4.200000e-03, double 1.000000e-04, double 2.010000e-02], [3 x double] [double 0x3F7F212D77318FC5, double 2.000000e-04, double 3.620000e-02], [3 x double] [double 1.430000e-02, double 4.000000e-04, double 6.790000e-02], [3 x double] [double 2.320000e-02, double 6.000000e-04, double 1.102000e-01], [3 x double] [double 4.350000e-02, double 1.200000e-03, double 2.074000e-01], [3 x double] [double 7.760000e-02, double 2.200000e-03, double 3.713000e-01], [3 x double] [double 1.344000e-01, double 4.000000e-03, double 0x3FE4A8C154C985F0], [3 x double] [double 2.148000e-01, double 7.300000e-03, double 1.039100e+00], [3 x double] [double 2.839000e-01, double 1.160000e-02, double 1.385600e+00], [3 x double] [double 3.285000e-01, double 1.680000e-02, double 1.623000e+00], [3 x double] [double 3.483000e-01, double 2.300000e-02, double 1.747100e+00], [3 x double] [double 3.481000e-01, double 2.980000e-02, double 1.782600e+00], [3 x double] [double 3.362000e-01, double 3.800000e-02, double 1.772100e+00], [3 x double] [double 3.187000e-01, double 4.800000e-02, double 1.744100e+00], [3 x double] [double 2.908000e-01, double 6.000000e-02, double 1.669200e+00], [3 x double] [double 2.511000e-01, double 7.390000e-02, double 1.528100e+00], [3 x double] [double 1.954000e-01, double 0x3FB74BC6A7EF9DB2, double 1.287600e+00], [3 x double] [double 1.421000e-01, double 1.126000e-01, double 1.041900e+00], [3 x double] [double 9.560000e-02, double 1.390000e-01, double 0x3FEA04189374BC6A], [3 x double] [double 5.800000e-02, double 1.693000e-01, double 6.162000e-01], [3 x double] [double 3.200000e-02, double 2.080000e-01, double 4.652000e-01], [3 x double] [double 1.470000e-02, double 2.586000e-01, double 3.533000e-01], [3 x double] [double 4.900000e-03, double 3.230000e-01, double 2.720000e-01], [3 x double] [double 2.400000e-03, double 4.073000e-01, double 2.123000e-01], [3 x double] [double 9.300000e-03, double 5.030000e-01, double 1.582000e-01], [3 x double] [double 2.910000e-02, double 6.082000e-01, double 1.117000e-01], [3 x double] [double 6.330000e-02, double 7.100000e-01, double 7.820000e-02], [3 x double] [double 1.096000e-01, double 7.932000e-01, double 5.730000e-02], [3 x double] [double 1.655000e-01, double 8.620000e-01, double 4.220000e-02], [3 x double] [double 2.257000e-01, double 9.149000e-01, double 2.980000e-02], [3 x double] [double 2.904000e-01, double 0x3FEE872B020C49BA, double 2.030000e-02], [3 x double] [double 3.597000e-01, double 0x3FEF5E9E1B089A02, double 1.340000e-02], [3 x double] [double 4.334000e-01, double 0x3FEFD70A3D70A3D7, double 0x3F81D14E3BCD35A8], [3 x double] [double 5.121000e-01, double 1.000000e+00, double 5.700000e-03], [3 x double] [double 5.945000e-01, double 0x3FEFD70A3D70A3D7, double 3.900000e-03], [3 x double] [double 6.784000e-01, double 9.786000e-01, double 2.700000e-03], [3 x double] [double 0x3FE8631F8A0902DE, double 0x3FEE76C8B4395810, double 2.100000e-03], [3 x double] [double 8.425000e-01, double 0x3FED4AF4F0D844D0, double 1.800000e-03], [3 x double] [double 9.163000e-01, double 8.700000e-01, double 1.700000e-03], [3 x double] [double 9.786000e-01, double 8.163000e-01, double 1.400000e-03], [3 x double] [double 1.026300e+00, double 7.570000e-01, double 1.100000e-03], [3 x double] [double 1.056700e+00, double 6.949000e-01, double 1.000000e-03], [3 x double] [double 1.062200e+00, double 6.310000e-01, double 8.000000e-04], [3 x double] [double 1.045600e+00, double 5.668000e-01, double 6.000000e-04], [3 x double] [double 1.002600e+00, double 5.030000e-01, double 3.000000e-04], [3 x double] [double 9.384000e-01, double 4.412000e-01, double 2.000000e-04], [3 x double] [double 8.544000e-01, double 3.810000e-01, double 2.000000e-04], [3 x double] [double 7.514000e-01, double 3.210000e-01, double 1.000000e-04], [3 x double] [double 6.424000e-01, double 2.650000e-01, double 0.000000e+00], [3 x double] [double 5.419000e-01, double 2.170000e-01, double 0.000000e+00], [3 x double] [double 4.479000e-01, double 1.750000e-01, double 0.000000e+00], [3 x double] [double 3.608000e-01, double 1.382000e-01, double 0.000000e+00], [3 x double] [double 2.835000e-01, double 1.070000e-01, double 0.000000e+00], [3 x double] [double 2.187000e-01, double 8.160000e-02, double 0.000000e+00], [3 x double] [double 1.649000e-01, double 6.100000e-02, double 0.000000e+00], [3 x double] [double 1.212000e-01, double 4.460000e-02, double 0.000000e+00], [3 x double] [double 8.740000e-02, double 3.200000e-02, double 0.000000e+00], [3 x double] [double 6.360000e-02, double 2.320000e-02, double 0.000000e+00], [3 x double] [double 4.680000e-02, double 1.700000e-02, double 0.000000e+00], [3 x double] [double 3.290000e-02, double 1.190000e-02, double 0.000000e+00], [3 x double] [double 2.270000e-02, double 8.200000e-03, double 0.000000e+00], [3 x double] [double 1.580000e-02, double 5.700000e-03, double 0.000000e+00], [3 x double] [double 1.140000e-02, double 4.100000e-03, double 0.000000e+00], [3 x double] [double 8.100000e-03, double 2.900000e-03, double 0.000000e+00], [3 x double] [double 5.800000e-03, double 2.100000e-03, double 0.000000e+00], [3 x double] [double 4.100000e-03, double 1.500000e-03, double 0.000000e+00], [3 x double] [double 2.900000e-03, double 1.000000e-03, double 0.000000e+00], [3 x double] [double 2.000000e-03, double 7.000000e-04, double 0.000000e+00], [3 x double] [double 1.400000e-03, double 5.000000e-04, double 0.000000e+00], [3 x double] [double 1.000000e-03, double 4.000000e-04, double 0.000000e+00], [3 x double] [double 7.000000e-04, double 2.000000e-04, double 0.000000e+00], [3 x double] [double 5.000000e-04, double 2.000000e-04, double 0.000000e+00], [3 x double] [double 3.000000e-04, double 1.000000e-04, double 0.000000e+00], [3 x double] [double 2.000000e-04, double 1.000000e-04, double 0.000000e+00], [3 x double] [double 2.000000e-04, double 1.000000e-04, double 0.000000e+00], [3 x double] [double 1.000000e-04, double 0.000000e+00, double 0.000000e+00], [3 x double] [double 1.000000e-04, double 0.000000e+00, double 0.000000e+00], [3 x double] [double 1.000000e-04, double 0.000000e+00, double 0.000000e+00], [3 x double] zeroinitializer]
define void @spectrum_to_xyz(double (double)* nocapture %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
br label %5
5: ; preds = %4, %5
%6 = phi i64 [ 0, %4 ], [ %20, %5 ]
%7 = phi double [ 3.800000e+02, %4 ], [ %21, %5 ]
%8 = phi double [ 0.000000e+00, %4 ], [ %13, %5 ]
%9 = phi <2 x double> [ zeroinitializer, %4 ], [ %19, %5 ]
%10 = tail call double %0(double %7)
%11 = getelementptr inbounds [81 x [3 x double]], [81 x [3 x double]]* @spectrum_to_xyz.cie_colour_match, i64 0, i64 %6, i64 0
%12 = load double, double* %11
%13 = tail call double @llvm.fmuladd.f64(double %10, double %12, double %8)
%14 = getelementptr inbounds [81 x [3 x double]], [81 x [3 x double]]* @spectrum_to_xyz.cie_colour_match, i64 0, i64 %6, i64 1
%15 = bitcast double* %14 to <2 x double>*
%16 = load <2 x double>, <2 x double>* %15
%17 = insertelement <2 x double> poison, double %10, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %16, <2 x double> %9)
%20 = add nuw nsw i64 %6, 1
%21 = fadd double %7, 5.000000e+00
%22 = icmp eq i64 %20, 81
br i1 %22, label %23, label %5
23: ; preds = %5
%24 = extractelement <2 x double> %19, i64 0
%25 = fadd double %13, %24
%26 = extractelement <2 x double> %19, i64 1
%27 = fadd double %25, %26
%28 = fdiv double %13, %27
store double %28, double* %1
%29 = fdiv double %24, %27
store double %29, double* %2
%30 = fdiv double %26, %27
store double %30, double* %3
ret void
}