#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 sscanf(char const *, char *, float *, float *, float *);
int iupStrToHSI(const char *str, float *h, float *s, float *i) {
  float fh, fs, fi;
  if (!str)
    return 0;
  if (sscanf(str, "%f %f %f", &fh, &fs, &fi) != 3)
    return 0;
  if (fh > 359 || fs > 1 || fi > 1)
    return 0;
  if (fh < 0 || fs < 0 || fi < 0)
    return 0;
  *h = fh;
  *s = fs;
  *i = fi;
  return 1;
}


x86 assembly (clang, -O0):
<iupStrToHSI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113f <iupStrToHSI+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    121f <iupStrToHSI+0x10f>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x34(%rbp),%r8
call   1030 <sscanf@plt>
cmp    $0x3,%eax
je     1170 <iupStrToHSI+0x60>
movl   $0x0,-0x4(%rbp)
jmp    121f <iupStrToHSI+0x10f>
movss  -0x2c(%rbp),%xmm0
movss  0xe83(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     11b2 <iupStrToHSI+0xa2>
movss  -0x30(%rbp),%xmm0
movss  0xe71(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     11b2 <iupStrToHSI+0xa2>
movss  -0x34(%rbp),%xmm0
movss  0xe5b(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11be <iupStrToHSI+0xae>
movl   $0x0,-0x4(%rbp)
jmp    121f <iupStrToHSI+0x10f>
xorps  %xmm0,%xmm0
ucomiss -0x2c(%rbp),%xmm0
ja     11e5 <iupStrToHSI+0xd5>
xorps  %xmm0,%xmm0
ucomiss -0x30(%rbp),%xmm0
ja     11e5 <iupStrToHSI+0xd5>
xorps  %xmm0,%xmm0
ucomiss -0x34(%rbp),%xmm0
jbe    11f1 <iupStrToHSI+0xe1>
movl   $0x0,-0x4(%rbp)
jmp    121f <iupStrToHSI+0x10f>
movss  -0x2c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x34(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrToHSI>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %ebx,%ebx
test   %rdi,%rdi
je     11a6 <iupStrToHSI+0x96>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
lea    0xed2(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <sscanf@plt>
cmp    $0x3,%eax
jne    11a6 <iupStrToHSI+0x96>
movss  0x14(%rsp),%xmm0
ucomiss 0xea4(%rip),%xmm0
ja     11a6 <iupStrToHSI+0x96>
movss  0x10(%rsp),%xmm1
ucomiss 0xe99(%rip),%xmm1
ja     11a6 <iupStrToHSI+0x96>
movss  0xc(%rsp),%xmm2
ucomiss 0xe8a(%rip),%xmm2
ja     11a6 <iupStrToHSI+0x96>
xorps  %xmm3,%xmm3
ucomiss %xmm0,%xmm3
ja     11a6 <iupStrToHSI+0x96>
ucomiss %xmm1,%xmm3
ja     11a6 <iupStrToHSI+0x96>
xorps  %xmm3,%xmm3
ucomiss %xmm2,%xmm3
ja     11a6 <iupStrToHSI+0x96>
movss  %xmm0,(%r12)
movss  %xmm1,(%r15)
movss  %xmm2,(%r14)
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%f %f %f\00"
define i32 @iupStrToHSI(i8* %0, float* %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float
%11 = alloca float
%12 = alloca float
store i8* %0, i8** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %16, label %15
15: ; preds = %4
store i32 0, i32* %5
br label %48
16: ; preds = %4
%17 = load i8*, i8** %6
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %10, float* %11, float* %12)
%19 = icmp ne i32 %18, 3
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %5
br label %48
21: ; preds = %16
%22 = load float, float* %10
%23 = fcmp ogt float %22, 3.590000e+02
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load float, float* %11
%26 = fcmp ogt float %25, 1.000000e+00
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load float, float* %12
%29 = fcmp ogt float %28, 1.000000e+00
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %21
store i32 0, i32* %5
br label %48
31: ; preds = %27
%32 = load float, float* %10
%33 = fcmp olt float %32, 0.000000e+00
br i1 %33, label %40, label %34
34: ; preds = %31
%35 = load float, float* %11
%36 = fcmp olt float %35, 0.000000e+00
br i1 %36, label %40, label %37
37: ; preds = %34
%38 = load float, float* %12
%39 = fcmp olt float %38, 0.000000e+00
br i1 %39, label %40, label %41
40: ; preds = %37, %34, %31
store i32 0, i32* %5
br label %48
41: ; preds = %37
%42 = load float, float* %10
%43 = load float*, float** %7
store float %42, float* %43
%44 = load float, float* %11
%45 = load float*, float** %8
store float %44, float* %45
%46 = load float, float* %12
%47 = load float*, float** %9
store float %46, float* %47
store i32 1, i32* %5
br label %48
48: ; preds = %41, %40, %30, %20, %15
%49 = load i32, i32* %5
ret i32 %49
}

LLVM IR (-O2):
@.str = [9 x i8] c"%f %f %f\00"
define i32 @iupStrToHSI(i8* %0, float* nocapture writeonly %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = bitcast float* %5 to i8*
%9 = bitcast float* %6 to i8*
%10 = bitcast float* %7 to i8*
%11 = icmp eq i8* %0, null
br i1 %11, label %31, label %12
12: ; preds = %4
%13 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %5, float* %6, float* %7)
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %31
15: ; preds = %12
%16 = load float, float* %5
%17 = fcmp ogt float %16, 3.590000e+02
%18 = load float, float* %6
%19 = fcmp ogt float %18, 1.000000e+00
%20 = select i1 %17, i1 true, i1 %19
%21 = load float, float* %7
%22 = fcmp ogt float %21, 1.000000e+00
%23 = select i1 %20, i1 true, i1 %22
br i1 %23, label %31, label %24
24: ; preds = %15
%25 = fcmp olt float %16, 0.000000e+00
%26 = fcmp olt float %18, 0.000000e+00
%27 = select i1 %25, i1 true, i1 %26
%28 = fcmp olt float %21, 0.000000e+00
%29 = select i1 %27, i1 true, i1 %28
br i1 %29, label %31, label %30
30: ; preds = %24
store float %16, float* %1
store float %18, float* %2
store float %21, float* %3
br label %31
31: ; preds = %24, %15, %12, %4, %30
%32 = phi i32 [ 1, %30 ], [ 0, %4 ], [ 0, %12 ], [ 0, %15 ], [ 0, %24 ]
ret i32 %32
}