#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_21__ TYPE_8__;
typedef struct TYPE_20__ TYPE_6__;
typedef struct TYPE_19__ TYPE_5__;
typedef struct TYPE_18__ TYPE_4__;
typedef struct TYPE_17__ TYPE_3__;
typedef struct TYPE_16__ TYPE_2__;
typedef struct TYPE_15__ TYPE_1__;

/* Type definitions */
struct TYPE_15__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
typedef TYPE_1__ xcb_segment_t;
struct TYPE_16__ {
  int black_pixel;
  int white_pixel;
  int /*<<< orphan*/ root_visual;
  void *root;
};
typedef TYPE_2__ xcb_screen_t;
struct TYPE_17__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
typedef TYPE_3__ xcb_rectangle_t;
struct TYPE_18__ {
  int member_0;
  int member_1;
};
typedef TYPE_4__ xcb_point_t;
struct TYPE_19__ {
  int response_type;
};
typedef TYPE_5__ xcb_generic_event_t;
typedef void *xcb_gcontext_t;
typedef void *xcb_drawable_t;
typedef int /*<<< orphan*/ xcb_connection_t;
struct TYPE_20__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
  int member_5;
  int /*<<< orphan*/ member_4;
};
typedef TYPE_6__ xcb_arc_t;
typedef int uint32_t;
struct TYPE_21__ {
  TYPE_2__ *data;
};

/* Variables and functions */
int /*<<< orphan*/ XCB_COORD_MODE_ORIGIN;
int /*<<< orphan*/ XCB_COORD_MODE_PREVIOUS;
int /*<<< orphan*/ XCB_COPY_FROM_PARENT;
int XCB_CW_BACK_PIXEL;
int XCB_CW_EVENT_MASK;
int XCB_EVENT_MASK_EXPOSURE;
#define XCB_EXPOSE 128
int XCB_GC_FOREGROUND;
int XCB_GC_GRAPHICS_EXPOSURES;
int /*<<< orphan*/ XCB_WINDOW_CLASS_INPUT_OUTPUT;
int /*<<< orphan*/ free(TYPE_5__ *);
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 /*<<< orphan*/,
                                     int /*<<< orphan*/, int, int, int,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int, int *);
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_arc(int /*<<< orphan*/ *, void *, void *, int,
                                TYPE_6__ *);
int /*<<< orphan*/ xcb_poly_line(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 void *, void *, int, TYPE_4__ *);
int /*<<< orphan*/ xcb_poly_point(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  void *, void *, int, TYPE_4__ *);
int /*<<< orphan*/ xcb_poly_rectangle(int /*<<< orphan*/ *, void *, void *, int,
                                      TYPE_3__ *);
int /*<<< orphan*/ xcb_poly_segment(int /*<<< orphan*/ *, void *, void *, int,
                                    TYPE_1__ *);
