#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 */
typedef struct TYPE_12__ TYPE_3__;
typedef struct TYPE_11__ TYPE_2__;
typedef struct TYPE_10__ TYPE_1__;

/* Type definitions */
struct TYPE_10__ {
  int /*<<< orphan*/ visual;
  int /*<<< orphan*/ depth;
};
typedef TYPE_1__ XVisualInfo;
struct TYPE_11__ {
  int x;
  int y;
  int width;
  int height;
  int flags;
};
typedef TYPE_2__ XSizeHints;
struct TYPE_12__ {
  int event_mask;
  int /*<<< orphan*/ colormap;
  scalar_t__ border_pixel;
  scalar_t__ background_pixel;
};
typedef TYPE_3__ XSetWindowAttributes;
typedef int /*<<< orphan*/ Window;
typedef scalar_t__ GLXContext;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ AllocNone;
int ButtonPressMask;
int ButtonReleaseMask;
unsigned long CWBackPixel;
unsigned long CWBorderPixel;
unsigned long CWColormap;
unsigned long CWEventMask;
int DefaultScreen(int /*<<< orphan*/ *);
int ExposureMask;
int /*<<< orphan*/ False;
int GLX_BLUE_SIZE;
int GLX_DEPTH_SIZE;
int GLX_DOUBLEBUFFER;
int GLX_GREEN_SIZE;
int GLX_RED_SIZE;
int GLX_RGBA;
int /*<<< orphan*/ InputOutput;
int KeyPressMask;
int KeyReleaseMask;
int None;
int PointerMotionMask;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int StructureNotifyMask;
int /*<<< orphan*/ True;
int USPosition;
int USSize;
int /*<<< orphan*/ XCreateColormap(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XCreateWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/, int,
                                 int, int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 unsigned long, TYPE_3__ *);
int /*<<< orphan*/ XFree(TYPE_1__ *);
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ *XOpenDisplay(char *);
int /*<<< orphan*/ XSetNormalHints(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   TYPE_2__ *);
int /*<<< orphan*/ XSetStandardProperties(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/, char const *,
                                          char const *, int, char **,
                                          int /*<<< orphan*/, TYPE_2__ *);
