void xcflHSVToRGBInt(int *pHue, int *pSaturation, int *pValue) {
  if (*pSaturation == 0) {
    *pHue = *pValue;
    *pSaturation = *pValue;
  } else {
    double h, s, v, h_temp;
    double f, p, q, t;
    int i;
    h = *pHue;
    s = (double)*pSaturation / 255.0;
    v = (double)*pValue / 255.0;
    if (h == 360)
      h_temp = 0;
    else
      h_temp = h;
    h_temp /= 60.0;
    i = (int)floor(h_temp);
    f = h_temp - i;
    p = v * (1.0 - s);
    q = v * (1.0 - (s * f));
    t = v * (1.0 - (s * (1.0 - f)));
    switch (i) {
    case 0:
      *pHue = ((int)(((v)*255.0) + 0.5));
      *pSaturation = ((int)(((t)*255.0) + 0.5));
      *pValue = ((int)(((p)*255.0) + 0.5));
      break;
    case 1:
      *pHue = ((int)(((q)*255.0) + 0.5));
      *pSaturation = ((int)(((v)*255.0) + 0.5));
      *pValue = ((int)(((p)*255.0) + 0.5));
      break;
    case 2:
      *pHue = ((int)(((p)*255.0) + 0.5));
      *pSaturation = ((int)(((v)*255.0) + 0.5));
      *pValue = ((int)(((t)*255.0) + 0.5));
      break;
    case 3:
      *pHue = ((int)(((p)*255.0) + 0.5));
      *pSaturation = ((int)(((q)*255.0) + 0.5));
      *pValue = ((int)(((v)*255.0) + 0.5));
      break;
    case 4:
      *pHue = ((int)(((t)*255.0) + 0.5));
      *pSaturation = ((int)(((p)*255.0) + 0.5));
      *pValue = ((int)(((v)*255.0) + 0.5));
      break;
    case 5:
      *pHue = ((int)(((v)*255.0) + 0.5));
      *pSaturation = ((int)(((p)*255.0) + 0.5));
      *pValue = ((int)(((q)*255.0) + 0.5));
      break;
    }
  }
}


