#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 width;
  int height;
  int /*<<< orphan*/ root;
  int /*<<< orphan*/ y;
  int /*<<< orphan*/ x;
};
typedef TYPE_3__ XWindowAttributes;
struct TYPE_7__ {
  unsigned long *l;
};
struct TYPE_8__ {
  int format;
  TYPE_1__ data;
  void *message_type;
  int /*<<< orphan*/ window;
  void *send_event;
  scalar_t__ serial;
  int /*<<< orphan*/ type;
};
struct TYPE_10__ {
  TYPE_2__ xclient;
};
typedef TYPE_4__ XEvent;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;
typedef int Bool;
typedef void *Atom;

/* Variables and functions */
int /*<<< orphan*/ ClientMessage;
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int EXIT_FAILURE;
int EXIT_SUCCESS;
int False;
unsigned long NorthEastGravity;
unsigned long NorthWestGravity;
unsigned long StaticGravity;
long SubstructureNotifyMask;
long SubstructureRedirectMask;
void *True;
int /*<<< orphan*/ XA_ATOM;
int /*<<< orphan*/ XA_WINDOW;
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XFree(unsigned char *);
int /*<<< orphan*/ XGetWindowAttributes(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, TYPE_3__ *);
int /*<<< orphan*/ XGetWindowProperty(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                      void *, int /*<<< orphan*/, int, int,
                                      int /*<<< orphan*/, void **, int *,
                                      unsigned long *, unsigned long *,
                                      unsigned char **);
