#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 */
typedef double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_AMBIENT_AND_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
double Random();
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
void RandomColor(void) {
  GLfloat c[4];
  c[0] = Random();
  c[1] = Random();
  c[2] = Random();
  c[3] = 1.0;
  glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, c);
}


x86 assembly (clang, -O0):
<RandomColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <Random@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <Random@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <Random@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1040 <glMaterialfv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomColor>:
sub    $0x28,%rsp
xor    %eax,%eax
call   1030 <Random@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <Random@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <Random@plt>
movsd  %xmm0,0x10(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x18(%rsp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1040 <glMaterialfv@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@GL_FRONT = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
define void @RandomColor() {
%1 = alloca [4 x double]
%2 = call double (...) @Random()
%3 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
store double %2, double* %3
%4 = call double (...) @Random()
%5 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 1
store double %4, double* %5
%6 = call double (...) @Random()
%7 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 2
store double %6, double* %7
%8 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 3
store double 1.000000e+00, double* %8
%9 = load i32, i32* @GL_FRONT
%10 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%12 = call i32 @glMaterialfv(i32 %9, i32 %10, double* %11)
ret void
}

LLVM IR (-O2):
@GL_FRONT = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
define void @RandomColor() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = tail call double (...) @Random()
%4 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
store double %3, double* %4
%5 = tail call double (...) @Random()
%6 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 1
store double %5, double* %6
%7 = tail call double (...) @Random()
%8 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 2
store double %7, double* %8
%9 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 3
store double 1.000000e+00, double* %9
%10 = load i32, i32* @GL_FRONT
%11 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%12 = call i32 @glMaterialfv(i32 %10, i32 %11, double* %4)
ret void
}