#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;
  int /*<<< orphan*/ root_depth;
};
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 uint32_t;
struct TYPE_11__ {
  TYPE_1__ *data;
};

/* Variables and functions */
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_FOREGROUND;
int XCB_GC_GRAPHICS_EXPOSURES;
#define XCB_KEY_PRESS 128
int /*<<< orphan*/ XCB_WINDOW_CLASS_INPUT_OUTPUT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(TYPE_3__ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ *xcb_connect(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ xcb_connection_has_error(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 *c;
  xcb_screen_t *s;
  xcb_window_t w;
  xcb_gcontext_t g;
  xcb_generic_event_t *e;
  uint32_t mask;
  uint32_t values[2];
  int done = 0;
  xcb_rectangle_t r = {20, 20, 60, 60};
  c = xcb_connect(NULL, NULL);
  if (xcb_connection_has_error(c)) {
    printf("Cannot open display\n");
    exit(1);
  }
  s = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
  g = xcb_generate_id(c);
  w = s->root;
  mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
  values[0] = s->black_pixel;
  values[1] = 0;
  xcb_create_gc(c, g, w, mask, values);
  w = xcb_generate_id(c);
  mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
  values[0] = s->white_pixel;
  values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS;
  xcb_create_window(c, s->root_depth, w, s->root, 10, 10, 100, 100, 1,
                    XCB_WINDOW_CLASS_INPUT_OUTPUT, s->root_visual, mask,
                    values);
  xcb_map_window(c, w);
  xcb_flush(c);
  while (!done && (e = xcb_wait_for_event(c))) {
    switch (e->response_type & ~0x80) {
    case XCB_EXPOSE:
      xcb_poly_fill_rectangle(c, w, g, 1, &r);
      xcb_flush(c);
      break;
    case XCB_KEY_PRESS:
      done = 1;
      break;
    }
    free(e);
  }
  xcb_disconnect(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x98,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x48(%rbp)
mov    0xdef(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xdec(%rip),%rax
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1050 <xcb_connect@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   10f0 <xcb_connection_has_error@plt>
cmp    $0x0,%rax
je     1259 <main+0x69>
lea    0xdc6(%rip),%rdi
call   1090 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1100 <xcb_get_setup@plt>
mov    %eax,%edi
call   10b0 <xcb_setup_roots_iterator@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <xcb_generate_id@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    0x2d5b(%rip),%rax
mov    (%rax),%eax
mov    0x2d32(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x3c(%rbp),%ecx
lea    -0x44(%rbp),%r8
call   1060 <xcb_create_gc@plt>
mov    -0x18(%rbp),%rdi
call   1080 <xcb_generate_id@plt>
mov    %rax,-0x28(%rbp)
mov    0x2ce9(%rip),%rax
mov    (%rax),%eax
mov    0x2cc8(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2cda(%rip),%rax
mov    (%rax),%eax
mov    0x2cb1(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%esi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
mov    0x2cb6(%rip),%rax
mov    (%rax),%ebx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%r11d
mov    -0x3c(%rbp),%r10d
lea    -0x44(%rbp),%rax
mov    $0xa,%r9d
mov    %r9d,%r8d
movl   $0x64,(%rsp)
movl   $0x64,0x8(%rsp)
movl   $0x1,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),%rdi
mov    -0x28(%rbp),%rsi
call   10c0 <xcb_map_window@plt>
mov    -0x18(%rbp),%rdi
call   1070 <xcb_flush@plt>
xor    %eax,%eax
cmpl   $0x0,-0x48(%rbp)
mov    %al,-0x61(%rbp)
jne    13b0 <main+0x1c0>
mov    -0x18(%rbp),%rdi
call   10d0 <xcb_wait_for_event@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    13c0 <main+0x1d0>
jmp    142e <main+0x23e>
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
and    $0xffffff7f,%eax
mov    %eax,-0x68(%rbp)
sub    $0x80,%eax
je     1419 <main+0x229>
jmp    13de <main+0x1ee>
mov    -0x68(%rbp),%eax
sub    $0x81,%eax
jne    1420 <main+0x230>
jmp    13f1 <main+0x201>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    $0x1,%ecx
lea    -0x58(%rbp),%r8
call   10a0 <xcb_poly_fill_rectangle@plt>
mov    -0x18(%rbp),%rdi
call   1070 <xcb_flush@plt>
jmp    1420 <main+0x230>
movl   $0x1,-0x48(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
jmp    138a <main+0x19a>
mov    -0x18(%rbp),%rdi
call   10e0 <xcb_disconnect@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1060 <xcb_connect@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10e0 <xcb_connection_has_error@plt>
test   %rax,%rax
jne    131d <main+0x13d>
mov    %rbx,%rdi
call   10f0 <xcb_get_setup@plt>
mov    %eax,%edi
call   10a0 <xcb_setup_roots_iterator@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1090 <xcb_generate_id@plt>
mov    0x2dca(%rip),%rdx
mov    0x2da3(%rip),%rcx
mov    (%rcx),%ecx
or     (%rdx),%ecx
mov    0x10(%r15),%rdx
mov    (%r15),%esi
mov    %esi,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r12,%r8
call   1070 <xcb_create_gc@plt>
mov    %rbx,%rdi
call   1090 <xcb_generate_id@plt>
mov    %rax,%r14
mov    0x2d62(%rip),%rdx
mov    0x2d43(%rip),%rcx
mov    (%rcx),%eax
or     (%rdx),%eax
mov    0x4(%r15),%ecx
mov    %ecx,(%rsp)
mov    0x2d59(%rip),%rcx
mov    0x2d32(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    %edx,0x4(%rsp)
mov    0x18(%r15),%esi
mov    0x10(%r15),%rcx
mov    0x2d43(%rip),%rdx
mov    (%rdx),%r10d
mov    0x8(%r15),%r11d
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %r14,%rdx
mov    $0xa,%r8d
mov    $0xa,%r9d
push   %r12
push   %rax
push   %r11
push   %r10
push   $0x1
push   $0x64
push   $0x64
call   1050 <xcb_create_window@plt>
add    $0x40,%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   (%rax)
mov    %rbx,%rdi
call   10c0 <xcb_wait_for_event@plt>
test   %rax,%rax
je     1307 <main+0x127>
mov    %rax,%rdi
call   1030 <free@plt>
jmp    12f0 <main+0x110>
mov    %rbx,%rdi
call   10d0 <xcb_disconnect@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xcdc(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_9__ = type { i32, i32, i32, i32 }
%struct.TYPE_8__ = type { i32, i32, i32, i8*, i32 }
%struct.TYPE_10__ = type { i32 }
%struct.TYPE_11__ = type { %struct.TYPE_8__* }
@__const.main.r = %struct.TYPE_9__ { i32 20, i32 20, i32 60, i32 60 }
@.str = [21 x i8] c"Cannot open display\0A\00"
@XCB_GC_FOREGROUND = global i32 0
@XCB_GC_GRAPHICS_EXPOSURES = 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_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca %struct.TYPE_8__*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.TYPE_10__*
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca i32
%10 = alloca %struct.TYPE_9__
%11 = alloca %struct.TYPE_11__
store i32 0, i32* %1
store i32 0, i32* %9
%12 = bitcast %struct.TYPE_9__* %10 to i8*
%13 = call i32* @xcb_connect(i32* null, i32* null)
store i32* %13, i32** %2
%14 = load i32*, i32** %2
%15 = call i64 @xcb_connection_has_error(i32* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %0
%21 = load i32*, i32** %2
%22 = call i32 @xcb_get_setup(i32* %21)
%23 = call %struct.TYPE_8__* @xcb_setup_roots_iterator(i32 %22)
%24 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %11, i32 0, i32 0
store %struct.TYPE_8__* %23, %struct.TYPE_8__** %24
%25 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %11, i32 0, i32 0
%26 = load %struct.TYPE_8__*, %struct.TYPE_8__** %25
store %struct.TYPE_8__* %26, %struct.TYPE_8__** %3
%27 = load i32*, i32** %2
%28 = call i8* @xcb_generate_id(i32* %27)
store i8* %28, i8** %5
%29 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%30 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %29, i32 0, i32 3
%31 = load i8*, i8** %30
store i8* %31, i8** %4
%32 = load i32, i32* @XCB_GC_FOREGROUND
%33 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%34 = or i32 %32, %33
store i32 %34, i32* %7
%35 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%36 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %35, i32 0, i32 0
%37 = load i32, i32* %36
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
store i32 %37, i32* %38
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 0, i32* %39
%40 = load i32*, i32** %2
%41 = load i8*, i8** %5
%42 = load i8*, i8** %4
%43 = load i32, i32* %7
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%45 = call i32 @xcb_create_gc(i32* %40, i8* %41, i8* %42, i32 %43, i32* %44)
%46 = load i32*, i32** %2
%47 = call i8* @xcb_generate_id(i32* %46)
store i8* %47, i8** %4
%48 = load i32, i32* @XCB_CW_BACK_PIXEL
%49 = load i32, i32* @XCB_CW_EVENT_MASK
%50 = or i32 %48, %49
store i32 %50, i32* %7
%51 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%52 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %51, i32 0, i32 1
%53 = load i32, i32* %52
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
store i32 %53, i32* %54
%55 = load i32, i32* @XCB_EVENT_MASK_EXPOSURE
%56 = load i32, i32* @XCB_EVENT_MASK_KEY_PRESS
%57 = or i32 %55, %56
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 %57, i32* %58
%59 = load i32*, i32** %2
%60 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%61 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %60, i32 0, i32 4
%62 = load i32, i32* %61
%63 = load i8*, i8** %4
%64 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%65 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %64, i32 0, i32 3
%66 = load i8*, i8** %65
%67 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%68 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%69 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %68, i32 0, i32 2
%70 = load i32, i32* %69
%71 = load i32, i32* %7
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%73 = call i32 @xcb_create_window(i32* %59, i32 %62, i8* %63, i8* %66, i32 10, i32 10, i32 100, i32 100, i32 1, i32 %67, i32 %70, i32 %71, i32* %72)
%74 = load i32*, i32** %2
%75 = load i8*, i8** %4
%76 = call i32 @xcb_map_window(i32* %74, i8* %75)
%77 = load i32*, i32** %2
%78 = call i32 @xcb_flush(i32* %77)
br label %79
79: ; preds = %101, %20
%80 = load i32, i32* %9
%81 = icmp ne i32 %80, 0
br i1 %81, label %86, label %82
82: ; preds = %79
%83 = load i32*, i32** %2
%84 = call %struct.TYPE_10__* @xcb_wait_for_event(i32* %83)
store %struct.TYPE_10__* %84, %struct.TYPE_10__** %6
%85 = icmp ne %struct.TYPE_10__* %84, null
br label %86
86: ; preds = %82, %79
%87 = phi i1 [ false, %79 ], [ %85, %82 ]
br i1 %87, label %88, label %104
88: ; preds = %86
%89 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%90 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %89, i32 0, i32 0
%91 = load i32, i32* %90
%92 = and i32 %91, -129
switch i32 %92, label %101 [
i32 129, label %93
i32 128, label %100
]
93: ; preds = %88
%94 = load i32*, i32** %2
%95 = load i8*, i8** %4
%96 = load i8*, i8** %5
%97 = call i32 @xcb_poly_fill_rectangle(i32* %94, i8* %95, i8* %96, i32 1, %struct.TYPE_9__* %10)
%98 = load i32*, i32** %2
%99 = call i32 @xcb_flush(i32* %98)
br label %101
100: ; preds = %88
store i32 1, i32* %9
br label %101
101: ; preds = %88, %100, %93
%102 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%103 = call i32 @free(%struct.TYPE_10__* %102)
br label %79
104: ; preds = %86
%105 = load i32*, i32** %2
%106 = call i32 @xcb_disconnect(i32* %105)
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_8__ = type { i32, i32, i32, i8*, i32 }
%struct.TYPE_10__ = type { i32 }
@XCB_GC_FOREGROUND = global i32 0
@XCB_GC_GRAPHICS_EXPOSURES = 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_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
@str = [20 x i8] c"Cannot open display\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = tail call i32* @xcb_connect(i32* null, i32* null)
%4 = tail call i64 @xcb_connection_has_error(i32* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = tail call i32 @xcb_get_setup(i32* %3)
%11 = tail call %struct.TYPE_8__* @xcb_setup_roots_iterator(i32 %10)
%12 = tail call i8* @xcb_generate_id(i32* %3)
%13 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %11, i64 0, i32 3
%14 = load i8*, i8** %13
%15 = load i32, i32* @XCB_GC_FOREGROUND
%16 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%17 = or i32 %16, %15
%18 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %11, i64 0, i32 0
%19 = load i32, i32* %18
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 %19, i32* %20
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 0, i32* %21
%22 = call i32 @xcb_create_gc(i32* %3, i8* %12, i8* %14, i32 %17, i32* %20)
%23 = call i8* @xcb_generate_id(i32* %3)
%24 = load i32, i32* @XCB_CW_BACK_PIXEL
%25 = load i32, i32* @XCB_CW_EVENT_MASK
%26 = or i32 %25, %24
%27 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %11, i64 0, i32 1
%28 = load i32, i32* %27
store i32 %28, i32* %20
%29 = load i32, i32* @XCB_EVENT_MASK_EXPOSURE
%30 = load i32, i32* @XCB_EVENT_MASK_KEY_PRESS
%31 = or i32 %30, %29
store i32 %31, i32* %21
%32 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %11, i64 0, i32 4
%33 = load i32, i32* %32
%34 = load i8*, i8** %13
%35 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%36 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %11, i64 0, i32 2
%37 = load i32, i32* %36
%38 = call i32 @xcb_create_window(i32* %3, i32 %33, i8* %23, i8* %34, i32 10, i32 10, i32 100, i32 100, i32 1, i32 %35, i32 %37, i32 %26, i32* %20)
%39 = call i32 @xcb_map_window(i32* %3, i8* %23)
%40 = call i32 @xcb_flush(i32* %3)
%41 = call %struct.TYPE_10__* @xcb_wait_for_event(i32* %3)
%42 = icmp eq %struct.TYPE_10__* %41, null
br i1 %42, label %48, label %43
43: ; preds = %9, %43
%44 = phi %struct.TYPE_10__* [ %46, %43 ], [ %41, %9 ]
%45 = call i32 @free(%struct.TYPE_10__* %44)
%46 = call %struct.TYPE_10__* @xcb_wait_for_event(i32* %3)
%47 = icmp eq %struct.TYPE_10__* %46, null
br i1 %47, label %48, label %43
48: ; preds = %43, %9
%49 = call i32 @xcb_disconnect(i32* %3)
ret i32 0
}