#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;

/* Variables and functions */
int /*<<< orphan*/ AllocNone;
unsigned long CWBackPixel;
unsigned long CWBorderPixel;
unsigned long CWColormap;
unsigned long CWEventMask;
int DefaultScreen(int /*<<< orphan*/ *);
int ExposureMask;
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 None;
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*/ 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*/ 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(Display *dpy, const char *name, int x, int y, int width,
                 int height, 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;
  scrnum = DefaultScreen(dpy);
  root = RootWindow(dpy, scrnum);
  visinfo = glXChooseVisual(dpy, 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(dpy, root, visinfo->visual, AllocNone);
  attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
  mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
  win = XCreateWindow(dpy, 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(dpy, win, &sizehints);
    XSetStandardProperties(dpy, win, name, name, None, (char **)NULL, 0,
                           &sizehints);
  }
  ctx = glXCreateContext(dpy, 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    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    0x2de5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2d79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x1,-0x58(%rbp)
mov    0x2dbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
movl   $0x1,-0x50(%rbp)
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x1,-0x48(%rbp)
mov    0x2d50(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2da4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    0x2d61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   10d0 <DefaultScreen@plt>
mov    %eax,-0x64(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1090 <RootWindow@plt>
mov    %eax,-0x8c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x64(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   10b0 <glXChooseVisual@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0xa0(%rbp)
jne    12a5 <make_window+0xf5>
lea    0xd6a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8c(%rbp),%esi
mov    -0xa0(%rbp),%rax
mov    (%rax),%edx
mov    0x2cc9(%rip),%rax
mov    (%rax),%ecx
call   10a0 <XCreateColormap@plt>
mov    %eax,-0x7c(%rbp)
mov    0x2ca0(%rip),%rax
mov    (%rax),%eax
mov    0x2c77(%rip),%rcx
or     (%rcx),%eax
mov    0x2cbe(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x80(%rbp)
mov    0x2cd2(%rip),%rax
mov    (%rax),%rax
mov    0x2ce0(%rip),%rcx
or     (%rcx),%rax
mov    0x2c7e(%rip),%rcx
or     (%rcx),%rax
mov    0x2c3c(%rip),%rcx
or     (%rcx),%rax
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8c(%rbp),%esi
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0xa0(%rbp),%rax
mov    0x4(%rax),%r14d
mov    0x2c26(%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   1080 <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    0x2b96(%rip),%rax
mov    (%rax),%eax
mov    0x2c35(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x90(%rbp),%esi
lea    -0xb8(%rbp),%rdx
call   1060 <XSetNormalHints@plt>
mov    -0x18(%rbp),%rdi
mov    -0x90(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x2bae(%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    -0x18(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
mov    0x2b72(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edx
call   1070 <glXCreateContext@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    1464 <make_window+0x2b4>
lea    0xbdf(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0xa0(%rbp),%rdi
call   1050 <XFree@plt>
mov    -0x90(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x98(%rbp),%rcx
mov    0x18(%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,0x14(%rsp)
mov    %r8d,%ebx
mov    %ecx,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %rsi,0x68(%rsp)
mov    %rdi,%r12
mov    0x2de8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x30(%rsp)
mov    0x2d7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x34(%rsp)
movl   $0x1,0x38(%rsp)
mov    0x2dbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x3c(%rsp)
movl   $0x1,0x40(%rsp)
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x44(%rsp)
movl   $0x1,0x48(%rsp)
mov    0x2d4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4c(%rsp)
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x50(%rsp)
movl   $0x1,0x54(%rsp)
mov    0x2d5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x58(%rsp)
call   10d0 <DefaultScreen@plt>
mov    %eax,%ebp
mov    %r12,%rdi
mov    %eax,%esi
call   1090 <RootWindow@plt>
mov    %eax,%r13d
lea    0x30(%rsp),%rdx
mov    %r12,%rdi
mov    %ebp,%esi
call   10b0 <glXChooseVisual@plt>
test   %rax,%rax
je     13e5 <make_window+0x235>
mov    %rax,%r14
xorps  %xmm0,%xmm0
movups %xmm0,0x78(%rsp)
mov    (%rax),%edx
mov    0x2d04(%rip),%rax
mov    (%rax),%ecx
mov    %r12,%rdi
mov    %r13d,%esi
call   10a0 <XCreateColormap@plt>
mov    0x2cd8(%rip),%rcx
mov    0x2cb1(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    0x2cf6(%rip),%rcx
or     (%rcx),%edx
mov    0x2d0d(%rip),%rcx
mov    0x2d1e(%rip),%rsi
mov    (%rsi),%rbp
or     (%rcx),%rbp
mov    %eax,0x74(%rsp)
mov    0x2cb5(%rip),%rax
or     (%rax),%rbp
mov    %edx,0x70(%rsp)
mov    0x2c6f(%rip),%rax
or     (%rax),%rbp
mov    (%r14),%eax
mov    0x4(%r14),%r10d
mov    0x2c76(%rip),%rcx
mov    (%rcx),%r11d
lea    0x70(%rsp),%r15
mov    %r12,%rdi
mov    %r13d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
mov    %ebx,%r13d
mov    0x14(%rsp),%ebx
mov    %ebx,%r9d
push   %r15
push   %rbp
push   %rax
push   %r11
push   %r10
push   $0x0
call   1080 <XCreateWindow@plt>
add    $0x30,%rsp
mov    %eax,%ebp
mov    0xc(%rsp),%eax
mov    %eax,0x18(%rsp)
mov    0x10(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    %r13d,0x20(%rsp)
mov    %ebx,0x24(%rsp)
mov    0x2c02(%rip),%rax
mov    0x2ca3(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %ecx,0x28(%rsp)
lea    0x18(%rsp),%r15
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
call   1060 <XSetNormalHints@plt>
mov    0x2c32(%rip),%rax
mov    (%rax),%r8d
mov    %r12,%rdi
mov    %ebp,%esi
mov    0x68(%rsp),%rcx
mov    %rcx,%rdx
xor    %r9d,%r9d
push   %r15
push   $0x0
call   1030 <XSetStandardProperties@plt>
add    $0x10,%rsp
mov    0x2c03(%rip),%rax
mov    (%rax),%ecx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1070 <glXCreateContext@plt>
test   %rax,%rax
je     13ee <make_window+0x23e>
mov    %rax,%rbx
mov    0xc8(%rsp),%r15
mov    0xc0(%rsp),%r12
mov    %r14,%rdi
call   1050 <XFree@plt>
mov    %ebp,(%r12)
mov    %rbx,(%r15)
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc14(%rip),%rdi
jmp    13f5 <make_window+0x245>
lea    0xc3e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10c0 <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 = [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
@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
@True = global i32 0
@.str.1 = [32 x i8] c"Error: glXCreateContext failed\0A\00"
define void @make_window(i32* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6, i64* %7) {
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i64*
%17 = alloca [11 x i32]
%18 = alloca i32
%19 = alloca %struct.TYPE_12__
%20 = alloca i64
%21 = alloca i32
%22 = alloca i32
%23 = alloca i64
%24 = alloca %struct.TYPE_10__*
%25 = alloca %struct.TYPE_11__
store i32* %0, i32** %9
store i8* %1, i8** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32* %6, i32** %15
store i64* %7, i64** %16
%26 = getelementptr inbounds [11 x i32], [11 x i32]* %17, i64 0, i64 0
%27 = load i32, i32* @GLX_RGBA
store i32 %27, i32* %26
%28 = getelementptr inbounds i32, i32* %26, i64 1
%29 = load i32, i32* @GLX_RED_SIZE
store i32 %29, i32* %28
%30 = getelementptr inbounds i32, i32* %28, i64 1
store i32 1, i32* %30
%31 = getelementptr inbounds i32, i32* %30, i64 1
%32 = load i32, i32* @GLX_GREEN_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_BLUE_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_DOUBLEBUFFER
store i32 %38, i32* %37
%39 = getelementptr inbounds i32, i32* %37, i64 1
%40 = load i32, i32* @GLX_DEPTH_SIZE
store i32 %40, i32* %39
%41 = getelementptr inbounds i32, i32* %39, i64 1
store i32 1, i32* %41
%42 = getelementptr inbounds i32, i32* %41, i64 1
%43 = load i32, i32* @None
store i32 %43, i32* %42
%44 = load i32*, i32** %9
%45 = call i32 @DefaultScreen(i32* %44)
store i32 %45, i32* %18
%46 = load i32*, i32** %9
%47 = load i32, i32* %18
%48 = call i32 @RootWindow(i32* %46, i32 %47)
store i32 %48, i32* %21
%49 = load i32*, i32** %9
%50 = load i32, i32* %18
%51 = getelementptr inbounds [11 x i32], [11 x i32]* %17, i64 0, i64 0
%52 = call %struct.TYPE_10__* @glXChooseVisual(i32* %49, i32 %50, i32* %51)
store %struct.TYPE_10__* %52, %struct.TYPE_10__** %24
%53 = load %struct.TYPE_10__*, %struct.TYPE_10__** %24
%54 = icmp ne %struct.TYPE_10__* %53, null
br i1 %54, label %58, label %55
55: ; preds = %8
%56 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %8
%59 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %19, i32 0, i32 3
store i64 0, i64* %59
%60 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %19, i32 0, i32 2
store i64 0, i64* %60
%61 = load i32*, i32** %9
%62 = load i32, i32* %21
%63 = load %struct.TYPE_10__*, %struct.TYPE_10__** %24
%64 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %63, i32 0, i32 0
%65 = load i32, i32* %64
%66 = load i32, i32* @AllocNone
%67 = call i32 @XCreateColormap(i32* %61, i32 %62, i32 %65, i32 %66)
%68 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %19, i32 0, i32 1
store i32 %67, i32* %68
%69 = load i32, i32* @StructureNotifyMask
%70 = load i32, i32* @ExposureMask
%71 = or i32 %69, %70
%72 = load i32, i32* @KeyPressMask
%73 = or i32 %71, %72
%74 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %19, i32 0, i32 0
store i32 %73, i32* %74
%75 = load i64, i64* @CWBackPixel
%76 = load i64, i64* @CWBorderPixel
%77 = or i64 %75, %76
%78 = load i64, i64* @CWColormap
%79 = or i64 %77, %78
%80 = load i64, i64* @CWEventMask
%81 = or i64 %79, %80
store i64 %81, i64* %20
%82 = load i32*, i32** %9
%83 = load i32, i32* %21
%84 = load i32, i32* %13
%85 = load i32, i32* %14
%86 = load %struct.TYPE_10__*, %struct.TYPE_10__** %24
%87 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %86, i32 0, i32 1
%88 = load i32, i32* %87
%89 = load i32, i32* @InputOutput
%90 = load %struct.TYPE_10__*, %struct.TYPE_10__** %24
%91 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %90, i32 0, i32 0
%92 = load i32, i32* %91
%93 = load i64, i64* %20
%94 = call i32 @XCreateWindow(i32* %82, i32 %83, i32 0, i32 0, i32 %84, i32 %85, i32 0, i32 %88, i32 %89, i32 %92, i64 %93, %struct.TYPE_12__* %19)
store i32 %94, i32* %22
%95 = load i32, i32* %11
%96 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %25, i32 0, i32 0
store i32 %95, i32* %96
%97 = load i32, i32* %12
%98 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %25, i32 0, i32 1
store i32 %97, i32* %98
%99 = load i32, i32* %13
%100 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %25, i32 0, i32 2
store i32 %99, i32* %100
%101 = load i32, i32* %14
%102 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %25, i32 0, i32 3
store i32 %101, i32* %102
%103 = load i32, i32* @USSize
%104 = load i32, i32* @USPosition
%105 = or i32 %103, %104
%106 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %25, i32 0, i32 4
store i32 %105, i32* %106
%107 = load i32*, i32** %9
%108 = load i32, i32* %22
%109 = call i32 @XSetNormalHints(i32* %107, i32 %108, %struct.TYPE_11__* %25)
%110 = load i32*, i32** %9
%111 = load i32, i32* %22
%112 = load i8*, i8** %10
%113 = load i8*, i8** %10
%114 = load i32, i32* @None
%115 = call i32 @XSetStandardProperties(i32* %110, i32 %111, i8* %112, i8* %113, i32 %114, i8** null, i32 0, %struct.TYPE_11__* %25)
%116 = load i32*, i32** %9
%117 = load %struct.TYPE_10__*, %struct.TYPE_10__** %24
%118 = load i32, i32* @True
%119 = call i64 @glXCreateContext(i32* %116, %struct.TYPE_10__* %117, i32* null, i32 %118)
store i64 %119, i64* %23
%120 = load i64, i64* %23
%121 = icmp ne i64 %120, 0
br i1 %121, label %125, label %122
122: ; preds = %58
%123 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%124 = call i32 @exit(i32 1)
unreachable
125: ; preds = %58
%126 = load %struct.TYPE_10__*, %struct.TYPE_10__** %24
%127 = call i32 @XFree(%struct.TYPE_10__* %126)
%128 = load i32, i32* %22
%129 = load i32*, i32** %15
store i32 %128, i32* %129
%130 = load i64, i64* %23
%131 = load i64*, i64** %16
store i64 %130, i64* %131
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
@AllocNone = global i32 0
@StructureNotifyMask = global i32 0
@ExposureMask = global i32 0
@KeyPressMask = 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
@True = global i32 0
@str = [51 x i8] c"Error: couldn't get an RGB, Double-buffered visual\00"
@str.2 = [31 x i8] c"Error: glXCreateContext failed\00"
define void @make_window(i32* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture writeonly %6, i64* nocapture writeonly %7) {
%9 = alloca [11 x i32]
%10 = alloca %struct.TYPE_12__
%11 = alloca %struct.TYPE_11__
%12 = bitcast [11 x i32]* %9 to i8*
%13 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 0
%14 = load i32, i32* @GLX_RGBA
store i32 %14, i32* %13
%15 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 1
%16 = load i32, i32* @GLX_RED_SIZE
store i32 %16, i32* %15
%17 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 2
store i32 1, i32* %17
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 3
%19 = load i32, i32* @GLX_GREEN_SIZE
store i32 %19, i32* %18
%20 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 4
store i32 1, i32* %20
%21 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 5
%22 = load i32, i32* @GLX_BLUE_SIZE
store i32 %22, i32* %21
%23 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 6
store i32 1, i32* %23
%24 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 7
%25 = load i32, i32* @GLX_DOUBLEBUFFER
store i32 %25, i32* %24
%26 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 8
%27 = load i32, i32* @GLX_DEPTH_SIZE
store i32 %27, i32* %26
%28 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 9
store i32 1, i32* %28
%29 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 10
%30 = load i32, i32* @None
store i32 %30, i32* %29
%31 = bitcast %struct.TYPE_12__* %10 to i8*
%32 = tail call i32 @DefaultScreen(i32* %0)
%33 = tail call i32 @RootWindow(i32* %0, i32 %32)
%34 = call %struct.TYPE_10__* @glXChooseVisual(i32* %0, i32 %32, i32* %13)
%35 = icmp eq %struct.TYPE_10__* %34, null
br i1 %35, label %36, label %39
36: ; preds = %8
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %8
%40 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %10, i64 0, i32 2
%41 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %34, i64 0, i32 0
%42 = bitcast i64* %40 to i8*
%43 = load i32, i32* %41
%44 = load i32, i32* @AllocNone
%45 = call i32 @XCreateColormap(i32* %0, i32 %33, i32 %43, i32 %44)
%46 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %10, i64 0, i32 1
store i32 %45, i32* %46
%47 = load i32, i32* @StructureNotifyMask
%48 = load i32, i32* @ExposureMask
%49 = or i32 %48, %47
%50 = load i32, i32* @KeyPressMask
%51 = or i32 %49, %50
%52 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %10, i64 0, i32 0
store i32 %51, i32* %52
%53 = load i64, i64* @CWBackPixel
%54 = load i64, i64* @CWBorderPixel
%55 = or i64 %54, %53
%56 = load i64, i64* @CWColormap
%57 = or i64 %55, %56
%58 = load i64, i64* @CWEventMask
%59 = or i64 %57, %58
%60 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %34, i64 0, i32 1
%61 = load i32, i32* %60
%62 = load i32, i32* @InputOutput
%63 = load i32, i32* %41
%64 = call i32 @XCreateWindow(i32* %0, i32 %33, i32 0, i32 0, i32 %4, i32 %5, i32 0, i32 %61, i32 %62, i32 %63, i64 %59, %struct.TYPE_12__* %10)
%65 = bitcast %struct.TYPE_11__* %11 to i8*
%66 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %11, i64 0, i32 0
store i32 %2, i32* %66
%67 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %11, i64 0, i32 1
store i32 %3, i32* %67
%68 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %11, i64 0, i32 2
store i32 %4, i32* %68
%69 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %11, i64 0, i32 3
store i32 %5, i32* %69
%70 = load i32, i32* @USSize
%71 = load i32, i32* @USPosition
%72 = or i32 %71, %70
%73 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %11, i64 0, i32 4
store i32 %72, i32* %73
%74 = call i32 @XSetNormalHints(i32* %0, i32 %64, %struct.TYPE_11__* %11)
%75 = load i32, i32* @None
%76 = call i32 @XSetStandardProperties(i32* %0, i32 %64, i8* %1, i8* %1, i32 %75, i8** null, i32 0, %struct.TYPE_11__* %11)
%77 = load i32, i32* @True
%78 = call i64 @glXCreateContext(i32* %0, %struct.TYPE_10__* %34, i32* null, i32 %77)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %39
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
%82 = call i32 @exit(i32 1)
unreachable
83: ; preds = %39
%84 = call i32 @XFree(%struct.TYPE_10__* %34)
store i32 %64, i32* %6
store i64 %78, i64* %7
ret void
}