#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_10__ TYPE_4__;
typedef struct TYPE_9__ TYPE_3__;
typedef struct TYPE_8__ TYPE_2__;
typedef struct TYPE_7__ TYPE_1__;

/* Type definitions */
struct TYPE_9__ {
  int x;
  int y;
  int width;
  int height;
};
struct TYPE_7__ {
  int *l;
};
struct TYPE_8__ {
  int format;
  TYPE_1__ data;
  void *window;
  int /*<<< orphan*/ *display;
  void *message_type;
  void *type;
};
struct TYPE_10__ {
  int type;
  TYPE_3__ xconfigure;
  TYPE_2__ xclient;
};
typedef TYPE_4__ XEvent;
typedef void *Window;
typedef int /*<<< orphan*/ Display;
typedef void *Atom;

/* Variables and functions */
void *ClientMessage;
#define ConfigureNotify 129
int /*<<< orphan*/ CopyFromParent;
#define Expose 128
int ExposureMask;
int /*<<< orphan*/ False;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int StructureNotifyMask;
int SubstructureNotifyMask;
int SubstructureRedirectMask;
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_4__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, void *, int);
int /*<<< orphan*/ XSendEvent(int /*<<< orphan*/ *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int, TYPE_4__ *);
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 _net_fs, _net_state;
  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;
  }
  _net_state = XInternAtom(display, "_NET_WM_STATE", False);
  _net_fs = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", 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);
  sleep(2);
  printf("fullscreen\n");
  msg.xclient.type = ClientMessage;
  msg.xclient.message_type = _net_state;
  msg.xclient.display = display;
  msg.xclient.window = win;
  msg.xclient.format = 32;
  msg.xclient.data.l[0] = 2;
  msg.xclient.data.l[1] = _net_fs;
  msg.xclient.data.l[2] = 0l;
  msg.xclient.data.l[3] = 0l;
  msg.xclient.data.l[4] = 0l;
  XSendEvent(display, RootWindow(display, 0), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &msg);
  XFlush(display);
  sleep(2);
  printf("restore\n");
  msg.xclient.type = ClientMessage;
  msg.xclient.message_type = _net_state;
  msg.xclient.display = display;
  msg.xclient.window = win;
  msg.xclient.format = 32;
  msg.xclient.data.l[0] = 2;
  msg.xclient.data.l[1] = _net_fs;
  msg.xclient.data.l[2] = 0l;
  msg.xclient.data.l[3] = 0l;
  msg.xclient.data.l[4] = 0l;
  XSendEvent(display, RootWindow(display, 0), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &msg);
  XSelectInput(display, win, ExposureMask | StructureNotifyMask);
  while (1) {
    XNextEvent(display, &report);
    switch (report.type) {
    case Expose:
      printf("exposed\n");
      break;
    case ConfigureNotify:
      x = report.xconfigure.x;
      y = report.xconfigure.y;
      w = report.xconfigure.width;
      h = report.xconfigure.height;
      printf("confignotify %i,%i-%ix%i\n", x, y, w, h);
      break;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x128,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0xc4(%rbp)
movl   $0xa,-0xc8(%rbp)
movl   $0x64,-0xcc(%rbp)
movl   $0x190,-0xd0(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1254 <main+0x74>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
lea    0xdbd(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
add    $0x128,%rsp
pop    %rbx
pop    %rbp
ret
mov    -0x18(%rbp),%rdi
mov    0x2d89(%rip),%rax
mov    (%rax),%edx
lea    0xdb9(%rip),%rsi
call   1090 <XInternAtom@plt>
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d6c(%rip),%rax
mov    (%rax),%edx
lea    0xdaa(%rip),%rsi
call   1090 <XInternAtom@plt>
mov    %rax,-0x70(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xf8(%rbp),%rdi
mov    %eax,%esi
mov    -0xc4(%rbp),%edx
mov    -0xc8(%rbp),%ecx
mov    -0xd0(%rbp),%r8d
mov    -0xcc(%rbp),%r9d
mov    0x2ce2(%rip),%rax
mov    (%rax),%r11d
mov    0x2cd8(%rip),%rax
mov    (%rax),%r10d
mov    0x2cce(%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,-0xf0(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <WhitePixel@plt>
mov    -0xf0(%rbp),%rdi
mov    -0xe8(%rbp),%rsi
mov    %eax,%edx
call   10f0 <XSetWindowBackground@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10e0 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <XFlush@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
lea    0xcd4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2c5e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x98(%rbp)
movl   $0x20,-0xa8(%rbp)
mov    -0xa0(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x70(%rbp),%rax
mov    %eax,%ecx
mov    -0xa0(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xa0(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0xa0(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0xa0(%rbp),%rax
movl   $0x0,0x10(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <RootWindow@plt>
mov    -0xe0(%rbp),%rdi
mov    %eax,%esi
mov    0x2bc7(%rip),%rax
mov    (%rax),%edx
mov    0x2b7e(%rip),%rax
mov    (%rax),%ecx
mov    0x2b8d(%rip),%rax
or     (%rax),%ecx
lea    -0xc0(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <XFlush@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
lea    0xbf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x98(%rbp)
movl   $0x20,-0xa8(%rbp)
mov    -0xa0(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x70(%rbp),%rax
mov    %eax,%ecx
mov    -0xa0(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xa0(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0xa0(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0xa0(%rbp),%rax
movl   $0x0,0x10(%rax)
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    0x2ae0(%rip),%rax
mov    (%rax),%edx
mov    0x2a97(%rip),%rax
mov    (%rax),%ecx
mov    0x2aa6(%rip),%rax
or     (%rax),%ecx
lea    -0xc0(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2a81(%rip),%rax
mov    (%rax),%edx
mov    0x2a90(%rip),%rax
or     (%rax),%edx
call   10c0 <XSelectInput@plt>
mov    -0x18(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1080 <XNextEvent@plt>
mov    -0x68(%rbp),%eax
mov    %eax,-0xfc(%rbp)
sub    $0x80,%eax
je     1583 <main+0x3a3>
jmp    156d <main+0x38d>
mov    -0xfc(%rbp),%eax
sub    $0x81,%eax
je     1596 <main+0x3b6>
jmp    15e1 <main+0x401>
lea    0xad3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15e1 <main+0x401>
mov    -0x64(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0xc8(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0xd0(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0xc4(%rbp),%esi
mov    -0xc8(%rbp),%edx
mov    -0xd0(%rbp),%ecx
mov    -0xcc(%rbp),%r8d
lea    0xa8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1547 <main+0x367>

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),%r14
mov    (%r14),%edx
lea    0xe2e(%rip),%rsi
mov    %rax,%rdi
call   1070 <XInternAtom@plt>
mov    (%r14),%edx
lea    0xe2a(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <RootWindow@plt>
mov    0x2db2(%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>
mov    $0x2,%edi
call   10d0 <sleep@plt>
lea    0xdb9(%rip),%rdi
call   1030 <puts@plt>

LLVM IR (-O0):
%struct.TYPE_10__ = type { i32, %struct.TYPE_9__, %struct.TYPE_8__ }
%struct.TYPE_9__ = type { i32, i32, i32, i32 }
%struct.TYPE_8__ = type { i32, %struct.TYPE_7__, i8*, i32*, i8*, i8* }
%struct.TYPE_7__ = type { i32* }
@stderr = global i32 0
@.str = [33 x i8] c"couldn't connect to X server :0\0A\00"
@.str.1 = [14 x i8] c"_NET_WM_STATE\00"
@False = global i32 0
@.str.2 = [25 x i8] c"_NET_WM_STATE_FULLSCREEN\00"
@CopyFromParent = global i32 0
@.str.3 = [12 x i8] c"fullscreen\0A\00"
@ClientMessage = global i8* null
@SubstructureNotifyMask = global i32 0
@SubstructureRedirectMask = global i32 0
@.str.4 = [9 x i8] c"restore\0A\00"
@ExposureMask = global i32 0
@StructureNotifyMask = global i32 0
@.str.5 = [9 x i8] c"exposed\0A\00"
@.str.6 = [26 x i8] c"confignotify %i,%i-%ix%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca %struct.TYPE_10__
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.TYPE_10__
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %8
store i32 10, i32* %9
store i32 100, i32* %10
store i32 400, i32* %11
%12 = call i32* @XOpenDisplay(i32* null)
store i32* %12, i32** %2
%13 = load i32*, i32** %2
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
18: ; preds = %0
%19 = load i32*, i32** %2
%20 = load i32, i32* @False
%21 = call i8* @XInternAtom(i32* %19, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %20)
store i8* %21, i8** %6
%22 = load i32*, i32** %2
%23 = load i32, i32* @False
%24 = call i8* @XInternAtom(i32* %22, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %23)
store i8* %24, i8** %5
%25 = load i32*, i32** %2
%26 = load i32*, i32** %2
%27 = call i32 @RootWindow(i32* %26, i32 0)
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = load i32, i32* %11
%31 = load i32, i32* %10
%32 = load i32, i32* @CopyFromParent
%33 = load i32, i32* @CopyFromParent
%34 = load i32, i32* @CopyFromParent
%35 = call i8* @XCreateWindow(i32* %25, i32 %27, i32 %28, i32 %29, i32 %30, i32 %31, i32 10, i32 %32, i32 %33, i32 %34, i32 0, i32* null)
store i8* %35, i8** %3
%36 = load i32*, i32** %2
%37 = load i8*, i8** %3
%38 = load i32*, i32** %2
%39 = call i32 @WhitePixel(i32* %38, i32 0)
%40 = call i32 @XSetWindowBackground(i32* %36, i8* %37, i32 %39)
%41 = load i32*, i32** %2
%42 = load i8*, i8** %3
%43 = call i32 @XMapWindow(i32* %41, i8* %42)
%44 = load i32*, i32** %2
%45 = call i32 @XFlush(i32* %44)
%46 = call i32 @sleep(i32 2)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%48 = load i8*, i8** @ClientMessage
%49 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%50 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %49, i32 0, i32 5
store i8* %48, i8** %50
%51 = load i8*, i8** %6
%52 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%53 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %52, i32 0, i32 4
store i8* %51, i8** %53
%54 = load i32*, i32** %2
%55 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%56 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %55, i32 0, i32 3
store i32* %54, i32** %56
%57 = load i8*, i8** %3
%58 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%59 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %58, i32 0, i32 2
store i8* %57, i8** %59
%60 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%61 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %60, i32 0, i32 0
store i32 32, i32* %61
%62 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%63 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %62, i32 0, i32 1
%64 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %63, i32 0, i32 0
%65 = load i32*, i32** %64
%66 = getelementptr inbounds i32, i32* %65, i64 0
store i32 2, i32* %66
%67 = load i8*, i8** %5
%68 = ptrtoint i8* %67 to i32
%69 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%70 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %69, i32 0, i32 1
%71 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %70, i32 0, i32 0
%72 = load i32*, i32** %71
%73 = getelementptr inbounds i32, i32* %72, i64 1
store i32 %68, i32* %73
%74 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%75 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %74, i32 0, i32 1
%76 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %75, i32 0, i32 0
%77 = load i32*, i32** %76
%78 = getelementptr inbounds i32, i32* %77, i64 2
store i32 0, i32* %78
%79 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%80 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %79, i32 0, i32 1
%81 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %80, i32 0, i32 0
%82 = load i32*, i32** %81
%83 = getelementptr inbounds i32, i32* %82, i64 3
store i32 0, i32* %83
%84 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%85 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %84, i32 0, i32 1
%86 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %85, i32 0, i32 0
%87 = load i32*, i32** %86
%88 = getelementptr inbounds i32, i32* %87, i64 4
store i32 0, i32* %88
%89 = load i32*, i32** %2
%90 = load i32*, i32** %2
%91 = call i32 @RootWindow(i32* %90, i32 0)
%92 = load i32, i32* @False
%93 = load i32, i32* @SubstructureNotifyMask
%94 = load i32, i32* @SubstructureRedirectMask
%95 = or i32 %93, %94
%96 = call i32 @XSendEvent(i32* %89, i32 %91, i32 %92, i32 %95, %struct.TYPE_10__* %7)
%97 = load i32*, i32** %2
%98 = call i32 @XFlush(i32* %97)
%99 = call i32 @sleep(i32 2)
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%101 = load i8*, i8** @ClientMessage
%102 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%103 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %102, i32 0, i32 5
store i8* %101, i8** %103
%104 = load i8*, i8** %6
%105 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%106 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %105, i32 0, i32 4
store i8* %104, i8** %106
%107 = load i32*, i32** %2
%108 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%109 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %108, i32 0, i32 3
store i32* %107, i32** %109
%110 = load i8*, i8** %3
%111 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%112 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %111, i32 0, i32 2
store i8* %110, i8** %112
%113 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%114 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %113, i32 0, i32 0
store i32 32, i32* %114
%115 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%116 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %115, i32 0, i32 1
%117 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %116, i32 0, i32 0
%118 = load i32*, i32** %117
%119 = getelementptr inbounds i32, i32* %118, i64 0
store i32 2, i32* %119
%120 = load i8*, i8** %5
%121 = ptrtoint i8* %120 to i32
%122 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%123 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %122, i32 0, i32 1
%124 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %123, i32 0, i32 0
%125 = load i32*, i32** %124
%126 = getelementptr inbounds i32, i32* %125, i64 1
store i32 %121, i32* %126
%127 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%128 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %127, i32 0, i32 1
%129 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %128, i32 0, i32 0
%130 = load i32*, i32** %129
%131 = getelementptr inbounds i32, i32* %130, i64 2
store i32 0, i32* %131
%132 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%133 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %132, i32 0, i32 1
%134 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %133, i32 0, i32 0
%135 = load i32*, i32** %134
%136 = getelementptr inbounds i32, i32* %135, i64 3
store i32 0, i32* %136
%137 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %7, i32 0, i32 2
%138 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %137, i32 0, i32 1
%139 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %138, i32 0, i32 0
%140 = load i32*, i32** %139
%141 = getelementptr inbounds i32, i32* %140, i64 4
store i32 0, i32* %141
%142 = load i32*, i32** %2
%143 = load i32*, i32** %2
%144 = call i32 @RootWindow(i32* %143, i32 0)
%145 = load i32, i32* @False
%146 = load i32, i32* @SubstructureNotifyMask
%147 = load i32, i32* @SubstructureRedirectMask
%148 = or i32 %146, %147
%149 = call i32 @XSendEvent(i32* %142, i32 %144, i32 %145, i32 %148, %struct.TYPE_10__* %7)
%150 = load i32*, i32** %2
%151 = load i8*, i8** %3
%152 = load i32, i32* @ExposureMask
%153 = load i32, i32* @StructureNotifyMask
%154 = or i32 %152, %153
%155 = call i32 @XSelectInput(i32* %150, i8* %151, i32 %154)
br label %156
156: ; preds = %18, %181
%157 = load i32*, i32** %2
%158 = call i32 @XNextEvent(i32* %157, %struct.TYPE_10__* %4)
%159 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %4, i32 0, i32 0
%160 = load i32, i32* %159
switch i32 %160, label %181 [
i32 128, label %161
i32 129, label %163
]
161: ; preds = %156
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %181
163: ; preds = %156
%164 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %4, i32 0, i32 1
%165 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %164, i32 0, i32 0
%166 = load i32, i32* %165
store i32 %166, i32* %8
%167 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %4, i32 0, i32 1
%168 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %167, i32 0, i32 1
%169 = load i32, i32* %168
store i32 %169, i32* %9
%170 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %4, i32 0, i32 1
%171 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %170, i32 0, i32 2
%172 = load i32, i32* %171
store i32 %172, i32* %11
%173 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %4, i32 0, i32 1
%174 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %173, i32 0, i32 3
%175 = load i32, i32* %174
store i32 %175, i32* %10
%176 = load i32, i32* %8
%177 = load i32, i32* %9
%178 = load i32, i32* %11
%179 = load i32, i32* %10
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %176, i32 %177, i32 %178, i32 %179)
br label %181
181: ; preds = %156, %163, %161
br label %156
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"couldn't connect to X server :0\0A\00"
@.str.1 = [14 x i8] c"_NET_WM_STATE\00"
@False = global i32 0
@.str.2 = [25 x i8] c"_NET_WM_STATE_FULLSCREEN\00"
@CopyFromParent = global i32 0
@ClientMessage = global i8* null
@SubstructureNotifyMask = global i32 0
@SubstructureRedirectMask = global i32 0
@ExposureMask = global i32 0
@StructureNotifyMask = global i32 0
@str = [11 x i8] c"fullscreen\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 ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @False
%10 = tail call i8* @XInternAtom(i32* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = tail call i32 @RootWindow(i32* %1, i32 0)
%12 = load i32, i32* @CopyFromParent
%13 = tail call i8* @XCreateWindow(i32* %1, i32 %11, i32 10, i32 10, i32 400, i32 100, i32 10, i32 %12, i32 %12, i32 %12, i32 0, i32* null)
%14 = tail call i32 @WhitePixel(i32* %1, i32 0)
%15 = tail call i32 @XSetWindowBackground(i32* %1, i8* %13, i32 %14)
%16 = tail call i32 @XMapWindow(i32* %1, i8* %13)
%17 = tail call i32 @XFlush(i32* %1)
%18 = tail call i32 @sleep(i32 2)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
unreachable
}