int /*<<< orphan*/ XSetWMProtocols(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *, int);
int /*<<< orphan*/ exit(int);
TYPE_1__ *glXChooseVisual(int /*<<< orphan*/ *, int, int *);
scalar_t__ glXCreateContext(int /*<<< orphan*/ *, TYPE_1__ *,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void make_window(char *dpyName, const char *name, int x, int y, int width,
                 int height, Display **dpyRet, Window *winRet,
                 GLXContext *ctxRet) {
  int attrib[] = {GLX_RGBA,
                  GLX_RED_SIZE,
                  1,
                  GLX_GREEN_SIZE,
                  1,
                  GLX_BLUE_SIZE,
                  1,
                  GLX_DOUBLEBUFFER,
                  GLX_DEPTH_SIZE,
                  1,
                  None};
  int scrnum;
  XSetWindowAttributes attr;
  unsigned long mask;
  Window root;
  Window win;
  GLXContext ctx;
  XVisualInfo *visinfo;
  *dpyRet = XOpenDisplay(dpyName);
  if (!(*dpyRet)) {
    printf("Error: couldn't open display %s\n", dpyName);
    exit(1);
  }
  scrnum = DefaultScreen(*dpyRet);
  root = RootWindow(*dpyRet, scrnum);
  visinfo = glXChooseVisual(*dpyRet, scrnum, attrib);
  if (!visinfo) {
    printf("Error: couldn't get an RGB, double-buffered visual\n");
    exit(1);
  }
  attr.background_pixel = 0;
  attr.border_pixel = 0;
  attr.colormap = XCreateColormap(*dpyRet, root, visinfo->visual, AllocNone);
  attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask |
                    KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
                    PointerMotionMask;
  mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
  win = XCreateWindow(*dpyRet, root, 0, 0, width, height, 0, visinfo->depth,
                      InputOutput, visinfo->visual, mask, &attr);
  XSizeHints sizehints;
  sizehints.x = x;
  sizehints.y = y;
  sizehints.width = width;
  sizehints.height = height;
  sizehints.flags = USSize | USPosition;
  XSetNormalHints(*dpyRet, win, &sizehints);
  XSetStandardProperties(*dpyRet, win, name, name, None, (char **)NULL, 0,
                         &sizehints);
  Atom wmDeleteMessage = XInternAtom(*dpyRet, "WM_DELETE_WINDOW", False);
  XSetWMProtocols(*dpyRet, win, &wmDeleteMessage, 1);
  ctx = glXCreateContext(*dpyRet, visinfo, NULL, True);
  if (!ctx) {
    printf("Error: glXCreateContext failed\n");
    exit(1);
  }
  XFree(visinfo);
  *winRet = win;
  *ctxRet = ctx;
}


x86 assembly (clang, -O0):
<make_window>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2d25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x1,-0x58(%rbp)
mov    0x2d7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
movl   $0x1,-0x50(%rbp)
mov    0x2d5f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x1,-0x48(%rbp)
mov    0x2d04(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2d68(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    0x2d15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <XOpenDisplay@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    12bd <make_window+0xdd>
mov    -0x18(%rbp),%rsi
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <DefaultScreen@plt>
mov    %eax,-0x64(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x64(%rbp),%esi
call   10c0 <RootWindow@plt>
mov    %eax,-0x8c(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x64(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   10e0 <glXChooseVisual@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0xa0(%rbp)
jne    1321 <make_window+0x141>
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8c(%rbp),%esi
mov    -0xa0(%rbp),%rax
mov    (%rax),%edx
mov    0x2c32(%rip),%rax
mov    (%rax),%ecx
call   10d0 <XCreateColormap@plt>
mov    %eax,-0x7c(%rbp)
mov    0x2c09(%rip),%rax
mov    (%rax),%eax
mov    0x2bd8(%rip),%rcx
or     (%rcx),%eax
mov    0x2c27(%rip),%rcx
or     (%rcx),%eax
mov    0x2bb6(%rip),%rcx
or     (%rcx),%eax
mov    0x2c1d(%rip),%rcx
or     (%rcx),%eax
mov    0x2bcc(%rip),%rcx
or     (%rcx),%eax
mov    0x2c53(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x80(%rbp)
mov    0x2c27(%rip),%rax
mov    (%rax),%rax
mov    0x2c35(%rip),%rcx
or     (%rcx),%rax
mov    0x2bc3(%rip),%rcx
or     (%rcx),%rax
mov    0x2b79(%rip),%rcx
or     (%rcx),%rax
mov    %rax,-0x88(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8c(%rbp),%esi
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0xa0(%rbp),%rax
mov    0x4(%rax),%r14d
mov    0x2b60(%rip),%rax
mov    (%rax),%ebx
mov    -0xa0(%rbp),%rax
mov    (%rax),%r11d
mov    -0x88(%rbp),%r10
xor    %ecx,%ecx
lea    -0x80(%rbp),%rax
mov    %ecx,%edx
movl   $0x0,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   10b0 <XCreateWindow@plt>
mov    %eax,-0x90(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    0x2ac8(%rip),%rax
mov    (%rax),%eax
mov    0x2b8f(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xa8(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x90(%rbp),%esi
lea    -0xb8(%rbp),%rdx
call   1080 <XSetNormalHints@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x90(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x2aea(%rip),%rax
mov    (%rax),%r8d
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
lea    -0xb8(%rbp),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <XSetStandardProperties@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2aea(%rip),%rax
mov    (%rax),%edx
lea    0xb76(%rip),%rsi
call   1090 <XInternAtom@plt>
mov    %eax,-0xbc(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x90(%rbp),%esi
lea    -0xbc(%rbp),%rdx
mov    $0x1,%ecx
call   1070 <XSetWMProtocols@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0xa0(%rbp),%rsi
mov    0x2a6b(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edx
call   10a0 <glXCreateContext@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    1555 <make_window+0x375>
lea    0xb22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0xa0(%rbp),%rdi
call   1050 <XFree@plt>
mov    -0x90(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x98(%rbp),%rcx
mov    0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_window>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9d,0x10(%rsp)
mov    %r8d,%r13d
mov    %ecx,0xc(%rsp)
mov    %edx,0x8(%rsp)
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    0xc0(%rsp),%r14
mov    0x2d92(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x30(%rsp)
mov    0x2d15(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x34(%rsp)
movl   $0x1,0x38(%rsp)
mov    0x2d68(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x3c(%rsp)
movl   $0x1,0x40(%rsp)
mov    0x2d4b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x44(%rsp)
movl   $0x1,0x48(%rsp)
mov    0x2cee(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4c(%rsp)
mov    0x2d51(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x50(%rsp)
movl   $0x1,0x54(%rsp)
mov    0x2cfc(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x58(%rsp)
call   1070 <XOpenDisplay@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     14a2 <make_window+0x2b2>
mov    %rbp,0x68(%rsp)
mov    %rax,%rdi
call   1110 <DefaultScreen@plt>
mov    %eax,%ebx
mov    (%r14),%rdi
mov    %eax,%esi
call   10d0 <RootWindow@plt>
mov    %eax,%r12d
mov    (%r14),%rdi
lea    0x30(%rsp),%rdx
mov    %ebx,%esi
call   10f0 <glXChooseVisual@plt>
test   %rax,%rax
je     14bd <make_window+0x2cd>
mov    %rax,%r15
xorps  %xmm0,%xmm0
movups %xmm0,0x78(%rsp)
mov    (%r14),%rdi
mov    (%rax),%edx
mov    0x2c8a(%rip),%rax
mov    (%rax),%ecx
mov    %r12d,%esi
call   10e0 <XCreateColormap@plt>
mov    0x2c61(%rip),%rcx
mov    0x2c32(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    0x2c7f(%rip),%rcx
or     (%rcx),%edx
mov    0x2c0e(%rip),%rcx
or     (%rcx),%edx
mov    0x2c75(%rip),%rcx
or     (%rcx),%edx
mov    %eax,0x74(%rsp)
mov    0x2c20(%rip),%rax
or     (%rax),%edx
mov    0x2ca7(%rip),%rax
or     (%rax),%edx
mov    0x2c7e(%rip),%rax
mov    0x2c8f(%rip),%rcx
mov    (%rcx),%rbp
or     (%rax),%rbp
mov    %edx,0x70(%rsp)
mov    0x2c16(%rip),%rax
or     (%rax),%rbp
mov    0x2bcc(%rip),%rax
or     (%rax),%rbp
mov    (%r14),%rdi
mov    (%r15),%eax
mov    0x4(%r15),%r10d
mov    0x2bd0(%rip),%rcx
mov    (%rcx),%ebx
lea    0x70(%rsp),%r11
mov    %r12d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r13d,%r8d
mov    %r13d,%r14d
mov    0x10(%rsp),%r13d
mov    %r13d,%r9d
push   %r11
push   %rbp
push   %rax
push   %rbx
push   %r10
push   $0x0
call   10c0 <XCreateWindow@plt>
add    $0x30,%rsp
mov    %eax,%r12d
mov    0x8(%rsp),%eax
mov    %eax,0x18(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    %r14d,0x20(%rsp)
mov    %r13d,0x24(%rsp)
mov    0x2b56(%rip),%rax
mov    0x2c1f(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %ecx,0x28(%rsp)
mov    0xc0(%rsp),%rbx
mov    (%rbx),%rdi
lea    0x18(%rsp),%rbp
mov    %r12d,%esi
mov    %rbp,%rdx
call   1090 <XSetNormalHints@plt>
mov    (%rbx),%rdi
mov    0x2b8a(%rip),%rax
mov    (%rax),%r8d
mov    %r12d,%esi
mov    0x68(%rsp),%rcx
mov    %rcx,%rdx
xor    %r9d,%r9d
push   %rbp
push   $0x0
call   1030 <XSetStandardProperties@plt>
add    $0x10,%rsp
mov    (%rbx),%rdi
mov    0x2b93(%rip),%rax
mov    (%rax),%edx
lea    0xbeb(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    %eax,0x14(%rsp)
mov    (%rbx),%rdi
lea    0x14(%rsp),%rdx
mov    %r12d,%esi
mov    $0x1,%ecx
call   1080 <XSetWMProtocols@plt>
mov    (%rbx),%rdi
mov    0x2b2a(%rip),%rax
mov    (%rax),%ecx
mov    %r15,%rsi
xor    %edx,%edx
call   10b0 <glXCreateContext@plt>
test   %rax,%rax
je     14c6 <make_window+0x2d6>
mov    %rax,%rbp
mov    0xd0(%rsp),%r14
mov    0xc8(%rsp),%rbx
mov    %r15,%rdi
call   1060 <XFree@plt>
mov    %r12d,(%rbx)
mov    %rbp,(%r14)
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb57(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xb6e(%rip),%rdi
jmp    14cd <make_window+0x2dd>
lea    0xb98(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_12__ = type { i32, i32, i64, i64 }
%struct.TYPE_10__ = type { i32, i32 }
%struct.TYPE_11__ = type { i32, i32, i32, i32, i32 }
@GLX_RGBA = global i32 0
@GLX_RED_SIZE = global i32 0
@GLX_GREEN_SIZE = global i32 0
@GLX_BLUE_SIZE = global i32 0
@GLX_DOUBLEBUFFER = global i32 0
@GLX_DEPTH_SIZE = global i32 0
@None = global i32 0
@.str = [33 x i8] c"Error: couldn't open display %s\0A\00"
@.str.1 = [52 x i8] c"Error: couldn't get an RGB, double-buffered visual\0A\00"
@AllocNone = global i32 0
@StructureNotifyMask = global i32 0
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@KeyReleaseMask = global i32 0
@ButtonPressMask = global i32 0
@ButtonReleaseMask = global i32 0
@PointerMotionMask = global i32 0
@CWBackPixel = global i64 0
@CWBorderPixel = global i64 0
@CWColormap = global i64 0
@CWEventMask = global i64 0
@InputOutput = global i32 0
@USSize = global i32 0
@USPosition = global i32 0
@.str.2 = [17 x i8] c"WM_DELETE_WINDOW\00"
@False = global i32 0
@True = global i32 0
@.str.3 = [32 x i8] c"Error: glXCreateContext failed\0A\00"
define void @make_window(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32** %6, i32* %7, i64* %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32**
%17 = alloca i32*
%18 = alloca i64*
%19 = alloca [11 x i32]
%20 = alloca i32
%21 = alloca %struct.TYPE_12__
%22 = alloca i64
%23 = alloca i32
%24 = alloca i32
%25 = alloca i64
%26 = alloca %struct.TYPE_10__*
%27 = alloca %struct.TYPE_11__
%28 = alloca i32
store i8* %0, i8** %10
store i8* %1, i8** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32** %6, i32*** %16
store i32* %7, i32** %17
store i64* %8, i64** %18
%29 = getelementptr inbounds [11 x i32], [11 x i32]* %19, i64 0, i64 0
%30 = load i32, i32* @GLX_RGBA
store i32 %30, i32* %29
%31 = getelementptr inbounds i32, i32* %29, i64 1
%32 = load i32, i32* @GLX_RED_SIZE
store i32 %32, i32* %31
%33 = getelementptr inbounds i32, i32* %31, i64 1
store i32 1, i32* %33
%34 = getelementptr inbounds i32, i32* %33, i64 1
%35 = load i32, i32* @GLX_GREEN_SIZE
store i32 %35, i32* %34
%36 = getelementptr inbounds i32, i32* %34, i64 1
store i32 1, i32* %36
%37 = getelementptr inbounds i32, i32* %36, i64 1
%38 = load i32, i32* @GLX_BLUE_SIZE
store i32 %38, i32* %37
%39 = getelementptr inbounds i32, i32* %37, i64 1
store i32 1, i32* %39
%40 = getelementptr inbounds i32, i32* %39, i64 1
%41 = load i32, i32* @GLX_DOUBLEBUFFER
store i32 %41, i32* %40
%42 = getelementptr inbounds i32, i32* %40, i64 1
%43 = load i32, i32* @GLX_DEPTH_SIZE
store i32 %43, i32* %42
%44 = getelementptr inbounds i32, i32* %42, i64 1
store i32 1, i32* %44
%45 = getelementptr inbounds i32, i32* %44, i64 1
%46 = load i32, i32* @None
store i32 %46, i32* %45
%47 = load i8*, i8** %10
%48 = call i32* @XOpenDisplay(i8* %47)
%49 = load i32**, i32*** %16
store i32* %48, i32** %49
%50 = load i32**, i32*** %16
%51 = load i32*, i32** %50
%52 = icmp ne i32* %51, null
br i1 %52, label %57, label %53
53: ; preds = %9
%54 = load i8*, i8** %10
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %54)
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %9
%58 = load i32**, i32*** %16
%59 = load i32*, i32** %58
%60 = call i32 @DefaultScreen(i32* %59)
store i32 %60, i32* %20
%61 = load i32**, i32*** %16
%62 = load i32*, i32** %61
%63 = load i32, i32* %20
%64 = call i32 @RootWindow(i32* %62, i32 %63)
store i32 %64, i32* %23
%65 = load i32**, i32*** %16
%66 = load i32*, i32** %65
%67 = load i32, i32* %20
%68 = getelementptr inbounds [11 x i32], [11 x i32]* %19, i64 0, i64 0
%69 = call %struct.TYPE_10__* @glXChooseVisual(i32* %66, i32 %67, i32* %68)
store %struct.TYPE_10__* %69, %struct.TYPE_10__** %26
%70 = load %struct.TYPE_10__*, %struct.TYPE_10__** %26
%71 = icmp ne %struct.TYPE_10__* %70, null
br i1 %71, label %75, label %72
72: ; preds = %57
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %57
%76 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %21, i32 0, i32 3
store i64 0, i64* %76
%77 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %21, i32 0, i32 2
store i64 0, i64* %77
%78 = load i32**, i32*** %16
%79 = load i32*, i32** %78
%80 = load i32, i32* %23
%81 = load %struct.TYPE_10__*, %struct.TYPE_10__** %26
%82 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %81, i32 0, i32 0
%83 = load i32, i32* %82
%84 = load i32, i32* @AllocNone
%85 = call i32 @XCreateColormap(i32* %79, i32 %80, i32 %83, i32 %84)
%86 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %21, i32 0, i32 1
store i32 %85, i32* %86
%87 = load i32, i32* @StructureNotifyMask
%88 = load i32, i32* @ExposureMask
%89 = or i32 %87, %88
%90 = load i32, i32* @KeyPressMask
%91 = or i32 %89, %90
%92 = load i32, i32* @KeyReleaseMask
%93 = or i32 %91, %92
%94 = load i32, i32* @ButtonPressMask
%95 = or i32 %93, %94
%96 = load i32, i32* @ButtonReleaseMask
%97 = or i32 %95, %96
%98 = load i32, i32* @PointerMotionMask
%99 = or i32 %97, %98
%100 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %21, i32 0, i32 0
store i32 %99, i32* %100
%101 = load i64, i64* @CWBackPixel
%102 = load i64, i64* @CWBorderPixel
%103 = or i64 %101, %102
%104 = load i64, i64* @CWColormap
%105 = or i64 %103, %104
%106 = load i64, i64* @CWEventMask
%107 = or i64 %105, %106
store i64 %107, i64* %22
%108 = load i32**, i32*** %16
%109 = load i32*, i32** %108
%110 = load i32, i32* %23
%111 = load i32, i32* %14
%112 = load i32, i32* %15
%113 = load %struct.TYPE_10__*, %struct.TYPE_10__** %26
%114 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %113, i32 0, i32 1
%115 = load i32, i32* %114
%116 = load i32, i32* @InputOutput
%117 = load %struct.TYPE_10__*, %struct.TYPE_10__** %26
%118 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %117, i32 0, i32 0
%119 = load i32, i32* %118
%120 = load i64, i64* %22
%121 = call i32 @XCreateWindow(i32* %109, i32 %110, i32 0, i32 0, i32 %111, i32 %112, i32 0, i32 %115, i32 %116, i32 %119, i64 %120, %struct.TYPE_12__* %21)
store i32 %121, i32* %24
%122 = load i32, i32* %12
%123 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %27, i32 0, i32 0
store i32 %122, i32* %123
%124 = load i32, i32* %13
%125 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %27, i32 0, i32 1
store i32 %124, i32* %125
%126 = load i32, i32* %14
%127 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %27, i32 0, i32 2
store i32 %126, i32* %127
%128 = load i32, i32* %15
%129 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %27, i32 0, i32 3
store i32 %128, i32* %129
%130 = load i32, i32* @USSize
%131 = load i32, i32* @USPosition
%132 = or i32 %130, %131
%133 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %27, i32 0, i32 4
store i32 %132, i32* %133
%134 = load i32**, i32*** %16
%135 = load i32*, i32** %134
%136 = load i32, i32* %24
%137 = call i32 @XSetNormalHints(i32* %135, i32 %136, %struct.TYPE_11__* %27)
%138 = load i32**, i32*** %16
%139 = load i32*, i32** %138
%140 = load i32, i32* %24
%141 = load i8*, i8** %11
%142 = load i8*, i8** %11
%143 = load i32, i32* @None
%144 = call i32 @XSetStandardProperties(i32* %139, i32 %140, i8* %141, i8* %142, i32 %143, i8** null, i32 0, %struct.TYPE_11__* %27)
%145 = load i32**, i32*** %16
%146 = load i32*, i32** %145
%147 = load i32, i32* @False
%148 = call i32 @XInternAtom(i32* %146, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %147)
store i32 %148, i32* %28
%149 = load i32**, i32*** %16
%150 = load i32*, i32** %149
%151 = load i32, i32* %24
%152 = call i32 @XSetWMProtocols(i32* %150, i32 %151, i32* %28, i32 1)
%153 = load i32**, i32*** %16
%154 = load i32*, i32** %153
%155 = load %struct.TYPE_10__*, %struct.TYPE_10__** %26
%156 = load i32, i32* @True
%157 = call i64 @glXCreateContext(i32* %154, %struct.TYPE_10__* %155, i32* null, i32 %156)
store i64 %157, i64* %25
%158 = load i64, i64* %25
%159 = icmp ne i64 %158, 0
br i1 %159, label %163, label %160
160: ; preds = %75
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%162 = call i32 @exit(i32 1)
unreachable
163: ; preds = %75
%164 = load %struct.TYPE_10__*, %struct.TYPE_10__** %26
%165 = call i32 @XFree(%struct.TYPE_10__* %164)
%166 = load i32, i32* %24
%167 = load i32*, i32** %17
store i32 %166, i32* %167
%168 = load i64, i64* %25
%169 = load i64*, i64** %18
store i64 %168, i64* %169
ret void
}

LLVM IR (-O2):
%struct.TYPE_12__ = type { i32, i32, i64, i64 }
%struct.TYPE_11__ = type { i32, i32, i32, i32, i32 }
%struct.TYPE_10__ = type { i32, i32 }
@GLX_RGBA = global i32 0
@GLX_RED_SIZE = global i32 0
@GLX_GREEN_SIZE = global i32 0
@GLX_BLUE_SIZE = global i32 0
@GLX_DOUBLEBUFFER = global i32 0
@GLX_DEPTH_SIZE = global i32 0
@None = global i32 0
@.str = [33 x i8] c"Error: couldn't open display %s\0A\00"
@AllocNone = global i32 0
@StructureNotifyMask = global i32 0
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@KeyReleaseMask = global i32 0
@ButtonPressMask = global i32 0
@ButtonReleaseMask = global i32 0
@PointerMotionMask = global i32 0
@CWBackPixel = global i64 0
@CWBorderPixel = global i64 0
@CWColormap = global i64 0
@CWEventMask = global i64 0
@InputOutput = global i32 0
@USSize = global i32 0
@USPosition = global i32 0
@.str.2 = [17 x i8] c"WM_DELETE_WINDOW\00"
@False = global i32 0
@True = global i32 0
@str = [51 x i8] c"Error: couldn't get an RGB, double-buffered visual\00"
@str.4 = [31 x i8] c"Error: glXCreateContext failed\00"
define void @make_window(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32** nocapture %6, i32* nocapture writeonly %7, i64* nocapture writeonly %8) {
%10 = alloca [11 x i32]
%11 = alloca %struct.TYPE_12__
%12 = alloca %struct.TYPE_11__
%13 = alloca i32
%14 = bitcast [11 x i32]* %10 to i8*
%15 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 0
%16 = load i32, i32* @GLX_RGBA
store i32 %16, i32* %15
%17 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 1
%18 = load i32, i32* @GLX_RED_SIZE
store i32 %18, i32* %17
%19 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 2
store i32 1, i32* %19
%20 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 3
%21 = load i32, i32* @GLX_GREEN_SIZE
store i32 %21, i32* %20
%22 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 4
store i32 1, i32* %22
%23 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 5
%24 = load i32, i32* @GLX_BLUE_SIZE
store i32 %24, i32* %23
%25 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 6
store i32 1, i32* %25
%26 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 7
%27 = load i32, i32* @GLX_DOUBLEBUFFER
store i32 %27, i32* %26
%28 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 8
%29 = load i32, i32* @GLX_DEPTH_SIZE
store i32 %29, i32* %28
%30 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 9
store i32 1, i32* %30
%31 = getelementptr inbounds [11 x i32], [11 x i32]* %10, i64 0, i64 10
%32 = load i32, i32* @None
store i32 %32, i32* %31
%33 = bitcast %struct.TYPE_12__* %11 to i8*
%34 = tail call i32* @XOpenDisplay(i8* %0)
store i32* %34, i32** %6
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %39
36: ; preds = %9
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%38 = tail call i32 @exit(i32 1)
unreachable
39: ; preds = %9
%40 = tail call i32 @DefaultScreen(i32* %34)
%41 = load i32*, i32** %6
%42 = tail call i32 @RootWindow(i32* %41, i32 %40)
%43 = load i32*, i32** %6
%44 = call %struct.TYPE_10__* @glXChooseVisual(i32* %43, i32 %40, i32* %15)
%45 = icmp eq %struct.TYPE_10__* %44, null
br i1 %45, label %46, label %49
46: ; preds = %39
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %39
%50 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %11, i64 0, i32 2
%51 = bitcast i64* %50 to i8*
%52 = load i32*, i32** %6
%53 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %44, i64 0, i32 0
%54 = load i32, i32* %53
%55 = load i32, i32* @AllocNone
%56 = call i32 @XCreateColormap(i32* %52, i32 %42, i32 %54, i32 %55)
%57 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %11, i64 0, i32 1
store i32 %56, i32* %57
%58 = load i32, i32* @StructureNotifyMask
%59 = load i32, i32* @ExposureMask
%60 = or i32 %59, %58
%61 = load i32, i32* @KeyPressMask
%62 = or i32 %60, %61
%63 = load i32, i32* @KeyReleaseMask
%64 = or i32 %62, %63
%65 = load i32, i32* @ButtonPressMask
%66 = or i32 %64, %65
%67 = load i32, i32* @ButtonReleaseMask
%68 = or i32 %66, %67
%69 = load i32, i32* @PointerMotionMask
%70 = or i32 %68, %69
%71 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %11, i64 0, i32 0
store i32 %70, i32* %71
%72 = load i64, i64* @CWBackPixel
%73 = load i64, i64* @CWBorderPixel
%74 = or i64 %73, %72
%75 = load i64, i64* @CWColormap
%76 = or i64 %74, %75
%77 = load i64, i64* @CWEventMask
%78 = or i64 %76, %77
%79 = load i32*, i32** %6
%80 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %44, i64 0, i32 1
%81 = load i32, i32* %80
%82 = load i32, i32* @InputOutput
%83 = load i32, i32* %53
%84 = call i32 @XCreateWindow(i32* %79, i32 %42, i32 0, i32 0, i32 %4, i32 %5, i32 0, i32 %81, i32 %82, i32 %83, i64 %78, %struct.TYPE_12__* %11)
%85 = bitcast %struct.TYPE_11__* %12 to i8*
%86 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %12, i64 0, i32 0
store i32 %2, i32* %86
%87 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %12, i64 0, i32 1
store i32 %3, i32* %87
%88 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %12, i64 0, i32 2
store i32 %4, i32* %88
%89 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %12, i64 0, i32 3
store i32 %5, i32* %89
%90 = load i32, i32* @USSize
%91 = load i32, i32* @USPosition
%92 = or i32 %91, %90
%93 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %12, i64 0, i32 4
store i32 %92, i32* %93
%94 = load i32*, i32** %6
%95 = call i32 @XSetNormalHints(i32* %94, i32 %84, %struct.TYPE_11__* %12)
%96 = load i32*, i32** %6
%97 = load i32, i32* @None
%98 = call i32 @XSetStandardProperties(i32* %96, i32 %84, i8* %1, i8* %1, i32 %97, i8** null, i32 0, %struct.TYPE_11__* %12)
%99 = bitcast i32* %13 to i8*
%100 = load i32*, i32** %6
%101 = load i32, i32* @False
%102 = call i32 @XInternAtom(i32* %100, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %101)
store i32 %102, i32* %13
%103 = load i32*, i32** %6
%104 = call i32 @XSetWMProtocols(i32* %103, i32 %84, i32* %13, i32 1)
%105 = load i32*, i32** %6
%106 = load i32, i32* @True
%107 = call i64 @glXCreateContext(i32* %105, %struct.TYPE_10__* %44, i32* null, i32 %106)
%108 = icmp eq i64 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %49
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
%111 = call i32 @exit(i32 1)
unreachable
112: ; preds = %49
%113 = call i32 @XFree(%struct.TYPE_10__* %44)
store i32 %84, i32* %7
store i64 %107, i64* %8
ret void
}