#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 */
struct rgb {
  int dummy;
};

/* Variables and functions */
double fabs(scalar_t__);
double fabsf(int);
scalar_t__ fmod(double, int);
int /*<<< orphan*/ rgb_create(double, double, double, struct rgb *);
void rgb_from_hsl(double h, double s, double l, struct rgb *to) {
  double c = 0.0, m = 0.0, x = 0.0;
  c = (1.0 - fabsf(2 * l - 1.0)) * s;
  m = 1.0 * (l - 0.5 * c);
  x = c * (1.0 - fabs(fmod(h / 60.0, 2) - 1.0));
  if (h >= 0.0 && h < (360.0 / 6.0)) {
    rgb_create(c + m, x + m, m, to);
  } else if (h >= (360.0 / 6.0) && h < (360.0 / 3.0)) {
    rgb_create(x + m, c + m, m, to);
  } else if (h < (360.0 / 3.0) && h < (360.0 / 2.0)) {
    rgb_create(m, c + m, x + m, to);
  } else if (h >= (360.0 / 2.0) && h < (2.0f * 360.0 / 3.0)) {
    rgb_create(m, x + m, c + m, to);
  } else if (h >= (2.0 * 360.0 / 3.0) && h < (5.0 * 360.0 / 6.0)) {
    rgb_create(x + m, m, c + m, to);
  } else if (h >= (5.0 * 360.0 / 6.0) && h < 360.0) {
    rgb_create(c + m, m, x + m, to);
  } else {
    rgb_create(m, m, m, to);
  }
}


