#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 */
scalar_t__ colorResolveB(char const *, unsigned char *, unsigned char *,
                         unsigned char *);
int colorResolveF(const char *name, float *r, float *g, float *b) {
  unsigned char cr, cg, cb;
  if (colorResolveB(name, &cr, &cg, &cb) < 0)
    return -1;
  (*r) = (float)cr / 255.0;
  (*g) = (float)cg / 255.0;
  (*b) = (float)cb / 255.0;
  return 0;
}


x86 assembly (clang, -O0):
<colorResolveF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x29(%rbp),%rsi
lea    -0x2a(%rbp),%rdx
lea    -0x2b(%rbp),%rcx
call   1030 <colorResolveB@plt>
cmp    $0x0,%rax
jge    1153 <colorResolveF+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    11be <colorResolveF+0xae>
movzbl -0x29(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movzbl -0x2a(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movzbl -0x2b(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe59(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorResolveF>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
lea    0xf(%rsp),%rsi
lea    0xe(%rsp),%rdx
lea    0xd(%rsp),%rcx
call   1030 <colorResolveB@plt>
test   %rax,%rax
js     118e <colorResolveF+0x7e>
movzbl 0xf(%rsp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeb4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movzbl 0xe(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15)
movzbl 0xd(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
xor    %eax,%eax
jmp    1193 <colorResolveF+0x83>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @colorResolveF(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 i8
%11 = alloca i8
%12 = alloca i8
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 = call i64 @colorResolveB(i8* %13, i8* %10, i8* %11, i8* %12)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 -1, i32* %5
br label %36
17: ; preds = %4
%18 = load i8, i8* %10
%19 = uitofp i8 %18 to float
%20 = fpext float %19 to double
%21 = fdiv double %20, 2.550000e+02
%22 = fptrunc double %21 to float
%23 = load float*, float** %7
store float %22, float* %23
%24 = load i8, i8* %11
%25 = uitofp i8 %24 to float
%26 = fpext float %25 to double
%27 = fdiv double %26, 2.550000e+02
%28 = fptrunc double %27 to float
%29 = load float*, float** %8
store float %28, float* %29
%30 = load i8, i8* %12
%31 = uitofp i8 %30 to float
%32 = fpext float %31 to double
%33 = fdiv double %32, 2.550000e+02
%34 = fptrunc double %33 to float
%35 = load float*, float** %9
store float %34, float* %35
store i32 0, i32* %5
br label %36
36: ; preds = %17, %16
%37 = load i32, i32* %5
ret i32 %37
}

LLVM IR (-O2):
define i32 @colorResolveF(i8* %0, float* nocapture writeonly %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = call i64 @colorResolveB(i8* %0, i8* %5, i8* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %4
%11 = load i8, i8* %5
%12 = uitofp i8 %11 to double
%13 = fdiv double %12, 2.550000e+02
%14 = fptrunc double %13 to float
store float %14, float* %1
%15 = load i8, i8* %6
%16 = uitofp i8 %15 to double
%17 = fdiv double %16, 2.550000e+02
%18 = fptrunc double %17 to float
store float %18, float* %2
%19 = load i8, i8* %7
%20 = uitofp i8 %19 to double
%21 = fdiv double %20, 2.550000e+02
%22 = fptrunc double %21 to float
store float %22, float* %3
br label %23
23: ; preds = %4, %10
%24 = phi i32 [ 0, %10 ], [ -1, %4 ]
ret i32 %24
}