#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 int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_AMBIENT;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ glVertex3f(double, double, double);
void drawFloor(GLfloat f_color[4], GLfloat ambient[4]) {
  glMaterialfv(GL_FRONT, GL_DIFFUSE, f_color);
  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
  glBegin(GL_QUADS);
  glVertex3f(-1.0, -1.0, 0.0);
  glVertex3f(1.0, -1.0, 0.0);
  glVertex3f(1.0, 1.0, 0.0);
  glVertex3f(-1.0, 1.0, 0.0);
  glEnd();
}


x86 assembly (clang, -O0):
<drawFloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
mov    0x2e75(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xe64(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1030 <glVertex3f@plt>
movsd  0xe59(%rip),%xmm0
movsd  0xe49(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
movsd  0xe41(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1030 <glVertex3f@plt>
movsd  0xe26(%rip),%xmm0
movsd  0xe26(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawFloor>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2e8f(%rip),%r14
mov    (%r14),%edi
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
call   1050 <glMaterialfv@plt>
mov    (%r14),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xe74(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
call   1030 <glVertex3f@plt>
movsd  0xe69(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xe56(%rip),%xmm1
call   1030 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movsd  0xe4e(%rip),%xmm0
movaps %xmm0,%xmm1
call   1030 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movsd  0xe33(%rip),%xmm0
movsd  0xe33(%rip),%xmm1
call   1030 <glVertex3f@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_AMBIENT = global i32 0
@GL_QUADS = global i32 0
define void @drawFloor(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @GL_FRONT
%6 = load i32, i32* @GL_DIFFUSE
%7 = load i32*, i32** %3
%8 = call i32 @glMaterialfv(i32 %5, i32 %6, i32* %7)
%9 = load i32, i32* @GL_FRONT
%10 = load i32, i32* @GL_AMBIENT
%11 = load i32*, i32** %4
%12 = call i32 @glMaterialfv(i32 %9, i32 %10, i32* %11)
%13 = load i32, i32* @GL_QUADS
%14 = call i32 @glBegin(i32 %13)
%15 = call i32 @glVertex3f(double -1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%16 = call i32 @glVertex3f(double 1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%17 = call i32 @glVertex3f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%18 = call i32 @glVertex3f(double -1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%19 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_AMBIENT = global i32 0
@GL_QUADS = global i32 0
define void @drawFloor(i32* %0, i32* %1) {
%3 = load i32, i32* @GL_FRONT
%4 = load i32, i32* @GL_DIFFUSE
%5 = tail call i32 @glMaterialfv(i32 %3, i32 %4, i32* %0)
%6 = load i32, i32* @GL_FRONT
%7 = load i32, i32* @GL_AMBIENT
%8 = tail call i32 @glMaterialfv(i32 %6, i32 %7, i32* %1)
%9 = load i32, i32* @GL_QUADS
%10 = tail call i32 @glBegin(i32 %9)
%11 = tail call i32 @glVertex3f(double -1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%12 = tail call i32 @glVertex3f(double 1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%13 = tail call i32 @glVertex3f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%14 = tail call i32 @glVertex3f(double -1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%15 = tail call i32 (...) @glEnd()
ret void
}