#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 */

/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_DECAL;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ GL_TEXTURE_ENV;
int /*<<< orphan*/ GL_TEXTURE_ENV_MODE;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glTexCoord2f(double, double);
int /*<<< orphan*/ glTexEnvf(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ glVertex3f(double, double, double);
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glEnable(GL_TEXTURE_2D);
  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
  glBegin(GL_QUADS);
  glTexCoord2f(0.0, 0.0);
  glVertex3f(-2.0, -1.0, 0.0);
  glTexCoord2f(0.0, 3.0);
  glVertex3f(-2.0, 1.0, 0.0);
  glTexCoord2f(3.0, 3.0);
  glVertex3f(0.0, 1.0, 0.0);
  glTexCoord2f(3.0, 0.0);
  glVertex3f(0.0, -1.0, 0.0);
  glTexCoord2f(0.0, 0.0);
  glVertex3f(1.0, -1.0, 0.0);
  glTexCoord2f(0.0, 3.0);
  glVertex3f(1.0, 1.0, 0.0);
  glTexCoord2f(3.0, 3.0);
  glVertex3f(2.41421, 1.0, -1.41421);
  glTexCoord2f(3.0, 0.0);
  glVertex3f(2.41421, -1.0, -1.41421);
  glEnd();
  glFlush();
  glDisable(GL_TEXTURE_2D);
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
mov    0x2e3c(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
mov    0x2dff(%rip),%rax
mov    (%rax),%esi
mov    0x2e26(%rip),%rax
mov    (%rax),%edx
call   1070 <glTexEnvf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1090 <glTexCoord2f@plt>
movsd  0xe2e(%rip),%xmm0
movsd  0xe06(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xe03(%rip),%xmm1
call   1090 <glTexCoord2f@plt>
movsd  0xe06(%rip),%xmm0
movsd  0xdf6(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
movsd  0xdde(%rip),%xmm1
movaps %xmm1,%xmm0
call   1090 <glTexCoord2f@plt>
xorps  %xmm2,%xmm2
movsd  0xdd3(%rip),%xmm1
movaps %xmm2,%xmm0
call   1040 <glVertex3f@plt>
movsd  0xdbb(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTexCoord2f@plt>
xorps  %xmm2,%xmm2
movsd  0xd98(%rip),%xmm1
movaps %xmm2,%xmm0
call   1040 <glVertex3f@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1090 <glTexCoord2f@plt>
movsd  0xd95(%rip),%xmm0
movsd  0xd75(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xd72(%rip),%xmm1
call   1090 <glTexCoord2f@plt>
movsd  0xd6d(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1040 <glVertex3f@plt>
movsd  0xd52(%rip),%xmm1
movaps %xmm1,%xmm0
call   1090 <glTexCoord2f@plt>
movsd  0xd2a(%rip),%xmm0
movsd  0xd42(%rip),%xmm1
movsd  0xd2a(%rip),%xmm2
call   1040 <glVertex3f@plt>
movsd  0xd25(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTexCoord2f@plt>
movsd  0xcfd(%rip),%xmm0
movsd  0xcfd(%rip),%xmm1
movsd  0xcfd(%rip),%xmm2
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
mov    $0x0,%al
call   1080 <glFlush@plt>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
call   10a0 <glDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbx
mov    0x2e18(%rip),%rax
mov    0x2e41(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e09(%rip),%rbx
mov    (%rbx),%edi
call   1050 <glEnable@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
mov    0x2e02(%rip),%rax
mov    (%rax),%esi
mov    0x2e29(%rip),%rax
mov    (%rax),%edx
call   1070 <glTexEnvf@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTexCoord2f@plt>
movsd  0xe09(%rip),%xmm0
movsd  0xe09(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
movsd  0xe01(%rip),%xmm1
xorps  %xmm0,%xmm0
call   1090 <glTexCoord2f@plt>
movsd  0xdf9(%rip),%xmm1
xorps  %xmm2,%xmm2
movsd  0xdd6(%rip),%xmm0
call   1040 <glVertex3f@plt>
movsd  0xdd9(%rip),%xmm0
movaps %xmm0,%xmm1
call   1090 <glTexCoord2f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xdcb(%rip),%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm1,%xmm1
movsd  0xdb3(%rip),%xmm0
call   1090 <glTexCoord2f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xd98(%rip),%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTexCoord2f@plt>
xorps  %xmm2,%xmm2
movsd  0xd8d(%rip),%xmm0
movsd  0xd75(%rip),%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xd6d(%rip),%xmm1
call   1090 <glTexCoord2f@plt>
xorps  %xmm2,%xmm2
movsd  0xd65(%rip),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex3f@plt>
movsd  0xd4d(%rip),%xmm0
movaps %xmm0,%xmm1
call   1090 <glTexCoord2f@plt>
movsd  0xd4d(%rip),%xmm0
movsd  0xd4d(%rip),%xmm2
movsd  0xd35(%rip),%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm1,%xmm1
movsd  0xd1d(%rip),%xmm0
call   1090 <glTexCoord2f@plt>
movsd  0xd20(%rip),%xmm0
movsd  0xd00(%rip),%xmm1
movsd  0xd18(%rip),%xmm2
call   1040 <glVertex3f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
xor    %eax,%eax
call   1080 <glFlush@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    10a0 <glDisable@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_DECAL = global i32 0
@GL_QUADS = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = load i32, i32* @GL_TEXTURE_2D
%6 = call i32 @glEnable(i32 %5)
%7 = load i32, i32* @GL_TEXTURE_ENV
%8 = load i32, i32* @GL_TEXTURE_ENV_MODE
%9 = load i32, i32* @GL_DECAL
%10 = call i32 @glTexEnvf(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* @GL_QUADS
%12 = call i32 @glBegin(i32 %11)
%13 = call i32 @glTexCoord2f(double 0.000000e+00, double 0.000000e+00)
%14 = call i32 @glVertex3f(double -2.000000e+00, double -1.000000e+00, double 0.000000e+00)
%15 = call i32 @glTexCoord2f(double 0.000000e+00, double 3.000000e+00)
%16 = call i32 @glVertex3f(double -2.000000e+00, double 1.000000e+00, double 0.000000e+00)
%17 = call i32 @glTexCoord2f(double 3.000000e+00, double 3.000000e+00)
%18 = call i32 @glVertex3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%19 = call i32 @glTexCoord2f(double 3.000000e+00, double 0.000000e+00)
%20 = call i32 @glVertex3f(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
%21 = call i32 @glTexCoord2f(double 0.000000e+00, double 0.000000e+00)
%22 = call i32 @glVertex3f(double 1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%23 = call i32 @glTexCoord2f(double 0.000000e+00, double 3.000000e+00)
%24 = call i32 @glVertex3f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%25 = call i32 @glTexCoord2f(double 3.000000e+00, double 3.000000e+00)
%26 = call i32 @glVertex3f(double 2.414210e+00, double 1.000000e+00, double -1.414210e+00)
%27 = call i32 @glTexCoord2f(double 3.000000e+00, double 0.000000e+00)
%28 = call i32 @glVertex3f(double 2.414210e+00, double -1.000000e+00, double -1.414210e+00)
%29 = call i32 (...) @glEnd()
%30 = call i32 (...) @glFlush()
%31 = load i32, i32* @GL_TEXTURE_2D
%32 = call i32 @glDisable(i32 %31)
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_DECAL = global i32 0
@GL_QUADS = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = load i32, i32* @GL_TEXTURE_2D
%6 = tail call i32 @glEnable(i32 %5)
%7 = load i32, i32* @GL_TEXTURE_ENV
%8 = load i32, i32* @GL_TEXTURE_ENV_MODE
%9 = load i32, i32* @GL_DECAL
%10 = tail call i32 @glTexEnvf(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* @GL_QUADS
%12 = tail call i32 @glBegin(i32 %11)
%13 = tail call i32 @glTexCoord2f(double 0.000000e+00, double 0.000000e+00)
%14 = tail call i32 @glVertex3f(double -2.000000e+00, double -1.000000e+00, double 0.000000e+00)
%15 = tail call i32 @glTexCoord2f(double 0.000000e+00, double 3.000000e+00)
%16 = tail call i32 @glVertex3f(double -2.000000e+00, double 1.000000e+00, double 0.000000e+00)
%17 = tail call i32 @glTexCoord2f(double 3.000000e+00, double 3.000000e+00)
%18 = tail call i32 @glVertex3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%19 = tail call i32 @glTexCoord2f(double 3.000000e+00, double 0.000000e+00)
%20 = tail call i32 @glVertex3f(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
%21 = tail call i32 @glTexCoord2f(double 0.000000e+00, double 0.000000e+00)
%22 = tail call i32 @glVertex3f(double 1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%23 = tail call i32 @glTexCoord2f(double 0.000000e+00, double 3.000000e+00)
%24 = tail call i32 @glVertex3f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%25 = tail call i32 @glTexCoord2f(double 3.000000e+00, double 3.000000e+00)
%26 = tail call i32 @glVertex3f(double 2.414210e+00, double 1.000000e+00, double -1.414210e+00)
%27 = tail call i32 @glTexCoord2f(double 3.000000e+00, double 0.000000e+00)
%28 = tail call i32 @glVertex3f(double 2.414210e+00, double -1.000000e+00, double -1.414210e+00)
%29 = tail call i32 (...) @glEnd()
%30 = tail call i32 (...) @glFlush()
%31 = load i32, i32* @GL_TEXTURE_2D
%32 = tail call i32 @glDisable(i32 %31)
ret void
}