#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 */
int fabs(int);
int fmod(float const, int);
void hsl_to_rgb_f(const float hsl[3], float rgb[3]) {
  float r = 0, g = 0, b = 0, c, x, m;
  const float h = hsl[0] / 60, s = hsl[1], l = hsl[2];
  c = (1 - fabs(2 * l - 1)) * s;
  x = c * (1 - fabs(fmod(h, 2) - 1));
  if (h < 1) {
    r = c;
    g = x;
    b = 0;
  } else if (h < 2) {
    r = x;
    g = c;
    b = 0;
  } else if (h < 3) {
    r = 0;
    g = c;
    b = x;
  } else if (h < 4) {
    r = 0;
    g = x;
    b = c;
  } else if (h < 5) {
    r = x;
    g = 0;
    b = c;
  } else if (h < 6) {
    r = c;
    g = 0;
    b = x;
  }
  m = l - 0.5 * c;
  rgb[0] = r + m;
  rgb[1] = g + m;
  rgb[2] = b + m;
}


x86 assembly (clang, -O0):
<hsl_to_rgb_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  0xeb0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xe76(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1040 <fabs@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
mulss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x2c(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <fmod@plt>
mov    %eax,%edi
sub    $0x1,%edi
call   1040 <fabs@plt>
movss  -0x38(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xe08(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    1223 <hsl_to_rgb_f+0x103>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1336 <hsl_to_rgb_f+0x216>
movss  0xde1(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    1256 <hsl_to_rgb_f+0x136>
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1331 <hsl_to_rgb_f+0x211>
movss  0xdb2(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    1289 <hsl_to_rgb_f+0x169>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    132c <hsl_to_rgb_f+0x20c>
movss  0xd83(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    12bc <hsl_to_rgb_f+0x19c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1327 <hsl_to_rgb_f+0x207>
movss  0xd54(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    12ef <hsl_to_rgb_f+0x1cf>
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1322 <hsl_to_rgb_f+0x202>
movss  0xd25(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    131d <hsl_to_rgb_f+0x1fd>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1322 <hsl_to_rgb_f+0x202>
jmp    1327 <hsl_to_rgb_f+0x207>
jmp    132c <hsl_to_rgb_f+0x20c>
jmp    1331 <hsl_to_rgb_f+0x211>
jmp    1336 <hsl_to_rgb_f+0x216>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcd0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x1c(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsl_to_rgb_f>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
divss  0xec0(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x14(%rsp)
addss  %xmm0,%xmm0
addss  0xea7(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1040 <fabs@plt>
mov    $0x1,%ebp
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <fmod@plt>
lea    -0x1(%rax),%edi
call   1040 <fabs@plt>
movss  0x10(%rsp),%xmm5
movss  0xc(%rsp),%xmm4
sub    %eax,%ebp
cvtsi2ss %ebp,%xmm2
mulss  %xmm4,%xmm2
xorps  %xmm0,%xmm0
movss  0xe4a(%rip),%xmm1
ucomiss %xmm5,%xmm1
jbe    11cb <hsl_to_rgb_f+0xab>
movaps %xmm2,%xmm1
movaps %xmm4,%xmm3
jmp    1240 <hsl_to_rgb_f+0x120>
movss  0xe39(%rip),%xmm1
ucomiss %xmm5,%xmm1
jbe    11e0 <hsl_to_rgb_f+0xc0>
movaps %xmm4,%xmm1
movaps %xmm2,%xmm3
jmp    1240 <hsl_to_rgb_f+0x120>
xorps  %xmm3,%xmm3
movss  0xe25(%rip),%xmm0
ucomiss %xmm5,%xmm0
jbe    11f8 <hsl_to_rgb_f+0xd8>
movaps %xmm2,%xmm0
movaps %xmm4,%xmm1
jmp    1240 <hsl_to_rgb_f+0x120>
movss  0xe14(%rip),%xmm0
ucomiss %xmm5,%xmm0
jbe    120d <hsl_to_rgb_f+0xed>
movaps %xmm4,%xmm0
movaps %xmm2,%xmm1
jmp    1240 <hsl_to_rgb_f+0x120>
xorps  %xmm1,%xmm1
movss  0xe00(%rip),%xmm0
ucomiss %xmm5,%xmm0
jbe    1225 <hsl_to_rgb_f+0x105>
movaps %xmm4,%xmm0
movaps %xmm2,%xmm3
jmp    1240 <hsl_to_rgb_f+0x120>
xorps  %xmm1,%xmm1
movss  0xdec(%rip),%xmm0
ucomiss %xmm5,%xmm0
jbe    123a <hsl_to_rgb_f+0x11a>
movaps %xmm2,%xmm0
jmp    11c6 <hsl_to_rgb_f+0xa6>
xorps  %xmm0,%xmm0
xorps  %xmm3,%xmm3
movss  0x14(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm4,%xmm4
mulsd  0xdca(%rip),%xmm4
addsd  %xmm2,%xmm4
xorps  %xmm2,%xmm2
cvtsd2ss %xmm4,%xmm2
addss  %xmm2,%xmm3
movss  %xmm3,(%rbx)
addss  %xmm2,%xmm1
movss  %xmm1,0x4(%rbx)
addss  %xmm2,%xmm0
movss  %xmm0,0x8(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @hsl_to_rgb_f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float* %0, float** %3
store float* %1, float** %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 0
%16 = load float, float* %15
%17 = fdiv float %16, 6.000000e+01
store float %17, float* %11
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 1
%20 = load float, float* %19
store float %20, float* %12
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
store float %23, float* %13
%24 = load float, float* %13
%25 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %24, float -1.000000e+00)
%26 = fptosi float %25 to i32
%27 = call i32 @fabs(i32 %26)
%28 = sub nsw i32 1, %27
%29 = sitofp i32 %28 to float
%30 = load float, float* %12
%31 = fmul float %29, %30
store float %31, float* %8
%32 = load float, float* %8
%33 = load float, float* %11
%34 = call i32 @fmod(float %33, i32 2)
%35 = sub nsw i32 %34, 1
%36 = call i32 @fabs(i32 %35)
%37 = sub nsw i32 1, %36
%38 = sitofp i32 %37 to float
%39 = fmul float %32, %38
store float %39, float* %9
%40 = load float, float* %11
%41 = fcmp olt float %40, 1.000000e+00
br i1 %41, label %42, label %45
42: ; preds = %2
%43 = load float, float* %8
store float %43, float* %5
%44 = load float, float* %9
store float %44, float* %6
store float 0.000000e+00, float* %7
br label %80
45: ; preds = %2
%46 = load float, float* %11
%47 = fcmp olt float %46, 2.000000e+00
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load float, float* %9
store float %49, float* %5
%50 = load float, float* %8
store float %50, float* %6
store float 0.000000e+00, float* %7
br label %79
51: ; preds = %45
%52 = load float, float* %11
%53 = fcmp olt float %52, 3.000000e+00
br i1 %53, label %54, label %57
54: ; preds = %51
store float 0.000000e+00, float* %5
%55 = load float, float* %8
store float %55, float* %6
%56 = load float, float* %9
store float %56, float* %7
br label %78
57: ; preds = %51
%58 = load float, float* %11
%59 = fcmp olt float %58, 4.000000e+00
br i1 %59, label %60, label %63
60: ; preds = %57
store float 0.000000e+00, float* %5
%61 = load float, float* %9
store float %61, float* %6
%62 = load float, float* %8
store float %62, float* %7
br label %77
63: ; preds = %57
%64 = load float, float* %11
%65 = fcmp olt float %64, 5.000000e+00
br i1 %65, label %66, label %69
66: ; preds = %63
%67 = load float, float* %9
store float %67, float* %5
store float 0.000000e+00, float* %6
%68 = load float, float* %8
store float %68, float* %7
br label %76
69: ; preds = %63
%70 = load float, float* %11
%71 = fcmp olt float %70, 6.000000e+00
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load float, float* %8
store float %73, float* %5
store float 0.000000e+00, float* %6
%74 = load float, float* %9
store float %74, float* %7
br label %75
75: ; preds = %72, %69
br label %76
76: ; preds = %75, %66
br label %77
77: ; preds = %76, %60
br label %78
78: ; preds = %77, %54
br label %79
79: ; preds = %78, %48
br label %80
80: ; preds = %79, %42
%81 = load float, float* %13
%82 = fpext float %81 to double
%83 = load float, float* %8
%84 = fpext float %83 to double
%85 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %84, double %82)
%86 = fptrunc double %85 to float
store float %86, float* %10
%87 = load float, float* %5
%88 = load float, float* %10
%89 = fadd float %87, %88
%90 = load float*, float** %4
%91 = getelementptr inbounds float, float* %90, i64 0
store float %89, float* %91
%92 = load float, float* %6
%93 = load float, float* %10
%94 = fadd float %92, %93
%95 = load float*, float** %4
%96 = getelementptr inbounds float, float* %95, i64 1
store float %94, float* %96
%97 = load float, float* %7
%98 = load float, float* %10
%99 = fadd float %97, %98
%100 = load float*, float** %4
%101 = getelementptr inbounds float, float* %100, i64 2
store float %99, float* %101
ret void
}

LLVM IR (-O2):
define void @hsl_to_rgb_f(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fdiv float %3, 6.000000e+01
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float 2.000000e+00, float -1.000000e+00)
%10 = fptosi float %9 to i32
%11 = tail call i32 @fabs(i32 %10)
%12 = sub nsw i32 1, %11
%13 = sitofp i32 %12 to float
%14 = fmul float %6, %13
%15 = tail call i32 @fmod(float %4, i32 2)
%16 = add nsw i32 %15, -1
%17 = tail call i32 @fabs(i32 %16)
%18 = sub nsw i32 1, %17
%19 = sitofp i32 %18 to float
%20 = fmul float %14, %19
%21 = fcmp olt float %4, 1.000000e+00
br i1 %21, label %33, label %22
22: ; preds = %2
%23 = fcmp olt float %4, 2.000000e+00
br i1 %23, label %33, label %24
24: ; preds = %22
%25 = fcmp olt float %4, 3.000000e+00
br i1 %25, label %33, label %26
26: ; preds = %24
%27 = fcmp olt float %4, 4.000000e+00
br i1 %27, label %33, label %28
28: ; preds = %26
%29 = fcmp olt float %4, 5.000000e+00
br i1 %29, label %33, label %30
30: ; preds = %28
%31 = fcmp olt float %4, 6.000000e+00
br i1 %31, label %32, label %33
32: ; preds = %30
br label %33
33: ; preds = %28, %26, %24, %22, %2, %30, %32
%34 = phi float [ %20, %32 ], [ 0.000000e+00, %30 ], [ 0.000000e+00, %2 ], [ 0.000000e+00, %22 ], [ %20, %24 ], [ %14, %26 ], [ %14, %28 ]
%35 = phi float [ 0.000000e+00, %32 ], [ 0.000000e+00, %30 ], [ %20, %2 ], [ %14, %22 ], [ %14, %24 ], [ %20, %26 ], [ 0.000000e+00, %28 ]
%36 = phi float [ %14, %32 ], [ 0.000000e+00, %30 ], [ %14, %2 ], [ %20, %22 ], [ 0.000000e+00, %24 ], [ 0.000000e+00, %26 ], [ %20, %28 ]
%37 = fpext float %8 to double
%38 = fpext float %14 to double
%39 = tail call double @llvm.fmuladd.f64(double %38, double -5.000000e-01, double %37)
%40 = fptrunc double %39 to float
%41 = fadd float %36, %40
store float %41, float* %1
%42 = fadd float %35, %40
%43 = getelementptr inbounds float, float* %1, i64 1
store float %42, float* %43
%44 = fadd float %34, %40
%45 = getelementptr inbounds float, float* %1, i64 2
store float %44, float* %45
ret void
}