void HLStoRGB(red, green, blue, hue, lightness, saturation) double *red, *green,
    *blue;
double hue, lightness, saturation;
{
  double rgb[3];
  double min, max, Mid, h, l, s;
  int i;
  static struct Index {
    double sign, base;
    int min, mid, max;
  } index[6] = {
      1.0,  0.0, 2, 1, 0, -1.0, 2.0, 2, 0, 1, 1.0,  2.0, 0, 2, 1,
      -1.0, 4.0, 0, 1, 2, 1.0,  4.0, 1, 0, 2, -1.0, 6.0, 1, 2, 0,
  };
  rgb[0] = *red;
  rgb[1] = *green;
  rgb[2] = *blue;
  hue /= 60.0;
  while (hue >= 6.0)
    hue -= 6.0;
  while (h < 0.0)
    hue += 6.0;
  lightness *= 3.0;
  if (lightness >= 3.0) {
    rgb[0] = rgb[1] = rgb[2] = 1.0;
    return;
  } else if (lightness <= 0.0) {
    rgb[0] = rgb[1] = rgb[2] = 0.0;
    return;
  }
  if (saturation > 1.0)
    saturation = 1.0;
  else if (saturation <= 0.0) {
    rgb[0] = rgb[1] = rgb[2] = lightness / 3.0;
    return;
  }
  i = hue;
  Mid = index[i].sign * (hue - index[i].base);
  if (Mid >= (lightness - 1.0)) {
    rgb[index[i].min] = min = lightness / 3.0 * (1.0 - saturation);
    rgb[index[i].max] = max = min + (lightness - 3.0 * min) / (1.0 + Mid);
    rgb[index[i].mid] = lightness - min - max;
  } else {
    rgb[index[i].max] = max =
        1.0 - (1.0 - saturation) * (1.0 - lightness / 3.0);
    rgb[index[i].min] = min = (lightness - max * (1.0 + Mid)) / (2.0 - Mid);
    rgb[index[i].mid] = lightness - max - min;
  }
  *red = rgb[0];
  *green = rgb[1];
  *blue = rgb[2];
}


