#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 */

/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ CopyFromParent;
int /*<<< orphan*/ False;
int /*<<< orphan*/ PropModeReplace;
int /*<<< orphan*/ PropertyChangeMask;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XA_ATOM;
int /*<<< orphan*/ XChangeProperty(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/, int,
                                   int /*<<< orphan*/, unsigned char *, int);
int /*<<< orphan*/ XCreateWindow(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                 int, int, int, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reply(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ request(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main() {
  Display *display;
  Window win;
  Atom _request, _extents, _type, _normal, _desktop, _state;
  Atom _state_fs, _state_mh, _state_mv;
  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;
  }
  _type = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
  _normal = XInternAtom(display, "_NET_WM_WINDOW_TYPE_NORMAL", False);
  _desktop = XInternAtom(display, "_NET_WM_WINDOW_TYPE_DESKTOP", False);
  _request = XInternAtom(display, "_NET_REQUEST_FRAME_EXTENTS", False);
  _extents = XInternAtom(display, "_NET_FRAME_EXTENTS", False);
  _state = XInternAtom(display, "_NET_WM_STATE", False);
  _state_fs = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", False);
  _state_mh = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
  _state_mv = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
  win = XCreateWindow(display, RootWindow(display, 0), x, y, w, h, 10,
                      CopyFromParent, CopyFromParent, CopyFromParent, 0, NULL);
  XSelectInput(display, win, PropertyChangeMask);
  printf("requesting for type normal\n");
  XChangeProperty(display, win, _type, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_normal, 1);
  request(display, _request, _extents, win);
  reply(display, _extents);
  printf("requesting for type normal+fullscreen\n");
  XChangeProperty(display, win, _type, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_normal, 1);
  XChangeProperty(display, win, _state, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_state_fs, 1);
  request(display, _request, _extents, win);
  reply(display, _extents);
  printf("requesting for type normal+maxv\n");
  XChangeProperty(display, win, _type, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_normal, 1);
  XChangeProperty(display, win, _state, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_state_mv, 1);
  request(display, _request, _extents, win);
  reply(display, _extents);
  printf("requesting for type normal+maxh\n");
  XChangeProperty(display, win, _type, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_normal, 1);
  XChangeProperty(display, win, _state, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_state_mh, 1);
  request(display, _request, _extents, win);
  reply(display, _extents);
  printf("requesting for type desktop\n");
  XChangeProperty(display, win, _type, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&_desktop, 1);
  request(display, _request, _extents, win);
  reply(display, _extents);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x88,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x44(%rbp)
movl   $0xa,-0x48(%rbp)
movl   $0x64,-0x4c(%rbp)
movl   $0x190,-0x50(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1208 <main+0x68>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
jmp    1628 <main+0x488>
mov    -0x18(%rbp),%rdi
mov    0x2dcd(%rip),%rax
mov    (%rax),%edx
lea    0xe05(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2db1(%rip),%rax
mov    (%rax),%edx
lea    0xdfd(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d95(%rip),%rax
mov    (%rax),%edx
lea    0xdfc(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d79(%rip),%rax
mov    (%rax),%edx
lea    0xdfc(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d5d(%rip),%rax
mov    (%rax),%edx
lea    0xdfb(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d41(%rip),%rax
mov    (%rax),%edx
lea    0xdf2(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d25(%rip),%rax
mov    (%rax),%edx
lea    0xde4(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d09(%rip),%rax
mov    (%rax),%edx
lea    0xde1(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2ced(%rip),%rax
mov    (%rax),%edx
lea    0xde2(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10a0 <RootWindow@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%esi
mov    -0x44(%rbp),%edx
mov    -0x48(%rbp),%ecx
mov    -0x50(%rbp),%r8d
mov    -0x4c(%rbp),%r9d
mov    0x2c86(%rip),%rax
mov    (%rax),%r11d
mov    0x2c7c(%rip),%rax
mov    (%rax),%r10d
mov    0x2c72(%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   1090 <XCreateWindow@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    0x2c50(%rip),%rax
mov    (%rax),%edx
call   10b0 <XSelectInput@plt>
lea    0xd65(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    0x2c3c(%rip),%rax
mov    (%rax),%ecx
mov    0x2c0b(%rip),%rax
mov    (%rax),%r9d
lea    -0x2c(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   10c0 <request@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <reply@plt>
lea    0xd1f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    0x2bda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ba9(%rip),%rax
mov    (%rax),%r9d
lea    -0x2c(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    0x2ba2(%rip),%rax
mov    (%rax),%ecx
mov    0x2b71(%rip),%rax
mov    (%rax),%r9d
lea    -0x38(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   10c0 <request@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <reply@plt>
lea    0xcac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    0x2b40(%rip),%rax
mov    (%rax),%ecx
mov    0x2b0f(%rip),%rax
mov    (%rax),%r9d
lea    -0x2c(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    0x2b08(%rip),%rax
mov    (%rax),%ecx
mov    0x2ad7(%rip),%rax
mov    (%rax),%r9d
lea    -0x40(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   10c0 <request@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <reply@plt>
lea    0xc33(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    0x2aa6(%rip),%rax
mov    (%rax),%ecx
mov    0x2a75(%rip),%rax
mov    (%rax),%r9d
lea    -0x2c(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    0x2a6e(%rip),%rax
mov    (%rax),%ecx
mov    0x2a3d(%rip),%rax
mov    (%rax),%r9d
lea    -0x3c(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   10c0 <request@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <reply@plt>
lea    0xbba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    0x2a0c(%rip),%rax
mov    (%rax),%ecx
mov    0x29db(%rip),%rax
mov    (%rax),%r9d
lea    -0x30(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   10c0 <request@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <reply@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x88,%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
xor    %ebp,%ebp
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
test   %rax,%rax
je     1539 <main+0x399>
mov    %rax,%rbx
mov    0x2e16(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xe4d(%rip),%rsi
mov    %rax,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,%r15d
mov    0x0(%rbp),%edx
lea    0xe4c(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,0x4(%rsp)
mov    0x0(%rbp),%edx
lea    0xe51(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,0x24(%rsp)
mov    0x0(%rbp),%edx
lea    0xe57(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,%r12d
mov    0x0(%rbp),%edx
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,%r13d
mov    0x0(%rbp),%edx
lea    0xe5b(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,0xc(%rsp)
mov    0x0(%rbp),%edx
lea    0xe53(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,0x20(%rsp)
mov    0x0(%rbp),%edx
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,0x1c(%rsp)
mov    0x0(%rbp),%edx
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,0x18(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <RootWindow@plt>
mov    0x2d1a(%rip),%rcx
mov    (%rcx),%ebp
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0x190,%r8d
mov    $0x64,%r9d
push   $0x0
push   $0x0
push   %rbp
push   %rbp
push   %rbp
push   $0xa
call   1090 <XCreateWindow@plt>
add    $0x30,%rsp
mov    %eax,%ebp
mov    0x2d02(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   10b0 <XSelectInput@plt>
lea    0xe12(%rip),%rdi
call   1030 <puts@plt>
mov    0x2cf3(%rip),%rax
mov    (%rax),%ecx
mov    %rax,%r14
mov    0x2cbf(%rip),%rax
mov    (%rax),%r9d
lea    0x4(%rsp),%rax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    %r12d,0x14(%rsp)
mov    %r12d,%esi
mov    %r13d,0x10(%rsp)
mov    %r13d,%edx
mov    %ebp,%ecx
call   10c0 <request@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
call   1040 <reply@plt>
lea    0xdc7(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%ecx
mov    0x2c62(%rip),%r14
mov    (%r14),%r9d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r15d,%r13d
mov    %r15d,0x8(%rsp)
mov    $0x20,%r8d
push   $0x1
lea    0xc(%rsp),%rax
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    0x2c59(%rip),%rax
mov    (%rax),%ecx
mov    (%r14),%r9d
lea    0x20(%rsp),%rax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    0xc(%rsp),%r14d
mov    %r14d,%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    %r12d,%esi
mov    0x10(%rsp),%r15d
mov    %r15d,%edx
mov    %ebp,%ecx
call   10c0 <request@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <reply@plt>
lea    0xd5d(%rip),%rdi
call   1030 <puts@plt>
mov    0x2bfd(%rip),%r12
mov    (%r12),%ecx
mov    0x2bca(%rip),%rax
mov    (%rax),%r9d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r13d,%edx
mov    $0x20,%r8d
push   $0x1
lea    0xc(%rsp),%rax
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    (%r12),%ecx
mov    %r12,%r13
mov    0x2b9a(%rip),%rax
mov    (%rax),%r9d
lea    0x18(%rsp),%rax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    0x14(%rsp),%r12d
mov    %r12d,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   10c0 <request@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <reply@plt>
lea    0xced(%rip),%rdi
call   1030 <puts@plt>
mov    0x0(%r13),%ecx
mov    0x2b41(%rip),%r14
mov    (%r14),%r9d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    0x8(%rsp),%edx
mov    $0x20,%r8d
push   $0x1
lea    0xc(%rsp),%rax
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    0x0(%r13),%ecx
mov    (%r14),%r9d
lea    0x1c(%rsp),%rax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    0xc(%rsp),%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   10c0 <request@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <reply@plt>
lea    0xc91(%rip),%rdi
call   1030 <puts@plt>
mov    0x0(%r13),%ecx
mov    (%r14),%r9d
lea    0x24(%rsp),%rax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    0x8(%rsp),%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   10c0 <request@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <reply@plt>
mov    $0x1,%ebp
jmp    154e <main+0x3ae>
mov    0x2a88(%rip),%rax
mov    (%rax),%edi
lea    0xab7(%rip),%rsi
call   1060 <fprintf@plt>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@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_WM_WINDOW_TYPE\00"
@False = global i32 0
@.str.2 = [27 x i8] c"_NET_WM_WINDOW_TYPE_NORMAL\00"
@.str.3 = [28 x i8] c"_NET_WM_WINDOW_TYPE_DESKTOP\00"
@.str.4 = [27 x i8] c"_NET_REQUEST_FRAME_EXTENTS\00"
@.str.5 = [19 x i8] c"_NET_FRAME_EXTENTS\00"
@.str.6 = [14 x i8] c"_NET_WM_STATE\00"
@.str.7 = [25 x i8] c"_NET_WM_STATE_FULLSCREEN\00"
@.str.8 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_HORZ\00"
@.str.9 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_VERT\00"
@CopyFromParent = global i32 0
@PropertyChangeMask = global i32 0
@.str.10 = [28 x i8] c"requesting for type normal\0A\00"
@XA_ATOM = global i32 0
@PropModeReplace = global i32 0
@.str.11 = [39 x i8] c"requesting for type normal+fullscreen\0A\00"
@.str.12 = [33 x i8] c"requesting for type normal+maxv\0A\00"
@.str.13 = [33 x i8] c"requesting for type normal+maxh\0A\00"
@.str.14 = [29 x i8] c"requesting for type desktop\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %13
store i32 10, i32* %14
store i32 100, i32* %15
store i32 400, i32* %16
%17 = call i32* @XOpenDisplay(i32* null)
store i32* %17, i32** %2
%18 = load i32*, i32** %2
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %0
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %167
23: ; preds = %0
%24 = load i32*, i32** %2
%25 = load i32, i32* @False
%26 = call i32 @XInternAtom(i32* %24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %25)
store i32 %26, i32* %6
%27 = load i32*, i32** %2
%28 = load i32, i32* @False
%29 = call i32 @XInternAtom(i32* %27, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %28)
store i32 %29, i32* %7
%30 = load i32*, i32** %2
%31 = load i32, i32* @False
%32 = call i32 @XInternAtom(i32* %30, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %31)
store i32 %32, i32* %8
%33 = load i32*, i32** %2
%34 = load i32, i32* @False
%35 = call i32 @XInternAtom(i32* %33, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %34)
store i32 %35, i32* %4
%36 = load i32*, i32** %2
%37 = load i32, i32* @False
%38 = call i32 @XInternAtom(i32* %36, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %37)
store i32 %38, i32* %5
%39 = load i32*, i32** %2
%40 = load i32, i32* @False
%41 = call i32 @XInternAtom(i32* %39, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %40)
store i32 %41, i32* %9
%42 = load i32*, i32** %2
%43 = load i32, i32* @False
%44 = call i32 @XInternAtom(i32* %42, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %43)
store i32 %44, i32* %10
%45 = load i32*, i32** %2
%46 = load i32, i32* @False
%47 = call i32 @XInternAtom(i32* %45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %46)
store i32 %47, i32* %11
%48 = load i32*, i32** %2
%49 = load i32, i32* @False
%50 = call i32 @XInternAtom(i32* %48, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %49)
store i32 %50, i32* %12
%51 = load i32*, i32** %2
%52 = load i32*, i32** %2
%53 = call i32 @RootWindow(i32* %52, i32 0)
%54 = load i32, i32* %13
%55 = load i32, i32* %14
%56 = load i32, i32* %16
%57 = load i32, i32* %15
%58 = load i32, i32* @CopyFromParent
%59 = load i32, i32* @CopyFromParent
%60 = load i32, i32* @CopyFromParent
%61 = call i32 @XCreateWindow(i32* %51, i32 %53, i32 %54, i32 %55, i32 %56, i32 %57, i32 10, i32 %58, i32 %59, i32 %60, i32 0, i32* null)
store i32 %61, i32* %3
%62 = load i32*, i32** %2
%63 = load i32, i32* %3
%64 = load i32, i32* @PropertyChangeMask
%65 = call i32 @XSelectInput(i32* %62, i32 %63, i32 %64)
%66 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%67 = load i32*, i32** %2
%68 = load i32, i32* %3
%69 = load i32, i32* %6
%70 = load i32, i32* @XA_ATOM
%71 = load i32, i32* @PropModeReplace
%72 = bitcast i32* %7 to i8*
%73 = call i32 @XChangeProperty(i32* %67, i32 %68, i32 %69, i32 %70, i32 32, i32 %71, i8* %72, i32 1)
%74 = load i32*, i32** %2
%75 = load i32, i32* %4
%76 = load i32, i32* %5
%77 = load i32, i32* %3
%78 = call i32 @request(i32* %74, i32 %75, i32 %76, i32 %77)
%79 = load i32*, i32** %2
%80 = load i32, i32* %5
%81 = call i32 @reply(i32* %79, i32 %80)
%82 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%83 = load i32*, i32** %2
%84 = load i32, i32* %3
%85 = load i32, i32* %6
%86 = load i32, i32* @XA_ATOM
%87 = load i32, i32* @PropModeReplace
%88 = bitcast i32* %7 to i8*
%89 = call i32 @XChangeProperty(i32* %83, i32 %84, i32 %85, i32 %86, i32 32, i32 %87, i8* %88, i32 1)
%90 = load i32*, i32** %2
%91 = load i32, i32* %3
%92 = load i32, i32* %9
%93 = load i32, i32* @XA_ATOM
%94 = load i32, i32* @PropModeReplace
%95 = bitcast i32* %10 to i8*
%96 = call i32 @XChangeProperty(i32* %90, i32 %91, i32 %92, i32 %93, i32 32, i32 %94, i8* %95, i32 1)
%97 = load i32*, i32** %2
%98 = load i32, i32* %4
%99 = load i32, i32* %5
%100 = load i32, i32* %3
%101 = call i32 @request(i32* %97, i32 %98, i32 %99, i32 %100)
%102 = load i32*, i32** %2
%103 = load i32, i32* %5
%104 = call i32 @reply(i32* %102, i32 %103)
%105 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
%106 = load i32*, i32** %2
%107 = load i32, i32* %3
%108 = load i32, i32* %6
%109 = load i32, i32* @XA_ATOM
%110 = load i32, i32* @PropModeReplace
%111 = bitcast i32* %7 to i8*
%112 = call i32 @XChangeProperty(i32* %106, i32 %107, i32 %108, i32 %109, i32 32, i32 %110, i8* %111, i32 1)
%113 = load i32*, i32** %2
%114 = load i32, i32* %3
%115 = load i32, i32* %9
%116 = load i32, i32* @XA_ATOM
%117 = load i32, i32* @PropModeReplace
%118 = bitcast i32* %12 to i8*
%119 = call i32 @XChangeProperty(i32* %113, i32 %114, i32 %115, i32 %116, i32 32, i32 %117, i8* %118, i32 1)
%120 = load i32*, i32** %2
%121 = load i32, i32* %4
%122 = load i32, i32* %5
%123 = load i32, i32* %3
%124 = call i32 @request(i32* %120, i32 %121, i32 %122, i32 %123)
%125 = load i32*, i32** %2
%126 = load i32, i32* %5
%127 = call i32 @reply(i32* %125, i32 %126)
%128 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
%129 = load i32*, i32** %2
%130 = load i32, i32* %3
%131 = load i32, i32* %6
%132 = load i32, i32* @XA_ATOM
%133 = load i32, i32* @PropModeReplace
%134 = bitcast i32* %7 to i8*
%135 = call i32 @XChangeProperty(i32* %129, i32 %130, i32 %131, i32 %132, i32 32, i32 %133, i8* %134, i32 1)
%136 = load i32*, i32** %2
%137 = load i32, i32* %3
%138 = load i32, i32* %9
%139 = load i32, i32* @XA_ATOM
%140 = load i32, i32* @PropModeReplace
%141 = bitcast i32* %11 to i8*
%142 = call i32 @XChangeProperty(i32* %136, i32 %137, i32 %138, i32 %139, i32 32, i32 %140, i8* %141, i32 1)
%143 = load i32*, i32** %2
%144 = load i32, i32* %4
%145 = load i32, i32* %5
%146 = load i32, i32* %3
%147 = call i32 @request(i32* %143, i32 %144, i32 %145, i32 %146)
%148 = load i32*, i32** %2
%149 = load i32, i32* %5
%150 = call i32 @reply(i32* %148, i32 %149)
%151 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0))
%152 = load i32*, i32** %2
%153 = load i32, i32* %3
%154 = load i32, i32* %6
%155 = load i32, i32* @XA_ATOM
%156 = load i32, i32* @PropModeReplace
%157 = bitcast i32* %8 to i8*
%158 = call i32 @XChangeProperty(i32* %152, i32 %153, i32 %154, i32 %155, i32 32, i32 %156, i8* %157, i32 1)
%159 = load i32*, i32** %2
%160 = load i32, i32* %4
%161 = load i32, i32* %5
%162 = load i32, i32* %3
%163 = call i32 @request(i32* %159, i32 %160, i32 %161, i32 %162)
%164 = load i32*, i32** %2
%165 = load i32, i32* %5
%166 = call i32 @reply(i32* %164, i32 %165)
store i32 1, i32* %1
br label %167
167: ; preds = %23, %20
%168 = load i32, i32* %1
ret i32 %168
}

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_WM_WINDOW_TYPE\00"
@False = global i32 0
@.str.2 = [27 x i8] c"_NET_WM_WINDOW_TYPE_NORMAL\00"
@.str.3 = [28 x i8] c"_NET_WM_WINDOW_TYPE_DESKTOP\00"
@.str.4 = [27 x i8] c"_NET_REQUEST_FRAME_EXTENTS\00"
@.str.5 = [19 x i8] c"_NET_FRAME_EXTENTS\00"
@.str.6 = [14 x i8] c"_NET_WM_STATE\00"
@.str.7 = [25 x i8] c"_NET_WM_STATE_FULLSCREEN\00"
@.str.8 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_HORZ\00"
@.str.9 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_VERT\00"
@CopyFromParent = global i32 0
@PropertyChangeMask = global i32 0
@XA_ATOM = global i32 0
@PropModeReplace = global i32 0
@str = [27 x i8] c"requesting for type normal\00"
@str.15 = [38 x i8] c"requesting for type normal+fullscreen\00"
@str.16 = [32 x i8] c"requesting for type normal+maxv\00"
@str.17 = [32 x i8] c"requesting for type normal+maxh\00"
@str.18 = [28 x i8] c"requesting for type desktop\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = tail call i32* @XOpenDisplay(i32* null)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %79
16: ; preds = %0
%17 = load i32, i32* @False
%18 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* @False
%20 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %19)
store i32 %20, i32* %1
%21 = load i32, i32* @False
%22 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %21)
store i32 %22, i32* %2
%23 = load i32, i32* @False
%24 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = load i32, i32* @False
%26 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %25)
%27 = load i32, i32* @False
%28 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @False
%30 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %29)
store i32 %30, i32* %3
%31 = load i32, i32* @False
%32 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %31)
store i32 %32, i32* %4
%33 = load i32, i32* @False
%34 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %33)
store i32 %34, i32* %5
%35 = tail call i32 @RootWindow(i32* %11, i32 0)
%36 = load i32, i32* @CopyFromParent
%37 = tail call i32 @XCreateWindow(i32* %11, i32 %35, i32 10, i32 10, i32 400, i32 100, i32 10, i32 %36, i32 %36, i32 %36, i32 0, i32* null)
%38 = load i32, i32* @PropertyChangeMask
%39 = tail call i32 @XSelectInput(i32* %11, i32 %37, i32 %38)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%41 = load i32, i32* @XA_ATOM
%42 = load i32, i32* @PropModeReplace
%43 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %18, i32 %41, i32 32, i32 %42, i8* %6, i32 1)
%44 = call i32 @request(i32* %11, i32 %24, i32 %26, i32 %37)
%45 = call i32 @reply(i32* %11, i32 %26)
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%47 = load i32, i32* @XA_ATOM
%48 = load i32, i32* @PropModeReplace
%49 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %18, i32 %47, i32 32, i32 %48, i8* %6, i32 1)
%50 = load i32, i32* @XA_ATOM
%51 = load i32, i32* @PropModeReplace
%52 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %28, i32 %50, i32 32, i32 %51, i8* %8, i32 1)
%53 = call i32 @request(i32* %11, i32 %24, i32 %26, i32 %37)
%54 = call i32 @reply(i32* %11, i32 %26)
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.16, i64 0, i64 0))
%56 = load i32, i32* @XA_ATOM
%57 = load i32, i32* @PropModeReplace
%58 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %18, i32 %56, i32 32, i32 %57, i8* %6, i32 1)
%59 = load i32, i32* @XA_ATOM
%60 = load i32, i32* @PropModeReplace
%61 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %28, i32 %59, i32 32, i32 %60, i8* %10, i32 1)
%62 = call i32 @request(i32* %11, i32 %24, i32 %26, i32 %37)
%63 = call i32 @reply(i32* %11, i32 %26)
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.17, i64 0, i64 0))
%65 = load i32, i32* @XA_ATOM
%66 = load i32, i32* @PropModeReplace
%67 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %18, i32 %65, i32 32, i32 %66, i8* %6, i32 1)
%68 = load i32, i32* @XA_ATOM
%69 = load i32, i32* @PropModeReplace
%70 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %28, i32 %68, i32 32, i32 %69, i8* %9, i32 1)
%71 = call i32 @request(i32* %11, i32 %24, i32 %26, i32 %37)
%72 = call i32 @reply(i32* %11, i32 %26)
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.18, i64 0, i64 0))
%74 = load i32, i32* @XA_ATOM
%75 = load i32, i32* @PropModeReplace
%76 = call i32 @XChangeProperty(i32* %11, i32 %37, i32 %18, i32 %74, i32 32, i32 %75, i8* %7, i32 1)
%77 = call i32 @request(i32* %11, i32 %24, i32 %26, i32 %37)
%78 = call i32 @reply(i32* %11, i32 %26)
br label %79
79: ; preds = %16, %13
%80 = phi i32 [ 0, %13 ], [ 1, %16 ]
ret i32 %80
}