#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_FLAT;
int /*<<< orphan*/ GL_POLYGON;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(int, int, int);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ glTexCoord2f(int, int);
int /*<<< orphan*/ glVertex2f(double, double);
void DrawLogo(void) {
  glEnable(GL_TEXTURE_2D);
  glShadeModel(GL_SMOOTH);
  glBegin(GL_POLYGON);
  glColor3f(1, 0, 0);
  glTexCoord2f(0, 0);
  glVertex2f(-1.0, -0.5);
  glColor3f(0, 1, 0);
  glTexCoord2f(1, 0);
  glVertex2f(1.0, -0.5);
  glColor3f(0, 0, 1);
  glTexCoord2f(1, 1);
  glVertex2f(1.0, 0.5);
  glColor3f(1, 1, 0);
  glTexCoord2f(0, 1);
  glVertex2f(-1.0, 0.5);
  glEnd();
  glDisable(GL_TEXTURE_2D);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<DrawLogo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1080 <glShadeModel@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <glColor3f@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1070 <glTexCoord2f@plt>
movsd  0xe33(%rip),%xmm0
movsd  0xe43(%rip),%xmm1
call   1060 <glVertex2f@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1050 <glColor3f@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <glTexCoord2f@plt>
movsd  0xe14(%rip),%xmm0
movsd  0xe14(%rip),%xmm1
call   1060 <glVertex2f@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1050 <glColor3f@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1070 <glTexCoord2f@plt>
movsd  0xde5(%rip),%xmm0
movsd  0xdd5(%rip),%xmm1
call   1060 <glVertex2f@plt>
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <glColor3f@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1070 <glTexCoord2f@plt>
movsd  0xda6(%rip),%xmm0
movsd  0xda6(%rip),%xmm1
call   1060 <glVertex2f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
call   1090 <glDisable@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
call   1080 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawLogo>:
push   %rbx
mov    0x2e48(%rip),%rbx
mov    (%rbx),%edi
call   1030 <glEnable@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1080 <glShadeModel@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <glColor3f@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glTexCoord2f@plt>
movsd  0xe36(%rip),%xmm0
movsd  0xe36(%rip),%xmm1
call   1060 <glVertex2f@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <glColor3f@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <glTexCoord2f@plt>
movsd  0xe17(%rip),%xmm0
movsd  0xe07(%rip),%xmm1
call   1060 <glVertex2f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <glColor3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1070 <glTexCoord2f@plt>
movsd  0xded(%rip),%xmm1
movsd  0xddd(%rip),%xmm0
call   1060 <glVertex2f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <glColor3f@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1070 <glTexCoord2f@plt>
movsd  0xda3(%rip),%xmm0
movsd  0xdb3(%rip),%xmm1
call   1060 <glVertex2f@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
mov    (%rbx),%edi
call   1090 <glDisable@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1080 <glShadeModel@plt>

LLVM IR (-O0):
@GL_TEXTURE_2D = global i32 0
@GL_SMOOTH = global i32 0
@GL_POLYGON = global i32 0
@GL_FLAT = global i32 0
define void @DrawLogo() {
%1 = load i32, i32* @GL_TEXTURE_2D
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_SMOOTH
%4 = call i32 @glShadeModel(i32 %3)
%5 = load i32, i32* @GL_POLYGON
%6 = call i32 @glBegin(i32 %5)
%7 = call i32 @glColor3f(i32 1, i32 0, i32 0)
%8 = call i32 @glTexCoord2f(i32 0, i32 0)
%9 = call i32 @glVertex2f(double -1.000000e+00, double -5.000000e-01)
%10 = call i32 @glColor3f(i32 0, i32 1, i32 0)
%11 = call i32 @glTexCoord2f(i32 1, i32 0)
%12 = call i32 @glVertex2f(double 1.000000e+00, double -5.000000e-01)
%13 = call i32 @glColor3f(i32 0, i32 0, i32 1)
%14 = call i32 @glTexCoord2f(i32 1, i32 1)
%15 = call i32 @glVertex2f(double 1.000000e+00, double 5.000000e-01)
%16 = call i32 @glColor3f(i32 1, i32 1, i32 0)
%17 = call i32 @glTexCoord2f(i32 0, i32 1)
%18 = call i32 @glVertex2f(double -1.000000e+00, double 5.000000e-01)
%19 = call i32 (...) @glEnd()
%20 = load i32, i32* @GL_TEXTURE_2D
%21 = call i32 @glDisable(i32 %20)
%22 = load i32, i32* @GL_FLAT
%23 = call i32 @glShadeModel(i32 %22)
ret void
}

LLVM IR (-O2):
@GL_TEXTURE_2D = global i32 0
@GL_SMOOTH = global i32 0
@GL_POLYGON = global i32 0
@GL_FLAT = global i32 0
define void @DrawLogo() {
%1 = load i32, i32* @GL_TEXTURE_2D
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_SMOOTH
%4 = tail call i32 @glShadeModel(i32 %3)
%5 = load i32, i32* @GL_POLYGON
%6 = tail call i32 @glBegin(i32 %5)
%7 = tail call i32 @glColor3f(i32 1, i32 0, i32 0)
%8 = tail call i32 @glTexCoord2f(i32 0, i32 0)
%9 = tail call i32 @glVertex2f(double -1.000000e+00, double -5.000000e-01)
%10 = tail call i32 @glColor3f(i32 0, i32 1, i32 0)
%11 = tail call i32 @glTexCoord2f(i32 1, i32 0)
%12 = tail call i32 @glVertex2f(double 1.000000e+00, double -5.000000e-01)
%13 = tail call i32 @glColor3f(i32 0, i32 0, i32 1)
%14 = tail call i32 @glTexCoord2f(i32 1, i32 1)
%15 = tail call i32 @glVertex2f(double 1.000000e+00, double 5.000000e-01)
%16 = tail call i32 @glColor3f(i32 1, i32 1, i32 0)
%17 = tail call i32 @glTexCoord2f(i32 0, i32 1)
%18 = tail call i32 @glVertex2f(double -1.000000e+00, double 5.000000e-01)
%19 = tail call i32 (...) @glEnd()
%20 = load i32, i32* @GL_TEXTURE_2D
%21 = tail call i32 @glDisable(i32 %20)
%22 = load i32, i32* @GL_FLAT
%23 = tail call i32 @glShadeModel(i32 %22)
ret void
}