x86 assembly (clang, -O0):
<HLStoRGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1192 <HLStoRGB+0x92>
movsd  -0x20(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1160 <HLStoRGB+0x60>
jmp    1197 <HLStoRGB+0x97>
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    11bc <HLStoRGB+0xbc>
movsd  0xe5b(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1197 <HLStoRGB+0x97>
movsd  0xe4c(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe35(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1211 <HLStoRGB+0x111>
movsd  0xe2b(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe1e(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe11(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1514 <HLStoRGB+0x414>
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     123c <HLStoRGB+0x13c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1514 <HLStoRGB+0x414>
jmp    1241 <HLStoRGB+0x141>
movsd  -0x30(%rbp),%xmm0
movsd  0xdca(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    126a <HLStoRGB+0x16a>
movsd  0xdb8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12a2 <HLStoRGB+0x1a2>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     129d <HLStoRGB+0x19d>
movsd  -0x28(%rbp),%xmm0
movsd  0xd8b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  %xmm0,-0x48(%rbp)
movsd  %xmm0,-0x50(%rbp)
jmp    1514 <HLStoRGB+0x414>
jmp    12a2 <HLStoRGB+0x1a2>
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x84(%rbp)
movslq -0x84(%rbp),%rcx
lea    0x2d75(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
movslq -0x84(%rbp),%rcx
lea    0x2d57(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
subsd  0x8(%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xd18(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     13df <HLStoRGB+0x2df>
movsd  -0x28(%rbp),%xmm0
movsd  0xcf5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcf1(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movslq -0x84(%rbp),%rcx
lea    0x2ced(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x10(%rax),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
movsd  -0x58(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movsd  0xcbd(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0xc9d(%rip),%xmm2
addsd  -0x68(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movslq -0x84(%rbp),%rcx
lea    0x2c95(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x18(%rax),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
movsd  -0x28(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movslq -0x84(%rbp),%rcx
lea    0x2c67(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x14(%rax),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
jmp    14ed <HLStoRGB+0x3ed>
movsd  0xc31(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xc17(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xc13(%rip),%xmm1
subsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xbec(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movslq -0x84(%rbp),%rcx
lea    0x2bed(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x18(%rax),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
movsd  -0x28(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  0xbb2(%rip),%xmm2
addsd  -0x68(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xb8e(%rip),%xmm1
subsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movslq -0x84(%rbp),%rcx
lea    0x2b82(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x10(%rax),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
movsd  -0x28(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movslq -0x84(%rbp),%rcx
lea    0x2b54(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x14(%rax),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HLStoRGB>:
movsd  (%rdi),%xmm3
movsd  %xmm3,-0x18(%rsp)
movsd  (%rsi),%xmm3
movsd  %xmm3,-0x10(%rsp)
movsd  (%rdx),%xmm3
divsd  0xee0(%rip),%xmm0
movsd  %xmm3,-0x8(%rsp)
ucomisd 0xeda(%rip),%xmm0
jb     114a <HLStoRGB+0x4a>
movsd  0xed8(%rip),%xmm3
movsd  0xec8(%rip),%xmm4
addsd  %xmm3,%xmm0
ucomisd %xmm4,%xmm0
jae    1140 <HLStoRGB+0x40>
movsd  0xec6(%rip),%xmm3
mulsd  %xmm3,%xmm1
ucomisd %xmm3,%xmm1
jae    121f <HLStoRGB+0x11f>
xorpd  %xmm3,%xmm3
ucomisd %xmm1,%xmm3
jae    12b1 <HLStoRGB+0x1b1>
movsd  0xeaa(%rip),%xmm3
ucomisd %xmm3,%xmm2
ja     118e <HLStoRGB+0x8e>
xorpd  %xmm3,%xmm3
ucomisd %xmm2,%xmm3
movapd %xmm2,%xmm3
jae    12b2 <HLStoRGB+0x1b2>
cvttsd2si %xmm0,%eax
cltq
shl    $0x5,%rax
lea    0xeb1(%rip),%r8
subsd  0x8(%rax,%r8,1),%xmm0
mulsd  (%rax,%r8,1),%xmm0
movsd  0xe74(%rip),%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
jae    122c <HLStoRGB+0x12c>
movsd  0xe5a(%rip),%xmm2
movapd %xmm2,%xmm4
subsd  %xmm3,%xmm4
movapd %xmm1,%xmm3
divsd  0xe56(%rip),%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
movapd %xmm0,%xmm4
addsd  %xmm2,%xmm4
subsd  %xmm3,%xmm2
movslq 0x18(%rax,%r8,1),%rcx
movsd  %xmm2,-0x18(%rsp,%rcx,8)
mulsd  %xmm2,%xmm4
movapd %xmm1,%xmm3
subsd  %xmm4,%xmm3
movsd  0xe2b(%rip),%xmm4
subsd  %xmm0,%xmm4
divsd  %xmm4,%xmm3
lea    (%rax,%r8,1),%rcx
add    $0x10,%rcx
jmp    1277 <HLStoRGB+0x177>
movaps 0xe1a(%rip),%xmm0
movups %xmm0,-0x10(%rsp)
ret
movapd %xmm1,%xmm4
divsd  0xde0(%rip),%xmm4
movsd  0xde0(%rip),%xmm2
addsd  %xmm2,%xmm0
subsd  %xmm3,%xmm2
mulsd  %xmm4,%xmm2
movslq 0x10(%rax,%r8,1),%rcx
movsd  %xmm2,-0x18(%rsp,%rcx,8)
movsd  0xdd1(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
divsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
lea    (%rax,%r8,1),%rcx
add    $0x18,%rcx
movslq (%rcx),%rcx
movsd  %xmm3,-0x18(%rsp,%rcx,8)
subsd  %xmm2,%xmm1
subsd  %xmm3,%xmm1
movslq 0x14(%rax,%r8,1),%rax
movsd  %xmm1,-0x18(%rsp,%rax,8)
movsd  -0x18(%rsp),%xmm0
movsd  %xmm0,(%rdi)
movsd  -0x10(%rsp),%xmm0
movsd  %xmm0,(%rsi)
movsd  -0x8(%rsp),%xmm0
movsd  %xmm0,(%rdx)
ret
divsd  0xd5e(%rip),%xmm1
movsd  %xmm1,-0x8(%rsp)
ret

LLVM IR (-O0):
%struct.Index = type { double, double, i32, i32, i32 }
@HLStoRGB.index = internal global [6 x %struct.Index] [%struct.Index { double 1.000000e+00, double 0.000000e+00, i32 2, i32 1, i32 0 }, %struct.Index { double -1.000000e+00, double 2.000000e+00, i32 2, i32 0, i32 1 }, %struct.Index { double 1.000000e+00, double 2.000000e+00, i32 0, i32 2, i32 1 }, %struct.Index { double -1.000000e+00, double 4.000000e+00, i32 0, i32 1, i32 2 }, %struct.Index { double 1.000000e+00, double 4.000000e+00, i32 1, i32 0, i32 2 }, %struct.Index { double -1.000000e+00, double 6.000000e+00, i32 1, i32 2, i32 0 }]
define void @HLStoRGB(double* %0, double* %1, double* %2, double %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca [3 x double]
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
store double %22, double* %23
%24 = load double*, double** %8
%25 = load double, double* %24
%26 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double %25, double* %26
%27 = load double*, double** %9
%28 = load double, double* %27
%29 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
store double %28, double* %29
%30 = load double, double* %10
%31 = fdiv double %30, 6.000000e+01
store double %31, double* %10
br label %32
32: ; preds = %35, %6
%33 = load double, double* %10
%34 = fcmp oge double %33, 6.000000e+00
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load double, double* %10
%37 = fsub double %36, 6.000000e+00
store double %37, double* %10
br label %32
38: ; preds = %32
br label %39
39: ; preds = %42, %38
%40 = load double, double* %17
%41 = fcmp olt double %40, 0.000000e+00
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load double, double* %10
%44 = fadd double %43, 6.000000e+00
store double %44, double* %10
br label %39
45: ; preds = %39
%46 = load double, double* %11
%47 = fmul double %46, 3.000000e+00
store double %47, double* %11
%48 = load double, double* %11
%49 = fcmp oge double %48, 3.000000e+00
br i1 %49, label %50, label %54
50: ; preds = %45
%51 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
store double 1.000000e+00, double* %51
%52 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double 1.000000e+00, double* %52
%53 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
store double 1.000000e+00, double* %53
br label %189
54: ; preds = %45
%55 = load double, double* %11
%56 = fcmp ole double %55, 0.000000e+00
br i1 %56, label %57, label %61
57: ; preds = %54
%58 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
store double 0.000000e+00, double* %58
%59 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double 0.000000e+00, double* %59
%60 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
store double 0.000000e+00, double* %60
br label %189
61: ; preds = %54
br label %62
62: ; preds = %61
%63 = load double, double* %12
%64 = fcmp ogt double %63, 1.000000e+00
br i1 %64, label %65, label %66
65: ; preds = %62
store double 1.000000e+00, double* %12
br label %76
66: ; preds = %62
%67 = load double, double* %12
%68 = fcmp ole double %67, 0.000000e+00
br i1 %68, label %69, label %75
69: ; preds = %66
%70 = load double, double* %11
%71 = fdiv double %70, 3.000000e+00
%72 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
store double %71, double* %72
%73 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double %71, double* %73
%74 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
store double %71, double* %74
br label %189
75: ; preds = %66
br label %76
76: ; preds = %75, %65
%77 = load double, double* %10
%78 = fptosi double %77 to i32
store i32 %78, i32* %20
%79 = load i32, i32* %20
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %80
%82 = getelementptr inbounds %struct.Index, %struct.Index* %81, i32 0, i32 0
%83 = load double, double* %82
%84 = load double, double* %10
%85 = load i32, i32* %20
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %86
%88 = getelementptr inbounds %struct.Index, %struct.Index* %87, i32 0, i32 1
%89 = load double, double* %88
%90 = fsub double %84, %89
%91 = fmul double %83, %90
store double %91, double* %16
%92 = load double, double* %16
%93 = load double, double* %11
%94 = fsub double %93, 1.000000e+00
%95 = fcmp oge double %92, %94
br i1 %95, label %96, label %136
96: ; preds = %76
%97 = load double, double* %11
%98 = fdiv double %97, 3.000000e+00
%99 = load double, double* %12
%100 = fsub double 1.000000e+00, %99
%101 = fmul double %98, %100
store double %101, double* %14
%102 = load i32, i32* %20
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %103
%105 = getelementptr inbounds %struct.Index, %struct.Index* %104, i32 0, i32 2
%106 = load i32, i32* %105
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %107
store double %101, double* %108
%109 = load double, double* %14
%110 = load double, double* %11
%111 = load double, double* %14
%112 = call double @llvm.fmuladd.f64(double -3.000000e+00, double %111, double %110)
%113 = load double, double* %16
%114 = fadd double 1.000000e+00, %113
%115 = fdiv double %112, %114
%116 = fadd double %109, %115
store double %116, double* %15
%117 = load i32, i32* %20
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %118
%120 = getelementptr inbounds %struct.Index, %struct.Index* %119, i32 0, i32 4
%121 = load i32, i32* %120
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %122
store double %116, double* %123
%124 = load double, double* %11
%125 = load double, double* %14
%126 = fsub double %124, %125
%127 = load double, double* %15
%128 = fsub double %126, %127
%129 = load i32, i32* %20
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %130
%132 = getelementptr inbounds %struct.Index, %struct.Index* %131, i32 0, i32 3
%133 = load i32, i32* %132
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %134
store double %128, double* %135
br label %179
136: ; preds = %76
%137 = load double, double* %12
%138 = fsub double 1.000000e+00, %137
%139 = load double, double* %11
%140 = fdiv double %139, 3.000000e+00
%141 = fsub double 1.000000e+00, %140
%142 = fneg double %138
%143 = call double @llvm.fmuladd.f64(double %142, double %141, double 1.000000e+00)
store double %143, double* %15
%144 = load i32, i32* %20
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %145
%147 = getelementptr inbounds %struct.Index, %struct.Index* %146, i32 0, i32 4
%148 = load i32, i32* %147
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %149
store double %143, double* %150
%151 = load double, double* %11
%152 = load double, double* %15
%153 = load double, double* %16
%154 = fadd double 1.000000e+00, %153
%155 = fneg double %152
%156 = call double @llvm.fmuladd.f64(double %155, double %154, double %151)
%157 = load double, double* %16
%158 = fsub double 2.000000e+00, %157
%159 = fdiv double %156, %158
store double %159, double* %14
%160 = load i32, i32* %20
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %161
%163 = getelementptr inbounds %struct.Index, %struct.Index* %162, i32 0, i32 2
%164 = load i32, i32* %163
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %165
store double %159, double* %166
%167 = load double, double* %11
%168 = load double, double* %15
%169 = fsub double %167, %168
%170 = load double, double* %14
%171 = fsub double %169, %170
%172 = load i32, i32* %20
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %173
%175 = getelementptr inbounds %struct.Index, %struct.Index* %174, i32 0, i32 3
%176 = load i32, i32* %175
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %177
store double %171, double* %178
br label %179
179: ; preds = %136, %96
%180 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%181 = load double, double* %180
%182 = load double*, double** %7
store double %181, double* %182
%183 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
%184 = load double, double* %183
%185 = load double*, double** %8
store double %184, double* %185
%186 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
%187 = load double, double* %186
%188 = load double*, double** %9
store double %187, double* %188
br label %189
189: ; preds = %179, %69, %57, %50
ret void
}

LLVM IR (-O2):
%struct.Index = type { double, double, i32, i32, i32 }
@HLStoRGB.index = internal unnamed_addr constant [6 x %struct.Index] [%struct.Index { double 1.000000e+00, double 0.000000e+00, i32 2, i32 1, i32 0 }, %struct.Index { double -1.000000e+00, double 2.000000e+00, i32 2, i32 0, i32 1 }, %struct.Index { double 1.000000e+00, double 2.000000e+00, i32 0, i32 2, i32 1 }, %struct.Index { double -1.000000e+00, double 4.000000e+00, i32 0, i32 1, i32 2 }, %struct.Index { double 1.000000e+00, double 4.000000e+00, i32 1, i32 0, i32 2 }, %struct.Index { double -1.000000e+00, double 6.000000e+00, i32 1, i32 2, i32 0 }]
define void @HLStoRGB(double* nocapture %0, double* nocapture %1, double* nocapture %2, double %3, double %4, double %5) {
%7 = alloca [3 x double]
%8 = bitcast [3 x double]* %7 to i8*
%9 = load double, double* %0
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %9, double* %10
%11 = load double, double* %1
%12 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %11, double* %12
%13 = load double, double* %2
%14 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %13, double* %14
%15 = fdiv double %3, 6.000000e+01
%16 = fcmp ult double %15, 6.000000e+00
br i1 %16, label %21, label %17
17: ; preds = %6, %17
%18 = phi double [ %19, %17 ], [ %15, %6 ]
%19 = fadd double %18, -6.000000e+00
%20 = fcmp ult double %19, 6.000000e+00
br i1 %20, label %21, label %17
21: ; preds = %17, %6
%22 = phi double [ %15, %6 ], [ %19, %17 ]
%23 = fmul double %4, 3.000000e+00
%24 = fcmp ult double %23, 3.000000e+00
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %26
br label %92
27: ; preds = %21
%28 = fcmp ugt double %23, 0.000000e+00
br i1 %28, label %29, label %92
29: ; preds = %27
%30 = fcmp ogt double %5, 1.000000e+00
br i1 %30, label %35, label %31
31: ; preds = %29
%32 = fcmp ugt double %5, 0.000000e+00
br i1 %32, label %35, label %33
33: ; preds = %31
%34 = fdiv double %23, 3.000000e+00
store double %34, double* %14
br label %92
35: ; preds = %29, %31
%36 = phi double [ %5, %31 ], [ 1.000000e+00, %29 ]
%37 = fptosi double %22 to i32
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %38, i32 0
%40 = load double, double* %39
%41 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %38, i32 1
%42 = load double, double* %41
%43 = fsub double %22, %42
%44 = fmul double %40, %43
%45 = fadd double %23, -1.000000e+00
%46 = fcmp ult double %44, %45
br i1 %46, label %60, label %47
47: ; preds = %35
%48 = fdiv double %23, 3.000000e+00
%49 = fsub double 1.000000e+00, %36
%50 = fmul double %48, %49
%51 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %38, i32 2
%52 = load i32, i32* %51
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %53
store double %50, double* %54
%55 = tail call double @llvm.fmuladd.f64(double %50, double -3.000000e+00, double %23)
%56 = fadd double %44, 1.000000e+00
%57 = fdiv double %55, %56
%58 = fadd double %50, %57
%59 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %38, i32 4
br label %76
60: ; preds = %35
%61 = fsub double 1.000000e+00, %36
%62 = fdiv double %23, 3.000000e+00
%63 = fsub double 1.000000e+00, %62
%64 = fneg double %61
%65 = tail call double @llvm.fmuladd.f64(double %64, double %63, double 1.000000e+00)
%66 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %38, i32 4
%67 = load i32, i32* %66
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %68
store double %65, double* %69
%70 = fadd double %44, 1.000000e+00
%71 = fneg double %65
%72 = tail call double @llvm.fmuladd.f64(double %71, double %70, double %23)
%73 = fsub double 2.000000e+00, %44
%74 = fdiv double %72, %73
%75 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %38, i32 2
br label %76
76: ; preds = %60, %47
%77 = phi i32* [ %75, %60 ], [ %59, %47 ]
%78 = phi double [ %74, %60 ], [ %58, %47 ]
%79 = phi double [ %65, %60 ], [ %50, %47 ]
%80 = load i32, i32* %77
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %81
store double %78, double* %82
%83 = fsub double %23, %79
%84 = fsub double %83, %78
%85 = getelementptr inbounds [6 x %struct.Index], [6 x %struct.Index]* @HLStoRGB.index, i64 0, i64 %38, i32 3
%86 = load i32, i32* %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %87
store double %84, double* %88
%89 = load double, double* %10
store double %89, double* %0
%90 = load double, double* %12
store double %90, double* %1
%91 = load double, double* %14
store double %91, double* %2
br label %92
92: ; preds = %27, %76, %33, %25
ret void
}