TYPE_8__ xcb_setup_roots_iterator(int /*<<< orphan*/);
TYPE_5__ *xcb_wait_for_event(int /*<<< orphan*/ *);
int main() {
  xcb_connection_t *c;
  xcb_screen_t *screen;
  xcb_drawable_t win;
  xcb_gcontext_t foreground;
  xcb_generic_event_t *e;
  uint32_t mask = 0;
  uint32_t values[2];
  xcb_point_t points[] = {{10, 10}, {10, 20}, {20, 10}, {20, 20}};
  xcb_point_t polyline[] = {{50, 10}, {5, 20}, {25, -20}, {10, 10}};
  xcb_segment_t segments[] = {{100, 10, 140, 30}, {110, 25, 130, 60}};
  xcb_rectangle_t rectangles[] = {{10, 50, 40, 20}, {80, 50, 10, 40}};
  xcb_arc_t arcs[] = {{10, 100, 60, 40, 0, 90 << 6},
                      {90, 100, 55, 40, 0, 270 << 6}};
  c = xcb_connect(NULL, NULL);
  screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
  win = screen->root;
  foreground = xcb_generate_id(c);
  mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
  values[0] = screen->black_pixel;
  values[1] = 0;
  xcb_create_gc(c, foreground, win, mask, values);
  win = xcb_generate_id(c);
  mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
  values[0] = screen->white_pixel;
  values[1] = XCB_EVENT_MASK_EXPOSURE;
  xcb_create_window(c, XCB_COPY_FROM_PARENT, win, screen->root, 0, 0, 150, 150,
                    10, XCB_WINDOW_CLASS_INPUT_OUTPUT, screen->root_visual,
                    mask, values);
  xcb_map_window(c, win);
  xcb_flush(c);
  while ((e = xcb_wait_for_event(c))) {
    switch (e->response_type & ~0x80) {
    case XCB_EXPOSE: {
      xcb_poly_point(c, XCB_COORD_MODE_ORIGIN, win, foreground, 4, points);
      xcb_poly_line(c, XCB_COORD_MODE_PREVIOUS, win, foreground, 4, polyline);
      xcb_poly_segment(c, win, foreground, 2, segments);
      xcb_poly_rectangle(c, win, foreground, 2, rectangles);
      xcb_poly_arc(c, win, foreground, 2, arcs);
      xcb_flush(c);
      break;
    }
    default: {
      break;
    }
    }
    free(e);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x138,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    0xddf(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xddc(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xdd9(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xdd6(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xdd3(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xdcd(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xdc7(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xdc4(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xdc1(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xdbb(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xdb5(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xdaf(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xda9(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0xda3(%rip),%rax
mov    %rax,-0xc8(%rbp)
mov    0xd9d(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xd97(%rip),%rax
mov    %rax,-0xb8(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xd8a(%rip),%rsi
mov    $0x30,%edx
call   10a0 <memcpy@plt>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1050 <xcb_connect@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1120 <xcb_get_setup@plt>
mov    %eax,%edi
call   1090 <xcb_setup_roots_iterator@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <xcb_generate_id@plt>
mov    %rax,-0x30(%rbp)
mov    0x2c9e(%rip),%rax
mov    (%rax),%eax
mov    0x2c65(%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    0x2c1c(%rip),%rax
mov    (%rax),%eax
mov    0x2bfb(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2c15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2bfd(%rip),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
mov    0x2c00(%rip),%rax
mov    (%rax),%ebx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%r11d
mov    -0x3c(%rbp),%r10d
lea    -0x44(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x96,(%rsp)
movl   $0x96,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),%rdi
mov    -0x28(%rbp),%rsi
call   10e0 <xcb_map_window@plt>
mov    -0x18(%rbp),%rdi
call   1070 <xcb_flush@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <xcb_wait_for_event@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     1532 <main+0x332>
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
and    $0xffffff7f,%eax
sub    $0x80,%eax
jne    151f <main+0x31f>
jmp    146f <main+0x26f>
mov    -0x18(%rbp),%rdi
mov    0x2b5e(%rip),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    -0x70(%rbp),%r9
mov    $0x4,%r8d
call   10b0 <xcb_poly_point@plt>
mov    -0x18(%rbp),%rdi
mov    0x2b0a(%rip),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    -0x90(%rbp),%r9
mov    $0x4,%r8d
call   10c0 <xcb_poly_line@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    -0xb0(%rbp),%r8
mov    $0x2,%ecx
call   1110 <xcb_poly_segment@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    -0xd0(%rbp),%r8
mov    $0x2,%ecx
call   1100 <xcb_poly_rectangle@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    -0x100(%rbp),%r8
mov    $0x2,%ecx
call   10d0 <xcb_poly_arc@plt>
mov    -0x18(%rbp),%rdi
call   1070 <xcb_flush@plt>
jmp    1524 <main+0x324>
jmp    1524 <main+0x324>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
jmp    143d <main+0x23d>
xor    %eax,%eax
add    $0x138,%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   1050 <xcb_connect@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10c0 <xcb_get_setup@plt>
mov    %eax,%edi
call   1090 <xcb_setup_roots_iterator@plt>
mov    %rax,%r14
mov    0x10(%rax),%r15
mov    %rbx,%rdi
call   1080 <xcb_generate_id@plt>
mov    0x2e17(%rip),%rdx
mov    0x2de8(%rip),%rcx
mov    (%rcx),%ecx
or     (%rdx),%ecx
mov    (%r14),%edx
mov    %edx,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r15,%rdx
mov    %r12,%r8
call   1060 <xcb_create_gc@plt>
mov    %rbx,%rdi
call   1080 <xcb_generate_id@plt>
mov    0x2dab(%rip),%rcx
mov    0x2d94(%rip),%rdx
mov    (%rdx),%r10d
or     (%rcx),%r10d
mov    %rax,%r15
mov    0x4(%r14),%eax
mov    %eax,(%rsp)
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
mov    0x10(%r14),%rcx
mov    0x2d93(%rip),%rax
mov    (%rax),%r11d
mov    0x8(%r14),%eax
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %r12
push   %r10
push   %rax
push   %r11
push   $0xa
push   $0x96
push   $0x96
call   1040 <xcb_create_window@plt>
add    $0x40,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   10a0 <xcb_map_window@plt>
mov    %rbx,%rdi
call   1070 <xcb_flush@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   10b0 <xcb_wait_for_event@plt>
test   %rax,%rax
je     12b7 <main+0x117>
mov    %rax,%rdi
call   1030 <free@plt>
jmp    12a0 <main+0x100>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_18__ = type { i32, i32 }
%struct.TYPE_15__ = type { i32, i32, i32, i32 }
%struct.TYPE_17__ = type { i32, i32, i32, i32 }
%struct.TYPE_20__ = type { i32, i32, i32, i32, i32, i32 }
%struct.TYPE_16__ = type { i32, i32, i32, i8* }
%struct.TYPE_19__ = type { i32 }
%struct.TYPE_21__ = type { %struct.TYPE_16__* }
@__const.main.points = [4 x %struct.TYPE_18__] [%struct.TYPE_18__ { i32 10, i32 10 }, %struct.TYPE_18__ { i32 10, i32 20 }, %struct.TYPE_18__ { i32 20, i32 10 }, %struct.TYPE_18__ { i32 20, i32 20 }]
@__const.main.polyline = [4 x %struct.TYPE_18__] [%struct.TYPE_18__ { i32 50, i32 10 }, %struct.TYPE_18__ { i32 5, i32 20 }, %struct.TYPE_18__ { i32 25, i32 -20 }, %struct.TYPE_18__ { i32 10, i32 10 }]
@__const.main.segments = [2 x %struct.TYPE_15__] [%struct.TYPE_15__ { i32 100, i32 10, i32 140, i32 30 }, %struct.TYPE_15__ { i32 110, i32 25, i32 130, i32 60 }]
@__const.main.rectangles = [2 x %struct.TYPE_17__] [%struct.TYPE_17__ { i32 10, i32 50, i32 40, i32 20 }, %struct.TYPE_17__ { i32 80, i32 50, i32 10, i32 40 }]
@__const.main.arcs = [2 x %struct.TYPE_20__] [%struct.TYPE_20__ { i32 10, i32 100, i32 60, i32 40, i32 0, i32 5760 }, %struct.TYPE_20__ { i32 90, i32 100, i32 55, i32 40, i32 0, i32 17280 }]
@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_COPY_FROM_PARENT = global i32 0
@XCB_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
@XCB_COORD_MODE_ORIGIN = global i32 0
@XCB_COORD_MODE_PREVIOUS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca %struct.TYPE_16__*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.TYPE_19__*
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca [4 x %struct.TYPE_18__]
%10 = alloca [4 x %struct.TYPE_18__]
%11 = alloca [2 x %struct.TYPE_15__]
%12 = alloca [2 x %struct.TYPE_17__]
%13 = alloca [2 x %struct.TYPE_20__]
%14 = alloca %struct.TYPE_21__
store i32 0, i32* %1
store i32 0, i32* %7
%15 = bitcast [4 x %struct.TYPE_18__]* %9 to i8*
%16 = bitcast [4 x %struct.TYPE_18__]* %10 to i8*
%17 = bitcast [2 x %struct.TYPE_15__]* %11 to i8*
%18 = bitcast [2 x %struct.TYPE_17__]* %12 to i8*
%19 = bitcast [2 x %struct.TYPE_20__]* %13 to i8*
%20 = call i32* @xcb_connect(i32* null, i32* null)
store i32* %20, i32** %2
%21 = load i32*, i32** %2
%22 = call i32 @xcb_get_setup(i32* %21)
%23 = call %struct.TYPE_16__* @xcb_setup_roots_iterator(i32 %22)
%24 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %14, i32 0, i32 0
store %struct.TYPE_16__* %23, %struct.TYPE_16__** %24
%25 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %14, i32 0, i32 0
%26 = load %struct.TYPE_16__*, %struct.TYPE_16__** %25
store %struct.TYPE_16__* %26, %struct.TYPE_16__** %3
%27 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%28 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %27, i32 0, i32 3
%29 = load i8*, i8** %28
store i8* %29, i8** %4
%30 = load i32*, i32** %2
%31 = call i8* @xcb_generate_id(i32* %30)
store i8* %31, i8** %5
%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_16__*, %struct.TYPE_16__** %3
%36 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %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_16__*, %struct.TYPE_16__** %3
%52 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %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 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 %55, i32* %56
%57 = load i32*, i32** %2
%58 = load i32, i32* @XCB_COPY_FROM_PARENT
%59 = load i8*, i8** %4
%60 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%61 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %60, i32 0, i32 3
%62 = load i8*, i8** %61
%63 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%64 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%65 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %64, i32 0, i32 2
%66 = load i32, i32* %65
%67 = load i32, i32* %7
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%69 = call i32 @xcb_create_window(i32* %57, i32 %58, i8* %59, i8* %62, i32 0, i32 0, i32 150, i32 150, i32 10, i32 %63, i32 %66, i32 %67, i32* %68)
%70 = load i32*, i32** %2
%71 = load i8*, i8** %4
%72 = call i32 @xcb_map_window(i32* %70, i8* %71)
%73 = load i32*, i32** %2
%74 = call i32 @xcb_flush(i32* %73)
br label %75
75: ; preds = %115, %0
%76 = load i32*, i32** %2
%77 = call %struct.TYPE_19__* @xcb_wait_for_event(i32* %76)
store %struct.TYPE_19__* %77, %struct.TYPE_19__** %6
%78 = icmp ne %struct.TYPE_19__* %77, null
br i1 %78, label %79, label %118
79: ; preds = %75
%80 = load %struct.TYPE_19__*, %struct.TYPE_19__** %6
%81 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %80, i32 0, i32 0
%82 = load i32, i32* %81
%83 = and i32 %82, -129
switch i32 %83, label %114 [
i32 128, label %84
]
84: ; preds = %79
%85 = load i32*, i32** %2
%86 = load i32, i32* @XCB_COORD_MODE_ORIGIN
%87 = load i8*, i8** %4
%88 = load i8*, i8** %5
%89 = getelementptr inbounds [4 x %struct.TYPE_18__], [4 x %struct.TYPE_18__]* %9, i64 0, i64 0
%90 = call i32 @xcb_poly_point(i32* %85, i32 %86, i8* %87, i8* %88, i32 4, %struct.TYPE_18__* %89)
%91 = load i32*, i32** %2
%92 = load i32, i32* @XCB_COORD_MODE_PREVIOUS
%93 = load i8*, i8** %4
%94 = load i8*, i8** %5
%95 = getelementptr inbounds [4 x %struct.TYPE_18__], [4 x %struct.TYPE_18__]* %10, i64 0, i64 0
%96 = call i32 @xcb_poly_line(i32* %91, i32 %92, i8* %93, i8* %94, i32 4, %struct.TYPE_18__* %95)
%97 = load i32*, i32** %2
%98 = load i8*, i8** %4
%99 = load i8*, i8** %5
%100 = getelementptr inbounds [2 x %struct.TYPE_15__], [2 x %struct.TYPE_15__]* %11, i64 0, i64 0
%101 = call i32 @xcb_poly_segment(i32* %97, i8* %98, i8* %99, i32 2, %struct.TYPE_15__* %100)
%102 = load i32*, i32** %2
%103 = load i8*, i8** %4
%104 = load i8*, i8** %5
%105 = getelementptr inbounds [2 x %struct.TYPE_17__], [2 x %struct.TYPE_17__]* %12, i64 0, i64 0
%106 = call i32 @xcb_poly_rectangle(i32* %102, i8* %103, i8* %104, i32 2, %struct.TYPE_17__* %105)
%107 = load i32*, i32** %2
%108 = load i8*, i8** %4
%109 = load i8*, i8** %5
%110 = getelementptr inbounds [2 x %struct.TYPE_20__], [2 x %struct.TYPE_20__]* %13, i64 0, i64 0
%111 = call i32 @xcb_poly_arc(i32* %107, i8* %108, i8* %109, i32 2, %struct.TYPE_20__* %110)
%112 = load i32*, i32** %2
%113 = call i32 @xcb_flush(i32* %112)
br label %115
114: ; preds = %79
br label %115
115: ; preds = %114, %84
%116 = load %struct.TYPE_19__*, %struct.TYPE_19__** %6
%117 = call i32 @free(%struct.TYPE_19__* %116)
br label %75
118: ; preds = %75
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_16__ = type { i32, i32, i32, i8* }
%struct.TYPE_19__ = 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_COPY_FROM_PARENT = global i32 0
@XCB_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
@XCB_COORD_MODE_ORIGIN = global i32 0
@XCB_COORD_MODE_PREVIOUS = global i32 0
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 i32 @xcb_get_setup(i32* %3)
%5 = tail call %struct.TYPE_16__* @xcb_setup_roots_iterator(i32 %4)
%6 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %5, i64 0, i32 3
%7 = load i8*, i8** %6
%8 = tail call i8* @xcb_generate_id(i32* %3)
%9 = load i32, i32* @XCB_GC_FOREGROUND
%10 = load i32, i32* @XCB_GC_GRAPHICS_EXPOSURES
%11 = or i32 %10, %9
%12 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %5, i64 0, i32 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 0, i32* %15
%16 = call i32 @xcb_create_gc(i32* %3, i8* %8, i8* %7, i32 %11, i32* %14)
%17 = call i8* @xcb_generate_id(i32* %3)
%18 = load i32, i32* @XCB_CW_BACK_PIXEL
%19 = load i32, i32* @XCB_CW_EVENT_MASK
%20 = or i32 %19, %18
%21 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %5, i64 0, i32 1
%22 = load i32, i32* %21
store i32 %22, i32* %14
%23 = load i32, i32* @XCB_EVENT_MASK_EXPOSURE
store i32 %23, i32* %15
%24 = load i32, i32* @XCB_COPY_FROM_PARENT
%25 = load i8*, i8** %6
%26 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%27 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %5, i64 0, i32 2
%28 = load i32, i32* %27
%29 = call i32 @xcb_create_window(i32* %3, i32 %24, i8* %17, i8* %25, i32 0, i32 0, i32 150, i32 150, i32 10, i32 %26, i32 %28, i32 %20, i32* %14)
%30 = call i32 @xcb_map_window(i32* %3, i8* %17)
%31 = call i32 @xcb_flush(i32* %3)
%32 = call %struct.TYPE_19__* @xcb_wait_for_event(i32* %3)
%33 = icmp eq %struct.TYPE_19__* %32, null
br i1 %33, label %39, label %34
34: ; preds = %0, %34
%35 = phi %struct.TYPE_19__* [ %37, %34 ], [ %32, %0 ]
%36 = call i32 @free(%struct.TYPE_19__* %35)
%37 = call %struct.TYPE_19__* @xcb_wait_for_event(i32* %3)
%38 = icmp eq %struct.TYPE_19__* %37, null
br i1 %38, label %39, label %34
39: ; preds = %34, %0
ret i32 0
}