x86 assembly (clang, -O0):
<rgb_from_hsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe94(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabsf@plt>
movaps %xmm0,%xmm1
movsd  0xe64(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe54(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe34(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe1c(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1040 <fmod@plt>
cvtsi2sd %rax,%xmm0
movsd  0xdf9(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <fabs@plt>
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movsd  0xddb(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     127e <rgb_from_hsl+0x13e>
movsd  0xdbc(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    127e <rgb_from_hsl+0x13e>
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1060 <rgb_create@plt>
jmp    1440 <rgb_from_hsl+0x300>
movsd  -0x8(%rbp),%xmm0
movsd  0xd7d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12cf <rgb_from_hsl+0x18f>
movsd  0xd83(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    12cf <rgb_from_hsl+0x18f>
movsd  -0x38(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1060 <rgb_create@plt>
jmp    143b <rgb_from_hsl+0x2fb>
movsd  0xd49(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    131c <rgb_from_hsl+0x1dc>
movsd  0xd3e(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    131c <rgb_from_hsl+0x1dc>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1060 <rgb_create@plt>
jmp    1436 <rgb_from_hsl+0x2f6>
movsd  -0x8(%rbp),%xmm0
movsd  0xcff(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     136d <rgb_from_hsl+0x22d>
movsd  0xcf5(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    136d <rgb_from_hsl+0x22d>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1060 <rgb_create@plt>
jmp    1431 <rgb_from_hsl+0x2f1>
movsd  -0x8(%rbp),%xmm0
movsd  0xcb6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     13be <rgb_from_hsl+0x27e>
movsd  0xcac(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    13be <rgb_from_hsl+0x27e>
movsd  -0x38(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1060 <rgb_create@plt>
jmp    142c <rgb_from_hsl+0x2ec>
movsd  -0x8(%rbp),%xmm0
movsd  0xc6d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     140f <rgb_from_hsl+0x2cf>
movsd  0xc63(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    140f <rgb_from_hsl+0x2cf>
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1060 <rgb_create@plt>
jmp    1427 <rgb_from_hsl+0x2e7>
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1060 <rgb_create@plt>
jmp    142c <rgb_from_hsl+0x2ec>
jmp    1431 <rgb_from_hsl+0x2f1>
jmp    1436 <rgb_from_hsl+0x2f6>
jmp    143b <rgb_from_hsl+0x2fb>
jmp    1440 <rgb_from_hsl+0x300>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_from_hsl>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
addsd  0xe96(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabsf@plt>
movsd  0xe8d(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0xe67(%rip),%xmm0
mov    $0x2,%edi
call   1040 <fmod@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xe35(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <fabs@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm3
movsd  0xe1f(%rip),%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1224 <rgb_from_hsl+0xe4>
movsd  0xe15(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1224 <rgb_from_hsl+0xe4>
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm3
addsd  %xmm2,%xmm4
movapd %xmm3,%xmm0
movapd %xmm4,%xmm1
jmp    132b <rgb_from_hsl+0x1eb>
ucomisd 0xdec(%rip),%xmm1
jb     1257 <rgb_from_hsl+0x117>
movsd  0xdea(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1257 <rgb_from_hsl+0x117>
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm4
addsd  %xmm2,%xmm3
movapd %xmm4,%xmm0
movapd %xmm3,%xmm1
jmp    132b <rgb_from_hsl+0x1eb>
movsd  0xdc1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    128e <rgb_from_hsl+0x14e>
movsd  0xdbb(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    128e <rgb_from_hsl+0x14e>
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm3
addsd  %xmm0,%xmm4
movapd %xmm3,%xmm1
movapd %xmm4,%xmm2
jmp    132b <rgb_from_hsl+0x1eb>
ucomisd 0xd92(%rip),%xmm1
jb     12be <rgb_from_hsl+0x17e>
movsd  0xd90(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12be <rgb_from_hsl+0x17e>
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm4
addsd  %xmm0,%xmm3
movapd %xmm4,%xmm1
movapd %xmm3,%xmm2
jmp    132b <rgb_from_hsl+0x1eb>
ucomisd 0xd6a(%rip),%xmm1
jb     12ee <rgb_from_hsl+0x1ae>
movsd  0xd68(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12ee <rgb_from_hsl+0x1ae>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm4
addsd  %xmm1,%xmm3
movapd %xmm4,%xmm0
movapd %xmm3,%xmm2
jmp    132b <rgb_from_hsl+0x1eb>
ucomisd 0xd42(%rip),%xmm1
jb     131d <rgb_from_hsl+0x1dd>
movsd  0xd40(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    131d <rgb_from_hsl+0x1dd>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm3
addsd  %xmm1,%xmm4
movapd %xmm3,%xmm0
jmp    1285 <rgb_from_hsl+0x145>
movsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm1
movapd %xmm0,%xmm2
mov    %rbx,%rdi
add    $0x20,%rsp
pop    %rbx
jmp    1060 <rgb_create@plt>

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

LLVM IR (-O2):
%struct.rgb = type { i32 }
define void @rgb_from_hsl(double %0, double %1, double %2, %struct.rgb* %3) {
%5 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double -1.000000e+00)
%6 = fptosi double %5 to i32
%7 = tail call double @fabsf(i32 %6)
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %8, %1
%10 = tail call double @llvm.fmuladd.f64(double %9, double -5.000000e-01, double %2)
%11 = fdiv double %0, 6.000000e+01
%12 = tail call i64 @fmod(double %11, i32 2)
%13 = sitofp i64 %12 to double
%14 = fadd double %13, -1.000000e+00
%15 = fptosi double %14 to i64
%16 = tail call double @fabs(i64 %15)
%17 = fsub double 1.000000e+00, %16
%18 = fmul double %9, %17
%19 = fcmp oge double %0, 0.000000e+00
%20 = fcmp olt double %0, 6.000000e+01
%21 = and i1 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %4
%23 = fadd double %9, %10
%24 = fadd double %10, %18
%25 = tail call i32 @rgb_create(double %23, double %24, double %10, %struct.rgb* %3)
br label %67
26: ; preds = %4
%27 = fcmp oge double %0, 6.000000e+01
%28 = fcmp olt double %0, 1.200000e+02
%29 = and i1 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = fadd double %10, %18
%32 = fadd double %9, %10
%33 = tail call i32 @rgb_create(double %31, double %32, double %10, %struct.rgb* %3)
br label %67
34: ; preds = %26
%35 = fcmp olt double %0, 1.800000e+02
%36 = and i1 %28, %35
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = fadd double %9, %10
%39 = fadd double %10, %18
%40 = tail call i32 @rgb_create(double %10, double %38, double %39, %struct.rgb* %3)
br label %67
41: ; preds = %34
%42 = fcmp oge double %0, 1.800000e+02
%43 = fcmp olt double %0, 2.400000e+02
%44 = and i1 %42, %43
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = fadd double %10, %18
%47 = fadd double %9, %10
%48 = tail call i32 @rgb_create(double %10, double %46, double %47, %struct.rgb* %3)
br label %67
49: ; preds = %41
%50 = fcmp oge double %0, 2.400000e+02
%51 = fcmp olt double %0, 3.000000e+02
%52 = and i1 %50, %51
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = fadd double %10, %18
%55 = fadd double %9, %10
%56 = tail call i32 @rgb_create(double %54, double %10, double %55, %struct.rgb* %3)
br label %67
57: ; preds = %49
%58 = fcmp oge double %0, 3.000000e+02
%59 = fcmp olt double %0, 3.600000e+02
%60 = and i1 %58, %59
br i1 %60, label %61, label %65
61: ; preds = %57
%62 = fadd double %9, %10
%63 = fadd double %10, %18
%64 = tail call i32 @rgb_create(double %62, double %10, double %63, %struct.rgb* %3)
br label %67
65: ; preds = %57
%66 = tail call i32 @rgb_create(double %10, double %10, double %10, %struct.rgb* %3)
br label %67
67: ; preds = %30, %45, %61, %65, %53, %37, %22
ret void
}