#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
unsigned int HSLtoRGB_Subfunction(float, float, float);
void HSLtoRGB(const unsigned int h, const unsigned int s, const unsigned int l,
              unsigned int *rr, unsigned int *rg, unsigned int *rb) {
  unsigned int r = 0;
  unsigned int g = 0;
  unsigned int b = 0;
  float L = ((float)l) / 100;
  float S = ((float)s) / 100;
  float H = ((float)h) / 360;
  float temp1, temp2, temp3;
  int i;
  if (s == 0) {
    r = l;
    g = l;
    b = l;
  } else {
    temp1 = 0;
    if (L < .50) {
      temp1 = L * (1 + S);
    } else {
      temp1 = L + S - (L * S);
    }
    temp2 = 2 * L - temp1;
    temp3 = 0;
    for (i = 0; i < 3; i++) {
      switch (i) {
      case 0: {
        temp3 = H + .33333f;
        if (temp3 > 1)
          temp3 -= 1;
        r = HSLtoRGB_Subfunction(temp1, temp2, temp3);
        break;
      }
      case 1: {
        temp3 = H;
        g = HSLtoRGB_Subfunction(temp1, temp2, temp3);
        break;
      }
      case 2: {
        temp3 = H - .33333f;
        if (temp3 < 0)
          temp3 += 1;
        b = HSLtoRGB_Subfunction(temp1, temp2, temp3);
        break;
      }
      default: {
      }
      }
    }
  }
  *rr = (unsigned int)((((float)r) / 100) * 255);
  *rg = (unsigned int)((((float)g) / 100) * 255);
  *rb = (unsigned int)((((float)b) / 100) * 255);
}