x86 assembly (clang, -O0):
<xcflHSVToRGBInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    114e <xcflHSVToRGBInt+0x3e>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1568 <xcflHSVToRGBInt+0x458>
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xe9d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe66(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11b7 <xcflHSVToRGBInt+0xa7>
jp     11b7 <xcflHSVToRGBInt+0xa7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11c1 <xcflHSVToRGBInt+0xb1>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe42(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <floor@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x5c(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0x5c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm3
movsd  0xe0b(%rip),%xmm1
movaps %xmm1,%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm3
movaps %xmm1,%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm4
movaps %xmm1,%xmm3
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x5c(%rbp),%eax
mov    %rax,-0x68(%rbp)
sub    $0x5,%rax
ja     1563 <xcflHSVToRGBInt+0x453>
mov    -0x68(%rbp),%rax
lea    0xda5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  -0x30(%rbp),%xmm0
movsd  0xd6f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd7b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x58(%rbp),%xmm0
movsd  0xd48(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd54(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  0xd21(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd2d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1563 <xcflHSVToRGBInt+0x453>
movsd  -0x50(%rbp),%xmm0
movsd  0xcf5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd01(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  0xcce(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcda(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  0xca7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcb3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1563 <xcflHSVToRGBInt+0x453>
movsd  -0x48(%rbp),%xmm0
movsd  0xc7b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc87(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  0xc54(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc60(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x58(%rbp),%xmm0
movsd  0xc2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc39(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1563 <xcflHSVToRGBInt+0x453>
movsd  -0x48(%rbp),%xmm0
movsd  0xc01(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc0d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xbda(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbe6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  0xbb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbbf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1563 <xcflHSVToRGBInt+0x453>
movsd  -0x58(%rbp),%xmm0
movsd  0xb87(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb93(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  0xb60(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb6c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  0xb39(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb45(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1563 <xcflHSVToRGBInt+0x453>
movsd  -0x30(%rbp),%xmm0
movsd  0xb0d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb19(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  0xae6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xaf2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xabf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xacb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1568 <xcflHSVToRGBInt+0x458>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcflHSVToRGBInt>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rsi),%ebp
test   %ebp,%ebp
je     121e <xcflHSVToRGBInt+0x10e>
mov    (%rbx),%eax
xorpd  %xmm1,%xmm1
cmp    $0x168,%eax
je     1149 <xcflHSVToRGBInt+0x39>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0xebf(%rip),%xmm1
cvtsi2sdl (%r14),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <floor@plt>
cvttsd2si %xmm0,%eax
cmp    $0x5,%eax
ja     1334 <xcflHSVToRGBInt+0x224>
cvtsi2sd %ebp,%xmm3
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm3
movsd  0x10(%rsp),%xmm6
divsd  %xmm1,%xmm6
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
movsd  0x8(%rsp),%xmm7
subsd  %xmm0,%xmm7
movsd  0xe6c(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm6,%xmm0
movapd %xmm2,%xmm4
subsd  %xmm7,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm3,%xmm5
mulsd  %xmm7,%xmm5
movapd %xmm2,%xmm3
subsd  %xmm5,%xmm3
mulsd  %xmm6,%xmm3
subsd  %xmm4,%xmm2
mulsd  %xmm6,%xmm2
lea    0xe41(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mulsd  %xmm1,%xmm6
movsd  0xe24(%rip),%xmm3
addsd  %xmm3,%xmm6
cvttsd2si %xmm6,%eax
mov    %eax,(%rbx)
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
cvttsd2si %xmm2,%eax
mov    %eax,(%r15)
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
cvttsd2si %xmm0,%eax
jmp    1331 <xcflHSVToRGBInt+0x221>
mov    (%r14),%eax
mov    %eax,(%rbx)
mov    (%r14),%eax
mov    %eax,(%r15)
jmp    1334 <xcflHSVToRGBInt+0x224>
mulsd  %xmm1,%xmm3
movsd  0xdde(%rip),%xmm2
addsd  %xmm2,%xmm3
cvttsd2si %xmm3,%eax
mov    %eax,(%rbx)
mulsd  %xmm1,%xmm6
addsd  %xmm2,%xmm6
cvttsd2si %xmm6,%eax
mov    %eax,(%r15)
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
cvttsd2si %xmm0,%eax
jmp    1331 <xcflHSVToRGBInt+0x221>
mulsd  %xmm1,%xmm0
movsd  0xda8(%rip),%xmm3
addsd  %xmm3,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rbx)
mulsd  %xmm1,%xmm6
addsd  %xmm3,%xmm6
cvttsd2si %xmm6,%eax
mov    %eax,(%r15)
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
cvttsd2si %xmm2,%eax
jmp    1331 <xcflHSVToRGBInt+0x221>
mulsd  %xmm1,%xmm0
movsd  0xd72(%rip),%xmm2
addsd  %xmm2,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rbx)
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
cvttsd2si %xmm3,%eax
mov    %eax,(%r15)
mulsd  %xmm1,%xmm6
addsd  %xmm2,%xmm6
cvttsd2si %xmm6,%eax
jmp    1331 <xcflHSVToRGBInt+0x221>
mulsd  %xmm1,%xmm2
movsd  0xd3f(%rip),%xmm3
addsd  %xmm3,%xmm2
cvttsd2si %xmm2,%eax
mov    %eax,(%rbx)
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%r15)
mulsd  %xmm1,%xmm6
addsd  %xmm3,%xmm6
cvttsd2si %xmm6,%eax
jmp    1331 <xcflHSVToRGBInt+0x221>
mulsd  %xmm1,%xmm6
movsd  0xd0c(%rip),%xmm2
addsd  %xmm2,%xmm6
cvttsd2si %xmm6,%eax
mov    %eax,(%rbx)
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%r15)
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
cvttsd2si %xmm3,%eax
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @xcflHSVToRGBInt(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %3
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = load i32*, i32** %4
store i32 %21, i32* %22
%23 = load i32*, i32** %6
%24 = load i32, i32* %23
%25 = load i32*, i32** %5
store i32 %24, i32* %25
br label %150
26: ; preds = %3
%27 = load i32*, i32** %4
%28 = load i32, i32* %27
%29 = sitofp i32 %28 to double
store double %29, double* %7
%30 = load i32*, i32** %5
%31 = load i32, i32* %30
%32 = sitofp i32 %31 to double
%33 = fdiv double %32, 2.550000e+02
store double %33, double* %8
%34 = load i32*, i32** %6
%35 = load i32, i32* %34
%36 = sitofp i32 %35 to double
%37 = fdiv double %36, 2.550000e+02
store double %37, double* %9
%38 = load double, double* %7
%39 = fcmp oeq double %38, 3.600000e+02
br i1 %39, label %40, label %41
40: ; preds = %26
store double 0.000000e+00, double* %10
br label %43
41: ; preds = %26
%42 = load double, double* %7
store double %42, double* %10
br label %43
43: ; preds = %41, %40
%44 = load double, double* %10
%45 = fdiv double %44, 6.000000e+01
store double %45, double* %10
%46 = load double, double* %10
%47 = call double @llvm.floor.f64(double %46)
%48 = fptosi double %47 to i32
store i32 %48, i32* %15
%49 = load double, double* %10
%50 = load i32, i32* %15
%51 = sitofp i32 %50 to double
%52 = fsub double %49, %51
store double %52, double* %11
%53 = load double, double* %9
%54 = load double, double* %8
%55 = fsub double 1.000000e+00, %54
%56 = fmul double %53, %55
store double %56, double* %12
%57 = load double, double* %9
%58 = load double, double* %8
%59 = load double, double* %11
%60 = fneg double %58
%61 = call double @llvm.fmuladd.f64(double %60, double %59, double 1.000000e+00)
%62 = fmul double %57, %61
store double %62, double* %13
%63 = load double, double* %9
%64 = load double, double* %8
%65 = load double, double* %11
%66 = fsub double 1.000000e+00, %65
%67 = fneg double %64
%68 = call double @llvm.fmuladd.f64(double %67, double %66, double 1.000000e+00)
%69 = fmul double %63, %68
store double %69, double* %14
%70 = load i32, i32* %15
switch i32 %70, label %149 [
i32 0, label %71
i32 1, label %84
i32 2, label %97
i32 3, label %110
i32 4, label %123
i32 5, label %136
]
71: ; preds = %43
%72 = load double, double* %9
%73 = call double @llvm.fmuladd.f64(double %72, double 2.550000e+02, double 5.000000e-01)
%74 = fptosi double %73 to i32
%75 = load i32*, i32** %4
store i32 %74, i32* %75
%76 = load double, double* %14
%77 = call double @llvm.fmuladd.f64(double %76, double 2.550000e+02, double 5.000000e-01)
%78 = fptosi double %77 to i32
%79 = load i32*, i32** %5
store i32 %78, i32* %79
%80 = load double, double* %12
%81 = call double @llvm.fmuladd.f64(double %80, double 2.550000e+02, double 5.000000e-01)
%82 = fptosi double %81 to i32
%83 = load i32*, i32** %6
store i32 %82, i32* %83
br label %149
84: ; preds = %43
%85 = load double, double* %13
%86 = call double @llvm.fmuladd.f64(double %85, double 2.550000e+02, double 5.000000e-01)
%87 = fptosi double %86 to i32
%88 = load i32*, i32** %4
store i32 %87, i32* %88
%89 = load double, double* %9
%90 = call double @llvm.fmuladd.f64(double %89, double 2.550000e+02, double 5.000000e-01)
%91 = fptosi double %90 to i32
%92 = load i32*, i32** %5
store i32 %91, i32* %92
%93 = load double, double* %12
%94 = call double @llvm.fmuladd.f64(double %93, double 2.550000e+02, double 5.000000e-01)
%95 = fptosi double %94 to i32
%96 = load i32*, i32** %6
store i32 %95, i32* %96
br label %149
97: ; preds = %43
%98 = load double, double* %12
%99 = call double @llvm.fmuladd.f64(double %98, double 2.550000e+02, double 5.000000e-01)
%100 = fptosi double %99 to i32
%101 = load i32*, i32** %4
store i32 %100, i32* %101
%102 = load double, double* %9
%103 = call double @llvm.fmuladd.f64(double %102, double 2.550000e+02, double 5.000000e-01)
%104 = fptosi double %103 to i32
%105 = load i32*, i32** %5
store i32 %104, i32* %105
%106 = load double, double* %14
%107 = call double @llvm.fmuladd.f64(double %106, double 2.550000e+02, double 5.000000e-01)
%108 = fptosi double %107 to i32
%109 = load i32*, i32** %6
store i32 %108, i32* %109
br label %149
110: ; preds = %43
%111 = load double, double* %12
%112 = call double @llvm.fmuladd.f64(double %111, double 2.550000e+02, double 5.000000e-01)
%113 = fptosi double %112 to i32
%114 = load i32*, i32** %4
store i32 %113, i32* %114
%115 = load double, double* %13
%116 = call double @llvm.fmuladd.f64(double %115, double 2.550000e+02, double 5.000000e-01)
%117 = fptosi double %116 to i32
%118 = load i32*, i32** %5
store i32 %117, i32* %118
%119 = load double, double* %9
%120 = call double @llvm.fmuladd.f64(double %119, double 2.550000e+02, double 5.000000e-01)
%121 = fptosi double %120 to i32
%122 = load i32*, i32** %6
store i32 %121, i32* %122
br label %149
123: ; preds = %43
%124 = load double, double* %14
%125 = call double @llvm.fmuladd.f64(double %124, double 2.550000e+02, double 5.000000e-01)
%126 = fptosi double %125 to i32
%127 = load i32*, i32** %4
store i32 %126, i32* %127
%128 = load double, double* %12
%129 = call double @llvm.fmuladd.f64(double %128, double 2.550000e+02, double 5.000000e-01)
%130 = fptosi double %129 to i32
%131 = load i32*, i32** %5
store i32 %130, i32* %131
%132 = load double, double* %9
%133 = call double @llvm.fmuladd.f64(double %132, double 2.550000e+02, double 5.000000e-01)
%134 = fptosi double %133 to i32
%135 = load i32*, i32** %6
store i32 %134, i32* %135
br label %149
136: ; preds = %43
%137 = load double, double* %9
%138 = call double @llvm.fmuladd.f64(double %137, double 2.550000e+02, double 5.000000e-01)
%139 = fptosi double %138 to i32
%140 = load i32*, i32** %4
store i32 %139, i32* %140
%141 = load double, double* %12
%142 = call double @llvm.fmuladd.f64(double %141, double 2.550000e+02, double 5.000000e-01)
%143 = fptosi double %142 to i32
%144 = load i32*, i32** %5
store i32 %143, i32* %144
%145 = load double, double* %13
%146 = call double @llvm.fmuladd.f64(double %145, double 2.550000e+02, double 5.000000e-01)
%147 = fptosi double %146 to i32
%148 = load i32*, i32** %6
store i32 %147, i32* %148
br label %149
149: ; preds = %43, %136, %123, %110, %97, %84, %71
br label %150
150: ; preds = %149, %19
ret void
}

LLVM IR (-O2):
define void @xcflHSVToRGBInt(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
store i32 %7, i32* %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %74
9: ; preds = %3
%10 = load i32, i32* %0
%11 = sitofp i32 %4 to double
%12 = fdiv double %11, 2.550000e+02
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 2.550000e+02
%16 = icmp eq i32 %10, 360
%17 = sitofp i32 %10 to double
%18 = fdiv double %17, 6.000000e+01
%19 = select i1 %16, double 0.000000e+00, double %18
%20 = tail call double @llvm.floor.f64(double %19)
%21 = fptosi double %20 to i32
%22 = sitofp i32 %21 to double
%23 = fsub double %19, %22
%24 = fsub double 1.000000e+00, %12
%25 = fmul double %24, %15
%26 = fneg double %12
%27 = tail call double @llvm.fmuladd.f64(double %26, double %23, double 1.000000e+00)
%28 = fmul double %15, %27
%29 = fsub double 1.000000e+00, %23
%30 = tail call double @llvm.fmuladd.f64(double %26, double %29, double 1.000000e+00)
%31 = fmul double %15, %30
switch i32 %21, label %74 [
i32 0, label %32
i32 1, label %39
i32 2, label %46
i32 3, label %53
i32 4, label %60
i32 5, label %67
]
32: ; preds = %9
%33 = tail call double @llvm.fmuladd.f64(double %15, double 2.550000e+02, double 5.000000e-01)
%34 = fptosi double %33 to i32
store i32 %34, i32* %0
%35 = tail call double @llvm.fmuladd.f64(double %31, double 2.550000e+02, double 5.000000e-01)
%36 = fptosi double %35 to i32
store i32 %36, i32* %1
%37 = tail call double @llvm.fmuladd.f64(double %25, double 2.550000e+02, double 5.000000e-01)
%38 = fptosi double %37 to i32
store i32 %38, i32* %2
br label %74
39: ; preds = %9
%40 = tail call double @llvm.fmuladd.f64(double %28, double 2.550000e+02, double 5.000000e-01)
%41 = fptosi double %40 to i32
store i32 %41, i32* %0
%42 = tail call double @llvm.fmuladd.f64(double %15, double 2.550000e+02, double 5.000000e-01)
%43 = fptosi double %42 to i32
store i32 %43, i32* %1
%44 = tail call double @llvm.fmuladd.f64(double %25, double 2.550000e+02, double 5.000000e-01)
%45 = fptosi double %44 to i32
store i32 %45, i32* %2
br label %74
46: ; preds = %9
%47 = tail call double @llvm.fmuladd.f64(double %25, double 2.550000e+02, double 5.000000e-01)
%48 = fptosi double %47 to i32
store i32 %48, i32* %0
%49 = tail call double @llvm.fmuladd.f64(double %15, double 2.550000e+02, double 5.000000e-01)
%50 = fptosi double %49 to i32
store i32 %50, i32* %1
%51 = tail call double @llvm.fmuladd.f64(double %31, double 2.550000e+02, double 5.000000e-01)
%52 = fptosi double %51 to i32
store i32 %52, i32* %2
br label %74
53: ; preds = %9
%54 = tail call double @llvm.fmuladd.f64(double %25, double 2.550000e+02, double 5.000000e-01)
%55 = fptosi double %54 to i32
store i32 %55, i32* %0
%56 = tail call double @llvm.fmuladd.f64(double %28, double 2.550000e+02, double 5.000000e-01)
%57 = fptosi double %56 to i32
store i32 %57, i32* %1
%58 = tail call double @llvm.fmuladd.f64(double %15, double 2.550000e+02, double 5.000000e-01)
%59 = fptosi double %58 to i32
store i32 %59, i32* %2
br label %74
60: ; preds = %9
%61 = tail call double @llvm.fmuladd.f64(double %31, double 2.550000e+02, double 5.000000e-01)
%62 = fptosi double %61 to i32
store i32 %62, i32* %0
%63 = tail call double @llvm.fmuladd.f64(double %25, double 2.550000e+02, double 5.000000e-01)
%64 = fptosi double %63 to i32
store i32 %64, i32* %1
%65 = tail call double @llvm.fmuladd.f64(double %15, double 2.550000e+02, double 5.000000e-01)
%66 = fptosi double %65 to i32
store i32 %66, i32* %2
br label %74
67: ; preds = %9
%68 = tail call double @llvm.fmuladd.f64(double %15, double 2.550000e+02, double 5.000000e-01)
%69 = fptosi double %68 to i32
store i32 %69, i32* %0
%70 = tail call double @llvm.fmuladd.f64(double %25, double 2.550000e+02, double 5.000000e-01)
%71 = fptosi double %70 to i32
store i32 %71, i32* %1
%72 = tail call double @llvm.fmuladd.f64(double %28, double 2.550000e+02, double 5.000000e-01)
%73 = fptosi double %72 to i32
store i32 %73, i32* %2
br label %74
74: ; preds = %32, %39, %46, %53, %60, %67, %9, %6
ret void
}