#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;
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(double, double, double);
int /*<<< orphan*/ glutSolidTeapot(double);
void renderTeapot(GLfloat x, GLfloat y, GLfloat z, GLfloat ambr, GLfloat ambg,
                  GLfloat ambb, GLfloat difr, GLfloat difg, GLfloat difb,
                  GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine) {
  float mat[4];
  glPushMatrix();
  glTranslatef(x, y, z);
  mat[0] = ambr;
  mat[1] = ambg;
  mat[2] = ambb;
  mat[3] = 1.0;
  glMaterialfv(GL_FRONT, GL_AMBIENT, mat);
  mat[0] = difr;
  mat[1] = difg;
  mat[2] = difb;
  glMaterialfv(GL_FRONT, GL_DIFFUSE, mat);
  mat[0] = specr;
  mat[1] = specg;
  mat[2] = specb;
  glMaterialfv(GL_FRONT, GL_SPECULAR, mat);
  glMaterialf(GL_FRONT, GL_SHININESS, shine * 128.0);
  glutSolidTeapot(0.5);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<renderTeapot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  0x30(%rbp),%xmm8
movsd  0x28(%rbp),%xmm8
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1070 <glTranslatef@plt>
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  0xe15(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
mov    0x2de0(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1080 <glMaterialfv@plt>
movsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movsd  0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
mov    0x2d6b(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1080 <glMaterialfv@plt>
movsd  0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movsd  0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movsd  0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
mov    0x2d46(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1080 <glMaterialfv@plt>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
mov    0x2d33(%rip),%rax
mov    (%rax),%esi
movsd  0xd49(%rip),%xmm0
mulsd  0x30(%rbp),%xmm0
call   1040 <glMaterialf@plt>
movsd  0xd2f(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
mov    $0x0,%al
call   1050 <glPopMatrix@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderTeapot>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movsd  %xmm7,0x50(%rsp)
movsd  %xmm6,0x48(%rsp)
movsd  %xmm5,0x40(%rsp)
movsd  %xmm4,0x38(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
call   1070 <glTranslatef@plt>
movsd  0x30(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsp)
movsd  0x38(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
movsd  0x40(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
movl   $0x3f800000,0xc(%rsp)
3f
mov    0x2ddd(%rip),%rbx
mov    (%rbx),%edi
mov    0x2df4(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%r14
mov    %r14,%rdx
call   1080 <glMaterialfv@plt>
movsd  0x48(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0x50(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm0,(%rsp)
movss  %xmm1,0x4(%rsp)
movsd  0x70(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
mov    (%rbx),%edi
mov    0x2d7f(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1080 <glMaterialfv@plt>
movsd  0x78(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0x80(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm0,(%rsp)
movss  %xmm1,0x4(%rsp)
movsd  0x88(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
mov    (%rbx),%edi
mov    0x2d57(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1080 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2d4c(%rip),%rax
mov    (%rax),%esi
movsd  0x90(%rsp),%xmm0
mulsd  0xd51(%rip),%xmm0
call   1040 <glMaterialf@plt>
movsd  0xd4c(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
xor    %eax,%eax
call   1050 <glPopMatrix@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
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 @renderTeapot(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12) {
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca [4 x float]
store double %0, double* %14
store double %1, double* %15
store double %2, double* %16
store double %3, double* %17
store double %4, double* %18
store double %5, double* %19
store double %6, double* %20
store double %7, double* %21
store double %8, double* %22
store double %9, double* %23
store double %10, double* %24
store double %11, double* %25
store double %12, double* %26
%28 = call i32 (...) @glPushMatrix()
%29 = load double, double* %14
%30 = load double, double* %15
%31 = load double, double* %16
%32 = call i32 @glTranslatef(double %29, double %30, double %31)
%33 = load double, double* %17
%34 = fptrunc double %33 to float
%35 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 0
store float %34, float* %35
%36 = load double, double* %18
%37 = fptrunc double %36 to float
%38 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 1
store float %37, float* %38
%39 = load double, double* %19
%40 = fptrunc double %39 to float
%41 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 2
store float %40, float* %41
%42 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 3
store float 1.000000e+00, float* %42
%43 = load i32, i32* @GL_FRONT
%44 = load i32, i32* @GL_AMBIENT
%45 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 0
%46 = call i32 @glMaterialfv(i32 %43, i32 %44, float* %45)
%47 = load double, double* %20
%48 = fptrunc double %47 to float
%49 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 0
store float %48, float* %49
%50 = load double, double* %21
%51 = fptrunc double %50 to float
%52 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 1
store float %51, float* %52
%53 = load double, double* %22
%54 = fptrunc double %53 to float
%55 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 2
store float %54, float* %55
%56 = load i32, i32* @GL_FRONT
%57 = load i32, i32* @GL_DIFFUSE
%58 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 0
%59 = call i32 @glMaterialfv(i32 %56, i32 %57, float* %58)
%60 = load double, double* %23
%61 = fptrunc double %60 to float
%62 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 0
store float %61, float* %62
%63 = load double, double* %24
%64 = fptrunc double %63 to float
%65 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 1
store float %64, float* %65
%66 = load double, double* %25
%67 = fptrunc double %66 to float
%68 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 2
store float %67, float* %68
%69 = load i32, i32* @GL_FRONT
%70 = load i32, i32* @GL_SPECULAR
%71 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 0
%72 = call i32 @glMaterialfv(i32 %69, i32 %70, float* %71)
%73 = load i32, i32* @GL_FRONT
%74 = load i32, i32* @GL_SHININESS
%75 = load double, double* %26
%76 = fmul double %75, 1.280000e+02
%77 = call i32 @glMaterialf(i32 %73, i32 %74, double %76)
%78 = call i32 @glutSolidTeapot(double 5.000000e-01)
%79 = 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 @renderTeapot(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12) {
%14 = alloca [4 x float]
%15 = bitcast [4 x float]* %14 to i8*
%16 = tail call i32 (...) @glPushMatrix()
%17 = tail call i32 @glTranslatef(double %0, double %1, double %2)
%18 = fptrunc double %3 to float
%19 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 0
store float %18, float* %19
%20 = fptrunc double %4 to float
%21 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 1
store float %20, float* %21
%22 = fptrunc double %5 to float
%23 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 2
store float %22, float* %23
%24 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 3
store float 1.000000e+00, float* %24
%25 = load i32, i32* @GL_FRONT
%26 = load i32, i32* @GL_AMBIENT
%27 = call i32 @glMaterialfv(i32 %25, i32 %26, float* %19)
%28 = fptrunc double %6 to float
store float %28, float* %19
%29 = fptrunc double %7 to float
store float %29, float* %21
%30 = fptrunc double %8 to float
store float %30, float* %23
%31 = load i32, i32* @GL_FRONT
%32 = load i32, i32* @GL_DIFFUSE
%33 = call i32 @glMaterialfv(i32 %31, i32 %32, float* %19)
%34 = fptrunc double %9 to float
store float %34, float* %19
%35 = fptrunc double %10 to float
store float %35, float* %21
%36 = fptrunc double %11 to float
store float %36, float* %23
%37 = load i32, i32* @GL_FRONT
%38 = load i32, i32* @GL_SPECULAR
%39 = call i32 @glMaterialfv(i32 %37, i32 %38, float* %19)
%40 = load i32, i32* @GL_FRONT
%41 = load i32, i32* @GL_SHININESS
%42 = fmul double %12, 1.280000e+02
%43 = call i32 @glMaterialf(i32 %40, i32 %41, double %42)
%44 = call i32 @glutSolidTeapot(double 5.000000e-01)
%45 = call i32 (...) @glPopMatrix()
ret void
}