x86 assembly (clang, -O0):
<HSLtoRGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xeb2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xe84(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11a6 <HSLtoRGB+0x96>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1377 <HSLtoRGB+0x267>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe59(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e9 <HSLtoRGB+0xd9>
movss  -0x38(%rbp),%xmm0
movss  0xe32(%rip),%xmm1
addss  -0x3c(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    1217 <HSLtoRGB+0x107>
movss  -0x38(%rbp),%xmm1
addss  -0x3c(%rbp),%xmm1
movss  -0x38(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x38(%rbp),%xmm0
movss  -0x44(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x3,-0x50(%rbp)
jge    1372 <HSLtoRGB+0x262>
mov    -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
test   %eax,%eax
je     1289 <HSLtoRGB+0x179>
jmp    1267 <HSLtoRGB+0x157>
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
je     12e3 <HSLtoRGB+0x1d3>
jmp    1278 <HSLtoRGB+0x168>
mov    -0x54(%rbp),%eax
sub    $0x2,%eax
je     1309 <HSLtoRGB+0x1f9>
jmp    135a <HSLtoRGB+0x24a>
movss  0xd7b(%rip),%xmm0
addss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
movss  0xd60(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    12c7 <HSLtoRGB+0x1b7>
movss  -0x4c(%rbp),%xmm0
movss  0xd4a(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm1
movss  -0x4c(%rbp),%xmm2
call   1030 <HSLtoRGB_Subfunction@plt>
mov    %eax,-0x2c(%rbp)
jmp    135f <HSLtoRGB+0x24f>
movss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm1
movss  -0x4c(%rbp),%xmm2
call   1030 <HSLtoRGB_Subfunction@plt>
mov    %eax,-0x30(%rbp)
jmp    135f <HSLtoRGB+0x24f>
movss  -0x40(%rbp),%xmm0
movss  0xcf6(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4c(%rbp),%xmm0
jbe    133e <HSLtoRGB+0x22e>
movss  0xcd4(%rip),%xmm0
addss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm1
movss  -0x4c(%rbp),%xmm2
call   1030 <HSLtoRGB_Subfunction@plt>
mov    %eax,-0x34(%rbp)
jmp    135f <HSLtoRGB+0x24f>
jmp    135f <HSLtoRGB+0x24f>
jmp    1364 <HSLtoRGB+0x254>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    124a <HSLtoRGB+0x13a>
jmp    1377 <HSLtoRGB+0x267>
mov    -0x2c(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xc7d(%rip),%xmm2
divss  %xmm2,%xmm0
movss  0xc7d(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSLtoRGB>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %edx,%eax
cvtsi2ss %rax,%xmm2
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
movss  0xece(%rip),%xmm0
divss  %xmm0,%xmm2
test   %esi,%esi
je     116f <HSLtoRGB+0x5f>
mov    %esi,%eax
cvtsi2ss %rax,%xmm4
mov    %edi,%eax
cvtsi2ss %rax,%xmm3
divss  0xeb4(%rip),%xmm3
divss  %xmm0,%xmm4
movss  0xeac(%rip),%xmm0
ucomiss %xmm2,%xmm0
jbe    117b <HSLtoRGB+0x6b>
addss  0xea3(%rip),%xmm4
mulss  %xmm2,%xmm4
jmp    118a <HSLtoRGB+0x7a>
movaps %xmm2,%xmm3
shufps $0x0,%xmm2,%xmm3
jmp    127c <HSLtoRGB+0x16c>
movaps %xmm2,%xmm0
mulss  %xmm4,%xmm0
addss  %xmm2,%xmm4
subss  %xmm0,%xmm4
addss  %xmm2,%xmm2
subss  %xmm4,%xmm2
movss  0xe76(%rip),%xmm5
addss  %xmm3,%xmm5
movaps %xmm2,%xmm1
movaps %xmm2,0x20(%rsp)
movss  0xe5e(%rip),%xmm2
movaps %xmm4,%xmm0
movss  %xmm4,0xc(%rsp)
movaps %xmm5,%xmm4
addss  %xmm2,%xmm4
movaps %xmm3,%xmm7
movss  %xmm3,0x10(%rsp)
xorps  %xmm3,%xmm3
movaps %xmm5,%xmm6
cmpltss %xmm3,%xmm6
andps  %xmm6,%xmm4
andnps %xmm5,%xmm6
orps   %xmm4,%xmm6
movaps %xmm6,0x30(%rsp)
movss  0xe2c(%rip),%xmm4
addss  %xmm7,%xmm4
movss  0xe24(%rip),%xmm3
addss  %xmm4,%xmm3
cmpltss %xmm4,%xmm2
andps  %xmm2,%xmm3
andnps %xmm4,%xmm2
orps   %xmm3,%xmm2
call   1030 <HSLtoRGB_Subfunction@plt>
mov    %eax,%ebp
movss  0xc(%rsp),%xmm0
movaps 0x20(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
call   1030 <HSLtoRGB_Subfunction@plt>
movd   %ebp,%xmm0
movd   %eax,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa 0xde9(%rip),%xmm0
por    %xmm0,%xmm1
subpd  %xmm0,%xmm1
cvtpd2ps %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
movaps 0x20(%rsp),%xmm1
movaps 0x30(%rsp),%xmm2
call   1030 <HSLtoRGB_Subfunction@plt>
movaps 0x10(%rsp),%xmm3
mov    %eax,%eax
xorps  %xmm2,%xmm2
cvtsi2ss %rax,%xmm2
divps  0xdbc(%rip),%xmm3
divss  0xd84(%rip),%xmm2
movaps %xmm3,%xmm0
shufps $0x55,%xmm3,%xmm0
movss  0xd91(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,(%rbx)
mulss  %xmm1,%xmm3
cvttss2si %xmm3,%rax
mov    %eax,(%r15)
mulss  %xmm1,%xmm2
cvttss2si %xmm2,%rax
mov    %eax,(%r14)
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @HSLtoRGB(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
%23 = load i32, i32* %9
%24 = uitofp i32 %23 to float
%25 = fdiv float %24, 1.000000e+02
store float %25, float* %16
%26 = load i32, i32* %8
%27 = uitofp i32 %26 to float
%28 = fdiv float %27, 1.000000e+02
store float %28, float* %17
%29 = load i32, i32* %7
%30 = uitofp i32 %29 to float
%31 = fdiv float %30, 3.600000e+02
store float %31, float* %18
%32 = load i32, i32* %8
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %6
%35 = load i32, i32* %9
store i32 %35, i32* %13
%36 = load i32, i32* %9
store i32 %36, i32* %14
%37 = load i32, i32* %9
store i32 %37, i32* %15
br label %103
38: ; preds = %6
store float 0.000000e+00, float* %19
%39 = load float, float* %16
%40 = fpext float %39 to double
%41 = fcmp olt double %40, 5.000000e-01
br i1 %41, label %42, label %47
42: ; preds = %38
%43 = load float, float* %16
%44 = load float, float* %17
%45 = fadd float 1.000000e+00, %44
%46 = fmul float %43, %45
store float %46, float* %19
br label %55
47: ; preds = %38
%48 = load float, float* %16
%49 = load float, float* %17
%50 = fadd float %48, %49
%51 = load float, float* %16
%52 = load float, float* %17
%53 = fneg float %51
%54 = call float @llvm.fmuladd.f32(float %53, float %52, float %50)
store float %54, float* %19
br label %55
55: ; preds = %47, %42
%56 = load float, float* %16
%57 = load float, float* %19
%58 = fneg float %57
%59 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %56, float %58)
store float %59, float* %20
store float 0.000000e+00, float* %21
store i32 0, i32* %22
br label %60
60: ; preds = %99, %55
%61 = load i32, i32* %22
%62 = icmp slt i32 %61, 3
br i1 %62, label %63, label %102
63: ; preds = %60
%64 = load i32, i32* %22
switch i32 %64, label %97 [
i32 0, label %65
i32 1, label %78
i32 2, label %84
]
65: ; preds = %63
%66 = load float, float* %18
%67 = fadd float %66, 0x3FD5554760000000
store float %67, float* %21
%68 = load float, float* %21
%69 = fcmp ogt float %68, 1.000000e+00
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = load float, float* %21
%72 = fsub float %71, 1.000000e+00
store float %72, float* %21
br label %73
73: ; preds = %70, %65
%74 = load float, float* %19
%75 = load float, float* %20
%76 = load float, float* %21
%77 = call i32 @HSLtoRGB_Subfunction(float %74, float %75, float %76)
store i32 %77, i32* %13
br label %98
78: ; preds = %63
%79 = load float, float* %18
store float %79, float* %21
%80 = load float, float* %19
%81 = load float, float* %20
%82 = load float, float* %21
%83 = call i32 @HSLtoRGB_Subfunction(float %80, float %81, float %82)
store i32 %83, i32* %14
br label %98
84: ; preds = %63
%85 = load float, float* %18
%86 = fsub float %85, 0x3FD5554760000000
store float %86, float* %21
%87 = load float, float* %21
%88 = fcmp olt float %87, 0.000000e+00
br i1 %88, label %89, label %92
89: ; preds = %84
%90 = load float, float* %21
%91 = fadd float %90, 1.000000e+00
store float %91, float* %21
br label %92
92: ; preds = %89, %84
%93 = load float, float* %19
%94 = load float, float* %20
%95 = load float, float* %21
%96 = call i32 @HSLtoRGB_Subfunction(float %93, float %94, float %95)
store i32 %96, i32* %15
br label %98
97: ; preds = %63
br label %98
98: ; preds = %97, %92, %78, %73
br label %99
99: ; preds = %98
%100 = load i32, i32* %22
%101 = add nsw i32 %100, 1
store i32 %101, i32* %22
br label %60
102: ; preds = %60
br label %103
103: ; preds = %102, %34
%104 = load i32, i32* %13
%105 = uitofp i32 %104 to float
%106 = fdiv float %105, 1.000000e+02
%107 = fmul float %106, 2.550000e+02
%108 = fptoui float %107 to i32
%109 = load i32*, i32** %10
store i32 %108, i32* %109
%110 = load i32, i32* %14
%111 = uitofp i32 %110 to float
%112 = fdiv float %111, 1.000000e+02
%113 = fmul float %112, 2.550000e+02
%114 = fptoui float %113 to i32
%115 = load i32*, i32** %11
store i32 %114, i32* %115
%116 = load i32, i32* %15
%117 = uitofp i32 %116 to float
%118 = fdiv float %117, 1.000000e+02
%119 = fmul float %118, 2.550000e+02
%120 = fptoui float %119 to i32
%121 = load i32*, i32** %12
store i32 %120, i32* %121
ret void
}

LLVM IR (-O2):
define void @HSLtoRGB(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = uitofp i32 %2 to float
%8 = fdiv float %7, 1.000000e+02
%9 = uitofp i32 %1 to float
%10 = fdiv float %9, 1.000000e+02
%11 = uitofp i32 %0 to float
%12 = fdiv float %11, 3.600000e+02
%13 = icmp eq i32 %1, 0
%14 = insertelement <2 x float> poison, float %8, i64 0
%15 = shufflevector <2 x float> %14, <2 x float> poison, <2 x i32> zeroinitializer
br i1 %13, label %46, label %16
16: ; preds = %6
%17 = fcmp olt float %8, 5.000000e-01
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = fadd float %10, 1.000000e+00
%20 = fmul float %8, %19
br label %25
21: ; preds = %16
%22 = fadd float %10, %8
%23 = fneg float %8
%24 = tail call float @llvm.fmuladd.f32(float %23, float %10, float %22)
br label %25
25: ; preds = %21, %18
%26 = phi float [ %20, %18 ], [ %24, %21 ]
%27 = fneg float %26
%28 = tail call float @llvm.fmuladd.f32(float %8, float 2.000000e+00, float %27)
%29 = fadd float %12, 0xBFD5554760000000
%30 = fcmp olt float %29, 0.000000e+00
%31 = fadd float %29, 1.000000e+00
%32 = select i1 %30, float %31, float %29
%33 = fadd float %12, 0x3FD5554760000000
%34 = fcmp ogt float %33, 1.000000e+00
%35 = fadd float %33, -1.000000e+00
%36 = select i1 %34, float %35, float %33
%37 = tail call i32 @HSLtoRGB_Subfunction(float %26, float %28, float %36)
%38 = tail call i32 @HSLtoRGB_Subfunction(float %26, float %28, float %12)
%39 = insertelement <2 x i32> poison, i32 %38, i64 0
%40 = insertelement <2 x i32> %39, i32 %37, i64 1
%41 = uitofp <2 x i32> %40 to <2 x float>
%42 = tail call i32 @HSLtoRGB_Subfunction(float %26, float %28, float %32)
%43 = uitofp i32 %42 to float
%44 = fdiv <2 x float> %41, <float 1.000000e+02, float 1.000000e+02>
%45 = fdiv float %43, 1.000000e+02
br label %46
46: ; preds = %25, %6
%47 = phi float [ %45, %25 ], [ %8, %6 ]
%48 = phi <2 x float> [ %44, %25 ], [ %15, %6 ]
%49 = extractelement <2 x float> %48, i64 1
%50 = fmul float %49, 2.550000e+02
%51 = fptoui float %50 to i32
store i32 %51, i32* %3
%52 = extractelement <2 x float> %48, i64 0
%53 = fmul float %52, 2.550000e+02
%54 = fptoui float %53 to i32
store i32 %54, i32* %4
%55 = fmul float %47, 2.550000e+02
%56 = fptoui float %55 to i32
store i32 %56, i32* %5
ret void
}