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

/* Variables and functions */
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_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*/ *);
int /*<<< orphan*/ xcb_create_gc(int /*<<< orphan*/ *, void *, void *, int,
                                 int *);
int /*<<< orphan*/ xcb_create_window(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     void *, int /*<<< orphan*/, 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(int argc, char **argv) {
  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;
  xcb_rectangle_t r = {20, 20, 60, 60};
  c = xcb_connect(NULL, NULL);
  if (!c) {
    printf("Cannot open display\n");
    exit(1);
  }
  s = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
  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;
  w = xcb_generate_id(c);
  xcb_create_window(c, XCB_COPY_FROM_PARENT, w, s->root, 10, 10, 100, 100, 1,
                    XCB_WINDOW_CLASS_INPUT_OUTPUT, s->root_visual, mask,
                    values);
  mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
  values[0] = s->black_pixel;
  values[1] = 0;
  g = xcb_generate_id(c);
  xcb_create_gc(c, g, w, mask, values);
  xcb_map_window(c, w);
  xcb_flush(c);
  done = 0;
  while (!done && (e = xcb_wait_for_event(c))) {
    switch (e->response_type) {
    case XCB_EXPOSE:
      printf("EXPOSE\n");
      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    $0xa8,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0xdff(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xdfc(%rip),%rax
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1050 <xcb_connect@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1241 <main+0x61>
lea    0xdde(%rip),%rdi
call   1090 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x20(%rbp),%rdi
call   10f0 <xcb_get_setup@plt>
mov    %eax,%edi
call   10b0 <xcb_setup_roots_iterator@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2d5c(%rip),%rax
mov    (%rax),%eax
mov    0x2d3b(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2d56(%rip),%rax
mov    (%rax),%eax
mov    0x2d25(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <xcb_generate_id@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2d28(%rip),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    0xc(%rax),%ecx
mov    0x2d24(%rip),%rax
mov    (%rax),%ebx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r11d
mov    -0x44(%rbp),%r10d
lea    -0x4c(%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    0x2ce3(%rip),%rax
mov    (%rax),%eax
mov    0x2cb2(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <xcb_generate_id@plt>
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x44(%rbp),%ecx
lea    -0x4c(%rbp),%r8
call   1060 <xcb_create_gc@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10c0 <xcb_map_window@plt>
mov    -0x20(%rbp),%rdi
call   1070 <xcb_flush@plt>
movl   $0x0,-0x50(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x50(%rbp)
mov    %al,-0x69(%rbp)
jne    1394 <main+0x1b4>
mov    -0x20(%rbp),%rdi
call   10d0 <xcb_wait_for_event@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    13a4 <main+0x1c4>
jmp    1419 <main+0x239>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
sub    $0x80,%eax
je     1404 <main+0x224>
jmp    13bd <main+0x1dd>
mov    -0x70(%rbp),%eax
sub    $0x81,%eax
jne    140b <main+0x22b>
jmp    13d0 <main+0x1f0>
lea    0xc4e(%rip),%rdi
call   1090 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    $0x1,%ecx
lea    -0x60(%rbp),%r8
call   10a0 <xcb_poly_fill_rectangle@plt>
mov    -0x20(%rbp),%rdi
call   1070 <xcb_flush@plt>
jmp    140b <main+0x22b>
movl   $0x1,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    136e <main+0x18e>
mov    -0x20(%rbp),%rdi
call   10e0 <xcb_disconnect@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movups 0xe0b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
xor    %edi,%edi
xor    %esi,%esi
call   1060 <xcb_connect@plt>
test   %rax,%rax
je     138f <main+0x1af>
mov    %rax,%r12
mov    %rax,%rdi
call   10f0 <xcb_get_setup@plt>
mov    %eax,%edi
call   10b0 <xcb_setup_roots_iterator@plt>
mov    %rax,%r15
mov    0x2d98(%rip),%rax
mov    0x2d79(%rip),%rcx
mov    (%rcx),%ebp
or     (%rax),%ebp
mov    (%r15),%eax
mov    %eax,0x8(%rsp)
mov    0x2d97(%rip),%rax
mov    0x2d68(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %ecx,0xc(%rsp)
mov    %r12,%rdi
call   1090 <xcb_generate_id@plt>
mov    %rax,%r14
mov    0x2d6e(%rip),%rax
mov    (%rax),%esi
mov    0x8(%r15),%eax
mov    0xc(%r15),%ecx
mov    0x2d6d(%rip),%rdx
mov    (%rdx),%ebx
sub    $0x8,%rsp
lea    0x10(%rsp),%r13
mov    %r12,%rdi
mov    %r14,%rdx
mov    $0xa,%r8d
mov    $0xa,%r9d
push   %r13
push   %rbp
push   %rax
push   %rbx
push   $0x1
push   $0x64
push   $0x64
call   1050 <xcb_create_window@plt>
add    $0x40,%rsp
mov    0x2d45(%rip),%rax
mov    0x2d16(%rip),%rcx
mov    (%rcx),%ebp
or     (%rax),%ebp
mov    0x4(%r15),%eax
mov    %eax,0x8(%rsp)
movl   $0x0,0xc(%rsp)
mov    %r12,%rdi
call   1090 <xcb_generate_id@plt>
mov    %rax,%r15
mov    %r12,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %r13,%r8
call   1070 <xcb_create_gc@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   10c0 <xcb_map_window@plt>
mov    %r12,%rdi
call   1080 <xcb_flush@plt>
mov    %r12,%rdi
call   10d0 <xcb_wait_for_event@plt>
test   %rax,%rax
je     1376 <main+0x196>
mov    %rax,%rbx
lea    0xd16(%rip),%r13
lea    0x10(%rsp),%rbp
jmp    135e <main+0x17e>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x1,%ecx
mov    %rbp,%r8
call   10a0 <xcb_poly_fill_rectangle@plt>
mov    %r12,%rdi
call   1080 <xcb_flush@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   10d0 <xcb_wait_for_event@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1376 <main+0x196>
mov    (%rbx),%eax
cmp    $0x81,%eax
je     1320 <main+0x140>
cmp    $0x80,%eax
jne    1346 <main+0x166>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   10e0 <xcb_disconnect@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc7a(%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, 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_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_GC_FOREGROUND = global i32 0
@XCB_GC_GRAPHICS_EXPOSURES = global i32 0
@.str.1 = [8 x i8] c"EXPOSE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.TYPE_8__*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca %struct.TYPE_10__*
%11 = alloca i32
%12 = alloca [2 x i32]
%13 = alloca i32
%14 = alloca %struct.TYPE_9__
%15 = alloca %struct.TYPE_11__
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = bitcast %struct.TYPE_9__* %14 to i8*
%17 = call i32* @xcb_connect(i32* null, i32* null)
store i32* %17, i32** %6
%18 = load i32*, i32** %6
%19 = icmp ne i32* %18, null
br i1 %19, label %23, label %20
20: ; preds = %2
%21 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %2
%24 = load i32*, i32** %6
%25 = call i32 @xcb_get_setup(i32* %24)
%26 = call %struct.TYPE_8__* @xcb_setup_roots_iterator(i32 %25)
%27 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %15, i32 0, i32 0
store %struct.TYPE_8__* %26, %struct.TYPE_8__** %27
%28 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %15, i32 0, i32 0
%29 = load %struct.TYPE_8__*, %struct.TYPE_8__** %28
store %struct.TYPE_8__* %29, %struct.TYPE_8__** %7
%30 = load i32, i32* @XCB_CW_BACK_PIXEL
%31 = load i32, i32* @XCB_CW_EVENT_MASK
%32 = or i32 %30, %31
store i32 %32, i32* %11
%33 = load %struct.TYPE_8__*, %struct.TYPE_8__** %7
%34 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %33, i32 0, i32 0
%35 = load i32, i32* %34
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
store i32 %35, i32* %36
%37 = load i32, i32* @XCB_EVENT_MASK_EXPOSURE
%38 = load i32, i32* @XCB_EVENT_MASK_KEY_PRESS
%39 = or i32 %37, %38
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 1
store i32 %39, i32* %40
%41 = load i32*, i32** %6
%42 = call i8* @xcb_generate_id(i32* %41)
store i8* %42, i8** %8
%43 = load i32*, i32** %6
%44 = load i32, i32* @XCB_COPY_FROM_PARENT
%45 = load i8*, i8** %8
%46 = load %struct.TYPE_8__*, %struct.TYPE_8__** %7
%47 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %46, i32 0, i32 3
%48 = load i32, i32* %47
%49 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%50 = load %struct.TYPE_8__*, %struct.TYPE_8__** %7
%51 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %50, i32 0, i32 2
%52 = load i32, i32* %51
%53 = load i32, i32* %11
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%55 = call i32 @xcb_create_window(i32* %43, i32 %44, i8* %45, i32 %48, i32 10, i32 10, i32 100, i32 100, i32 1, i32 %49, i32 %52, i32 %53, i32* %54)
%56 = load i32, i32* @XCB_GC_FOREGROUND
%57 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%58 = or i32 %56, %57
store i32 %58, i32* %11
%59 = load %struct.TYPE_8__*, %struct.TYPE_8__** %7
%60 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %59, i32 0, i32 1
%61 = load i32, i32* %60
%62 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
store i32 %61, i32* %62
%63 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 1
store i32 0, i32* %63
%64 = load i32*, i32** %6
%65 = call i8* @xcb_generate_id(i32* %64)
store i8* %65, i8** %9
%66 = load i32*, i32** %6
%67 = load i8*, i8** %9
%68 = load i8*, i8** %8
%69 = load i32, i32* %11
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%71 = call i32 @xcb_create_gc(i32* %66, i8* %67, i8* %68, i32 %69, i32* %70)
%72 = load i32*, i32** %6
%73 = load i8*, i8** %8
%74 = call i32 @xcb_map_window(i32* %72, i8* %73)
%75 = load i32*, i32** %6
%76 = call i32 @xcb_flush(i32* %75)
store i32 0, i32* %13
br label %77
77: ; preds = %99, %23
%78 = load i32, i32* %13
%79 = icmp ne i32 %78, 0
br i1 %79, label %84, label %80
80: ; preds = %77
%81 = load i32*, i32** %6
%82 = call %struct.TYPE_10__* @xcb_wait_for_event(i32* %81)
store %struct.TYPE_10__* %82, %struct.TYPE_10__** %10
%83 = icmp ne %struct.TYPE_10__* %82, null
br label %84
84: ; preds = %80, %77
%85 = phi i1 [ false, %77 ], [ %83, %80 ]
br i1 %85, label %86, label %102
86: ; preds = %84
%87 = load %struct.TYPE_10__*, %struct.TYPE_10__** %10
%88 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %87, i32 0, i32 0
%89 = load i32, i32* %88
switch i32 %89, label %99 [
i32 129, label %90
i32 128, label %98
]
90: ; preds = %86
%91 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%92 = load i32*, i32** %6
%93 = load i8*, i8** %8
%94 = load i8*, i8** %9
%95 = call i32 @xcb_poly_fill_rectangle(i32* %92, i8* %93, i8* %94, i32 1, %struct.TYPE_9__* %14)
%96 = load i32*, i32** %6
%97 = call i32 @xcb_flush(i32* %96)
br label %99
98: ; preds = %86
store i32 1, i32* %13
br label %99
99: ; preds = %86, %98, %90
%100 = load %struct.TYPE_10__*, %struct.TYPE_10__** %10
%101 = call i32 @free(%struct.TYPE_10__* %100)
br label %77
102: ; preds = %84
%103 = load i32*, i32** %6
%104 = call i32 @xcb_disconnect(i32* %103)
ret i32 0
}

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