#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 /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScaled(double, double, double);
int /*<<< orphan*/ glTexCoord2d(double, double);
int /*<<< orphan*/ glVertex3d(double, double, double);
void testTexture() {
  glPushMatrix();
  glColor3f(0.0, 1.0, 0.0);
  glScaled(60.0, 60.0, 60.0);
  glBegin(GL_QUADS);
  glTexCoord2d(0.0, 0.0);
  glVertex3d(-1.0, 0.0, +1.0);
  glTexCoord2d(1.0, 0.0);
  glVertex3d(+1.0, 0.0, +1.0);
  glTexCoord2d(1.0, 1.0);
  glVertex3d(+1.0, 0.0, -1.0);
  glTexCoord2d(0.0, 1.0);
  glVertex3d(-1.0, 0.0, -1.0);
  glEnd();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<testTexture>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movsd  0xe72(%rip),%xmm1
movaps %xmm2,%xmm0
call   1060 <glColor3f@plt>
movsd  0xe6a(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glScaled@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1090 <glTexCoord2d@plt>
movsd  0xe2e(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xe2b(%rip),%xmm2
call   1030 <glVertex3d@plt>
movsd  0xe1e(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTexCoord2d@plt>
movsd  0xe0e(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm2,%xmm0
call   1030 <glVertex3d@plt>
movsd  0xdfb(%rip),%xmm1
movaps %xmm1,%xmm0
call   1090 <glTexCoord2d@plt>
movsd  0xdeb(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xdd8(%rip),%xmm2
call   1030 <glVertex3d@plt>
xorps  %xmm0,%xmm0
movsd  0xdd0(%rip),%xmm1
call   1090 <glTexCoord2d@plt>
movsd  0xdbb(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm2,%xmm0
call   1030 <glVertex3d@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
mov    $0x0,%al
call   1050 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTexture>:
push   %rax
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xe70(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1060 <glColor3f@plt>
movsd  0xe65(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glScaled@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTexCoord2d@plt>
movsd  0xe41(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xe26(%rip),%xmm2
call   1030 <glVertex3d@plt>
xorps  %xmm1,%xmm1
movsd  0xe16(%rip),%xmm0
call   1090 <glTexCoord2d@plt>
xorps  %xmm1,%xmm1
movsd  0xe06(%rip),%xmm0
movaps %xmm0,%xmm2
call   1030 <glVertex3d@plt>
movsd  0xdf6(%rip),%xmm0
movaps %xmm0,%xmm1
call   1090 <glTexCoord2d@plt>
xorps  %xmm1,%xmm1
movsd  0xde3(%rip),%xmm0
movsd  0xdeb(%rip),%xmm2
call   1030 <glVertex3d@plt>
xorps  %xmm0,%xmm0
movsd  0xdcb(%rip),%xmm1
call   1090 <glTexCoord2d@plt>
xorps  %xmm1,%xmm1
movsd  0xdcb(%rip),%xmm0
movaps %xmm0,%xmm2
call   1030 <glVertex3d@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glPopMatrix@plt>

LLVM IR (-O0):
@GL_QUADS = global i32 0
define void @testTexture() {
%1 = call i32 (...) @glPushMatrix()
%2 = call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = call i32 @glScaled(double 6.000000e+01, double 6.000000e+01, double 6.000000e+01)
%4 = load i32, i32* @GL_QUADS
%5 = call i32 @glBegin(i32 %4)
%6 = call i32 @glTexCoord2d(double 0.000000e+00, double 0.000000e+00)
%7 = call i32 @glVertex3d(double -1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%8 = call i32 @glTexCoord2d(double 1.000000e+00, double 0.000000e+00)
%9 = call i32 @glVertex3d(double 1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%10 = call i32 @glTexCoord2d(double 1.000000e+00, double 1.000000e+00)
%11 = call i32 @glVertex3d(double 1.000000e+00, double 0.000000e+00, double -1.000000e+00)
%12 = call i32 @glTexCoord2d(double 0.000000e+00, double 1.000000e+00)
%13 = call i32 @glVertex3d(double -1.000000e+00, double 0.000000e+00, double -1.000000e+00)
%14 = call i32 (...) @glEnd()
%15 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_QUADS = global i32 0
define void @testTexture() {
%1 = tail call i32 (...) @glPushMatrix()
%2 = tail call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = tail call i32 @glScaled(double 6.000000e+01, double 6.000000e+01, double 6.000000e+01)
%4 = load i32, i32* @GL_QUADS
%5 = tail call i32 @glBegin(i32 %4)
%6 = tail call i32 @glTexCoord2d(double 0.000000e+00, double 0.000000e+00)
%7 = tail call i32 @glVertex3d(double -1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%8 = tail call i32 @glTexCoord2d(double 1.000000e+00, double 0.000000e+00)
%9 = tail call i32 @glVertex3d(double 1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%10 = tail call i32 @glTexCoord2d(double 1.000000e+00, double 1.000000e+00)
%11 = tail call i32 @glVertex3d(double 1.000000e+00, double 0.000000e+00, double -1.000000e+00)
%12 = tail call i32 @glTexCoord2d(double 0.000000e+00, double 1.000000e+00)
%13 = tail call i32 @glVertex3d(double -1.000000e+00, double 0.000000e+00, double -1.000000e+00)
%14 = tail call i32 (...) @glEnd()
%15 = tail call i32 (...) @glPopMatrix()
ret void
}