#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*/ iColorHSI2RGB(float, float, float, float *, float *,
                                 float *);
unsigned char iColorQuantize(float);
void iupColorHSI2RGB(float h, float s, float i, unsigned char *r,
                     unsigned char *g, unsigned char *b) {
  float fr, fg, fb;
  iColorHSI2RGB(h, s, i, &fr, &fg, &fb);
  *r = iColorQuantize(fr);
  *g = iColorQuantize(fg);
  *b = iColorQuantize(fb);
}


x86 assembly (clang, -O0):
<iupColorHSI2RGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    -0x2c(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x34(%rbp),%rdx
call   1030 <iColorHSI2RGB@plt>
movss  -0x2c(%rbp),%xmm0
call   1040 <iColorQuantize@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movss  -0x30(%rbp),%xmm0
call   1040 <iColorQuantize@plt>
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movss  -0x34(%rbp),%xmm0
call   1040 <iColorQuantize@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupColorHSI2RGB>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <iColorHSI2RGB@plt>
movss  0xc(%rsp),%xmm0
call   1040 <iColorQuantize@plt>
mov    %al,(%rbx)
movss  0x8(%rsp),%xmm0
call   1040 <iColorQuantize@plt>
mov    %al,(%r15)
movss  0x4(%rsp),%xmm0
call   1040 <iColorQuantize@plt>
mov    %al,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @iupColorHSI2RGB(float %0, float %1, float %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca float
%14 = alloca float
%15 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%16 = load float, float* %7
%17 = load float, float* %8
%18 = load float, float* %9
%19 = call i32 @iColorHSI2RGB(float %16, float %17, float %18, float* %13, float* %14, float* %15)
%20 = load float, float* %13
%21 = call zeroext i8 @iColorQuantize(float %20)
%22 = load i8*, i8** %10
store i8 %21, i8* %22
%23 = load float, float* %14
%24 = call zeroext i8 @iColorQuantize(float %23)
%25 = load i8*, i8** %11
store i8 %24, i8* %25
%26 = load float, float* %15
%27 = call zeroext i8 @iColorQuantize(float %26)
%28 = load i8*, i8** %12
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @iupColorHSI2RGB(float %0, float %1, float %2, i8* nocapture writeonly %3, i8* nocapture writeonly %4, i8* nocapture writeonly %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = bitcast float* %7 to i8*
%11 = bitcast float* %8 to i8*
%12 = bitcast float* %9 to i8*
%13 = call i32 @iColorHSI2RGB(float %0, float %1, float %2, float* %7, float* %8, float* %9)
%14 = load float, float* %7
%15 = call zeroext i8 @iColorQuantize(float %14)
store i8 %15, i8* %3
%16 = load float, float* %8
%17 = call zeroext i8 @iColorQuantize(float %16)
store i8 %17, i8* %4
%18 = load float, float* %9
%19 = call zeroext i8 @iColorQuantize(float %18)
store i8 %19, i8* %5
ret void
}