#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 /*<<< orphan*/ H360S1V1toHSV255(double, double, double, double *, double *,
                                    double *);
int /*<<< orphan*/ HSV255toH360S1V1(double, double, double, double *, double *,
                                    double *);
int /*<<< orphan*/ HSVtoRGBPat(double *, double *, double *, double, double,
                               double);
int /*<<< orphan*/ RGB0255toRGB01(int, int, int, double *, double *, double *);
int /*<<< orphan*/ RGBtoHSVPat(double, double, double, double *, double *,
                               double *);
int /*<<< orphan*/ printf(char *, double, double, double);
void couleur_test1() {
  double c1, c2, c3, c4, c5, c6;
  printf("RGB0255 %lf %lf %lf\n", 0., 0., 255.);
  RGB0255toRGB01(0., 0., 255., &c1, &c2, &c3);
  printf("RGB01 %lf %lf %lf\n", c1, c2, c3);
  RGBtoHSVPat(c1, c2, c3, &c4, &c5, &c6);
  printf("RGBtoHSV %lf %lf %lf\n", c4, c5, c6);
  H360S1V1toHSV255(c4, c5, c6, &c1, &c2, &c3);
  printf("H360S1V1toHSV255 %lf %lf %lf\n", c1, c2, c3);
  HSV255toH360S1V1(c1, c2, c3, &c4, &c5, &c6);
  printf("HSV255toH360S1V1 %lf %lf %lf\n", c4, c5, c6);
  HSVtoRGBPat(&c1, &c2, &c3, c4, c5, c6);
  printf("HSVtoRGB01 %lf %lf %lf\n", c1, c2, c3);
}


