#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_AND_BACK;
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
int /*<<< orphan*/ glNormal3i(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ glVertex3f(int, int /*<<< orphan*/, int);
void drawGround(void) {
  GLfloat groundColor[4] = {.647, .165, .165, 1};
  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, groundColor);
  glBegin(GL_QUADS);
  glNormal3i(0, 1, 0);
  glVertex3f(10, 0, 10);
  glVertex3f(10, 0, -10);
  glVertex3f(-10, 0, -10);
  glVertex3f(-10, 0, 10);
  glEnd();
}


x86 assembly (clang, -O0):
<drawGround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xea1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1060 <glMaterialfv@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   1070 <glBegin@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1050 <glNormal3i@plt>
mov    $0xa,%edx
xor    %esi,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xfffffff6,%edx
call   1030 <glVertex3f@plt>
mov    $0xfffffff6,%edx
xor    %esi,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
mov    $0xfffffff6,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <glVertex3f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawGround>:
sub    $0x28,%rsp
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1060 <glMaterialfv@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1070 <glBegin@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <glNormal3i@plt>
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <glVertex3f@plt>
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xfffffff6,%edx
call   1030 <glVertex3f@plt>
mov    $0xfffffff6,%edi
xor    %esi,%esi
mov    $0xfffffff6,%edx
call   1030 <glVertex3f@plt>
mov    $0xfffffff6,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <glVertex3f@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.drawGround.groundColor = [4 x double] [double 6.470000e-01, double 1.650000e-01, double 1.650000e-01, double 1.000000e+00]
@GL_FRONT_AND_BACK = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
@GL_QUADS = global i32 0
define void @drawGround() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_FRONT_AND_BACK
%4 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%5 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%6 = call i32 @glMaterialfv(i32 %3, i32 %4, double* %5)
%7 = load i32, i32* @GL_QUADS
%8 = call i32 @glBegin(i32 %7)
%9 = call i32 @glNormal3i(i32 0, i32 1, i32 0)
%10 = call i32 @glVertex3f(i32 10, i32 0, i32 10)
%11 = call i32 @glVertex3f(i32 10, i32 0, i32 -10)
%12 = call i32 @glVertex3f(i32 -10, i32 0, i32 -10)
%13 = call i32 @glVertex3f(i32 -10, i32 0, i32 10)
%14 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@__const.drawGround.groundColor = [4 x double] [double 6.470000e-01, double 1.650000e-01, double 1.650000e-01, double 1.000000e+00]
@GL_FRONT_AND_BACK = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
@GL_QUADS = global i32 0
define void @drawGround() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_FRONT_AND_BACK
%4 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%5 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%6 = call i32 @glMaterialfv(i32 %3, i32 %4, double* %5)
%7 = load i32, i32* @GL_QUADS
%8 = call i32 @glBegin(i32 %7)
%9 = call i32 @glNormal3i(i32 0, i32 1, i32 0)
%10 = call i32 @glVertex3f(i32 10, i32 0, i32 10)
%11 = call i32 @glVertex3f(i32 10, i32 0, i32 -10)
%12 = call i32 @glVertex3f(i32 -10, i32 0, i32 -10)
%13 = call i32 @glVertex3f(i32 -10, i32 0, i32 10)
%14 = call i32 (...) @glEnd()
ret void
}