#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 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, 0.0);
  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(1.0);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<renderTeapot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
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
xorps  %xmm2,%xmm2
call   1070 <glTranslatef@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)
movss  0xe1d(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
mov    0x2de8(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1080 <glMaterialfv@plt>
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movsd  -0x40(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
mov    0x2d73(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1080 <glMaterialfv@plt>
movsd  0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movsd  0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movsd  0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
mov    0x2d4e(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1080 <glMaterialfv@plt>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
mov    0x2d3b(%rip),%rax
mov    (%rax),%esi
movsd  0xd51(%rip),%xmm0
mulsd  0x28(%rbp),%xmm0
call   1040 <glMaterialf@plt>
movsd  0xd37(%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>
xorps  %xmm2,%xmm2
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1070 <glTranslatef@plt>
movsd  0x28(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsp)
movsd  0x30(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
movsd  0x38(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
movl   $0x3f800000,0xc(%rsp)
3f
mov    0x2de0(%rip),%rbx
mov    (%rbx),%edi
mov    0x2df7(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%r14
mov    %r14,%rdx
call   1080 <glMaterialfv@plt>
movsd  0x40(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0x48(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm0,(%rsp)
movss  %xmm1,0x4(%rsp)
movsd  0x50(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
mov    (%rbx),%edi
mov    0x2d82(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1080 <glMaterialfv@plt>
movsd  0x70(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0x78(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm0,(%rsp)
movss  %xmm1,0x4(%rsp)
movsd  0x80(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
mov    (%rbx),%edi
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1080 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2d52(%rip),%rax
mov    (%rax),%esi
movsd  0x88(%rsp),%xmm0
mulsd  0xd57(%rip),%xmm0
call   1040 <glMaterialf@plt>
movsd  0xd52(%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) {
%13 = alloca double
%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 [4 x float]
store double %0, double* %13
store double %1, double* %14
store double %2, double* %15
store double %3, double* %16
store double %4, double* %17
store double %5, double* %18
store double %6, double* %19
store double %7, double* %20
store double %8, double* %21
store double %9, double* %22
store double %10, double* %23
store double %11, double* %24
%26 = call i32 (...) @glPushMatrix()
%27 = load double, double* %13
%28 = load double, double* %14
%29 = call i32 @glTranslatef(double %27, double %28, double 0.000000e+00)
%30 = load double, double* %15
%31 = fptrunc double %30 to float
%32 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 0
store float %31, float* %32
%33 = load double, double* %16
%34 = fptrunc double %33 to float
%35 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 1
store float %34, float* %35
%36 = load double, double* %17
%37 = fptrunc double %36 to float
%38 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 2
store float %37, float* %38
%39 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 3
store float 1.000000e+00, float* %39
%40 = load i32, i32* @GL_FRONT
%41 = load i32, i32* @GL_AMBIENT
%42 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 0
%43 = call i32 @glMaterialfv(i32 %40, i32 %41, float* %42)
%44 = load double, double* %18
%45 = fptrunc double %44 to float
%46 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 0
store float %45, float* %46
%47 = load double, double* %19
%48 = fptrunc double %47 to float
%49 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 1
store float %48, float* %49
%50 = load double, double* %20
%51 = fptrunc double %50 to float
%52 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 2
store float %51, float* %52
%53 = load i32, i32* @GL_FRONT
%54 = load i32, i32* @GL_DIFFUSE
%55 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 0
%56 = call i32 @glMaterialfv(i32 %53, i32 %54, float* %55)
%57 = load double, double* %21
%58 = fptrunc double %57 to float
%59 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 0
store float %58, float* %59
%60 = load double, double* %22
%61 = fptrunc double %60 to float
%62 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 1
store float %61, float* %62
%63 = load double, double* %23
%64 = fptrunc double %63 to float
%65 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 2
store float %64, float* %65
%66 = load i32, i32* @GL_FRONT
%67 = load i32, i32* @GL_SPECULAR
%68 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 0
%69 = call i32 @glMaterialfv(i32 %66, i32 %67, float* %68)
%70 = load i32, i32* @GL_FRONT
%71 = load i32, i32* @GL_SHININESS
%72 = load double, double* %24
%73 = fmul double %72, 1.280000e+02
%74 = call i32 @glMaterialf(i32 %70, i32 %71, double %73)
%75 = call i32 @glutSolidTeapot(double 1.000000e+00)
%76 = 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) {
%13 = alloca [4 x float]
%14 = bitcast [4 x float]* %13 to i8*
%15 = tail call i32 (...) @glPushMatrix()
%16 = tail call i32 @glTranslatef(double %0, double %1, double 0.000000e+00)
%17 = fptrunc double %2 to float
%18 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 0
store float %17, float* %18
%19 = fptrunc double %3 to float
%20 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 1
store float %19, float* %20
%21 = fptrunc double %4 to float
%22 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 2
store float %21, float* %22
%23 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 3
store float 1.000000e+00, float* %23
%24 = load i32, i32* @GL_FRONT
%25 = load i32, i32* @GL_AMBIENT
%26 = call i32 @glMaterialfv(i32 %24, i32 %25, float* %18)
%27 = fptrunc double %5 to float
store float %27, float* %18
%28 = fptrunc double %6 to float
store float %28, float* %20
%29 = fptrunc double %7 to float
store float %29, float* %22
%30 = load i32, i32* @GL_FRONT
%31 = load i32, i32* @GL_DIFFUSE
%32 = call i32 @glMaterialfv(i32 %30, i32 %31, float* %18)
%33 = fptrunc double %8 to float
store float %33, float* %18
%34 = fptrunc double %9 to float
store float %34, float* %20
%35 = fptrunc double %10 to float
store float %35, float* %22
%36 = load i32, i32* @GL_FRONT
%37 = load i32, i32* @GL_SPECULAR
%38 = call i32 @glMaterialfv(i32 %36, i32 %37, float* %18)
%39 = load i32, i32* @GL_FRONT
%40 = load i32, i32* @GL_SHININESS
%41 = fmul double %11, 1.280000e+02
%42 = call i32 @glMaterialf(i32 %39, i32 %40, double %41)
%43 = call i32 @glutSolidTeapot(double 1.000000e+00)
%44 = call i32 (...) @glPopMatrix()
ret void
}