#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 material_table {
  int dummy;
};

/* Variables and functions */
scalar_t__ error();
int get_color_number(struct material_table *, char *);
int /*<<< orphan*/ number_to_rgb(struct material_table *, int, double *,
                                 double *, double *);
void name_to_rgb(struct material_table *table, char *color_name, double *red,
                 double *green, double *blue) {
  int hue;
  hue = get_color_number(table, color_name);
  if (error())
    return;
  number_to_rgb(table, hue, red, green, blue);
}


x86 assembly (clang, -O0):
<name_to_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_color_number@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1050 <error@plt>
cmp    $0x0,%rax
je     1172 <name_to_rgb+0x42>
jmp    118a <name_to_rgb+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <number_to_rgb@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_to_rgb>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%rbx
call   1030 <get_color_number@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <error@plt>
test   %rax,%rax
je     1160 <name_to_rgb+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <number_to_rgb@plt>

LLVM IR (-O0):
%struct.material_table = type { i32 }
define void @name_to_rgb(%struct.material_table* %0, i8* %1, double* %2, double* %3, double* %4) {
%6 = alloca %struct.material_table*
%7 = alloca i8*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
store %struct.material_table* %0, %struct.material_table** %6
store i8* %1, i8** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%12 = load %struct.material_table*, %struct.material_table** %6
%13 = load i8*, i8** %7
%14 = call i32 @get_color_number(%struct.material_table* %12, i8* %13)
store i32 %14, i32* %11
%15 = call i64 (...) @error()
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %5
br label %25
18: ; preds = %5
%19 = load %struct.material_table*, %struct.material_table** %6
%20 = load i32, i32* %11
%21 = load double*, double** %8
%22 = load double*, double** %9
%23 = load double*, double** %10
%24 = call i32 @number_to_rgb(%struct.material_table* %19, i32 %20, double* %21, double* %22, double* %23)
br label %25
25: ; preds = %18, %17
ret void
}

LLVM IR (-O2):
%struct.material_table = type { i32 }
define void @name_to_rgb(%struct.material_table* %0, i8* %1, double* %2, double* %3, double* %4) {
%6 = tail call i32 @get_color_number(%struct.material_table* %0, i8* %1)
%7 = tail call i64 (...) @error()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @number_to_rgb(%struct.material_table* %0, i32 %6, double* %2, double* %3, double* %4)
br label %11
11: ; preds = %5, %9
ret void
}