x86 assembly (clang, -O0):
<couleur_test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xe99(%rip),%rdi
xorps  %xmm1,%xmm1
movsd  0xe86(%rip),%xmm2
movaps %xmm1,%xmm0
call   1030 <printf@plt>
xor    %esi,%esi
mov    $0xff,%edx
lea    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%r8
lea    -0x18(%rbp),%r9
mov    %esi,%edi
call   1080 <RGB0255toRGB01@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1070 <RGBtoHSVPat@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <H360S1V1toHSV255@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1050 <HSV255toH360S1V1@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <HSVtoRGBPat@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xdd1(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<couleur_test1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe93(%rip),%rdi
movsd  0xe83(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1030 <printf@plt>
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%r15
xor    %edi,%edi
xor    %esi,%esi
mov    $0xff,%edx
mov    %r12,%rcx
mov    %r14,%r8
mov    %r15,%r9
call   1080 <RGB0255toRGB01@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
lea    0x30(%rsp),%rbx
lea    0x28(%rsp),%r13
lea    0x20(%rsp),%rbp
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1070 <RGBtoHSVPat@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
lea    0xe09(%rip),%rdi
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <H360S1V1toHSV255@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
lea    0xde1(%rip),%rdi
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1050 <HSV255toH360S1V1@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
lea    0xdc1(%rip),%rdi
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <HSVtoRGBPat@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
lea    0xda1(%rip),%rdi
call   1030 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"RGB0255 %lf %lf %lf\0A\00"
@.str.1 = [19 x i8] c"RGB01 %lf %lf %lf\0A\00"
@.str.2 = [22 x i8] c"RGBtoHSV %lf %lf %lf\0A\00"
@.str.3 = [30 x i8] c"H360S1V1toHSV255 %lf %lf %lf\0A\00"
@.str.4 = [30 x i8] c"HSV255toH360S1V1 %lf %lf %lf\0A\00"
@.str.5 = [24 x i8] c"HSVtoRGB01 %lf %lf %lf\0A\00"
define void @couleur_test1() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double 0.000000e+00, double 0.000000e+00, double 2.550000e+02)
%8 = call i32 @RGB0255toRGB01(i32 0, i32 0, i32 255, double* %1, double* %2, double* %3)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = load double, double* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %9, double %10, double %11)
%13 = load double, double* %1
%14 = load double, double* %2
%15 = load double, double* %3
%16 = call i32 @RGBtoHSVPat(double %13, double %14, double %15, double* %4, double* %5, double* %6)
%17 = load double, double* %4
%18 = load double, double* %5
%19 = load double, double* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %17, double %18, double %19)
%21 = load double, double* %4
%22 = load double, double* %5
%23 = load double, double* %6
%24 = call i32 @H360S1V1toHSV255(double %21, double %22, double %23, double* %1, double* %2, double* %3)
%25 = load double, double* %1
%26 = load double, double* %2
%27 = load double, double* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %25, double %26, double %27)
%29 = load double, double* %1
%30 = load double, double* %2
%31 = load double, double* %3
%32 = call i32 @HSV255toH360S1V1(double %29, double %30, double %31, double* %4, double* %5, double* %6)
%33 = load double, double* %4
%34 = load double, double* %5
%35 = load double, double* %6
%36 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %33, double %34, double %35)
%37 = load double, double* %4
%38 = load double, double* %5
%39 = load double, double* %6
%40 = call i32 @HSVtoRGBPat(double* %1, double* %2, double* %3, double %37, double %38, double %39)
%41 = load double, double* %1
%42 = load double, double* %2
%43 = load double, double* %3
%44 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), double %41, double %42, double %43)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"RGB0255 %lf %lf %lf\0A\00"
@.str.1 = [19 x i8] c"RGB01 %lf %lf %lf\0A\00"
@.str.2 = [22 x i8] c"RGBtoHSV %lf %lf %lf\0A\00"
@.str.3 = [30 x i8] c"H360S1V1toHSV255 %lf %lf %lf\0A\00"
@.str.4 = [30 x i8] c"HSV255toH360S1V1 %lf %lf %lf\0A\00"
@.str.5 = [24 x i8] c"HSVtoRGB01 %lf %lf %lf\0A\00"
define void @couleur_test1() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %1 to i8*
%8 = bitcast double* %2 to i8*
%9 = bitcast double* %3 to i8*
%10 = bitcast double* %4 to i8*
%11 = bitcast double* %5 to i8*
%12 = bitcast double* %6 to i8*
%13 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double 0.000000e+00, double 0.000000e+00, double 2.550000e+02)
%14 = call i32 @RGB0255toRGB01(i32 0, i32 0, i32 255, double* %1, double* %2, double* %3)
%15 = load double, double* %1
%16 = load double, double* %2
%17 = load double, double* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %15, double %16, double %17)
%19 = load double, double* %1
%20 = load double, double* %2
%21 = load double, double* %3
%22 = call i32 @RGBtoHSVPat(double %19, double %20, double %21, double* %4, double* %5, double* %6)
%23 = load double, double* %4
%24 = load double, double* %5
%25 = load double, double* %6
%26 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %23, double %24, double %25)
%27 = load double, double* %4
%28 = load double, double* %5
%29 = load double, double* %6
%30 = call i32 @H360S1V1toHSV255(double %27, double %28, double %29, double* %1, double* %2, double* %3)
%31 = load double, double* %1
%32 = load double, double* %2
%33 = load double, double* %3
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %31, double %32, double %33)
%35 = load double, double* %1
%36 = load double, double* %2
%37 = load double, double* %3
%38 = call i32 @HSV255toH360S1V1(double %35, double %36, double %37, double* %4, double* %5, double* %6)
%39 = load double, double* %4
%40 = load double, double* %5
%41 = load double, double* %6
%42 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %39, double %40, double %41)
%43 = load double, double* %4
%44 = load double, double* %5
%45 = load double, double* %6
%46 = call i32 @HSVtoRGBPat(double* %1, double* %2, double* %3, double %43, double %44, double %45)
%47 = load double, double* %1
%48 = load double, double* %2
%49 = load double, double* %3
%50 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), double %47, double %48, double %49)
ret void
}