void *XInternAtom(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSendEvent(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                              long, TYPE_4__ *);
int /*<<< orphan*/ XTranslateCoordinates(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/, int /*<<< orphan*/,
                                         int /*<<< orphan*/, int /*<<< orphan*/,
                                         int *, int *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int ret = EXIT_SUCCESS;
  int x, y, new_x, new_y;
  int actual_format_return;
  unsigned long nitems_return;
  unsigned long bytes_after_return;
  unsigned long grflags;
  long mask;
  unsigned char *data;
  Display *disp;
  Window win = (Window)0;
  Window w_dum = (Window)0;
  XWindowAttributes activ_atr;
  XWindowAttributes root_atr;
  XEvent event;
  if (!(disp = XOpenDisplay(NULL))) {
    fputs("Cannot open display.\n", stderr);
    return EXIT_FAILURE;
  }
  Atom ret_atom = (Atom)0;
  Atom maximised_vertically =
      XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_VERT", False);
  Atom maximised_horizontally =
      XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
  XGetWindowProperty(disp, DefaultRootWindow(disp),
                     XInternAtom(disp, "_NET_ACTIVE_WINDOW", False), 0, 1024,
                     False, XA_WINDOW, &ret_atom, &actual_format_return,
                     &nitems_return, &bytes_after_return, &data);
  win = *((Window *)data);
  XFree(data);
  XGetWindowAttributes(disp, win, &activ_atr);
  XTranslateCoordinates(disp, win, activ_atr.root, activ_atr.x, activ_atr.y, &x,
                        &y, &w_dum);
  if (1) {
    fprintf(stderr, "%ux%u @ (%d,%d)\n", activ_atr.width, activ_atr.height, x,
            y);
  };
  XGetWindowAttributes(disp, activ_atr.root, &root_atr);
  if (1) {
    fprintf(stderr, "Resolution: %ux%u\n", root_atr.width, root_atr.height);
  };
  Bool isMaxVert = False;
  Bool isMaxHorz = False;
  Bool move_x;
  XGetWindowProperty(disp, win, XInternAtom(disp, "_NET_WM_STATE", False), 0,
                     1024, False, XA_ATOM, &ret_atom, &actual_format_return,
                     &nitems_return, &bytes_after_return, &data);
  unsigned long *buff = (unsigned long *)data;
  for (; nitems_return; nitems_return--) {
    if (*buff == (unsigned long)maximised_vertically) {
      isMaxVert = True;
      if (1) {
        fprintf(stderr, "Is Vertically maximised\n");
      };
    } else if (*buff == (unsigned long)maximised_horizontally) {
      isMaxHorz = True;
      if (1) {
        fprintf(stderr, "Is Horizontally maximised\n");
      };
    }
    buff++;
  }
  XFree(data);
  if ((isMaxVert) || ((activ_atr.height + 90) > root_atr.height)) {
    move_x = 1;
  } else if ((isMaxHorz) || ((activ_atr.width + 20) > root_atr.width)) {
    move_x = 0;
  } else if (y + (activ_atr.height / 2) <= (root_atr.height / 2)) {
    if (x + (activ_atr.width / 2) <= (root_atr.width / 2)) {
      if (1) {
        fprintf(stderr, "Top left: move x\n");
      };
      move_x = 1;
    } else {
      if (1) {
        fprintf(stderr, "Top right: move y\n");
      };
      move_x = 0;
    }
  } else if (x + (activ_atr.width / 2) > (root_atr.width / 2)) {
    if (1) {
      fprintf(stderr, "Bottom right: move x\n");
    };
    move_x = 1;
  } else {
    if (1) {
      fprintf(stderr, "Bottom left: move y\n");
    };
    move_x = 0;
  }
  if (move_x == 1) {
    new_y = y;
    if (x + (activ_atr.width / 2) > (root_atr.width / 2)) {
      if (1) {
        fprintf(stderr, "Right side\n");
      };
      new_x = (root_atr.width / 2) -
              (x + (activ_atr.width / 2) - (root_atr.width / 2)) -
              (activ_atr.width / 2);
    } else {
      if (1) {
        fprintf(stderr, "Left side\n");
      };
      new_x = (root_atr.width / 2) +
              ((root_atr.width / 2) - (x + (activ_atr.width / 2))) -
              (activ_atr.width / 2);
    }
  } else {
    new_x = x;
    if (y + (activ_atr.height / 2) > (root_atr.height / 2)) {
      if (1) {
        fprintf(stderr, "Bottom side\n");
      };
      new_y = (root_atr.height / 2) -
              (y + (activ_atr.height / 2) - (root_atr.height / 2)) -
              (activ_atr.height / 2);
    } else {
      if (1) {
        fprintf(stderr, "Top side\n");
      };
      new_y = (root_atr.height / 2) +
              ((root_atr.height / 2) - (y + (activ_atr.height / 2))) -
              (activ_atr.height / 2);
    }
  }
  grflags = StaticGravity;
  if (new_x < 0) {
    if (1) {
      fprintf(stderr, "Fixing left x\n");
    };
    grflags = NorthWestGravity;
    new_x = 0;
  }
  if (new_x + activ_atr.width > root_atr.width) {
    if (1) {
      fprintf(stderr, "Fixing right x\n");
    };
    grflags = NorthEastGravity;
    new_x = root_atr.width - activ_atr.width;
  }
  if (1) {
    fprintf(stderr, "%ux%u @ (%d,%d)\n", activ_atr.width, activ_atr.height,
            new_x, new_y);
  };
  grflags |= (move_x) ? 0x100 : 0x200;
  mask = SubstructureRedirectMask | SubstructureNotifyMask;
  event.xclient.type = ClientMessage;
  event.xclient.serial = 0;
  event.xclient.send_event = True;
  event.xclient.window = win;
  event.xclient.format = 32;
  event.xclient.message_type = XInternAtom(disp, "_NET_WM_STATE", False);
  event.xclient.data.l[0] = (unsigned long)0;
  event.xclient.data.l[1] = isMaxVert ? (unsigned long)maximised_vertically : 0;
  event.xclient.data.l[2] =
      isMaxHorz ? (unsigned long)maximised_horizontally : 0;
  XSendEvent(disp, DefaultRootWindow(disp), False, mask, &event);
  event.xclient.message_type =
      XInternAtom(disp, "_NET_MOVERESIZE_WINDOW", False);
  event.xclient.data.l[0] = grflags;
  event.xclient.data.l[1] = (unsigned long)new_x;
  event.xclient.data.l[2] = (unsigned long)new_y;
  XSendEvent(disp, DefaultRootWindow(disp), False, mask, &event);
  event.xclient.message_type = XInternAtom(disp, "_NET_WM_STATE", False);
  event.xclient.data.l[0] = (unsigned long)1;
  event.xclient.data.l[1] = isMaxVert ? (unsigned long)maximised_vertically : 0;
  event.xclient.data.l[2] =
      isMaxHorz ? (unsigned long)maximised_horizontally : 0;
  XSendEvent(disp, DefaultRootWindow(disp), False, mask, &event);
  XCloseDisplay(disp);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1d8,%rsp
movl   $0x0,-0x1c(%rbp)
mov    %edi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    0x2dc3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <XOpenDisplay@plt>
mov    %rax,-0x70(%rbp)
cmp    $0x0,%rax
jne    1225 <main+0x75>
mov    0x2db2(%rip),%rax
mov    (%rax),%esi
lea    0xdf1(%rip),%rdi
call   1070 <fputs@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1d51 <main+0xba1>
movq   $0x0,-0xe8(%rbp)
mov    -0x70(%rbp),%rdi
mov    0x2d9d(%rip),%rax
mov    (%rax),%edx
lea    0xdd2(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    %rax,-0xf0(%rbp)
mov    -0x70(%rbp),%rdi
mov    0x2d7d(%rip),%rax
mov    (%rax),%edx
lea    0xdcf(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    %rax,-0xf8(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x70(%rbp),%rdi
call   1050 <DefaultRootWindow@plt>
mov    %eax,-0x124(%rbp)
mov    -0x70(%rbp),%rdi
mov    0x2d43(%rip),%rax
mov    (%rax),%edx
lea    0xdb2(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    -0x130(%rbp),%rdi
mov    -0x124(%rbp),%esi
mov    %rax,%rdx
mov    0x2d1e(%rip),%rax
mov    (%rax),%r9d
mov    0x2ce4(%rip),%rax
mov    (%rax),%r15d
xor    %ecx,%ecx
mov    $0x400,%r8d
lea    -0xe8(%rbp),%r14
lea    -0x40(%rbp),%rbx
lea    -0x48(%rbp),%r11
lea    -0x50(%rbp),%r10
lea    -0x68(%rbp),%rax
mov    %r15d,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   10c0 <XGetWindowProperty@plt>
mov    -0x68(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x68(%rbp),%rdi
call   1060 <XFree@plt>
mov    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
lea    -0x90(%rbp),%rdx
call   10b0 <XGetWindowAttributes@plt>
mov    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    -0x88(%rbp),%edx
mov    -0x80(%rbp),%ecx
mov    -0x84(%rbp),%r8d
lea    -0x30(%rbp),%r9
lea    -0x34(%rbp),%r10
lea    -0x78(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <XTranslateCoordinates@plt>
mov    0x2c53(%rip),%rax
mov    (%rax),%edi
mov    -0x90(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
lea    0xce1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x88(%rbp),%esi
lea    -0xa8(%rbp),%rdx
call   10b0 <XGetWindowAttributes@plt>
mov    0x2c12(%rip),%rax
mov    (%rax),%edi
mov    -0xa8(%rbp),%edx
mov    -0xa4(%rbp),%ecx
lea    0xcb9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2c0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xfc(%rbp)
mov    0x2c00(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x100(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x114(%rbp)
mov    -0x70(%rbp),%rdi
mov    0x2bd9(%rip),%rax
mov    (%rax),%edx
lea    0xc7f(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    -0x120(%rbp),%rdi
mov    -0x114(%rbp),%esi
mov    %rax,%rdx
mov    0x2bb4(%rip),%rax
mov    (%rax),%r9d
mov    0x2bb2(%rip),%rax
mov    (%rax),%r15d
xor    %ecx,%ecx
mov    $0x400,%r8d
lea    -0xe8(%rbp),%r14
lea    -0x40(%rbp),%rbx
lea    -0x48(%rbp),%r11
lea    -0x50(%rbp),%r10
lea    -0x68(%rbp),%rax
mov    %r15d,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   10c0 <XGetWindowProperty@plt>
mov    -0x68(%rbp),%rax
mov    %rax,-0x110(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1537 <main+0x387>
mov    -0x110(%rbp),%rax
mov    (%rax),%rax
mov    -0xf0(%rbp),%rcx
cmp    %rcx,%rax
jne    14ce <main+0x31e>
mov    0x2b27(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xfc(%rbp)
mov    0x2aff(%rip),%rax
mov    (%rax),%edi
lea    0xbd3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1514 <main+0x364>
mov    -0x110(%rbp),%rax
mov    (%rax),%rax
mov    -0xf8(%rbp),%rcx
cmp    %rcx,%rax
jne    150f <main+0x35f>
mov    0x2ae1(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x100(%rbp)
mov    0x2ab9(%rip),%rax
mov    (%rax),%edi
lea    0xba6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1514 <main+0x364>
mov    -0x110(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x110(%rbp)
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
jmp    147d <main+0x2cd>
mov    -0x68(%rbp),%rdi
call   1060 <XFree@plt>
cmpl   $0x0,-0xfc(%rbp)
jne    1562 <main+0x3b2>
mov    -0x8c(%rbp),%eax
add    $0x5a,%eax
cmp    -0xa4(%rbp),%eax
jle    1571 <main+0x3c1>
movl   $0x1,-0x104(%rbp)
jmp    1713 <main+0x563>
cmpl   $0x0,-0x100(%rbp)
jne    1593 <main+0x3e3>
mov    -0x90(%rbp),%eax
add    $0x14,%eax
cmp    -0xa8(%rbp),%eax
jle    15a2 <main+0x3f2>
movl   $0x0,-0x104(%rbp)
jmp    170e <main+0x55e>
mov    -0x34(%rbp),%eax
mov    %eax,-0x138(%rbp)
mov    -0x8c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x138(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x134(%rbp)
mov    -0xa4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x134(%rbp),%eax
cmp    %ecx,%eax
jg     1678 <main+0x4c8>
mov    -0x30(%rbp),%eax
mov    %eax,-0x140(%rbp)
mov    -0x90(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x140(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x13c(%rbp)
mov    -0xa8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x13c(%rbp),%eax
cmp    %ecx,%eax
jg     1652 <main+0x4a2>
mov    0x2985(%rip),%rax
mov    (%rax),%edi
lea    0xa8d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x104(%rbp)
jmp    1673 <main+0x4c3>
mov    0x295f(%rip),%rax
mov    (%rax),%edi
lea    0xa79(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x104(%rbp)
jmp    1709 <main+0x559>
mov    -0x30(%rbp),%eax
mov    %eax,-0x148(%rbp)
mov    -0x90(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x148(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x144(%rbp)
mov    -0xa8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x144(%rbp),%eax
cmp    %ecx,%eax
jle    16e3 <main+0x533>
mov    0x28f4(%rip),%rax
mov    (%rax),%edi
lea    0xa21(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x104(%rbp)
jmp    1704 <main+0x554>
mov    0x28ce(%rip),%rax
mov    (%rax),%edi
lea    0xa11(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x104(%rbp)
jmp    1709 <main+0x559>
jmp    170e <main+0x55e>
jmp    1713 <main+0x563>
cmpl   $0x1,-0x104(%rbp)
jne    1875 <main+0x6c5>
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x150(%rbp)
mov    -0x90(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x150(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14c(%rbp)
mov    -0xa8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14c(%rbp),%eax
cmp    %ecx,%eax
jle    17e9 <main+0x639>
mov    0x2846(%rip),%rax
mov    (%rax),%edi
lea    0x99e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xa8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x158(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x90(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    %eax,%ecx
mov    -0xa8(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x158(%rbp),%eax
sub    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x154(%rbp)
mov    -0x90(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x154(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
jmp    1870 <main+0x6c0>
mov    0x27c8(%rip),%rax
mov    (%rax),%edi
lea    0x92c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xa8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x160(%rbp)
mov    -0xa8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
mov    %eax,-0x164(%rbp)
mov    -0x90(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    -0x164(%rbp),%edx
mov    %eax,%esi
mov    -0x160(%rbp),%eax
add    %esi,%edx
sub    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x15c(%rbp)
mov    -0x90(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x15c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
jmp    19ca <main+0x81a>
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x16c(%rbp)
mov    -0x8c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x16c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x168(%rbp)
mov    -0xa4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x168(%rbp),%eax
cmp    %ecx,%eax
jle    193e <main+0x78e>
mov    0x26f1(%rip),%rax
mov    (%rax),%edi
lea    0x860(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xa4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x174(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x8c(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    %eax,%ecx
mov    -0xa4(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x174(%rbp),%eax
sub    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x170(%rbp)
mov    -0x8c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x170(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
jmp    19c5 <main+0x815>
mov    0x2673(%rip),%rax
mov    (%rax),%edi
lea    0x7ef(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xa4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x17c(%rbp)
mov    -0xa4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
mov    %eax,-0x180(%rbp)
mov    -0x8c(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    -0x180(%rbp),%edx
mov    %eax,%esi
mov    -0x17c(%rbp),%eax
add    %esi,%edx
sub    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x178(%rbp)
mov    -0x8c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x178(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
jmp    19ca <main+0x81a>
mov    0x25bf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    1a0e <main+0x85e>
mov    0x25cf(%rip),%rax
mov    (%rax),%edi
lea    0x755(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x25e8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
add    -0x90(%rbp),%eax
cmp    -0xa8(%rbp),%eax
jle    1a57 <main+0x8a7>
mov    0x258e(%rip),%rax
mov    (%rax),%edi
lea    0x723(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x253f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0xa8(%rbp),%eax
sub    -0x90(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    0x255a(%rip),%rax
mov    (%rax),%edi
mov    -0x90(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
lea    0x5e8(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x104(%rbp),%edx
mov    $0x200,%eax
mov    $0x100,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
cltq
or     -0x58(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2507(%rip),%rax
mov    (%rax),%rax
mov    0x24d5(%rip),%rcx
or     (%rcx),%rax
mov    %rax,-0x60(%rbp)
mov    0x2507(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xb0(%rbp)
movq   $0x0,-0xb8(%rbp)
mov    0x24f5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0xc8(%rbp)
movl   $0x20,-0xe0(%rbp)
mov    -0x70(%rbp),%rdi
mov    0x24d5(%rip),%rax
mov    (%rax),%edx
lea    0x57b(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    %rax,-0xd0(%rbp)
mov    -0xd8(%rbp),%rax
movq   $0x0,(%rax)
cmpl   $0x0,-0xfc(%rbp)
je     1b46 <main+0x996>
mov    -0xf0(%rbp),%rax
mov    %rax,-0x188(%rbp)
jmp    1b54 <main+0x9a4>
xor    %eax,%eax
mov    %rax,-0x188(%rbp)
jmp    1b54 <main+0x9a4>
mov    -0x188(%rbp),%rcx
mov    -0xd8(%rbp),%rax
mov    %rcx,0x8(%rax)
cmpl   $0x0,-0x100(%rbp)
je     1b86 <main+0x9d6>
mov    -0xf8(%rbp),%rax
mov    %rax,-0x190(%rbp)
jmp    1b94 <main+0x9e4>
xor    %eax,%eax
mov    %rax,-0x190(%rbp)
jmp    1b94 <main+0x9e4>
mov    -0x190(%rbp),%rcx
mov    -0xd8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x70(%rbp),%rax
mov    %rax,-0x1a0(%rbp)
mov    -0x70(%rbp),%rdi
call   1050 <DefaultRootWindow@plt>
mov    -0x1a0(%rbp),%rdi
mov    %eax,%esi
mov    0x240e(%rip),%rax
mov    (%rax),%edx
mov    -0x60(%rbp),%rcx
lea    -0xe0(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x70(%rbp),%rdi
mov    0x23f1(%rip),%rax
mov    (%rax),%edx
lea    0x576(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    %rax,-0xd0(%rbp)
mov    -0x58(%rbp),%rcx
mov    -0xd8(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x38(%rbp),%rcx
mov    -0xd8(%rbp),%rax
mov    %rcx,0x8(%rax)
movslq -0x3c(%rbp),%rcx
mov    -0xd8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x70(%rbp),%rax
mov    %rax,-0x198(%rbp)
mov    -0x70(%rbp),%rdi
call   1050 <DefaultRootWindow@plt>
mov    -0x198(%rbp),%rdi
mov    %eax,%esi
mov    0x238c(%rip),%rax
mov    (%rax),%edx
mov    -0x60(%rbp),%rcx
lea    -0xe0(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x70(%rbp),%rdi
mov    0x236f(%rip),%rax
mov    (%rax),%edx
lea    0x415(%rip),%rsi
call   10a0 <XInternAtom@plt>
mov    %rax,-0xd0(%rbp)
mov    -0xd8(%rbp),%rax
movq   $0x1,(%rax)
cmpl   $0x0,-0xfc(%rbp)
je     1cac <main+0xafc>
mov    -0xf0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
jmp    1cba <main+0xb0a>
xor    %eax,%eax
mov    %rax,-0x1a8(%rbp)
jmp    1cba <main+0xb0a>
mov    -0x1a8(%rbp),%rcx
mov    -0xd8(%rbp),%rax
mov    %rcx,0x8(%rax)
cmpl   $0x0,-0x100(%rbp)
je     1cec <main+0xb3c>
mov    -0xf8(%rbp),%rax
mov    %rax,-0x1b0(%rbp)
jmp    1cfa <main+0xb4a>
xor    %eax,%eax
mov    %rax,-0x1b0(%rbp)
jmp    1cfa <main+0xb4a>
mov    -0x1b0(%rbp),%rcx
mov    -0xd8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x70(%rbp),%rax
mov    %rax,-0x1b8(%rbp)
mov    -0x70(%rbp),%rdi
call   1050 <DefaultRootWindow@plt>
mov    -0x1b8(%rbp),%rdi
mov    %eax,%esi
mov    0x22a8(%rip),%rax
mov    (%rax),%edx
mov    -0x60(%rbp),%rcx
lea    -0xe0(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x70(%rbp),%rdi
call   10d0 <XCloseDisplay@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1d8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movl   $0x0,0x4c(%rsp)
xor    %edi,%edi
call   1070 <XOpenDisplay@plt>
test   %rax,%rax
jne    11df <main+0x4f>
mov    0x2e0f(%rip),%rax
mov    (%rax),%esi
lea    0xe3e(%rip),%rdi
call   1060 <fputs@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rax,%r14
movq   $0x0,0x50(%rsp)
mov    0x2dee(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xe1a(%rip),%rsi
mov    %rax,%rdi
call   1090 <XInternAtom@plt>
mov    %rax,%rbx
mov    0x0(%rbp),%edx
mov    %rbp,%r15
lea    0xe1f(%rip),%rsi
mov    %r14,%rdi
call   1090 <XInternAtom@plt>
mov    %rax,0x60(%rsp)
mov    %r14,%rdi
call   1040 <DefaultRootWindow@plt>
mov    %eax,%ebp
mov    (%r15),%edx
lea    0xe1b(%rip),%rsi
mov    %r14,%rdi
call   1090 <XInternAtom@plt>
mov    (%r15),%r9d
mov    0x2d79(%rip),%rcx
mov    (%rcx),%r10d
lea    0x40(%rsp),%r13
lea    0x68(%rsp),%r11
lea    0x58(%rsp),%r15
lea    0x74(%rsp),%r12
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
xor    %ecx,%ecx
mov    $0x400,%r8d
push   %r13
push   %r11
push   %r15
mov    %r15,%r13
push   %r12
lea    0x70(%rsp),%rax
push   %rax
push   %r10
call   10b0 <XGetWindowProperty@plt>
add    $0x30,%rsp
mov    0x40(%rsp),%rdi
mov    (%rdi),%r15d
call   1050 <XFree@plt>
lea    0x10(%rsp),%rdx
mov    %r14,%rdi
mov    %r15d,%esi
call   10a0 <XGetWindowAttributes@plt>
mov    0x20(%rsp),%ecx
mov    0x18(%rsp),%edx
mov    0x1c(%rsp),%r8d
lea    0x4c(%rsp),%rax
lea    0x4(%rsp),%r10
lea    0x8(%rsp),%r9
mov    %r14,%rdi
mov    %r15d,%esi
push   %rax
push   %r10
call   1030 <XTranslateCoordinates@plt>
add    $0x10,%rsp
mov    0x2cec(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0x4(%rsp),%r9d
lea    0xd6b(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x18(%rsp),%esi
lea    0x28(%rsp),%rdx
mov    %r14,%rdi
call   10a0 <XGetWindowAttributes@plt>
mov    0x0(%rbp),%edi
mov    0x28(%rsp),%edx
mov    0x2c(%rsp),%ecx
lea    0xd52(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2cb0(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xd4d(%rip),%rsi
mov    %r14,%rdi
mov    %edx,0xc(%rsp)
call   1090 <XInternAtom@plt>
mov    0x0(%rbp),%r9d
mov    0x2c97(%rip),%rcx
mov    (%rcx),%ebp
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
xor    %ecx,%ecx
mov    $0x400,%r8d
lea    0x40(%rsp),%rax
push   %rax
lea    0x70(%rsp),%rax
push   %rax
push   %r13
push   %r12
lea    0x70(%rsp),%rax
push   %rax
push   %rbp
call   10b0 <XGetWindowProperty@plt>
add    $0x30,%rsp
cmpq   $0x0,0x58(%rsp)
je     13f4 <main+0x264>
mov    0x40(%rsp),%r13
mov    0x2c40(%rip),%r12
lea    0xcf6(%rip),%r15
mov    0xc(%rsp),%ebp
jmp    13d3 <main+0x243>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r12),%ebp
mov    %r15,%rsi
mov    0x2c0a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x8,%r13
addq   $0xffffffffffffffff,0x58(%rsp)
je     13f8 <main+0x268>
mov    0x0(%r13),%rax
cmp    %rbx,%rax
je     13b0 <main+0x220>
cmp    0x60(%rsp),%rax
jne    13c7 <main+0x237>
mov    (%r12),%eax
mov    %eax,0xc(%rsp)
lea    0xcbc(%rip),%rsi
jmp    13b7 <main+0x227>
mov    0xc(%rsp),%ebp
mov    0x40(%rsp),%rdi
call   1050 <XFree@plt>
test   %ebp,%ebp
jne    1419 <main+0x289>
mov    0x14(%rsp),%esi
lea    0x5a(%rsi),%eax
mov    0x2c(%rsp),%ecx
cmp    %ecx,%eax
jle    1505 <main+0x375>
mov    0x4(%rsp),%ebp
mov    0x10(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    0x8(%rsp),%ecx
mov    0x28(%rsp),%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
mov    0x2b86(%rip),%rax
mov    (%rax),%edi
cmp    %edx,%ecx
jle    1451 <main+0x2c1>
lea    0xcca(%rip),%rsi
jmp    1458 <main+0x2c8>
lea    0xccd(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x28(%rsp),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
and    $0xfffffffe,%ebx
mov    0x10(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    0x8(%rsp),%ebx
sub    %ecx,%ebx
test   %ebx,%ebx
jns    149e <main+0x30e>
mov    0x2b3c(%rip),%rax
mov    (%rax),%edi
lea    0xcb2(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x10(%rsp),%edx
lea    (%rdx,%rbx,1),%eax
cmp    0x28(%rsp),%eax
jle    14cc <main+0x33c>
mov    0x2b16(%rip),%rax
mov    (%rax),%edi
lea    0xc9b(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x28(%rsp),%ebx
mov    0x10(%rsp),%edx
sub    %edx,%ebx
mov    0x2af5(%rip),%rax
mov    (%rax),%edi
mov    0x14(%rsp),%ecx
lea    0xb83(%rip),%rsi
mov    %ebx,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2aec(%rip),%rax
mov    (%rax),%edx
lea    0xb8a(%rip),%rsi
mov    %r14,%rdi
call   1090 <XInternAtom@plt>
cmpl   $0x0,0xc(%rsp)
jne    1583 <main+0x3f3>
mov    0x10(%rsp),%edx
lea    0x14(%rdx),%edi
mov    0x28(%rsp),%eax
cmp    %eax,%edi
jg     1583 <main+0x3f3>
mov    %esi,%ebp
shr    $0x1f,%ebp
add    %esi,%ebp
sar    %ebp
add    0x4(%rsp),%ebp
mov    %ecx,%esi
shr    $0x1f,%esi
add    %ecx,%esi
sar    %esi
mov    %edx,%ecx
shr    $0x1f,%ecx
add    %edx,%ecx
sar    %ecx
add    0x8(%rsp),%ecx
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
mov    0x2a7a(%rip),%rax
mov    (%rax),%edi
cmp    %esi,%ebp
jle    1564 <main+0x3d4>
cmp    %edx,%ecx
jle    1575 <main+0x3e5>
lea    0xb8f(%rip),%rsi
jmp    15ff <main+0x46f>
cmp    %edx,%ecx
jle    15f8 <main+0x468>
lea    0xb68(%rip),%rsi
jmp    157c <main+0x3ec>
lea    0xb88(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x8(%rsp),%ebx
mov    0x14(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    0x4(%rsp),%ecx
mov    0x2c(%rsp),%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
mov    0x2a1c(%rip),%rax
mov    (%rax),%edi
cmp    %edx,%ecx
jle    15bb <main+0x42b>
lea    0xb77(%rip),%rsi
jmp    15c2 <main+0x432>
lea    0xb7b(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2c(%rsp),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
and    $0xfffffffe,%ebp
mov    0x14(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    0x4(%rsp),%ebp
sub    %ecx,%ebp
test   %ebx,%ebx
jns    149e <main+0x30e>
jmp    1485 <main+0x2f5>
lea    0xaca(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1419 <main+0x289>

LLVM IR (-O0):
%struct.TYPE_9__ = type { i32, i32, i32, i32, i32 }
%struct.TYPE_10__ = type { %struct.TYPE_8__ }
%struct.TYPE_8__ = type { i32, %struct.TYPE_7__, i8*, i32, i8*, i64, i32 }
%struct.TYPE_7__ = type { i64* }
@EXIT_SUCCESS = global i32 0
@.str = [22 x i8] c"Cannot open display.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_VERT\00"
@False = global i32 0
@.str.2 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_HORZ\00"
@.str.3 = [19 x i8] c"_NET_ACTIVE_WINDOW\00"
@XA_WINDOW = global i32 0
@.str.4 = [17 x i8] c"%ux%u @ (%d,%d)\0A\00"
@.str.5 = [19 x i8] c"Resolution: %ux%u\0A\00"
@.str.6 = [14 x i8] c"_NET_WM_STATE\00"
@XA_ATOM = global i32 0
@True = global i8* null
@.str.7 = [25 x i8] c"Is Vertically maximised\0A\00"
@.str.8 = [27 x i8] c"Is Horizontally maximised\0A\00"
@.str.9 = [18 x i8] c"Top left: move x\0A\00"
@.str.10 = [19 x i8] c"Top right: move y\0A\00"
@.str.11 = [22 x i8] c"Bottom right: move x\0A\00"
@.str.12 = [21 x i8] c"Bottom left: move y\0A\00"
@.str.13 = [12 x i8] c"Right side\0A\00"
@.str.14 = [11 x i8] c"Left side\0A\00"
@.str.15 = [13 x i8] c"Bottom side\0A\00"
@.str.16 = [10 x i8] c"Top side\0A\00"
@StaticGravity = global i64 0
@.str.17 = [15 x i8] c"Fixing left x\0A\00"
@NorthWestGravity = global i64 0
@.str.18 = [16 x i8] c"Fixing right x\0A\00"
@NorthEastGravity = global i64 0
@SubstructureRedirectMask = global i64 0
@SubstructureNotifyMask = global i64 0
@ClientMessage = global i32 0
@.str.19 = [23 x i8] c"_NET_MOVERESIZE_WINDOW\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca %struct.TYPE_9__
%21 = alloca %struct.TYPE_9__
%22 = alloca %struct.TYPE_10__
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i64*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%30 = load i32, i32* @EXIT_SUCCESS
store i32 %30, i32* %6
store i32 0, i32* %18
store i32 0, i32* %19
%31 = call i32* @XOpenDisplay(i32* null)
store i32* %31, i32** %17
%32 = icmp ne i32* %31, null
br i1 %32, label %37, label %33
33: ; preds = %2
%34 = load i32, i32* @stderr
%35 = call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = load i32, i32* @EXIT_FAILURE
store i32 %36, i32* %3
br label %484
37: ; preds = %2
store i8* null, i8** %23
%38 = load i32*, i32** %17
%39 = load i32, i32* @False
%40 = call i8* @XInternAtom(i32* %38, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %39)
store i8* %40, i8** %24
%41 = load i32*, i32** %17
%42 = load i32, i32* @False
%43 = call i8* @XInternAtom(i32* %41, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %42)
store i8* %43, i8** %25
%44 = load i32*, i32** %17
%45 = load i32*, i32** %17
%46 = call i32 @DefaultRootWindow(i32* %45)
%47 = load i32*, i32** %17
%48 = load i32, i32* @False
%49 = call i8* @XInternAtom(i32* %47, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %48)
%50 = load i32, i32* @False
%51 = load i32, i32* @XA_WINDOW
%52 = call i32 @XGetWindowProperty(i32* %44, i32 %46, i8* %49, i32 0, i32 1024, i32 %50, i32 %51, i8** %23, i32* %11, i64* %12, i64* %13, i8** %16)
%53 = load i8*, i8** %16
%54 = bitcast i8* %53 to i32*
%55 = load i32, i32* %54
store i32 %55, i32* %18
%56 = load i8*, i8** %16
%57 = call i32 @XFree(i8* %56)
%58 = load i32*, i32** %17
%59 = load i32, i32* %18
%60 = call i32 @XGetWindowAttributes(i32* %58, i32 %59, %struct.TYPE_9__* %20)
%61 = load i32*, i32** %17
%62 = load i32, i32* %18
%63 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 2
%64 = load i32, i32* %63
%65 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 4
%66 = load i32, i32* %65
%67 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 3
%68 = load i32, i32* %67
%69 = call i32 @XTranslateCoordinates(i32* %61, i32 %62, i32 %64, i32 %66, i32 %68, i32* %7, i32* %8, i32* %19)
%70 = load i32, i32* @stderr
%71 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%72 = load i32, i32* %71
%73 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%74 = load i32, i32* %73
%75 = load i32, i32* %7
%76 = load i32, i32* %8
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %72, i32 %74, i32 %75, i32 %76)
%78 = load i32*, i32** %17
%79 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 2
%80 = load i32, i32* %79
%81 = call i32 @XGetWindowAttributes(i32* %78, i32 %80, %struct.TYPE_9__* %21)
%82 = load i32, i32* @stderr
%83 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%84 = load i32, i32* %83
%85 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%86 = load i32, i32* %85
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %84, i32 %86)
%88 = load i32, i32* @False
store i32 %88, i32* %26
%89 = load i32, i32* @False
store i32 %89, i32* %27
%90 = load i32*, i32** %17
%91 = load i32, i32* %18
%92 = load i32*, i32** %17
%93 = load i32, i32* @False
%94 = call i8* @XInternAtom(i32* %92, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %93)
%95 = load i32, i32* @False
%96 = load i32, i32* @XA_ATOM
%97 = call i32 @XGetWindowProperty(i32* %90, i32 %91, i8* %94, i32 0, i32 1024, i32 %95, i32 %96, i8** %23, i32* %11, i64* %12, i64* %13, i8** %16)
%98 = load i8*, i8** %16
%99 = bitcast i8* %98 to i64*
store i64* %99, i64** %29
br label %100
100: ; preds = %129, %37
%101 = load i64, i64* %12
%102 = icmp ne i64 %101, 0
br i1 %102, label %103, label %132
103: ; preds = %100
%104 = load i64*, i64** %29
%105 = load i64, i64* %104
%106 = load i8*, i8** %24
%107 = ptrtoint i8* %106 to i64
%108 = icmp eq i64 %105, %107
br i1 %108, label %109, label %114
109: ; preds = %103
%110 = load i8*, i8** @True
%111 = ptrtoint i8* %110 to i32
store i32 %111, i32* %26
%112 = load i32, i32* @stderr
%113 = call i32 (i32, i8*, ...) @fprintf(i32 %112, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %126
114: ; preds = %103
%115 = load i64*, i64** %29
%116 = load i64, i64* %115
%117 = load i8*, i8** %25
%118 = ptrtoint i8* %117 to i64
%119 = icmp eq i64 %116, %118
br i1 %119, label %120, label %125
120: ; preds = %114
%121 = load i8*, i8** @True
%122 = ptrtoint i8* %121 to i32
store i32 %122, i32* %27
%123 = load i32, i32* @stderr
%124 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
br label %125
125: ; preds = %120, %114
br label %126
126: ; preds = %125, %109
%127 = load i64*, i64** %29
%128 = getelementptr inbounds i64, i64* %127, i32 1
store i64* %128, i64** %29
br label %129
129: ; preds = %126
%130 = load i64, i64* %12
%131 = add i64 %130, -1
store i64 %131, i64* %12
br label %100
132: ; preds = %100
%133 = load i8*, i8** %16
%134 = call i32 @XFree(i8* %133)
%135 = load i32, i32* %26
%136 = icmp ne i32 %135, 0
br i1 %136, label %144, label %137
137: ; preds = %132
%138 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%139 = load i32, i32* %138
%140 = add nsw i32 %139, 90
%141 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%142 = load i32, i32* %141
%143 = icmp sgt i32 %140, %142
br i1 %143, label %144, label %145
144: ; preds = %137, %132
store i32 1, i32* %28
br label %202
145: ; preds = %137
%146 = load i32, i32* %27
%147 = icmp ne i32 %146, 0
br i1 %147, label %155, label %148
148: ; preds = %145
%149 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%150 = load i32, i32* %149
%151 = add nsw i32 %150, 20
%152 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%153 = load i32, i32* %152
%154 = icmp sgt i32 %151, %153
br i1 %154, label %155, label %156
155: ; preds = %148, %145
store i32 0, i32* %28
br label %201
156: ; preds = %148
%157 = load i32, i32* %8
%158 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%159 = load i32, i32* %158
%160 = sdiv i32 %159, 2
%161 = add nsw i32 %157, %160
%162 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%163 = load i32, i32* %162
%164 = sdiv i32 %163, 2
%165 = icmp sle i32 %161, %164
br i1 %165, label %166, label %183
166: ; preds = %156
%167 = load i32, i32* %7
%168 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%169 = load i32, i32* %168
%170 = sdiv i32 %169, 2
%171 = add nsw i32 %167, %170
%172 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%173 = load i32, i32* %172
%174 = sdiv i32 %173, 2
%175 = icmp sle i32 %171, %174
br i1 %175, label %176, label %179
176: ; preds = %166
%177 = load i32, i32* @stderr
%178 = call i32 (i32, i8*, ...) @fprintf(i32 %177, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %28
br label %182
179: ; preds = %166
%180 = load i32, i32* @stderr
%181 = call i32 (i32, i8*, ...) @fprintf(i32 %180, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %28
br label %182
182: ; preds = %179, %176
br label %200
183: ; preds = %156
%184 = load i32, i32* %7
%185 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%186 = load i32, i32* %185
%187 = sdiv i32 %186, 2
%188 = add nsw i32 %184, %187
%189 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%190 = load i32, i32* %189
%191 = sdiv i32 %190, 2
%192 = icmp sgt i32 %188, %191
br i1 %192, label %193, label %196
193: ; preds = %183
%194 = load i32, i32* @stderr
%195 = call i32 (i32, i8*, ...) @fprintf(i32 %194, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %28
br label %199
196: ; preds = %183
%197 = load i32, i32* @stderr
%198 = call i32 (i32, i8*, ...) @fprintf(i32 %197, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %28
br label %199
199: ; preds = %196, %193
br label %200
200: ; preds = %199, %182
br label %201
201: ; preds = %200, %155
br label %202
202: ; preds = %201, %144
%203 = load i32, i32* %28
%204 = icmp eq i32 %203, 1
br i1 %204, label %205, label %257
205: ; preds = %202
%206 = load i32, i32* %8
store i32 %206, i32* %10
%207 = load i32, i32* %7
%208 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%209 = load i32, i32* %208
%210 = sdiv i32 %209, 2
%211 = add nsw i32 %207, %210
%212 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%213 = load i32, i32* %212
%214 = sdiv i32 %213, 2
%215 = icmp sgt i32 %211, %214
br i1 %215, label %216, label %236
216: ; preds = %205
%217 = load i32, i32* @stderr
%218 = call i32 (i32, i8*, ...) @fprintf(i32 %217, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%219 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%220 = load i32, i32* %219
%221 = sdiv i32 %220, 2
%222 = load i32, i32* %7
%223 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%224 = load i32, i32* %223
%225 = sdiv i32 %224, 2
%226 = add nsw i32 %222, %225
%227 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%228 = load i32, i32* %227
%229 = sdiv i32 %228, 2
%230 = sub nsw i32 %226, %229
%231 = sub nsw i32 %221, %230
%232 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%233 = load i32, i32* %232
%234 = sdiv i32 %233, 2
%235 = sub nsw i32 %231, %234
store i32 %235, i32* %9
br label %256
236: ; preds = %205
%237 = load i32, i32* @stderr
%238 = call i32 (i32, i8*, ...) @fprintf(i32 %237, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
%239 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%240 = load i32, i32* %239
%241 = sdiv i32 %240, 2
%242 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%243 = load i32, i32* %242
%244 = sdiv i32 %243, 2
%245 = load i32, i32* %7
%246 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%247 = load i32, i32* %246
%248 = sdiv i32 %247, 2
%249 = add nsw i32 %245, %248
%250 = sub nsw i32 %244, %249
%251 = add nsw i32 %241, %250
%252 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%253 = load i32, i32* %252
%254 = sdiv i32 %253, 2
%255 = sub nsw i32 %251, %254
store i32 %255, i32* %9
br label %256
256: ; preds = %236, %216
br label %309
257: ; preds = %202
%258 = load i32, i32* %7
store i32 %258, i32* %9
%259 = load i32, i32* %8
%260 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%261 = load i32, i32* %260
%262 = sdiv i32 %261, 2
%263 = add nsw i32 %259, %262
%264 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%265 = load i32, i32* %264
%266 = sdiv i32 %265, 2
%267 = icmp sgt i32 %263, %266
br i1 %267, label %268, label %288
268: ; preds = %257
%269 = load i32, i32* @stderr
%270 = call i32 (i32, i8*, ...) @fprintf(i32 %269, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0))
%271 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%272 = load i32, i32* %271
%273 = sdiv i32 %272, 2
%274 = load i32, i32* %8
%275 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%276 = load i32, i32* %275
%277 = sdiv i32 %276, 2
%278 = add nsw i32 %274, %277
%279 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%280 = load i32, i32* %279
%281 = sdiv i32 %280, 2
%282 = sub nsw i32 %278, %281
%283 = sub nsw i32 %273, %282
%284 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%285 = load i32, i32* %284
%286 = sdiv i32 %285, 2
%287 = sub nsw i32 %283, %286
store i32 %287, i32* %10
br label %308
288: ; preds = %257
%289 = load i32, i32* @stderr
%290 = call i32 (i32, i8*, ...) @fprintf(i32 %289, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
%291 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%292 = load i32, i32* %291
%293 = sdiv i32 %292, 2
%294 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 1
%295 = load i32, i32* %294
%296 = sdiv i32 %295, 2
%297 = load i32, i32* %8
%298 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%299 = load i32, i32* %298
%300 = sdiv i32 %299, 2
%301 = add nsw i32 %297, %300
%302 = sub nsw i32 %296, %301
%303 = add nsw i32 %293, %302
%304 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%305 = load i32, i32* %304
%306 = sdiv i32 %305, 2
%307 = sub nsw i32 %303, %306
store i32 %307, i32* %10
br label %308
308: ; preds = %288, %268
br label %309
309: ; preds = %308, %256
%310 = load i64, i64* @StaticGravity
store i64 %310, i64* %14
%311 = load i32, i32* %9
%312 = icmp slt i32 %311, 0
br i1 %312, label %313, label %317
313: ; preds = %309
%314 = load i32, i32* @stderr
%315 = call i32 (i32, i8*, ...) @fprintf(i32 %314, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0))
%316 = load i64, i64* @NorthWestGravity
store i64 %316, i64* %14
store i32 0, i32* %9
br label %317
317: ; preds = %313, %309
%318 = load i32, i32* %9
%319 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%320 = load i32, i32* %319
%321 = add nsw i32 %318, %320
%322 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%323 = load i32, i32* %322
%324 = icmp sgt i32 %321, %323
br i1 %324, label %325, label %334
325: ; preds = %317
%326 = load i32, i32* @stderr
%327 = call i32 (i32, i8*, ...) @fprintf(i32 %326, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0))
%328 = load i64, i64* @NorthEastGravity
store i64 %328, i64* %14
%329 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %21, i32 0, i32 0
%330 = load i32, i32* %329
%331 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%332 = load i32, i32* %331
%333 = sub nsw i32 %330, %332
store i32 %333, i32* %9
br label %334
334: ; preds = %325, %317
%335 = load i32, i32* @stderr
%336 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 0
%337 = load i32, i32* %336
%338 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%339 = load i32, i32* %338
%340 = load i32, i32* %9
%341 = load i32, i32* %10
%342 = call i32 (i32, i8*, ...) @fprintf(i32 %335, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %337, i32 %339, i32 %340, i32 %341)
%343 = load i32, i32* %28
%344 = icmp ne i32 %343, 0
%345 = zext i1 %344 to i64
%346 = select i1 %344, i32 256, i32 512
%347 = sext i32 %346 to i64
%348 = load i64, i64* %14
%349 = or i64 %348, %347
store i64 %349, i64* %14
%350 = load i64, i64* @SubstructureRedirectMask
%351 = load i64, i64* @SubstructureNotifyMask
%352 = or i64 %350, %351
store i64 %352, i64* %15
%353 = load i32, i32* @ClientMessage
%354 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%355 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %354, i32 0, i32 6
store i32 %353, i32* %355
%356 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%357 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %356, i32 0, i32 5
store i64 0, i64* %357
%358 = load i8*, i8** @True
%359 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%360 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %359, i32 0, i32 4
store i8* %358, i8** %360
%361 = load i32, i32* %18
%362 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%363 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %362, i32 0, i32 3
store i32 %361, i32* %363
%364 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%365 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %364, i32 0, i32 0
store i32 32, i32* %365
%366 = load i32*, i32** %17
%367 = load i32, i32* @False
%368 = call i8* @XInternAtom(i32* %366, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %367)
%369 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%370 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %369, i32 0, i32 2
store i8* %368, i8** %370
%371 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%372 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %371, i32 0, i32 1
%373 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %372, i32 0, i32 0
%374 = load i64*, i64** %373
%375 = getelementptr inbounds i64, i64* %374, i64 0
store i64 0, i64* %375
%376 = load i32, i32* %26
%377 = icmp ne i32 %376, 0
br i1 %377, label %378, label %381
378: ; preds = %334
%379 = load i8*, i8** %24
%380 = ptrtoint i8* %379 to i64
br label %382
381: ; preds = %334
br label %382
382: ; preds = %381, %378
%383 = phi i64 [ %380, %378 ], [ 0, %381 ]
%384 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%385 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %384, i32 0, i32 1
%386 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %385, i32 0, i32 0
%387 = load i64*, i64** %386
%388 = getelementptr inbounds i64, i64* %387, i64 1
store i64 %383, i64* %388
%389 = load i32, i32* %27
%390 = icmp ne i32 %389, 0
br i1 %390, label %391, label %394
391: ; preds = %382
%392 = load i8*, i8** %25
%393 = ptrtoint i8* %392 to i64
br label %395
394: ; preds = %382
br label %395
395: ; preds = %394, %391
%396 = phi i64 [ %393, %391 ], [ 0, %394 ]
%397 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%398 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %397, i32 0, i32 1
%399 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %398, i32 0, i32 0
%400 = load i64*, i64** %399
%401 = getelementptr inbounds i64, i64* %400, i64 2
store i64 %396, i64* %401
%402 = load i32*, i32** %17
%403 = load i32*, i32** %17
%404 = call i32 @DefaultRootWindow(i32* %403)
%405 = load i32, i32* @False
%406 = load i64, i64* %15
%407 = call i32 @XSendEvent(i32* %402, i32 %404, i32 %405, i64 %406, %struct.TYPE_10__* %22)
%408 = load i32*, i32** %17
%409 = load i32, i32* @False
%410 = call i8* @XInternAtom(i32* %408, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0), i32 %409)
%411 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%412 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %411, i32 0, i32 2
store i8* %410, i8** %412
%413 = load i64, i64* %14
%414 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%415 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %414, i32 0, i32 1
%416 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %415, i32 0, i32 0
%417 = load i64*, i64** %416
%418 = getelementptr inbounds i64, i64* %417, i64 0
store i64 %413, i64* %418
%419 = load i32, i32* %9
%420 = sext i32 %419 to i64
%421 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%422 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %421, i32 0, i32 1
%423 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %422, i32 0, i32 0
%424 = load i64*, i64** %423
%425 = getelementptr inbounds i64, i64* %424, i64 1
store i64 %420, i64* %425
%426 = load i32, i32* %10
%427 = sext i32 %426 to i64
%428 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%429 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %428, i32 0, i32 1
%430 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %429, i32 0, i32 0
%431 = load i64*, i64** %430
%432 = getelementptr inbounds i64, i64* %431, i64 2
store i64 %427, i64* %432
%433 = load i32*, i32** %17
%434 = load i32*, i32** %17
%435 = call i32 @DefaultRootWindow(i32* %434)
%436 = load i32, i32* @False
%437 = load i64, i64* %15
%438 = call i32 @XSendEvent(i32* %433, i32 %435, i32 %436, i64 %437, %struct.TYPE_10__* %22)
%439 = load i32*, i32** %17
%440 = load i32, i32* @False
%441 = call i8* @XInternAtom(i32* %439, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %440)
%442 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%443 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %442, i32 0, i32 2
store i8* %441, i8** %443
%444 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%445 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %444, i32 0, i32 1
%446 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %445, i32 0, i32 0
%447 = load i64*, i64** %446
%448 = getelementptr inbounds i64, i64* %447, i64 0
store i64 1, i64* %448
%449 = load i32, i32* %26
%450 = icmp ne i32 %449, 0
br i1 %450, label %451, label %454
451: ; preds = %395
%452 = load i8*, i8** %24
%453 = ptrtoint i8* %452 to i64
br label %455
454: ; preds = %395
br label %455
455: ; preds = %454, %451
%456 = phi i64 [ %453, %451 ], [ 0, %454 ]
%457 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%458 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %457, i32 0, i32 1
%459 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %458, i32 0, i32 0
%460 = load i64*, i64** %459
%461 = getelementptr inbounds i64, i64* %460, i64 1
store i64 %456, i64* %461
%462 = load i32, i32* %27
%463 = icmp ne i32 %462, 0
br i1 %463, label %464, label %467
464: ; preds = %455
%465 = load i8*, i8** %25
%466 = ptrtoint i8* %465 to i64
br label %468
467: ; preds = %455
br label %468
468: ; preds = %467, %464
%469 = phi i64 [ %466, %464 ], [ 0, %467 ]
%470 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %22, i32 0, i32 0
%471 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %470, i32 0, i32 1
%472 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %471, i32 0, i32 0
%473 = load i64*, i64** %472
%474 = getelementptr inbounds i64, i64* %473, i64 2
store i64 %469, i64* %474
%475 = load i32*, i32** %17
%476 = load i32*, i32** %17
%477 = call i32 @DefaultRootWindow(i32* %476)
%478 = load i32, i32* @False
%479 = load i64, i64* %15
%480 = call i32 @XSendEvent(i32* %475, i32 %477, i32 %478, i64 %479, %struct.TYPE_10__* %22)
%481 = load i32*, i32** %17
%482 = call i32 @XCloseDisplay(i32* %481)
%483 = load i32, i32* %6
store i32 %483, i32* %3
br label %484
484: ; preds = %468, %33
%485 = load i32, i32* %3
ret i32 %485
}

LLVM IR (-O2):
%struct.TYPE_9__ = type { i32, i32, i32, i32, i32 }
@EXIT_SUCCESS = global i32 0
@.str = [22 x i8] c"Cannot open display.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_VERT\00"
@False = global i32 0
@.str.2 = [29 x i8] c"_NET_WM_STATE_MAXIMIZED_HORZ\00"
@.str.3 = [19 x i8] c"_NET_ACTIVE_WINDOW\00"
@XA_WINDOW = global i32 0
@.str.4 = [17 x i8] c"%ux%u @ (%d,%d)\0A\00"
@.str.5 = [19 x i8] c"Resolution: %ux%u\0A\00"
@.str.6 = [14 x i8] c"_NET_WM_STATE\00"
@XA_ATOM = global i32 0
@True = global i8* null
@.str.7 = [25 x i8] c"Is Vertically maximised\0A\00"
@.str.8 = [27 x i8] c"Is Horizontally maximised\0A\00"
@.str.9 = [18 x i8] c"Top left: move x\0A\00"
@.str.10 = [19 x i8] c"Top right: move y\0A\00"
@.str.11 = [22 x i8] c"Bottom right: move x\0A\00"
@.str.12 = [21 x i8] c"Bottom left: move y\0A\00"
@.str.13 = [12 x i8] c"Right side\0A\00"
@.str.14 = [11 x i8] c"Left side\0A\00"
@.str.15 = [13 x i8] c"Bottom side\0A\00"
@.str.16 = [10 x i8] c"Top side\0A\00"
@StaticGravity = global i64 0
@.str.17 = [15 x i8] c"Fixing left x\0A\00"
@NorthWestGravity = global i64 0
@.str.18 = [16 x i8] c"Fixing right x\0A\00"
@NorthEastGravity = global i64 0
@SubstructureRedirectMask = global i64 0
@SubstructureNotifyMask = global i64 0
@ClientMessage = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca %struct.TYPE_9__
%11 = alloca %struct.TYPE_9__
%12 = alloca i8*
%13 = bitcast i32* %3 to i8*
%14 = bitcast i32* %4 to i8*
%15 = bitcast i32* %5 to i8*
%16 = bitcast i64* %6 to i8*
%17 = bitcast i64* %7 to i8*
%18 = bitcast i8** %8 to i8*
%19 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%20 = bitcast %struct.TYPE_9__* %10 to i8*
%21 = bitcast %struct.TYPE_9__* %11 to i8*
%22 = tail call i32* @XOpenDisplay(i32* null)
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %28
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = tail call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = load i32, i32* @EXIT_FAILURE
ret i32 %27
28: ; preds = %2
%29 = bitcast i8** %12 to i8*
store i8* null, i8** %12
%30 = load i32, i32* @False
%31 = tail call i8* @XInternAtom(i32* %22, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = load i32, i32* @False
%33 = tail call i8* @XInternAtom(i32* %22, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = tail call i32 @DefaultRootWindow(i32* %22)
%35 = load i32, i32* @False
%36 = tail call i8* @XInternAtom(i32* %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load i32, i32* @False
%38 = load i32, i32* @XA_WINDOW
%39 = call i32 @XGetWindowProperty(i32* %22, i32 %34, i8* %36, i32 0, i32 1024, i32 %37, i32 %38, i8** %12, i32* %5, i64* %6, i64* %7, i8** %8)
%40 = load i8*, i8** %8
%41 = bitcast i8* %40 to i32*
%42 = load i32, i32* %41
%43 = call i32 @XFree(i8* %40)
%44 = call i32 @XGetWindowAttributes(i32* %22, i32 %42, %struct.TYPE_9__* %10)
%45 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %10, i64 0, i32 2
%46 = load i32, i32* %45
%47 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %10, i64 0, i32 4
%48 = load i32, i32* %47
%49 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %10, i64 0, i32 3
%50 = load i32, i32* %49
%51 = call i32 @XTranslateCoordinates(i32* %22, i32 %42, i32 %46, i32 %48, i32 %50, i32* %3, i32* %4, i32* %9)
%52 = load i32, i32* @stderr
%53 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %10, i64 0, i32 0
%54 = load i32, i32* %53
%55 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %10, i64 0, i32 1
%56 = load i32, i32* %55
%57 = load i32, i32* %3
%58 = load i32, i32* %4
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %54, i32 %56, i32 %57, i32 %58)
%60 = load i32, i32* %45
%61 = call i32 @XGetWindowAttributes(i32* %22, i32 %60, %struct.TYPE_9__* %11)
%62 = load i32, i32* @stderr
%63 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %11, i64 0, i32 0
%64 = load i32, i32* %63
%65 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %11, i64 0, i32 1
%66 = load i32, i32* %65
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %64, i32 %66)
%68 = load i32, i32* @False
%69 = call i8* @XInternAtom(i32* %22, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %68)
%70 = load i32, i32* @False
%71 = load i32, i32* @XA_ATOM
%72 = call i32 @XGetWindowProperty(i32* %22, i32 %42, i8* %69, i32 0, i32 1024, i32 %70, i32 %71, i8** %12, i32* %5, i64* %6, i64* %7, i8** %8)
%73 = load i64, i64* %6
%74 = icmp eq i64 %73, 0
br i1 %74, label %109, label %75
75: ; preds = %28
%76 = bitcast i8** %8 to i64**
%77 = load i64*, i64** %76
%78 = ptrtoint i8* %31 to i64
%79 = ptrtoint i8* %33 to i64
br label %80
80: ; preds = %75, %102
%81 = phi i64* [ %77, %75 ], [ %105, %102 ]
%82 = phi i32 [ %68, %75 ], [ %104, %102 ]
%83 = phi i32 [ %68, %75 ], [ %103, %102 ]
%84 = load i64, i64* %81
%85 = icmp eq i64 %84, %78
br i1 %85, label %86, label %90
86: ; preds = %80
%87 = load i8*, i8** @True
%88 = ptrtoint i8* %87 to i64
%89 = trunc i64 %88 to i32
br label %96
90: ; preds = %80
%91 = icmp eq i64 %84, %79
br i1 %91, label %92, label %102
92: ; preds = %90
%93 = load i8*, i8** @True
%94 = ptrtoint i8* %93 to i64
%95 = trunc i64 %94 to i32
br label %96
96: ; preds = %86, %92
%97 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), %92 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), %86 ]
%98 = phi i32 [ %83, %92 ], [ %89, %86 ]
%99 = phi i32 [ %95, %92 ], [ %82, %86 ]
%100 = load i32, i32* @stderr
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* %97)
br label %102
102: ; preds = %96, %90
%103 = phi i32 [ %83, %90 ], [ %98, %96 ]
%104 = phi i32 [ %82, %90 ], [ %99, %96 ]
%105 = getelementptr inbounds i64, i64* %81, i64 1
%106 = load i64, i64* %6
%107 = add i64 %106, -1
store i64 %107, i64* %6
%108 = icmp eq i64 %107, 0
br i1 %108, label %109, label %80
109: ; preds = %102, %28
%110 = phi i32 [ %68, %28 ], [ %103, %102 ]
%111 = phi i32 [ %68, %28 ], [ %104, %102 ]
%112 = load i8*, i8** %8
%113 = call i32 @XFree(i8* %112)
%114 = icmp eq i32 %110, 0
br i1 %114, label %115, label %144
115: ; preds = %109
%116 = load i32, i32* %55
%117 = add nsw i32 %116, 90
%118 = load i32, i32* %65
%119 = icmp sgt i32 %117, %118
br i1 %119, label %144, label %120
120: ; preds = %115
%121 = icmp eq i32 %111, 0
br i1 %121, label %122, label %179
122: ; preds = %120
%123 = load i32, i32* %53
%124 = add nsw i32 %123, 20
%125 = load i32, i32* %63
%126 = icmp sgt i32 %124, %125
br i1 %126, label %179, label %127
127: ; preds = %122
%128 = load i32, i32* %4
%129 = sdiv i32 %116, 2
%130 = add nsw i32 %128, %129
%131 = sdiv i32 %118, 2
%132 = icmp sgt i32 %130, %131
%133 = load i32, i32* %3
%134 = sdiv i32 %123, 2
%135 = add nsw i32 %133, %134
%136 = sdiv i32 %125, 2
%137 = icmp sgt i32 %135, %136
%138 = load i32, i32* @stderr
br i1 %132, label %140, label %139
139: ; preds = %127
br i1 %137, label %176, label %141
140: ; preds = %127
br i1 %137, label %141, label %176
141: ; preds = %140, %139
%142 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), %139 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), %140 ]
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* %142)
br label %144
144: ; preds = %141, %115, %109
%145 = load i32, i32* %4
%146 = load i32, i32* %3
%147 = load i32, i32* %53
%148 = sdiv i32 %147, 2
%149 = add nsw i32 %148, %146
%150 = load i32, i32* %63
%151 = sdiv i32 %150, 2
%152 = icmp sgt i32 %149, %151
%153 = load i32, i32* @stderr
br i1 %152, label %154, label %165
154: ; preds = %144
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %153, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%156 = load i32, i32* %63
%157 = sdiv i32 %156, 2
%158 = load i32, i32* %3
%159 = load i32, i32* %53
%160 = sdiv i32 %159, -2
%161 = shl nsw i32 %157, 1
%162 = shl i32 %160, 1
%163 = sub i32 %161, %158
%164 = add i32 %163, %162
br label %211
165: ; preds = %144
%166 = call i32 (i32, i8*, ...) @fprintf(i32 %153, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
%167 = load i32, i32* %63
%168 = sdiv i32 %167, 2
%169 = load i32, i32* %3
%170 = load i32, i32* %53
%171 = sdiv i32 %170, -2
%172 = shl nsw i32 %168, 1
%173 = shl i32 %171, 1
%174 = sub i32 %172, %169
%175 = add i32 %174, %173
br label %211
176: ; preds = %140, %139
%177 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), %139 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), %140 ]
%178 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* %177)
br label %179
179: ; preds = %176, %122, %120
%180 = load i32, i32* %3
%181 = load i32, i32* %4
%182 = load i32, i32* %55
%183 = sdiv i32 %182, 2
%184 = add nsw i32 %183, %181
%185 = load i32, i32* %65
%186 = sdiv i32 %185, 2
%187 = icmp sgt i32 %184, %186
%188 = load i32, i32* @stderr
br i1 %187, label %189, label %200
189: ; preds = %179
%190 = call i32 (i32, i8*, ...) @fprintf(i32 %188, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0))
%191 = load i32, i32* %65
%192 = sdiv i32 %191, 2
%193 = load i32, i32* %4
%194 = load i32, i32* %55
%195 = sdiv i32 %194, -2
%196 = shl nsw i32 %192, 1
%197 = shl i32 %195, 1
%198 = sub i32 %196, %193
%199 = add i32 %198, %197
br label %211
200: ; preds = %179
%201 = call i32 (i32, i8*, ...) @fprintf(i32 %188, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
%202 = load i32, i32* %65
%203 = sdiv i32 %202, 2
%204 = load i32, i32* %4
%205 = load i32, i32* %55
%206 = sdiv i32 %205, -2
%207 = shl nsw i32 %203, 1
%208 = shl i32 %206, 1
%209 = sub i32 %207, %204
%210 = add i32 %209, %208
br label %211
211: ; preds = %189, %200, %154, %165
%212 = phi i32 [ %145, %154 ], [ %145, %165 ], [ %199, %189 ], [ %210, %200 ]
%213 = phi i32 [ %164, %154 ], [ %175, %165 ], [ %180, %189 ], [ %180, %200 ]
%214 = icmp slt i32 %213, 0
br i1 %214, label %215, label %218
215: ; preds = %211
%216 = load i32, i32* @stderr
%217 = call i32 (i32, i8*, ...) @fprintf(i32 %216, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0))
br label %218
218: ; preds = %215, %211
%219 = phi i32 [ 0, %215 ], [ %213, %211 ]
%220 = load i32, i32* %53
%221 = add nsw i32 %220, %219
%222 = load i32, i32* %63
%223 = icmp sgt i32 %221, %222
br i1 %223, label %224, label %230
224: ; preds = %218
%225 = load i32, i32* @stderr
%226 = call i32 (i32, i8*, ...) @fprintf(i32 %225, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0))
%227 = load i32, i32* %63
%228 = load i32, i32* %53
%229 = sub nsw i32 %227, %228
br label %230
230: ; preds = %224, %218
%231 = phi i32 [ %228, %224 ], [ %220, %218 ]
%232 = phi i32 [ %229, %224 ], [ %219, %218 ]
%233 = load i32, i32* @stderr
%234 = load i32, i32* %55
%235 = call i32 (i32, i8*, ...) @fprintf(i32 %233, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %231, i32 %234, i32 %232, i32 %212)
%236 = load i32, i32* @False
%237 = call i8* @XInternAtom(i32* %22, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %236)
unreachable
}