#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_11__ TYPE_5__;
typedef struct TYPE_10__ TYPE_3__;
typedef struct TYPE_9__ TYPE_2__;
typedef struct TYPE_8__ TYPE_1__;

/* Type definitions */
typedef void *xcb_window_t;
struct TYPE_8__ {
  int black_pixel;
  int white_pixel;
  int /*<<< orphan*/ root_visual;
  void *root;
};
typedef TYPE_1__ xcb_screen_t;
struct TYPE_9__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
typedef TYPE_2__ xcb_rectangle_t;
struct TYPE_10__ {
  int response_type;
};
typedef TYPE_3__ xcb_generic_event_t;
typedef void *xcb_gcontext_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int uint8_t;
typedef int uint32_t;
struct TYPE_11__ {
  TYPE_1__ *data;
};

/* Variables and functions */
int /*<<< orphan*/ XCB_ATOM_STRING;
int /*<<< orphan*/ XCB_ATOM_WM_ICON_NAME;
int /*<<< orphan*/ XCB_ATOM_WM_NAME;
int /*<<< orphan*/ XCB_COPY_FROM_PARENT;
int XCB_CW_BACK_PIXEL;
int XCB_CW_EVENT_MASK;
int XCB_EVENT_MASK_EXPOSURE;
int XCB_EVENT_MASK_KEY_PRESS;
#define XCB_EXPOSE 129
int XCB_GC_BACKGROUND;
int XCB_GC_FOREGROUND;
int XCB_GC_GRAPHICS_EXPOSURES;
#define XCB_KEY_PRESS 128
int /*<<< orphan*/ XCB_PROP_MODE_REPLACE;
int /*<<< orphan*/ XCB_WINDOW_CLASS_INPUT_OUTPUT;
int /*<<< orphan*/ free(TYPE_3__ *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ xcb_change_property(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       void *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int,
                                       int /*<<< orphan*/, char *);
int /*<<< orphan*/ *xcb_connect(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ xcb_create_gc(int /*<<< orphan*/ *, void *, void *, int,
                                 int *);
int /*<<< orphan*/ xcb_create_window(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     void *, void *, int, int, int, int, int,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int, int *);
int /*<<< orphan*/ xcb_disconnect(int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_flush(int /*<<< orphan*/ *);
void *xcb_generate_id(int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_get_setup(int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_map_window(int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ xcb_poly_fill_rectangle(int /*<<< orphan*/ *, void *, void *,
                                           int, TYPE_2__ *);
TYPE_5__ xcb_setup_roots_iterator(int /*<<< orphan*/);
TYPE_3__ *xcb_wait_for_event(int /*<<< orphan*/ *);
int main(void) {
  xcb_connection_t *pConn;
  xcb_screen_t *pScreen;
  xcb_window_t window;
  xcb_gcontext_t foreground;
  xcb_gcontext_t background;
  xcb_generic_event_t *pEvent;
  uint32_t mask = 0;
  uint32_t values[2];
  uint8_t isQuit = 0;
  char title[] = "Hello, Engine!";
  char title_icon[] = "Hello, Engine! (iconified)";
  pConn = xcb_connect(0, 0);
  pScreen = xcb_setup_roots_iterator(xcb_get_setup(pConn)).data;
  window = pScreen->root;
  foreground = xcb_generate_id(pConn);
  mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
  values[0] = pScreen->black_pixel;
  values[1] = 0;
  xcb_create_gc(pConn, foreground, window, mask, values);
  background = xcb_generate_id(pConn);
  mask = XCB_GC_BACKGROUND | XCB_GC_GRAPHICS_EXPOSURES;
  values[0] = pScreen->white_pixel;
  values[0] = 0;
  xcb_create_gc(pConn, background, window, mask, values);
  window = xcb_generate_id(pConn);
  mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
  values[0] = pScreen->white_pixel;
  values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS;
  xcb_create_window(pConn, XCB_COPY_FROM_PARENT, window, pScreen->root, 20, 20,
                    640, 480, 10, XCB_WINDOW_CLASS_INPUT_OUTPUT,
                    pScreen->root_visual, mask, values);
  xcb_change_property(pConn, XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_NAME,
                      XCB_ATOM_STRING, 8, strlen(title), title);
  xcb_change_property(pConn, XCB_PROP_MODE_REPLACE, window,
                      XCB_ATOM_WM_ICON_NAME, XCB_ATOM_STRING, 8,
                      strlen(title_icon), title_icon);
  xcb_map_window(pConn, window);
  xcb_flush(pConn);
  while ((pEvent = xcb_wait_for_event(pConn)) && !isQuit) {
    switch (pEvent->response_type & ~0x80) {
    case XCB_EXPOSE: {
      xcb_rectangle_t rect = {20, 20, 60, 80};
      xcb_poly_fill_rectangle(pConn, window, foreground, 1, &rect);
      xcb_flush(pConn);
    } break;
    case XCB_KEY_PRESS:
      isQuit = 1;
      break;
    }
    free(pEvent);
  }
  xcb_disconnect(pConn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x118,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x50(%rbp)
mov    0xdf8(%rip),%rax
mov    %rax,-0x5f(%rbp)
mov    0xdf6(%rip),%eax
mov    %eax,-0x57(%rbp)
mov    0xdf0(%rip),%ax
mov    %ax,-0x53(%rbp)
mov    0xde8(%rip),%al
mov    %al,-0x51(%rbp)
mov    0xde0(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xddd(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xdda(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xdd7(%rip),%ax
mov    %ax,-0x68(%rbp)
mov    0xdcf(%rip),%al
mov    %al,-0x66(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1050 <xcb_connect@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   10f0 <xcb_get_setup@plt>
mov    %eax,%edi
call   10b0 <xcb_setup_roots_iterator@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <xcb_generate_id@plt>
mov    %rax,-0x30(%rbp)
mov    0x2d43(%rip),%rax
mov    (%rax),%eax
mov    0x2cfa(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x44(%rbp),%ecx
lea    -0x4c(%rbp),%r8
call   1060 <xcb_create_gc@plt>
mov    -0x18(%rbp),%rdi
call   1090 <xcb_generate_id@plt>
mov    %rax,-0x38(%rbp)
mov    0x2c89(%rip),%rax
mov    (%rax),%eax
mov    0x2cb0(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x44(%rbp),%ecx
lea    -0x4c(%rbp),%r8
call   1060 <xcb_create_gc@plt>
mov    -0x18(%rbp),%rdi
call   1090 <xcb_generate_id@plt>
mov    %rax,-0x28(%rbp)
mov    0x2c66(%rip),%rax
mov    (%rax),%eax
mov    0x2c3d(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2c5f(%rip),%rax
mov    (%rax),%eax
mov    0x2c26(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2c3e(%rip),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
mov    0x2c39(%rip),%rax
mov    (%rax),%ebx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%r11d
mov    -0x44(%rbp),%r10d
lea    -0x4c(%rbp),%rax
mov    $0x14,%r9d
mov    %r9d,%r8d
movl   $0x280,(%rsp)
movl   $0x1e0,0x8(%rsp)
movl   $0xa,0x10(%rsp)
mov    %ebx,0x18(%rsp)
mov    %r11d,0x20(%rsp)
mov    %r10d,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1040 <xcb_create_window@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    0x2bad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xcc(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    0x2bcb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc0(%rbp)
mov    0x2bd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xbc(%rbp)
lea    -0x5f(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xd8(%rbp),%rdi
mov    -0xcc(%rbp),%esi
mov    -0xc8(%rbp),%rdx
mov    -0xc0(%rbp),%ecx
mov    -0xbc(%rbp),%r8d
mov    %eax,%r10d
lea    -0x5f(%rbp),%rax
mov    $0x8,%r9d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1100 <xcb_change_property@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    0x2b25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xac(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    0x2b4b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa0(%rbp)
mov    0x2b4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x9c(%rbp)
lea    -0x80(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xb8(%rbp),%rdi
mov    -0xac(%rbp),%esi
mov    -0xa8(%rbp),%rdx
mov    -0xa0(%rbp),%ecx
mov    -0x9c(%rbp),%r8d
mov    %eax,%r10d
lea    -0x80(%rbp),%rax
mov    $0x8,%r9d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1100 <xcb_change_property@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10c0 <xcb_map_window@plt>
mov    -0x18(%rbp),%rdi
call   1080 <xcb_flush@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <xcb_wait_for_event@plt>
mov    %rax,%rcx
mov    %rcx,-0x40(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd9(%rbp)
je     1530 <main+0x350>
cmpl   $0x0,-0x50(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0xd9(%rbp)
mov    -0xd9(%rbp),%al
test   $0x1,%al
jne    1543 <main+0x363>
jmp    15d6 <main+0x3f6>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
and    $0xffffff7f,%eax
mov    %eax,-0xe0(%rbp)
sub    $0x80,%eax
je     15c1 <main+0x3e1>
jmp    1564 <main+0x384>
mov    -0xe0(%rbp),%eax
sub    $0x81,%eax
jne    15c8 <main+0x3e8>
jmp    157a <main+0x39a>
mov    0xaab(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xaa5(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    $0x1,%ecx
lea    -0x98(%rbp),%r8
call   10a0 <xcb_poly_fill_rectangle@plt>
mov    -0x18(%rbp),%rdi
call   1080 <xcb_flush@plt>
jmp    15c8 <main+0x3e8>
movl   $0x1,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    14ff <main+0x31f>
mov    -0x18(%rbp),%rdi
call   10e0 <xcb_disconnect@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movabs $0x21656e69676e45,%rax
mov    %rax,0x17(%rsp)
movabs $0x45202c6f6c6c6548,%rax
2c 20 45
mov    %rax,0x10(%rsp)
movups 0xe18(%rip),%xmm0
movups %xmm0,0x2b(%rsp)
movaps 0xe01(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
xor    %esi,%esi
call   1050 <xcb_connect@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10e0 <xcb_get_setup@plt>
mov    %eax,%edi
call   10a0 <xcb_setup_roots_iterator@plt>
mov    %rax,%r15
mov    0x10(%rax),%r14
mov    %rbx,%rdi
call   1090 <xcb_generate_id@plt>
mov    0x2dab(%rip),%rdx
mov    0x2d64(%rip),%rbp
mov    0x0(%rbp),%ecx
or     (%rdx),%ecx
mov    (%r15),%edx
mov    %edx,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x8(%rsp),%r12
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
mov    %r12,%r8
call   1060 <xcb_create_gc@plt>
mov    %rbx,%rdi
call   1090 <xcb_generate_id@plt>
mov    0x2cfb(%rip),%rdx
mov    0x0(%rbp),%ecx
or     (%rdx),%ecx
movl   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
mov    %r12,%r8
call   1060 <xcb_create_gc@plt>
mov    %rbx,%rdi
call   1090 <xcb_generate_id@plt>
mov    %rax,%r14
mov    0x2cf3(%rip),%rax
mov    0x2ccc(%rip),%rcx
mov    (%rcx),%ebp
or     (%rax),%ebp
mov    0x4(%r15),%eax
mov    0x2cf5(%rip),%rcx
mov    0x2cbe(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    %eax,0x8(%rsp)
mov    %edx,0xc(%rsp)
mov    0x2cd3(%rip),%rax
mov    (%rax),%esi
mov    0x10(%r15),%rcx
mov    0x2cd6(%rip),%rax
mov    (%rax),%r10d
mov    0x8(%r15),%eax
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %r14,%rdx
mov    $0x14,%r8d
mov    $0x14,%r9d
push   %r12
push   %rbp
push   %rax
push   %r10
push   $0xa
push   $0x1e0
push   $0x280
call   1040 <xcb_create_window@plt>
add    $0x40,%rsp
mov    0x2c67(%rip),%rax
mov    (%rax),%r12d
mov    0x2c95(%rip),%rax
mov    (%rax),%r15d
mov    0x2ca3(%rip),%rax
mov    (%rax),%ebp
lea    0x10(%rsp),%r13
mov    %r13,%rdi
call   1070 <strlen@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
mov    %ebp,%r8d
mov    $0x8,%r9d
push   %r13
push   %rax
call   10f0 <xcb_change_property@plt>
add    $0x10,%rsp
mov    0x2c1c(%rip),%rax
mov    (%rax),%ebp
mov    0x2c53(%rip),%rax
mov    (%rax),%r15d
mov    0x2c59(%rip),%rax
mov    (%rax),%r12d
lea    0x20(%rsp),%r13
mov    %r13,%rdi
call   1070 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
mov    %r12d,%r8d
mov    $0x8,%r9d
push   %r13
push   %rax
call   10f0 <xcb_change_property@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <xcb_map_window@plt>
mov    %rbx,%rdi
call   1080 <xcb_flush@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   10c0 <xcb_wait_for_event@plt>
test   %rax,%rax
je     13f7 <main+0x227>
mov    %rax,%rdi
call   1030 <free@plt>
jmp    13e0 <main+0x210>
mov    %rbx,%rdi
call   10d0 <xcb_disconnect@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_9__ = type { i32, i32, i32, i32 }
%struct.TYPE_8__ = type { i32, i32, i32, i8* }
%struct.TYPE_10__ = type { i32 }
%struct.TYPE_11__ = type { %struct.TYPE_8__* }
@__const.main.title = [15 x i8] c"Hello, Engine!\00"
@__const.main.title_icon = [27 x i8] c"Hello, Engine! (iconified)\00"
@XCB_GC_FOREGROUND = global i32 0
@XCB_GC_GRAPHICS_EXPOSURES = global i32 0
@XCB_GC_BACKGROUND = global i32 0
@XCB_CW_BACK_PIXEL = global i32 0
@XCB_CW_EVENT_MASK = global i32 0
@XCB_EVENT_MASK_EXPOSURE = global i32 0
@XCB_EVENT_MASK_KEY_PRESS = global i32 0
@XCB_COPY_FROM_PARENT = global i32 0
@XCB_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
@XCB_PROP_MODE_REPLACE = global i32 0
@XCB_ATOM_WM_NAME = global i32 0
@XCB_ATOM_STRING = global i32 0
@XCB_ATOM_WM_ICON_NAME = global i32 0
@__const.main.rect = %struct.TYPE_9__ { i32 20, i32 20, i32 60, i32 80 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca %struct.TYPE_8__*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.TYPE_10__*
%8 = alloca i32
%9 = alloca [2 x i32]
%10 = alloca i32
%11 = alloca [15 x i8]
%12 = alloca [27 x i8]
%13 = alloca %struct.TYPE_11__
%14 = alloca %struct.TYPE_9__
store i32 0, i32* %1
store i32 0, i32* %8
store i32 0, i32* %10
%15 = bitcast [15 x i8]* %11 to i8*
%16 = bitcast [27 x i8]* %12 to i8*
%17 = call i32* @xcb_connect(i32 0, i32 0)
store i32* %17, i32** %2
%18 = load i32*, i32** %2
%19 = call i32 @xcb_get_setup(i32* %18)
%20 = call %struct.TYPE_8__* @xcb_setup_roots_iterator(i32 %19)
%21 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %13, i32 0, i32 0
store %struct.TYPE_8__* %20, %struct.TYPE_8__** %21
%22 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %13, i32 0, i32 0
%23 = load %struct.TYPE_8__*, %struct.TYPE_8__** %22
store %struct.TYPE_8__* %23, %struct.TYPE_8__** %3
%24 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%25 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %24, i32 0, i32 3
%26 = load i8*, i8** %25
store i8* %26, i8** %4
%27 = load i32*, i32** %2
%28 = call i8* @xcb_generate_id(i32* %27)
store i8* %28, i8** %5
%29 = load i32, i32* @XCB_GC_FOREGROUND
%30 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%31 = or i32 %29, %30
store i32 %31, i32* %8
%32 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%33 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %32, i32 0, i32 0
%34 = load i32, i32* %33
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %34, i32* %35
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 0, i32* %36
%37 = load i32*, i32** %2
%38 = load i8*, i8** %5
%39 = load i8*, i8** %4
%40 = load i32, i32* %8
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%42 = call i32 @xcb_create_gc(i32* %37, i8* %38, i8* %39, i32 %40, i32* %41)
%43 = load i32*, i32** %2
%44 = call i8* @xcb_generate_id(i32* %43)
store i8* %44, i8** %6
%45 = load i32, i32* @XCB_GC_BACKGROUND
%46 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%47 = or i32 %45, %46
store i32 %47, i32* %8
%48 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%49 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %48, i32 0, i32 1
%50 = load i32, i32* %49
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %50, i32* %51
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 0, i32* %52
%53 = load i32*, i32** %2
%54 = load i8*, i8** %6
%55 = load i8*, i8** %4
%56 = load i32, i32* %8
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%58 = call i32 @xcb_create_gc(i32* %53, i8* %54, i8* %55, i32 %56, i32* %57)
%59 = load i32*, i32** %2
%60 = call i8* @xcb_generate_id(i32* %59)
store i8* %60, i8** %4
%61 = load i32, i32* @XCB_CW_BACK_PIXEL
%62 = load i32, i32* @XCB_CW_EVENT_MASK
%63 = or i32 %61, %62
store i32 %63, i32* %8
%64 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%65 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %64, i32 0, i32 1
%66 = load i32, i32* %65
%67 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %66, i32* %67
%68 = load i32, i32* @XCB_EVENT_MASK_EXPOSURE
%69 = load i32, i32* @XCB_EVENT_MASK_KEY_PRESS
%70 = or i32 %68, %69
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %70, i32* %71
%72 = load i32*, i32** %2
%73 = load i32, i32* @XCB_COPY_FROM_PARENT
%74 = load i8*, i8** %4
%75 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%76 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %75, i32 0, i32 3
%77 = load i8*, i8** %76
%78 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%79 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%80 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %79, i32 0, i32 2
%81 = load i32, i32* %80
%82 = load i32, i32* %8
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%84 = call i32 @xcb_create_window(i32* %72, i32 %73, i8* %74, i8* %77, i32 20, i32 20, i32 640, i32 480, i32 10, i32 %78, i32 %81, i32 %82, i32* %83)
%85 = load i32*, i32** %2
%86 = load i32, i32* @XCB_PROP_MODE_REPLACE
%87 = load i8*, i8** %4
%88 = load i32, i32* @XCB_ATOM_WM_NAME
%89 = load i32, i32* @XCB_ATOM_STRING
%90 = getelementptr inbounds [15 x i8], [15 x i8]* %11, i64 0, i64 0
%91 = call i32 @strlen(i8* %90)
%92 = getelementptr inbounds [15 x i8], [15 x i8]* %11, i64 0, i64 0
%93 = call i32 @xcb_change_property(i32* %85, i32 %86, i8* %87, i32 %88, i32 %89, i32 8, i32 %91, i8* %92)
%94 = load i32*, i32** %2
%95 = load i32, i32* @XCB_PROP_MODE_REPLACE
%96 = load i8*, i8** %4
%97 = load i32, i32* @XCB_ATOM_WM_ICON_NAME
%98 = load i32, i32* @XCB_ATOM_STRING
%99 = getelementptr inbounds [27 x i8], [27 x i8]* %12, i64 0, i64 0
%100 = call i32 @strlen(i8* %99)
%101 = getelementptr inbounds [27 x i8], [27 x i8]* %12, i64 0, i64 0
%102 = call i32 @xcb_change_property(i32* %94, i32 %95, i8* %96, i32 %97, i32 %98, i32 8, i32 %100, i8* %101)
%103 = load i32*, i32** %2
%104 = load i8*, i8** %4
%105 = call i32 @xcb_map_window(i32* %103, i8* %104)
%106 = load i32*, i32** %2
%107 = call i32 @xcb_flush(i32* %106)
br label %108
108: ; preds = %132, %0
%109 = load i32*, i32** %2
%110 = call %struct.TYPE_10__* @xcb_wait_for_event(i32* %109)
store %struct.TYPE_10__* %110, %struct.TYPE_10__** %7
%111 = icmp ne %struct.TYPE_10__* %110, null
br i1 %111, label %112, label %116
112: ; preds = %108
%113 = load i32, i32* %10
%114 = icmp ne i32 %113, 0
%115 = xor i1 %114, true
br label %116
116: ; preds = %112, %108
%117 = phi i1 [ false, %108 ], [ %115, %112 ]
br i1 %117, label %118, label %135
118: ; preds = %116
%119 = load %struct.TYPE_10__*, %struct.TYPE_10__** %7
%120 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %119, i32 0, i32 0
%121 = load i32, i32* %120
%122 = and i32 %121, -129
switch i32 %122, label %132 [
i32 129, label %123
i32 128, label %131
]
123: ; preds = %118
%124 = bitcast %struct.TYPE_9__* %14 to i8*
%125 = load i32*, i32** %2
%126 = load i8*, i8** %4
%127 = load i8*, i8** %5
%128 = call i32 @xcb_poly_fill_rectangle(i32* %125, i8* %126, i8* %127, i32 1, %struct.TYPE_9__* %14)
%129 = load i32*, i32** %2
%130 = call i32 @xcb_flush(i32* %129)
br label %132
131: ; preds = %118
store i32 1, i32* %10
br label %132
132: ; preds = %118, %131, %123
%133 = load %struct.TYPE_10__*, %struct.TYPE_10__** %7
%134 = call i32 @free(%struct.TYPE_10__* %133)
br label %108
135: ; preds = %116
%136 = load i32*, i32** %2
%137 = call i32 @xcb_disconnect(i32* %136)
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_8__ = type { i32, i32, i32, i8* }
%struct.TYPE_10__ = type { i32 }
@__const.main.title = [15 x i8] c"Hello, Engine!\00"
@__const.main.title_icon = [27 x i8] c"Hello, Engine! (iconified)\00"
@XCB_GC_FOREGROUND = global i32 0
@XCB_GC_GRAPHICS_EXPOSURES = global i32 0
@XCB_GC_BACKGROUND = global i32 0
@XCB_CW_BACK_PIXEL = global i32 0
@XCB_CW_EVENT_MASK = global i32 0
@XCB_EVENT_MASK_EXPOSURE = global i32 0
@XCB_EVENT_MASK_KEY_PRESS = global i32 0
@XCB_COPY_FROM_PARENT = global i32 0
@XCB_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
@XCB_PROP_MODE_REPLACE = global i32 0
@XCB_ATOM_WM_NAME = global i32 0
@XCB_ATOM_STRING = global i32 0
@XCB_ATOM_WM_ICON_NAME = global i32 0
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [15 x i8]
%3 = alloca [27 x i8]
%4 = bitcast [2 x i32]* %1 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%7 = tail call i32* @xcb_connect(i32 0, i32 0)
%8 = tail call i32 @xcb_get_setup(i32* %7)
%9 = tail call %struct.TYPE_8__* @xcb_setup_roots_iterator(i32 %8)
%10 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %9, i64 0, i32 3
%11 = load i8*, i8** %10
%12 = tail call i8* @xcb_generate_id(i32* %7)
%13 = load i32, i32* @XCB_GC_FOREGROUND
%14 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%15 = or i32 %14, %13
%16 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %9, i64 0, i32 0
%17 = load i32, i32* %16
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 %17, i32* %18
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 0, i32* %19
%20 = call i32 @xcb_create_gc(i32* %7, i8* %12, i8* %11, i32 %15, i32* %18)
%21 = call i8* @xcb_generate_id(i32* %7)
%22 = load i32, i32* @XCB_GC_BACKGROUND
%23 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%24 = or i32 %23, %22
%25 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %9, i64 0, i32 1
store i32 0, i32* %18
%26 = call i32 @xcb_create_gc(i32* %7, i8* %21, i8* %11, i32 %24, i32* %18)
%27 = call i8* @xcb_generate_id(i32* %7)
%28 = load i32, i32* @XCB_CW_BACK_PIXEL
%29 = load i32, i32* @XCB_CW_EVENT_MASK
%30 = or i32 %29, %28
%31 = load i32, i32* %25
store i32 %31, i32* %18
%32 = load i32, i32* @XCB_EVENT_MASK_EXPOSURE
%33 = load i32, i32* @XCB_EVENT_MASK_KEY_PRESS
%34 = or i32 %33, %32
store i32 %34, i32* %19
%35 = load i32, i32* @XCB_COPY_FROM_PARENT
%36 = load i8*, i8** %10
%37 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%38 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %9, i64 0, i32 2
%39 = load i32, i32* %38
%40 = call i32 @xcb_create_window(i32* %7, i32 %35, i8* %27, i8* %36, i32 20, i32 20, i32 640, i32 480, i32 10, i32 %37, i32 %39, i32 %30, i32* %18)
%41 = load i32, i32* @XCB_PROP_MODE_REPLACE
%42 = load i32, i32* @XCB_ATOM_WM_NAME
%43 = load i32, i32* @XCB_ATOM_STRING
%44 = call i32 @strlen(i8* %5)
%45 = call i32 @xcb_change_property(i32* %7, i32 %41, i8* %27, i32 %42, i32 %43, i32 8, i32 %44, i8* %5)
%46 = load i32, i32* @XCB_PROP_MODE_REPLACE
%47 = load i32, i32* @XCB_ATOM_WM_ICON_NAME
%48 = load i32, i32* @XCB_ATOM_STRING
%49 = call i32 @strlen(i8* %6)
%50 = call i32 @xcb_change_property(i32* %7, i32 %46, i8* %27, i32 %47, i32 %48, i32 8, i32 %49, i8* %6)
%51 = call i32 @xcb_map_window(i32* %7, i8* %27)
%52 = call i32 @xcb_flush(i32* %7)
%53 = call %struct.TYPE_10__* @xcb_wait_for_event(i32* %7)
%54 = icmp eq %struct.TYPE_10__* %53, null
br i1 %54, label %60, label %55
55: ; preds = %0, %55
%56 = phi %struct.TYPE_10__* [ %58, %55 ], [ %53, %0 ]
%57 = call i32 @free(%struct.TYPE_10__* %56)
%58 = call %struct.TYPE_10__* @xcb_wait_for_event(i32* %7)
%59 = icmp eq %struct.TYPE_10__* %58, null
br i1 %59, label %60, label %55
60: ; preds = %55, %0
%61 = call i32 @xcb_disconnect(i32* %7)
ret i32 0
}