#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 GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glMaterialf(int /*<<< orphan*/, int /*<<< orphan*/, double);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glutSolidTeapot(double);
void display(void) {
  GLfloat low_ambient[] = {0.1, 0.1, 0.1, 1.0};
  GLfloat more_ambient[] = {0.4, 0.4, 0.4, 1.0};
  GLfloat most_ambient[] = {1.0, 1.0, 1.0, 1.0};
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glMaterialfv(GL_FRONT, GL_AMBIENT, low_ambient);
  glMaterialf(GL_FRONT, GL_SHININESS, 40.0);
  glPushMatrix();
  glTranslatef(0.0, 2.0, 0.0);
  glutSolidTeapot(1.0);
  glPopMatrix();
  glMaterialfv(GL_FRONT, GL_AMBIENT, more_ambient);
  glPushMatrix();
  glTranslatef(0.0, 0.0, 0.0);
  glutSolidTeapot(1.0);
  glPopMatrix();
  glMaterialfv(GL_FRONT, GL_AMBIENT, most_ambient);
  glPushMatrix();
  glTranslatef(0.0, -2.0, 0.0);
  glutSolidTeapot(1.0);
  glPopMatrix();
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xe91(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe82(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe7f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe7c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe79(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe76(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe73(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe70(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2dad(%rip),%rax
mov    (%rax),%edi
mov    0x2db4(%rip),%rax
or     (%rax),%edi
call   1050 <glClear@plt>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
mov    0x2dbd(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   10a0 <glMaterialfv@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
mov    0x2d9a(%rip),%rax
mov    (%rax),%esi
movsd  0xdc0(%rip),%xmm0
call   1040 <glMaterialf@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movsd  0xda1(%rip),%xmm1
movaps %xmm2,%xmm0
call   1090 <glTranslatef@plt>
movsd  0xd81(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
mov    0x2d55(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   10a0 <glMaterialfv@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1090 <glTranslatef@plt>
movsd  0xd3d(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    0x2d02(%rip),%rax
mov    (%rax),%edi
mov    0x2d11(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   10a0 <glMaterialfv@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movsd  0xd0c(%rip),%xmm1
movaps %xmm2,%xmm0
call   1090 <glTranslatef@plt>
movsd  0xcf4(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    $0x0,%al
call   1070 <glFlush@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r14
push   %rbx
sub    $0x68,%rsp
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2deb(%rip),%rax
mov    0x2df4(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1050 <glClear@plt>
mov    0x2dec(%rip),%rbx
mov    (%rbx),%edi
mov    0x2dfb(%rip),%r14
mov    (%r14),%esi
lea    0x40(%rsp),%rdx
call   10a0 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2ddd(%rip),%rax
mov    (%rax),%esi
movsd  0xdeb(%rip),%xmm0
call   1040 <glMaterialf@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xddf(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1090 <glTranslatef@plt>
movsd  0xdd4(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
lea    0x20(%rsp),%rdx
call   10a0 <glMaterialfv@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1090 <glTranslatef@plt>
movsd  0xd9c(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
mov    %rsp,%rdx
call   10a0 <glMaterialfv@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xd7c(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1090 <glTranslatef@plt>
movsd  0xd61(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
xor    %eax,%eax
call   1070 <glFlush@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.display.low_ambient = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 1.000000e-01, double 1.000000e+00]
@__const.display.more_ambient = [4 x double] [double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 1.000000e+00]
@__const.display.most_ambient = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_SHININESS = global i32 0
define void @display() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [4 x double]* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = load i32, i32* @GL_COLOR_BUFFER_BIT
%8 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%9 = or i32 %7, %8
%10 = call i32 @glClear(i32 %9)
%11 = load i32, i32* @GL_FRONT
%12 = load i32, i32* @GL_AMBIENT
%13 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%14 = call i32 @glMaterialfv(i32 %11, i32 %12, double* %13)
%15 = load i32, i32* @GL_FRONT
%16 = load i32, i32* @GL_SHININESS
%17 = call i32 @glMaterialf(i32 %15, i32 %16, double 4.000000e+01)
%18 = call i32 (...) @glPushMatrix()
%19 = call i32 @glTranslatef(double 0.000000e+00, double 2.000000e+00, double 0.000000e+00)
%20 = call i32 @glutSolidTeapot(double 1.000000e+00)
%21 = call i32 (...) @glPopMatrix()
%22 = load i32, i32* @GL_FRONT
%23 = load i32, i32* @GL_AMBIENT
%24 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%25 = call i32 @glMaterialfv(i32 %22, i32 %23, double* %24)
%26 = call i32 (...) @glPushMatrix()
%27 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%28 = call i32 @glutSolidTeapot(double 1.000000e+00)
%29 = call i32 (...) @glPopMatrix()
%30 = load i32, i32* @GL_FRONT
%31 = load i32, i32* @GL_AMBIENT
%32 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%33 = call i32 @glMaterialfv(i32 %30, i32 %31, double* %32)
%34 = call i32 (...) @glPushMatrix()
%35 = call i32 @glTranslatef(double 0.000000e+00, double -2.000000e+00, double 0.000000e+00)
%36 = call i32 @glutSolidTeapot(double 1.000000e+00)
%37 = call i32 (...) @glPopMatrix()
%38 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@__const.display.low_ambient = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 1.000000e-01, double 1.000000e+00]
@__const.display.more_ambient = [4 x double] [double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 1.000000e+00]
@__const.display.most_ambient = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_SHININESS = global i32 0
define void @display() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [4 x double]* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = load i32, i32* @GL_COLOR_BUFFER_BIT
%8 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%9 = or i32 %8, %7
%10 = tail call i32 @glClear(i32 %9)
%11 = load i32, i32* @GL_FRONT
%12 = load i32, i32* @GL_AMBIENT
%13 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%14 = call i32 @glMaterialfv(i32 %11, i32 %12, double* %13)
%15 = load i32, i32* @GL_FRONT
%16 = load i32, i32* @GL_SHININESS
%17 = call i32 @glMaterialf(i32 %15, i32 %16, double 4.000000e+01)
%18 = call i32 (...) @glPushMatrix()
%19 = call i32 @glTranslatef(double 0.000000e+00, double 2.000000e+00, double 0.000000e+00)
%20 = call i32 @glutSolidTeapot(double 1.000000e+00)
%21 = call i32 (...) @glPopMatrix()
%22 = load i32, i32* @GL_FRONT
%23 = load i32, i32* @GL_AMBIENT
%24 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%25 = call i32 @glMaterialfv(i32 %22, i32 %23, double* %24)
%26 = call i32 (...) @glPushMatrix()
%27 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%28 = call i32 @glutSolidTeapot(double 1.000000e+00)
%29 = call i32 (...) @glPopMatrix()
%30 = load i32, i32* @GL_FRONT
%31 = load i32, i32* @GL_AMBIENT
%32 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%33 = call i32 @glMaterialfv(i32 %30, i32 %31, double* %32)
%34 = call i32 (...) @glPushMatrix()
%35 = call i32 @glTranslatef(double 0.000000e+00, double -2.000000e+00, double 0.000000e+00)
%36 = call i32 @glutSolidTeapot(double 1.000000e+00)
%37 = call i32 (...) @glPopMatrix()
%38 = call i32 (...) @glFlush()
ret void
}