#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_BACK;
int /*<<< orphan*/ GL_BLEND;
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_LINE_SMOOTH;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_ONE_MINUS_SRC_ALPHA;
int /*<<< orphan*/ GL_POINT_SMOOTH;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ GL_SRC_ALPHA;
int /*<<< orphan*/ GL_TEXTURE;
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glDrawBuffer(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLineStipple(int, int);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glReadBuffer(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void setup_opengl(int w, int h) {
  glShadeModel(GL_SMOOTH);
  glClearColor(0, 0, 0, 0);
  glViewport(0, 0, w, h);
  glMatrixMode(GL_TEXTURE);
  glLoadIdentity();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glDrawBuffer(GL_BACK);
  glReadBuffer(GL_BACK);
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  glEnable(GL_LINE_SMOOTH);
  glEnable(GL_POINT_SMOOTH);
  glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
  glClear(GL_COLOR_BUFFER_BIT);
  glLineStipple(2, 0xAAAA);
}


x86 assembly (clang, -O0):
<setup_opengl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
call   10c0 <glShadeModel@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   10a0 <glClearColor@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   10d0 <glViewport@plt>
mov    0x2de5(%rip),%rax
mov    (%rax),%edi
call   1060 <glMatrixMode@plt>
mov    $0x0,%al
call   10b0 <glLoadIdentity@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
call   1060 <glMatrixMode@plt>
mov    $0x0,%al
call   10b0 <glLoadIdentity@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
call   1060 <glMatrixMode@plt>
mov    $0x0,%al
call   10b0 <glLoadIdentity@plt>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
call   1080 <glDrawBuffer@plt>
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
call   1050 <glReadBuffer@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   10a0 <glClearColor@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
mov    $0x2,%edi
mov    $0xaaaa,%esi
call   1090 <glLineStipple@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_opengl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
call   10c0 <glShadeModel@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   10a0 <glClearColor@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   10d0 <glViewport@plt>
mov    0x2dee(%rip),%rax
mov    (%rax),%edi
call   1060 <glMatrixMode@plt>
xor    %eax,%eax
call   10b0 <glLoadIdentity@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
call   1060 <glMatrixMode@plt>
xor    %eax,%eax
call   10b0 <glLoadIdentity@plt>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
call   1060 <glMatrixMode@plt>
xor    %eax,%eax
call   10b0 <glLoadIdentity@plt>
mov    0x2d8f(%rip),%rbx
mov    (%rbx),%edi
call   1080 <glDrawBuffer@plt>
mov    (%rbx),%edi
call   1050 <glReadBuffer@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
mov    0x2d93(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2d5f(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   10a0 <glClearColor@plt>
mov    0x2d08(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
mov    $0x2,%edi
mov    $0xaaaa,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1090 <glLineStipple@plt>

LLVM IR (-O0):
@GL_SMOOTH = global i32 0
@GL_TEXTURE = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_BACK = global i32 0
@GL_BLEND = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_LINE_SMOOTH = global i32 0
@GL_POINT_SMOOTH = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
define void @setup_opengl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_SMOOTH
%6 = call i32 @glShadeModel(i32 %5)
%7 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @glViewport(i32 0, i32 0, i32 %8, i32 %9)
%11 = load i32, i32* @GL_TEXTURE
%12 = call i32 @glMatrixMode(i32 %11)
%13 = call i32 (...) @glLoadIdentity()
%14 = load i32, i32* @GL_PROJECTION
%15 = call i32 @glMatrixMode(i32 %14)
%16 = call i32 (...) @glLoadIdentity()
%17 = load i32, i32* @GL_MODELVIEW
%18 = call i32 @glMatrixMode(i32 %17)
%19 = call i32 (...) @glLoadIdentity()
%20 = load i32, i32* @GL_BACK
%21 = call i32 @glDrawBuffer(i32 %20)
%22 = load i32, i32* @GL_BACK
%23 = call i32 @glReadBuffer(i32 %22)
%24 = load i32, i32* @GL_BLEND
%25 = call i32 @glEnable(i32 %24)
%26 = load i32, i32* @GL_SRC_ALPHA
%27 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%28 = call i32 @glBlendFunc(i32 %26, i32 %27)
%29 = load i32, i32* @GL_LINE_SMOOTH
%30 = call i32 @glEnable(i32 %29)
%31 = load i32, i32* @GL_POINT_SMOOTH
%32 = call i32 @glEnable(i32 %31)
%33 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%34 = load i32, i32* @GL_COLOR_BUFFER_BIT
%35 = call i32 @glClear(i32 %34)
%36 = call i32 @glLineStipple(i32 2, i32 43690)
ret void
}

LLVM IR (-O2):
@GL_SMOOTH = global i32 0
@GL_TEXTURE = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_BACK = global i32 0
@GL_BLEND = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_LINE_SMOOTH = global i32 0
@GL_POINT_SMOOTH = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
define void @setup_opengl(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_SMOOTH
%4 = tail call i32 @glShadeModel(i32 %3)
%5 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%6 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%7 = load i32, i32* @GL_TEXTURE
%8 = tail call i32 @glMatrixMode(i32 %7)
%9 = tail call i32 (...) @glLoadIdentity()
%10 = load i32, i32* @GL_PROJECTION
%11 = tail call i32 @glMatrixMode(i32 %10)
%12 = tail call i32 (...) @glLoadIdentity()
%13 = load i32, i32* @GL_MODELVIEW
%14 = tail call i32 @glMatrixMode(i32 %13)
%15 = tail call i32 (...) @glLoadIdentity()
%16 = load i32, i32* @GL_BACK
%17 = tail call i32 @glDrawBuffer(i32 %16)
%18 = load i32, i32* @GL_BACK
%19 = tail call i32 @glReadBuffer(i32 %18)
%20 = load i32, i32* @GL_BLEND
%21 = tail call i32 @glEnable(i32 %20)
%22 = load i32, i32* @GL_SRC_ALPHA
%23 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%24 = tail call i32 @glBlendFunc(i32 %22, i32 %23)
%25 = load i32, i32* @GL_LINE_SMOOTH
%26 = tail call i32 @glEnable(i32 %25)
%27 = load i32, i32* @GL_POINT_SMOOTH
%28 = tail call i32 @glEnable(i32 %27)
%29 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%30 = load i32, i32* @GL_COLOR_BUFFER_BIT
%31 = tail call i32 @glClear(i32 %30)
%32 = tail call i32 @glLineStipple(i32 2, i32 43690)
ret void
}