#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_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_setup_t;
struct TYPE_4__ {
  int /*<<< orphan*/ root_visual;
  int /*<<< orphan*/ root;
};
typedef TYPE_1__ xcb_screen_t;
struct TYPE_5__ {
  TYPE_1__ *data;
};
typedef TYPE_2__ xcb_screen_iterator_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ XCB_COPY_FROM_PARENT;
int /*<<< orphan*/ XCB_WINDOW_CLASS_INPUT_OUTPUT;
int /*<<< orphan*/ *xcb_connect(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_create_window(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int, int, int, int /*<<< orphan*/,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_disconnect(int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_flush(int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_generate_id(int /*<<< orphan*/ *);
int /*<<< orphan*/ *xcb_get_setup(int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_map_window(int /*<<< orphan*/ *, int /*<<< orphan*/);
TYPE_2__ xcb_setup_roots_iterator(int /*<<< orphan*/ const *);
int main() {
  xcb_connection_t *connection = xcb_connect(NULL, NULL);
  const xcb_setup_t *setup = xcb_get_setup(connection);
  xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup);
  xcb_screen_t *screen = iter.data;
  xcb_window_t window = xcb_generate_id(connection);
  xcb_create_window(connection, XCB_COPY_FROM_PARENT, window, screen->root, 0,
                    0, 150, 150, 10, XCB_WINDOW_CLASS_INPUT_OUTPUT,
                    screen->root_visual, 0, NULL);
  xcb_map_window(connection, window);
  xcb_flush(connection);
  xcb_disconnect(connection);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1040 <xcb_connect@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <xcb_get_setup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <xcb_setup_roots_iterator@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <xcb_generate_id@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e08(%rip),%rax
mov    (%rax),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%ecx
mov    0x2dfd(%rip),%rax
mov    (%rax),%r10d
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
xor    %r8d,%r8d
mov    %r9d,%r8d
movl   $0x96,(%rsp)
movl   $0x96,0x8(%rsp)
movl   $0xa,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movq   $0x0,0x30(%rsp)
call   1030 <xcb_create_window@plt>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1080 <xcb_map_window@plt>
mov    -0x10(%rbp),%rdi
call   1050 <xcb_flush@plt>
mov    -0x10(%rbp),%rdi
call   1090 <xcb_disconnect@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <xcb_connect@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10a0 <xcb_get_setup@plt>
mov    %rax,%rdi
call   1070 <xcb_setup_roots_iterator@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1060 <xcb_generate_id@plt>
mov    %eax,%r14d
mov    0x2e2b(%rip),%rax
mov    (%rax),%esi
mov    0x0(%rbp),%eax
mov    0x4(%rbp),%ecx
mov    0x2e24(%rip),%rdx
mov    (%rdx),%ebp
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   %rax
push   %rbp
push   $0xa
push   $0x96
push   $0x96
call   1030 <xcb_create_window@plt>
add    $0x40,%rsp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1080 <xcb_map_window@plt>
mov    %rbx,%rdi
call   1050 <xcb_flush@plt>
mov    %rbx,%rdi
call   1090 <xcb_disconnect@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__* }
%struct.TYPE_4__ = type { i32, i32 }
@XCB_COPY_FROM_PARENT = global i32 0
@XCB_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca %struct.TYPE_5__
%5 = alloca %struct.TYPE_4__*
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32* @xcb_connect(i32* null, i32* null)
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = call i32* @xcb_get_setup(i32* %8)
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = call %struct.TYPE_4__* @xcb_setup_roots_iterator(i32* %10)
%12 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 0
store %struct.TYPE_4__* %11, %struct.TYPE_4__** %12
%13 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 0
%14 = load %struct.TYPE_4__*, %struct.TYPE_4__** %13
store %struct.TYPE_4__* %14, %struct.TYPE_4__** %5
%15 = load i32*, i32** %2
%16 = call i32 @xcb_generate_id(i32* %15)
store i32 %16, i32* %6
%17 = load i32*, i32** %2
%18 = load i32, i32* @XCB_COPY_FROM_PARENT
%19 = load i32, i32* %6
%20 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%21 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %20, i32 0, i32 1
%22 = load i32, i32* %21
%23 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%24 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%25 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %24, i32 0, i32 0
%26 = load i32, i32* %25
%27 = call i32 @xcb_create_window(i32* %17, i32 %18, i32 %19, i32 %22, i32 0, i32 0, i32 150, i32 150, i32 10, i32 %23, i32 %26, i32 0, i32* null)
%28 = load i32*, i32** %2
%29 = load i32, i32* %6
%30 = call i32 @xcb_map_window(i32* %28, i32 %29)
%31 = load i32*, i32** %2
%32 = call i32 @xcb_flush(i32* %31)
%33 = load i32*, i32** %2
%34 = call i32 @xcb_disconnect(i32* %33)
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32 }
@XCB_COPY_FROM_PARENT = global i32 0
@XCB_WINDOW_CLASS_INPUT_OUTPUT = global i32 0
define i32 @main() {
%1 = tail call i32* @xcb_connect(i32* null, i32* null)
%2 = tail call i32* @xcb_get_setup(i32* %1)
%3 = tail call %struct.TYPE_4__* @xcb_setup_roots_iterator(i32* %2)
%4 = tail call i32 @xcb_generate_id(i32* %1)
%5 = load i32, i32* @XCB_COPY_FROM_PARENT
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 1
%7 = load i32, i32* %6
%8 = load i32, i32* @XCB_WINDOW_CLASS_INPUT_OUTPUT
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @xcb_create_window(i32* %1, i32 %5, i32 %4, i32 %7, i32 0, i32 0, i32 150, i32 150, i32 10, i32 %8, i32 %10, i32 0, i32* null)
%12 = tail call i32 @xcb_map_window(i32* %1, i32 %4)
%13 = tail call i32 @xcb_flush(i32* %1)
%14 = tail call i32 @xcb_disconnect(i32* %1)
ret i32 0
}