#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 float GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_AMBIENT_AND_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                float *);
int /*<<< orphan*/ glNormal3f(int, int, int);
int /*<<< orphan*/ glVertex3f(int, int, int);
void draw_room(void) {
  static GLfloat wall_mat[] = {1.f, 1.f, 1.f, 1.f};
  glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, wall_mat);
  glBegin(GL_QUADS);
  glNormal3f(0, 1, 0);
  glVertex3f(-1, -1, 1);
  glVertex3f(1, -1, 1);
  glVertex3f(1, -1, -1);
  glVertex3f(-1, -1, -1);
  glNormal3f(0, -1, 0);
  glVertex3f(-1, 1, -1);
  glVertex3f(1, 1, -1);
  glVertex3f(1, 1, 1);
  glVertex3f(-1, 1, 1);
  glNormal3f(1, 0, 0);
  glVertex3f(-1, -1, -1);
  glVertex3f(-1, 1, -1);
  glVertex3f(-1, 1, 1);
  glVertex3f(-1, -1, 1);
  glNormal3f(-1, 0, 0);
  glVertex3f(1, -1, 1);
  glVertex3f(1, 1, 1);
  glVertex3f(1, 1, -1);
  glVertex3f(1, -1, -1);
  glNormal3f(0, 0, 1);
  glVertex3f(-1, -1, -1);
  glVertex3f(1, -1, -1);
  glVertex3f(1, 1, -1);
  glVertex3f(-1, 1, -1);
  glNormal3f(0, 0, -1);
  glVertex3f(-1, 1, 1);
  glVertex3f(1, 1, 1);
  glVertex3f(1, -1, 1);
  glVertex3f(-1, -1, 1);
  glEnd();
}


x86 assembly (clang, -O0):
<draw_room>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
lea    0x2ee3(%rip),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <glVertex3f@plt>
mov    $0x1,%edx
mov    $0xffffffff,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <glVertex3f@plt>
xor    %edx,%edx
mov    $0xffffffff,%esi
mov    %edx,%edi
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    %esi,%edi
call   1030 <glVertex3f@plt>
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <glNormal3f@plt>
mov    $0x1,%edx
mov    $0xffffffff,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    %esi,%edi
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <glVertex3f@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    %esi,%edi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    %esi,%edi
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <glVertex3f@plt>
mov    $0x1,%edx
mov    $0xffffffff,%esi
mov    %edx,%edi
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <glVertex3f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_room>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
lea    0x2ee6(%rip),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <glNormal3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <glVertex3f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1070 <glNormal3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1030 <glVertex3f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@draw_room.wall_mat = internal global [4 x float] [float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00]
@GL_FRONT = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
@GL_QUADS = global i32 0
define void @draw_room() {
%1 = load i32, i32* @GL_FRONT
%2 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%3 = call i32 @glMaterialfv(i32 %1, i32 %2, float* getelementptr inbounds ([4 x float], [4 x float]* @draw_room.wall_mat, i64 0, i64 0))
%4 = load i32, i32* @GL_QUADS
%5 = call i32 @glBegin(i32 %4)
%6 = call i32 @glNormal3f(i32 0, i32 1, i32 0)
%7 = call i32 @glVertex3f(i32 -1, i32 -1, i32 1)
%8 = call i32 @glVertex3f(i32 1, i32 -1, i32 1)
%9 = call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%10 = call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%11 = call i32 @glNormal3f(i32 0, i32 -1, i32 0)
%12 = call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%13 = call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%14 = call i32 @glVertex3f(i32 1, i32 1, i32 1)
%15 = call i32 @glVertex3f(i32 -1, i32 1, i32 1)
%16 = call i32 @glNormal3f(i32 1, i32 0, i32 0)
%17 = call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%18 = call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%19 = call i32 @glVertex3f(i32 -1, i32 1, i32 1)
%20 = call i32 @glVertex3f(i32 -1, i32 -1, i32 1)
%21 = call i32 @glNormal3f(i32 -1, i32 0, i32 0)
%22 = call i32 @glVertex3f(i32 1, i32 -1, i32 1)
%23 = call i32 @glVertex3f(i32 1, i32 1, i32 1)
%24 = call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%25 = call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%26 = call i32 @glNormal3f(i32 0, i32 0, i32 1)
%27 = call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%28 = call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%29 = call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%30 = call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%31 = call i32 @glNormal3f(i32 0, i32 0, i32 -1)
%32 = call i32 @glVertex3f(i32 -1, i32 1, i32 1)
%33 = call i32 @glVertex3f(i32 1, i32 1, i32 1)
%34 = call i32 @glVertex3f(i32 1, i32 -1, i32 1)
%35 = call i32 @glVertex3f(i32 -1, i32 -1, i32 1)
%36 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@draw_room.wall_mat = internal global [4 x float] [float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00]
@GL_FRONT = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
@GL_QUADS = global i32 0
define void @draw_room() {
%1 = load i32, i32* @GL_FRONT
%2 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%3 = tail call i32 @glMaterialfv(i32 %1, i32 %2, float* getelementptr inbounds ([4 x float], [4 x float]* @draw_room.wall_mat, i64 0, i64 0))
%4 = load i32, i32* @GL_QUADS
%5 = tail call i32 @glBegin(i32 %4)
%6 = tail call i32 @glNormal3f(i32 0, i32 1, i32 0)
%7 = tail call i32 @glVertex3f(i32 -1, i32 -1, i32 1)
%8 = tail call i32 @glVertex3f(i32 1, i32 -1, i32 1)
%9 = tail call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%10 = tail call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%11 = tail call i32 @glNormal3f(i32 0, i32 -1, i32 0)
%12 = tail call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%13 = tail call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%14 = tail call i32 @glVertex3f(i32 1, i32 1, i32 1)
%15 = tail call i32 @glVertex3f(i32 -1, i32 1, i32 1)
%16 = tail call i32 @glNormal3f(i32 1, i32 0, i32 0)
%17 = tail call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%18 = tail call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%19 = tail call i32 @glVertex3f(i32 -1, i32 1, i32 1)
%20 = tail call i32 @glVertex3f(i32 -1, i32 -1, i32 1)
%21 = tail call i32 @glNormal3f(i32 -1, i32 0, i32 0)
%22 = tail call i32 @glVertex3f(i32 1, i32 -1, i32 1)
%23 = tail call i32 @glVertex3f(i32 1, i32 1, i32 1)
%24 = tail call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%25 = tail call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%26 = tail call i32 @glNormal3f(i32 0, i32 0, i32 1)
%27 = tail call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%28 = tail call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%29 = tail call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%30 = tail call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%31 = tail call i32 @glNormal3f(i32 0, i32 0, i32 -1)
%32 = tail call i32 @glVertex3f(i32 -1, i32 1, i32 1)
%33 = tail call i32 @glVertex3f(i32 1, i32 1, i32 1)
%34 = tail call i32 @glVertex3f(i32 1, i32 -1, i32 1)
%35 = tail call i32 @glVertex3f(i32 -1, i32 -1, i32 1)
%36 = tail call i32 (...) @glEnd()
ret void
}