#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_8__ TYPE_3__;
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  long *l;
};
struct TYPE_7__ {
  int format;
  TYPE_1__ data;
  void *window;
  int /*<<< orphan*/ *display;
  void *message_type;
  void *type;
};
struct TYPE_8__ {
  TYPE_2__ xclient;
};
typedef TYPE_3__ XEvent;
typedef void *Window;
typedef int /*<<< orphan*/ Display;
typedef void *Atom;

/* Variables and functions */
long Above;
long Below;
long BottomIf;
void *ClientMessage;
int /*<<< orphan*/ CopyFromParent;
int /*<<< orphan*/ False;
long Opposite;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int SubstructureNotifyMask;
int SubstructureRedirectMask;
long TopIf;
int /*<<< orphan*/ WhitePixel(int /*<<< orphan*/ *, int /*<<< orphan*/);
void *XCreateWindow(int /*<<< orphan*/ *, int /*<<< orphan*/, int, int, int,
                    int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/ *);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
void *XInternAtom(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, TYPE_3__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSendEvent(int /*<<< orphan*/ *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int, TYPE_3__ *);
int /*<<< orphan*/ XSetWindowBackground(int /*<<< orphan*/ *, void *,
                                        int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int main() {
  Display *display;
  Window win;
  XEvent report;
  Atom _restack;
  XEvent msg;
  int x = 10, y = 10, h = 100, w = 400;
  display = XOpenDisplay(NULL);
  if (display == NULL) {
    fprintf(stderr, "couldn't connect to X server :0\n");
    return 0;
  }
  _restack = XInternAtom(display, "_NET_RESTACK_WINDOW", False);
  win = XCreateWindow(display, RootWindow(display, 0), x, y, w, h, 10,
                      CopyFromParent, CopyFromParent, CopyFromParent, 0, NULL);
  XSetWindowBackground(display, win, WhitePixel(display, 0));
  XMapWindow(display, win);
  XFlush(display);
  printf("requesting bottom in 3\n");
  sleep(3);
  msg.xclient.type = ClientMessage;
  msg.xclient.message_type = _restack;
  msg.xclient.display = display;
  msg.xclient.window = win;
  msg.xclient.format = 32;
  msg.xclient.data.l[0] = 2l;
  msg.xclient.data.l[1] = 0l;
  msg.xclient.data.l[2] = Below;
  msg.xclient.data.l[3] = 0l;
  msg.xclient.data.l[4] = 0l;
  XSendEvent(display, RootWindow(display, 0), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &msg);
  XFlush(display);
  printf("requesting top in 3\n");
  sleep(3);
  msg.xclient.type = ClientMessage;
  msg.xclient.message_type = _restack;
  msg.xclient.display = display;
  msg.xclient.window = win;
  msg.xclient.format = 32;
  msg.xclient.data.l[0] = 2l;
  msg.xclient.data.l[1] = 0l;
  msg.xclient.data.l[2] = Above;
  msg.xclient.data.l[3] = 0l;
  msg.xclient.data.l[4] = 0l;
  XSendEvent(display, RootWindow(display, 0), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &msg);
  XFlush(display);
  printf("requesting bottomif in 3\n");
  sleep(3);
  msg.xclient.type = ClientMessage;
  msg.xclient.message_type = _restack;
  msg.xclient.display = display;
  msg.xclient.window = win;
  msg.xclient.format = 32;
  msg.xclient.data.l[0] = 2l;
  msg.xclient.data.l[1] = 0l;
  msg.xclient.data.l[2] = BottomIf;
  msg.xclient.data.l[3] = 0l;
  msg.xclient.data.l[4] = 0l;
  XSendEvent(display, RootWindow(display, 0), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &msg);
  XFlush(display);
  printf("requesting topif in 3\n");
  sleep(3);
  msg.xclient.type = ClientMessage;
  msg.xclient.message_type = _restack;
  msg.xclient.display = display;
  msg.xclient.window = win;
  msg.xclient.format = 32;
  msg.xclient.data.l[0] = 2l;
  msg.xclient.data.l[1] = 0l;
  msg.xclient.data.l[2] = TopIf;
  msg.xclient.data.l[3] = 0l;
  msg.xclient.data.l[4] = 0l;
  XSendEvent(display, RootWindow(display, 0), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &msg);
  XFlush(display);
  printf("requesting opposite in 3\n");
  sleep(3);
  msg.xclient.type = ClientMessage;
  msg.xclient.message_type = _restack;
  msg.xclient.display = display;
  msg.xclient.window = win;
  msg.xclient.format = 32;
  msg.xclient.data.l[0] = 2l;
  msg.xclient.data.l[1] = 0l;
  msg.xclient.data.l[2] = Opposite;
  msg.xclient.data.l[3] = 0l;
  msg.xclient.data.l[4] = 0l;
  XSendEvent(display, RootWindow(display, 0), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &msg);
  XFlush(display);
  while (1) {
    XNextEvent(display, &report);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x108,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x8c(%rbp)
movl   $0xa,-0x90(%rbp)
movl   $0x64,-0x94(%rbp)
movl   $0x190,-0x98(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1244 <main+0x74>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
lea    0xdcd(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret
mov    -0x18(%rbp),%rdi
mov    0x2d99(%rip),%rax
mov    (%rax),%edx
lea    0xdc9(%rip),%rsi
call   1090 <XInternAtom@plt>
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xd8(%rbp),%rdi
mov    %eax,%esi
mov    -0x8c(%rbp),%edx
mov    -0x90(%rbp),%ecx
mov    -0x98(%rbp),%r8d
mov    -0x94(%rbp),%r9d
mov    0x2d0f(%rip),%rax
mov    (%rax),%r11d
mov    0x2d05(%rip),%rax
mov    (%rax),%r10d
mov    0x2cfb(%rip),%rax
mov    (%rax),%eax
xor    %ebx,%ebx
xor    %ebx,%ebx
movl   $0xa,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movq   $0x0,0x28(%rsp)
call   10a0 <XCreateWindow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <WhitePixel@plt>
mov    -0xd0(%rbp),%rdi
mov    -0xc8(%rbp),%rsi
mov    %eax,%edx
call   10e0 <XSetWindowBackground@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10d0 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <XFlush@plt>
lea    0xcf8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   10f0 <sleep@plt>
mov    0x2c8d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
movl   $0x20,-0x88(%rbp)
mov    -0x80(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    0x2bf6(%rip),%rax
mov    (%rax),%rcx
mov    -0x80(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xc0(%rbp),%rdi
mov    %eax,%esi
mov    0x2c05(%rip),%rax
mov    (%rax),%edx
mov    0x2bbc(%rip),%rax
mov    (%rax),%ecx
mov    0x2bc3(%rip),%rax
or     (%rax),%ecx
lea    -0x88(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <XFlush@plt>
lea    0xc3a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   10f0 <sleep@plt>
mov    0x2bb7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
movl   $0x20,-0x88(%rbp)
mov    -0x80(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    0x2b58(%rip),%rax
mov    (%rax),%rcx
mov    -0x80(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xb8(%rbp),%rdi
mov    %eax,%esi
mov    0x2b2f(%rip),%rax
mov    (%rax),%edx
mov    0x2ae6(%rip),%rax
mov    (%rax),%ecx
mov    0x2aed(%rip),%rax
or     (%rax),%ecx
lea    -0x88(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <XFlush@plt>
lea    0xb79(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   10f0 <sleep@plt>
mov    0x2ae1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
movl   $0x20,-0x88(%rbp)
mov    -0x80(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    0x2a52(%rip),%rax
mov    (%rax),%rcx
mov    -0x80(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xb0(%rbp),%rdi
mov    %eax,%esi
mov    0x2a59(%rip),%rax
mov    (%rax),%edx
mov    0x2a10(%rip),%rax
mov    (%rax),%ecx
mov    0x2a17(%rip),%rax
or     (%rax),%ecx
lea    -0x88(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <XFlush@plt>
lea    0xabd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   10f0 <sleep@plt>
mov    0x2a0b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
movl   $0x20,-0x88(%rbp)
mov    -0x80(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    0x29b4(%rip),%rax
mov    (%rax),%rcx
mov    -0x80(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xa8(%rbp),%rdi
mov    %eax,%esi
mov    0x2983(%rip),%rax
mov    (%rax),%edx
mov    0x293a(%rip),%rax
mov    (%rax),%ecx
mov    0x2941(%rip),%rax
or     (%rax),%ecx
lea    -0x88(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <XFlush@plt>
lea    0x9fe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   10f0 <sleep@plt>
mov    0x2935(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
movl   $0x20,-0x88(%rbp)
mov    -0x80(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    0x2896(%rip),%rax
mov    (%rax),%rcx
mov    -0x80(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x80(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%esi
mov    0x28ad(%rip),%rax
mov    (%rax),%edx
mov    0x2864(%rip),%rax
mov    (%rax),%ecx
mov    0x286b(%rip),%rax
or     (%rax),%ecx
lea    -0x88(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <XFlush@plt>
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1080 <XNextEvent@plt>
jmp    1764 <main+0x594>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
test   %rax,%rax
jne    11df <main+0x2f>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
lea    0xe30(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rax,%rbx
mov    0x2dff(%rip),%rax
mov    (%rax),%edx
lea    0xe2f(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <RootWindow@plt>
mov    0x2dc5(%rip),%rcx
mov    (%rcx),%r10d
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0x190,%r8d
mov    $0x64,%r9d
push   $0x0
push   $0x0
push   %r10
push   %r10
push   %r10
push   $0xa
call   1080 <XCreateWindow@plt>
add    $0x30,%rsp
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <WhitePixel@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   10c0 <XSetWindowBackground@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <XMapWindow@plt>
mov    %rbx,%rdi
call   10a0 <XFlush@plt>
lea    0xdc3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>

LLVM IR (-O0):
%struct.TYPE_8__ = type { %struct.TYPE_7__ }
%struct.TYPE_7__ = type { i32, %struct.TYPE_6__, i8*, i32*, i8*, i8* }
%struct.TYPE_6__ = type { i64* }
@stderr = global i32 0
@.str = [33 x i8] c"couldn't connect to X server :0\0A\00"
@.str.1 = [20 x i8] c"_NET_RESTACK_WINDOW\00"
@False = global i32 0
@CopyFromParent = global i32 0
@.str.2 = [24 x i8] c"requesting bottom in 3\0A\00"
@ClientMessage = global i8* null
@Below = global i64 0
@SubstructureNotifyMask = global i32 0
@SubstructureRedirectMask = global i32 0
@.str.3 = [21 x i8] c"requesting top in 3\0A\00"
@Above = global i64 0
@.str.4 = [26 x i8] c"requesting bottomif in 3\0A\00"
@BottomIf = global i64 0
@.str.5 = [23 x i8] c"requesting topif in 3\0A\00"
@TopIf = global i64 0
@.str.6 = [26 x i8] c"requesting opposite in 3\0A\00"
@Opposite = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca %struct.TYPE_8__
%5 = alloca i8*
%6 = alloca %struct.TYPE_8__
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %7
store i32 10, i32* %8
store i32 100, i32* %9
store i32 400, i32* %10
%11 = call i32* @XOpenDisplay(i32* null)
store i32* %11, i32** %2
%12 = load i32*, i32** %2
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
17: ; preds = %0
%18 = load i32*, i32** %2
%19 = load i32, i32* @False
%20 = call i8* @XInternAtom(i32* %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %19)
store i8* %20, i8** %5
%21 = load i32*, i32** %2
%22 = load i32*, i32** %2
%23 = call i32 @RootWindow(i32* %22, i32 0)
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = load i32, i32* %10
%27 = load i32, i32* %9
%28 = load i32, i32* @CopyFromParent
%29 = load i32, i32* @CopyFromParent
%30 = load i32, i32* @CopyFromParent
%31 = call i8* @XCreateWindow(i32* %21, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 10, i32 %28, i32 %29, i32 %30, i32 0, i32* null)
store i8* %31, i8** %3
%32 = load i32*, i32** %2
%33 = load i8*, i8** %3
%34 = load i32*, i32** %2
%35 = call i32 @WhitePixel(i32* %34, i32 0)
%36 = call i32 @XSetWindowBackground(i32* %32, i8* %33, i32 %35)
%37 = load i32*, i32** %2
%38 = load i8*, i8** %3
%39 = call i32 @XMapWindow(i32* %37, i8* %38)
%40 = load i32*, i32** %2
%41 = call i32 @XFlush(i32* %40)
%42 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%43 = call i32 @sleep(i32 3)
%44 = load i8*, i8** @ClientMessage
%45 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%46 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %45, i32 0, i32 5
store i8* %44, i8** %46
%47 = load i8*, i8** %5
%48 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%49 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %48, i32 0, i32 4
store i8* %47, i8** %49
%50 = load i32*, i32** %2
%51 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%52 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %51, i32 0, i32 3
store i32* %50, i32** %52
%53 = load i8*, i8** %3
%54 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%55 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %54, i32 0, i32 2
store i8* %53, i8** %55
%56 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%57 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %56, i32 0, i32 0
store i32 32, i32* %57
%58 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%59 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %58, i32 0, i32 1
%60 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %59, i32 0, i32 0
%61 = load i64*, i64** %60
%62 = getelementptr inbounds i64, i64* %61, i64 0
store i64 2, i64* %62
%63 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%64 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %63, i32 0, i32 1
%65 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %64, i32 0, i32 0
%66 = load i64*, i64** %65
%67 = getelementptr inbounds i64, i64* %66, i64 1
store i64 0, i64* %67
%68 = load i64, i64* @Below
%69 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%70 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %69, i32 0, i32 1
%71 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %70, i32 0, i32 0
%72 = load i64*, i64** %71
%73 = getelementptr inbounds i64, i64* %72, i64 2
store i64 %68, i64* %73
%74 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%75 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %74, i32 0, i32 1
%76 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %75, i32 0, i32 0
%77 = load i64*, i64** %76
%78 = getelementptr inbounds i64, i64* %77, i64 3
store i64 0, i64* %78
%79 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%80 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %79, i32 0, i32 1
%81 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %80, i32 0, i32 0
%82 = load i64*, i64** %81
%83 = getelementptr inbounds i64, i64* %82, i64 4
store i64 0, i64* %83
%84 = load i32*, i32** %2
%85 = load i32*, i32** %2
%86 = call i32 @RootWindow(i32* %85, i32 0)
%87 = load i32, i32* @False
%88 = load i32, i32* @SubstructureNotifyMask
%89 = load i32, i32* @SubstructureRedirectMask
%90 = or i32 %88, %89
%91 = call i32 @XSendEvent(i32* %84, i32 %86, i32 %87, i32 %90, %struct.TYPE_8__* %6)
%92 = load i32*, i32** %2
%93 = call i32 @XFlush(i32* %92)
%94 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%95 = call i32 @sleep(i32 3)
%96 = load i8*, i8** @ClientMessage
%97 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%98 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %97, i32 0, i32 5
store i8* %96, i8** %98
%99 = load i8*, i8** %5
%100 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%101 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %100, i32 0, i32 4
store i8* %99, i8** %101
%102 = load i32*, i32** %2
%103 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%104 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %103, i32 0, i32 3
store i32* %102, i32** %104
%105 = load i8*, i8** %3
%106 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%107 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %106, i32 0, i32 2
store i8* %105, i8** %107
%108 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%109 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %108, i32 0, i32 0
store i32 32, i32* %109
%110 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%111 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %110, i32 0, i32 1
%112 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %111, i32 0, i32 0
%113 = load i64*, i64** %112
%114 = getelementptr inbounds i64, i64* %113, i64 0
store i64 2, i64* %114
%115 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%116 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %115, i32 0, i32 1
%117 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %116, i32 0, i32 0
%118 = load i64*, i64** %117
%119 = getelementptr inbounds i64, i64* %118, i64 1
store i64 0, i64* %119
%120 = load i64, i64* @Above
%121 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%122 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %121, i32 0, i32 1
%123 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %122, i32 0, i32 0
%124 = load i64*, i64** %123
%125 = getelementptr inbounds i64, i64* %124, i64 2
store i64 %120, i64* %125
%126 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%127 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %126, i32 0, i32 1
%128 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %127, i32 0, i32 0
%129 = load i64*, i64** %128
%130 = getelementptr inbounds i64, i64* %129, i64 3
store i64 0, i64* %130
%131 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%132 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %131, i32 0, i32 1
%133 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %132, i32 0, i32 0
%134 = load i64*, i64** %133
%135 = getelementptr inbounds i64, i64* %134, i64 4
store i64 0, i64* %135
%136 = load i32*, i32** %2
%137 = load i32*, i32** %2
%138 = call i32 @RootWindow(i32* %137, i32 0)
%139 = load i32, i32* @False
%140 = load i32, i32* @SubstructureNotifyMask
%141 = load i32, i32* @SubstructureRedirectMask
%142 = or i32 %140, %141
%143 = call i32 @XSendEvent(i32* %136, i32 %138, i32 %139, i32 %142, %struct.TYPE_8__* %6)
%144 = load i32*, i32** %2
%145 = call i32 @XFlush(i32* %144)
%146 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%147 = call i32 @sleep(i32 3)
%148 = load i8*, i8** @ClientMessage
%149 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%150 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %149, i32 0, i32 5
store i8* %148, i8** %150
%151 = load i8*, i8** %5
%152 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%153 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %152, i32 0, i32 4
store i8* %151, i8** %153
%154 = load i32*, i32** %2
%155 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%156 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %155, i32 0, i32 3
store i32* %154, i32** %156
%157 = load i8*, i8** %3
%158 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%159 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %158, i32 0, i32 2
store i8* %157, i8** %159
%160 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%161 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %160, i32 0, i32 0
store i32 32, i32* %161
%162 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%163 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %162, i32 0, i32 1
%164 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %163, i32 0, i32 0
%165 = load i64*, i64** %164
%166 = getelementptr inbounds i64, i64* %165, i64 0
store i64 2, i64* %166
%167 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%168 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %167, i32 0, i32 1
%169 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %168, i32 0, i32 0
%170 = load i64*, i64** %169
%171 = getelementptr inbounds i64, i64* %170, i64 1
store i64 0, i64* %171
%172 = load i64, i64* @BottomIf
%173 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%174 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %173, i32 0, i32 1
%175 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %174, i32 0, i32 0
%176 = load i64*, i64** %175
%177 = getelementptr inbounds i64, i64* %176, i64 2
store i64 %172, i64* %177
%178 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%179 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %178, i32 0, i32 1
%180 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %179, i32 0, i32 0
%181 = load i64*, i64** %180
%182 = getelementptr inbounds i64, i64* %181, i64 3
store i64 0, i64* %182
%183 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%184 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %183, i32 0, i32 1
%185 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %184, i32 0, i32 0
%186 = load i64*, i64** %185
%187 = getelementptr inbounds i64, i64* %186, i64 4
store i64 0, i64* %187
%188 = load i32*, i32** %2
%189 = load i32*, i32** %2
%190 = call i32 @RootWindow(i32* %189, i32 0)
%191 = load i32, i32* @False
%192 = load i32, i32* @SubstructureNotifyMask
%193 = load i32, i32* @SubstructureRedirectMask
%194 = or i32 %192, %193
%195 = call i32 @XSendEvent(i32* %188, i32 %190, i32 %191, i32 %194, %struct.TYPE_8__* %6)
%196 = load i32*, i32** %2
%197 = call i32 @XFlush(i32* %196)
%198 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%199 = call i32 @sleep(i32 3)
%200 = load i8*, i8** @ClientMessage
%201 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%202 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %201, i32 0, i32 5
store i8* %200, i8** %202
%203 = load i8*, i8** %5
%204 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%205 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %204, i32 0, i32 4
store i8* %203, i8** %205
%206 = load i32*, i32** %2
%207 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%208 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %207, i32 0, i32 3
store i32* %206, i32** %208
%209 = load i8*, i8** %3
%210 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%211 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %210, i32 0, i32 2
store i8* %209, i8** %211
%212 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%213 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %212, i32 0, i32 0
store i32 32, i32* %213
%214 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%215 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %214, i32 0, i32 1
%216 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %215, i32 0, i32 0
%217 = load i64*, i64** %216
%218 = getelementptr inbounds i64, i64* %217, i64 0
store i64 2, i64* %218
%219 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%220 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %219, i32 0, i32 1
%221 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %220, i32 0, i32 0
%222 = load i64*, i64** %221
%223 = getelementptr inbounds i64, i64* %222, i64 1
store i64 0, i64* %223
%224 = load i64, i64* @TopIf
%225 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%226 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %225, i32 0, i32 1
%227 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %226, i32 0, i32 0
%228 = load i64*, i64** %227
%229 = getelementptr inbounds i64, i64* %228, i64 2
store i64 %224, i64* %229
%230 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%231 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %230, i32 0, i32 1
%232 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %231, i32 0, i32 0
%233 = load i64*, i64** %232
%234 = getelementptr inbounds i64, i64* %233, i64 3
store i64 0, i64* %234
%235 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%236 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %235, i32 0, i32 1
%237 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %236, i32 0, i32 0
%238 = load i64*, i64** %237
%239 = getelementptr inbounds i64, i64* %238, i64 4
store i64 0, i64* %239
%240 = load i32*, i32** %2
%241 = load i32*, i32** %2
%242 = call i32 @RootWindow(i32* %241, i32 0)
%243 = load i32, i32* @False
%244 = load i32, i32* @SubstructureNotifyMask
%245 = load i32, i32* @SubstructureRedirectMask
%246 = or i32 %244, %245
%247 = call i32 @XSendEvent(i32* %240, i32 %242, i32 %243, i32 %246, %struct.TYPE_8__* %6)
%248 = load i32*, i32** %2
%249 = call i32 @XFlush(i32* %248)
%250 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%251 = call i32 @sleep(i32 3)
%252 = load i8*, i8** @ClientMessage
%253 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%254 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %253, i32 0, i32 5
store i8* %252, i8** %254
%255 = load i8*, i8** %5
%256 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%257 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %256, i32 0, i32 4
store i8* %255, i8** %257
%258 = load i32*, i32** %2
%259 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%260 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %259, i32 0, i32 3
store i32* %258, i32** %260
%261 = load i8*, i8** %3
%262 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%263 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %262, i32 0, i32 2
store i8* %261, i8** %263
%264 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%265 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %264, i32 0, i32 0
store i32 32, i32* %265
%266 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%267 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %266, i32 0, i32 1
%268 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %267, i32 0, i32 0
%269 = load i64*, i64** %268
%270 = getelementptr inbounds i64, i64* %269, i64 0
store i64 2, i64* %270
%271 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%272 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %271, i32 0, i32 1
%273 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %272, i32 0, i32 0
%274 = load i64*, i64** %273
%275 = getelementptr inbounds i64, i64* %274, i64 1
store i64 0, i64* %275
%276 = load i64, i64* @Opposite
%277 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%278 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %277, i32 0, i32 1
%279 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %278, i32 0, i32 0
%280 = load i64*, i64** %279
%281 = getelementptr inbounds i64, i64* %280, i64 2
store i64 %276, i64* %281
%282 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%283 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %282, i32 0, i32 1
%284 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %283, i32 0, i32 0
%285 = load i64*, i64** %284
%286 = getelementptr inbounds i64, i64* %285, i64 3
store i64 0, i64* %286
%287 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %6, i32 0, i32 0
%288 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %287, i32 0, i32 1
%289 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %288, i32 0, i32 0
%290 = load i64*, i64** %289
%291 = getelementptr inbounds i64, i64* %290, i64 4
store i64 0, i64* %291
%292 = load i32*, i32** %2
%293 = load i32*, i32** %2
%294 = call i32 @RootWindow(i32* %293, i32 0)
%295 = load i32, i32* @False
%296 = load i32, i32* @SubstructureNotifyMask
%297 = load i32, i32* @SubstructureRedirectMask
%298 = or i32 %296, %297
%299 = call i32 @XSendEvent(i32* %292, i32 %294, i32 %295, i32 %298, %struct.TYPE_8__* %6)
%300 = load i32*, i32** %2
%301 = call i32 @XFlush(i32* %300)
br label %302
302: ; preds = %17, %302
%303 = load i32*, i32** %2
%304 = call i32 @XNextEvent(i32* %303, %struct.TYPE_8__* %4)
br label %302
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"couldn't connect to X server :0\0A\00"
@.str.1 = [20 x i8] c"_NET_RESTACK_WINDOW\00"
@False = global i32 0
@CopyFromParent = global i32 0
@ClientMessage = global i8* null
@Below = global i64 0
@SubstructureNotifyMask = global i32 0
@SubstructureRedirectMask = global i32 0
@Above = global i64 0
@BottomIf = global i64 0
@TopIf = global i64 0
@Opposite = global i64 0
@str = [23 x i8] c"requesting bottom in 3\00"
define i32 @main() {
%1 = tail call i32* @XOpenDisplay(i32* null)
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
6: ; preds = %0
%7 = load i32, i32* @False
%8 = tail call i8* @XInternAtom(i32* %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @RootWindow(i32* %1, i32 0)
%10 = load i32, i32* @CopyFromParent
%11 = tail call i8* @XCreateWindow(i32* %1, i32 %9, i32 10, i32 10, i32 400, i32 100, i32 10, i32 %10, i32 %10, i32 %10, i32 0, i32* null)
%12 = tail call i32 @WhitePixel(i32* %1, i32 0)
%13 = tail call i32 @XSetWindowBackground(i32* %1, i8* %11, i32 %12)
%14 = tail call i32 @XMapWindow(i32* %1, i8* %11)
%15 = tail call i32 @XFlush(i32* %1)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 @sleep(i32 3)
unreachable
}