#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_SHININESS;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ glMaterialf(int /*<<< orphan*/, int /*<<< orphan*/, double);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                float *);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glTranslatef(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ glutSolidTeapot(double);
void renderRedTeapot(GLfloat x, GLfloat y, GLfloat z) {
  float mat[4];
  glPushMatrix();
  glTranslatef(x, y, z);
  mat[0] = 0.1745;
  mat[1] = 0.01175;
  mat[2] = 0.01175;
  mat[3] = 1.0;
  glMaterialfv(GL_FRONT, GL_AMBIENT, mat);
  mat[0] = 0.61424;
  mat[1] = 0.04136;
  mat[2] = 0.04136;
  glMaterialfv(GL_FRONT, GL_DIFFUSE, mat);
  mat[0] = 0.727811;
  mat[1] = 0.626959;
  mat[2] = 0.626959;
  glMaterialfv(GL_FRONT, GL_SPECULAR, mat);
  glMaterialf(GL_FRONT, GL_SHININESS, 0.6 * 128.0);
  glutSolidTeapot(1.0);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<renderRedTeapot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1070 <glTranslatef@plt>
movss  0xe9a(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xe89(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe7c(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe6b(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    0x2e26(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1080 <glMaterialfv@plt>
movss  0xe3f(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xe2e(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe21(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
mov    0x2db4(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1080 <glMaterialfv@plt>
movss  0xdf5(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xde4(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xdd7(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
mov    0x2d92(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1080 <glMaterialfv@plt>
mov    0x2d70(%rip),%rax
mov    (%rax),%edi
mov    0x2d7f(%rip),%rax
mov    (%rax),%esi
movsd  0xd95(%rip),%xmm0
call   1040 <glMaterialf@plt>
movsd  0xd80(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
mov    $0x0,%al
call   1050 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderRedTeapot>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1070 <glTranslatef@plt>
movaps 0xe77(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e3c(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2e52(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1080 <glMaterialfv@plt>
movabs $0x3d29691a3f1d3ed5,%rax
69 29 3d
mov    %rax,(%rsp)
movl   $0x3d29691a,0x8(%rsp)
3d
mov    0x0(%rbp),%edi
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdx
call   1080 <glMaterialfv@plt>
movabs $0x3f2080633f3a51d2,%rax
80 20 3f
mov    %rax,(%rsp)
movl   $0x3f208063,0x8(%rsp)
3f
mov    0x0(%rbp),%edi
mov    0x2deb(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdx
call   1080 <glMaterialfv@plt>
mov    0x0(%rbp),%edi
mov    0x2ddf(%rip),%rax
mov    (%rax),%esi
movsd  0xdfd(%rip),%xmm0
call   1040 <glMaterialf@plt>
movsd  0xdf8(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
xor    %eax,%eax
call   1050 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @renderRedTeapot(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x float]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @glPushMatrix()
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @glTranslatef(i32 %9, i32 %10, i32 %11)
%13 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
store float 0x3FC6560420000000, float* %13
%14 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 1
store float 0x3F88106240000000, float* %14
%15 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 2
store float 0x3F88106240000000, float* %15
%16 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 3
store float 1.000000e+00, float* %16
%17 = load i32, i32* @GL_FRONT
%18 = load i32, i32* @GL_AMBIENT
%19 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%20 = call i32 @glMaterialfv(i32 %17, i32 %18, float* %19)
%21 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
store float 0x3FE3A7DAA0000000, float* %21
%22 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 1
store float 0x3FA52D2340000000, float* %22
%23 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 2
store float 0x3FA52D2340000000, float* %23
%24 = load i32, i32* @GL_FRONT
%25 = load i32, i32* @GL_DIFFUSE
%26 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%27 = call i32 @glMaterialfv(i32 %24, i32 %25, float* %26)
%28 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
store float 0x3FE74A3A40000000, float* %28
%29 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 1
store float 0x3FE4100C60000000, float* %29
%30 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 2
store float 0x3FE4100C60000000, float* %30
%31 = load i32, i32* @GL_FRONT
%32 = load i32, i32* @GL_SPECULAR
%33 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%34 = call i32 @glMaterialfv(i32 %31, i32 %32, float* %33)
%35 = load i32, i32* @GL_FRONT
%36 = load i32, i32* @GL_SHININESS
%37 = call i32 @glMaterialf(i32 %35, i32 %36, double 0x4053333333333333)
%38 = call i32 @glutSolidTeapot(double 1.000000e+00)
%39 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @renderRedTeapot(i32 %0, i32 %1, i32 %2) {
%4 = alloca <4 x float>
%5 = bitcast <4 x float>* %4 to i8*
%6 = tail call i32 (...) @glPushMatrix()
%7 = tail call i32 @glTranslatef(i32 %0, i32 %1, i32 %2)
%8 = getelementptr inbounds <4 x float>, <4 x float>* %4, i64 0, i64 0
%9 = getelementptr inbounds <4 x float>, <4 x float>* %4, i64 0, i64 1
%10 = getelementptr inbounds <4 x float>, <4 x float>* %4, i64 0, i64 2
store <4 x float> <float 0x3FC6560420000000, float 0x3F88106240000000, float 0x3F88106240000000, float 1.000000e+00>, <4 x float>* %4
%11 = load i32, i32* @GL_FRONT
%12 = load i32, i32* @GL_AMBIENT
%13 = call i32 @glMaterialfv(i32 %11, i32 %12, float* %8)
store float 0x3FE3A7DAA0000000, float* %8
store float 0x3FA52D2340000000, float* %9
store float 0x3FA52D2340000000, float* %10
%14 = load i32, i32* @GL_FRONT
%15 = load i32, i32* @GL_DIFFUSE
%16 = call i32 @glMaterialfv(i32 %14, i32 %15, float* %8)
store float 0x3FE74A3A40000000, float* %8
store float 0x3FE4100C60000000, float* %9
store float 0x3FE4100C60000000, float* %10
%17 = load i32, i32* @GL_FRONT
%18 = load i32, i32* @GL_SPECULAR
%19 = call i32 @glMaterialfv(i32 %17, i32 %18, float* %8)
%20 = load i32, i32* @GL_FRONT
%21 = load i32, i32* @GL_SHININESS
%22 = call i32 @glMaterialf(i32 %20, i32 %21, double 0x4053333333333333)
%23 = call i32 @glutSolidTeapot(double 1.000000e+00)
%24 = call i32 (...) @glPopMatrix()
ret void
}