#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_25__ TYPE_7__;
typedef struct TYPE_24__ TYPE_5__;
typedef struct TYPE_23__ TYPE_4__;
typedef struct TYPE_22__ TYPE_3__;
typedef struct TYPE_21__ TYPE_2__;
typedef struct TYPE_20__ TYPE_1__;
typedef struct TYPE_19__ TYPE_14__;

/* Type definitions */
typedef int /*<<< orphan*/ window_change_event;
struct timespec {
  double tv_sec;
  int tv_nsec;
};
struct TYPE_24__ {
  int flags;
  int min_width;
  int min_height;
  int /*<<< orphan*/ initial_state;
  void *input;
};
typedef TYPE_5__ XWMHints;
typedef TYPE_5__ XSizeHints;
struct TYPE_23__ {
  int /*<<< orphan*/ y;
  int /*<<< orphan*/ x;
};
struct TYPE_22__ {
  int button;
  int x;
  int y;
};
struct TYPE_19__ {
  int state;
};
struct TYPE_20__ {
  int *l;
};
struct TYPE_21__ {
  void *message_type;
  int format;
  TYPE_1__ data;
  int /*<<< orphan*/ window;
};
struct TYPE_25__ {
  int type;
  TYPE_4__ xmotion;
  TYPE_3__ xbutton;
  TYPE_14__ xkey;
  TYPE_2__ xclient;
};
typedef TYPE_7__ XEvent;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ KeySym;
typedef int /*<<< orphan*/ Display;
typedef void *Bool;
typedef void *Atom;

/* Variables and functions */
unsigned long BlackPixel(int /*<<< orphan*/ *, int /*<<< orphan*/);
#define ButtonPress 132
int ButtonPressMask;
#define ButtonRelease 131
int ButtonReleaseMask;
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
#define ClientMessage 130
int ControlMask;
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ DefaultScreen(int /*<<< orphan*/ *);
scalar_t__ EINTR;
int EXIT_FAILURE;
int EXIT_SUCCESS;
int ExposureMask;
void *False;
int InputHint;
int /*<<< orphan*/ IsCursorKey(int /*<<< orphan*/);
int /*<<< orphan*/ IsFunctionKey(int /*<<< orphan*/);
int /*<<< orphan*/ IsKeypadKey(int /*<<< orphan*/);
int /*<<< orphan*/ IsMiscFunctionKey(int /*<<< orphan*/);
int /*<<< orphan*/ IsModifierKey(int /*<<< orphan*/);
#define KeyPress 129
int KeyPressMask;
int LockMask;
int Mod1Mask;
int Mod2Mask;
int Mod3Mask;
int Mod4Mask;
int Mod5Mask;
#define MotionNotify 128
int /*<<< orphan*/ NormalState;
int PMinSize;
int PointerMotionMask;
int ShiftMask;
int StateHint;
int SubstructureNotifyMask;
int SubstructureRedirectMask;
void *True;
unsigned long WhitePixel(int /*<<< orphan*/ *, int /*<<< orphan*/);
TYPE_5__ *XAllocSizeHints();
TYPE_5__ *XAllocWMHints();
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XCreateSimpleWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int, int, int, unsigned long,
                                       unsigned long);
int /*<<< orphan*/ XDestroyWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XFree(TYPE_5__ *);
void *XInternAtom(int /*<<< orphan*/ *, char *, void *);
int /*<<< orphan*/ XK_Escape;
int /*<<< orphan*/ XK_F11;
int /*<<< orphan*/ XK_Return;
int /*<<< orphan*/ XK_q;
char *XKeysymToString(int /*<<< orphan*/);
int /*<<< orphan*/ XLookupKeysym(TYPE_14__ *, int);
int XLookupString(TYPE_14__ *, char *, int, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XMoveWindow(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                               int);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, TYPE_7__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
scalar_t__ XPending(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ XSendEvent(int /*<<< orphan*/ *, int /*<<< orphan*/, void *,
                              int, TYPE_7__ *);
int /*<<< orphan*/ XSetWMProtocols(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   void **, int);
int /*<<< orphan*/ XWindowEvent(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                TYPE_7__ *);
int /*<<< orphan*/ Xutf8SetWMProperties(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, char *, char *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, TYPE_5__ *,
                                        TYPE_5__ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
scalar_t__ errno;
int /*<<< orphan*/ memset(TYPE_7__ *, int /*<<< orphan*/, int);
int nanosleep(struct timespec *, struct timespec *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ timespec_diff(struct timespec *, struct timespec *);
int main(int argc, char *argv[]) {
  Display *dpy = XOpenDisplay(NULL);
  if (dpy == NULL) {
    return EXIT_FAILURE;
  }
  unsigned long black = BlackPixel(dpy, DefaultScreen(dpy));
  Window win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 800, 600,
                                   0, black, black);
  XWMHints *wmhints = XAllocWMHints();
  wmhints->flags = InputHint | StateHint;
  wmhints->input = True;
  wmhints->initial_state = NormalState;
  XSizeHints *sizehints = XAllocSizeHints();
  sizehints->flags = PMinSize;
  sizehints->min_width = 400;
  sizehints->min_height = 300;
  Xutf8SetWMProperties(dpy, win, "Phase 01", "", NULL, 0, sizehints, wmhints,
                       NULL);
  XSelectInput(dpy, win, ExposureMask);
  unsigned long white = WhitePixel(dpy, DefaultScreen(dpy));
  Window sub = XCreateSimpleWindow(dpy, win, 0, 0, 20, 20, 5, white, black);
  int sub_x = 0;
  int sub_y = 0;
  Bool moving_square = False;
  int move_offset_x = 0;
  int move_offset_y = 0;
  XMapWindow(dpy, sub);
  Atom wm_protocol = XInternAtom(dpy, "WM_PROTOCOLS", True);
  Atom wm_delete = XInternAtom(dpy, "WM_DELETE_WINDOW", True);
  XSetWMProtocols(dpy, win, &wm_delete, 1);
  XMapWindow(dpy, win);
  XEvent e;
  XWindowEvent(dpy, win, ExposureMask, &e);
  XSelectInput(dpy, win,
               KeyPressMask | ButtonPressMask | ButtonReleaseMask |
                   PointerMotionMask);
  Bool done = False;
  struct timespec prev, curr;
  clock_gettime(CLOCK_MONOTONIC_RAW, &curr);
  prev.tv_sec = curr.tv_sec;
  prev.tv_nsec = curr.tv_nsec;
  double mill_store = 0;
  KeySym event_key_0, event_key_1, lookup_keysym;
  char *key_0_string = NULL, *key_1_string = NULL, lookup_buffer[20];
  int lookup_buffer_size = 20, charcount = 0;
  Bool chatting = False;
  Atom wm_state = XInternAtom(dpy, "_NET_WM_STATE", False);
  Atom fullscreen = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
  XEvent window_change_event;
  memset(&window_change_event, 0, sizeof(window_change_event));
  window_change_event.type = ClientMessage;
  window_change_event.xclient.window = win;
  window_change_event.xclient.message_type = wm_state;
  window_change_event.xclient.format = 32;
  window_change_event.xclient.data.l[0] = 2;
  window_change_event.xclient.data.l[1] = fullscreen;
  window_change_event.xclient.data.l[2] = 0;
  while (!done) {
    clock_gettime(CLOCK_MONOTONIC_RAW, &curr);
    mill_store += timespec_diff(&curr, &prev);
    while (XPending(dpy) > 0) {
      XNextEvent(dpy, &e);
      switch (e.type) {
      case ClientMessage:
        if (e.xclient.message_type == wm_protocol) {
          if (e.xclient.data.l[0] == wm_delete) {
            done = True;
          }
        }
        break;
      case KeyPress:
        charcount = XLookupString(&(e.xkey), lookup_buffer, lookup_buffer_size,
                                  &lookup_keysym, NULL);
        event_key_0 = XLookupKeysym(&(e.xkey), 0);
        event_key_1 = XLookupKeysym(&(e.xkey), 1);
        key_0_string = XKeysymToString(event_key_0);
        key_1_string = XKeysymToString(event_key_1);
        if (XK_Return == event_key_0) {
          if (chatting) {
            printf("\n-Done Chatting-\n");
            chatting = False;
          } else {
            printf("Message: \n");
            chatting = True;
          }
        } else if (event_key_0 == XK_Escape) {
          done = True;
          printf("Pressed Escape, quitting.\n");
          continue;
        } else if (XK_q == event_key_0 && e.xkey.state & ControlMask) {
          done = True;
          printf("Pressed Ctrl+q, quitting.\n");
          continue;
        } else if (XK_F11 == event_key_0) {
          XSendEvent(dpy, DefaultRootWindow(dpy), False,
                     SubstructureRedirectMask | SubstructureNotifyMask,
                     &window_change_event);
          XFlush(dpy);
        }
        if (chatting) {
          printf("%s", lookup_buffer);
        } else {
          printf("Key pressed: %s - %s", key_0_string, key_1_string);
          if (e.xkey.state & ShiftMask) {
            printf(" | Shift");
          }
          if (e.xkey.state & LockMask) {
            printf(" | Lock");
          }
          if (e.xkey.state & ControlMask) {
            printf(" | Ctrl");
          }
          if (e.xkey.state & Mod1Mask) {
            printf(" | Alt");
          }
          if (e.xkey.state & Mod2Mask) {
            printf(" | Num Lock");
          }
          if (e.xkey.state & Mod3Mask) {
            printf(" | Mod3");
          }
          if (e.xkey.state & Mod4Mask) {
            printf(" | Mod4");
          }
          if (e.xkey.state & Mod5Mask) {
            printf(" | Mod5");
          }
          if (IsCursorKey(event_key_0)) {
            printf(" | Cursor Key (0)");
          }
          if (IsCursorKey(event_key_1)) {
            printf(" | Cursor Key (1)");
          }
          if (IsFunctionKey(event_key_0)) {
            printf(" | Function key (0)");
          }
          if (IsFunctionKey(event_key_1)) {
            printf(" | Function key (1)");
          }
          if (IsKeypadKey(event_key_0)) {
            printf(" | keypad (0)");
          }
          if (IsKeypadKey(event_key_1)) {
            printf(" | keypad (1)");
          }
          if (IsMiscFunctionKey(event_key_0)) {
            printf(" | Fn (0)");
          }
          if (IsMiscFunctionKey(event_key_1)) {
            printf(" | Fn (1)");
          }
          if (IsModifierKey(event_key_0)) {
            printf(" | Modifier (0)");
          }
          if (IsModifierKey(event_key_1)) {
            printf(" | Modifier (1)");
          }
          printf("\n");
        }
        break;
      case ButtonPress:
        printf("Button %d press at %d,%d\n", e.xbutton.button, e.xbutton.x,
               e.xbutton.y);
        if (e.xbutton.button == 1 && e.xbutton.x >= sub_x &&
            e.xbutton.x < sub_x + 30 && e.xbutton.y >= sub_y &&
            e.xbutton.y < sub_y + 30) {
          moving_square = True;
          move_offset_x = e.xbutton.x - sub_x;
          move_offset_y = e.xbutton.y - sub_y;
          printf("Clicked in the square!\n");
        }
        break;
      case ButtonRelease:
        printf("Button %d released at %d,%d\n", e.xbutton.button, e.xbutton.x,
               e.xbutton.y);
        if (e.xbutton.button == 1 && moving_square) {
          moving_square = False;
          sub_x = e.xbutton.x - move_offset_x;
          sub_y = e.xbutton.y - move_offset_y;
          move_offset_x = 0;
          move_offset_y = 0;
        }
        break;
      case MotionNotify:
        if (moving_square) {
          sub_x = e.xmotion.x - move_offset_x;
          sub_y = e.xmotion.y - move_offset_y;
        }
        break;
      }
    }
    if (mill_store > 16.6 && !done) {
      for (; mill_store > 16.6 && !done; mill_store -= 16.6) {
      }
      XMoveWindow(dpy, sub, sub_x, sub_y);
    }
    prev.tv_sec = curr.tv_sec;
    prev.tv_nsec = curr.tv_nsec;
    if (mill_store < 16.6 && !done) {
      struct timespec sleep_required, sleep_remaining;
      int was_error = 0;
      sleep_remaining.tv_sec = mill_store / 1000.0;
      sleep_remaining.tv_nsec = ((int)mill_store % 1000) * 1000000;
      do {
        sleep_required.tv_sec = sleep_remaining.tv_sec;
        sleep_required.tv_nsec = sleep_remaining.tv_nsec;
        errno = 0;
        was_error = nanosleep(&sleep_required, &sleep_remaining);
      } while (was_error == -1 && errno == EINTR);
    }
  }
  XFree(sizehints);
  sizehints = NULL;
  XFree(wmhints);
  wmhints = NULL;
  XDestroyWindow(dpy, win);
  XCloseDisplay(dpy);
  dpy = NULL;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   2140 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    2372 <main+0x42>
mov    0x3bd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    301c <main+0xcec>
mov    -0x18(%rbp),%rax
mov    %rax,-0x1c0(%rbp)
mov    -0x18(%rbp),%rdi
call   2230 <DefaultScreen@plt>
mov    -0x1c0(%rbp),%rdi
mov    %eax,%esi
call   21e0 <BlackPixel@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x1b8(%rbp)
mov    -0x18(%rbp),%rdi
call   2090 <DefaultRootWindow@plt>
mov    -0x1b8(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%r10
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    $0x320,%r8d
mov    $0x258,%r9d
mov    %ecx,%edx
movl   $0x0,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   21c0 <XCreateSimpleWindow@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   2170 <XAllocWMHints@plt>
mov    %rax,-0x30(%rbp)
mov    0x3bd8(%rip),%rax
mov    (%rax),%ecx
mov    0x3bf7(%rip),%rax
or     (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    0x3b80(%rip),%rax
mov    (%rax),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    0x3b0e(%rip),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    $0x0,%al
call   2160 <XAllocSizeHints@plt>
mov    %rax,-0x38(%rbp)
mov    0x3ad3(%rip),%rax
mov    (%rax),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
movl   $0x190,0x4(%rax)
mov    -0x38(%rbp),%rax
movl   $0x12c,0x8(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x38(%rbp),%r10
mov    -0x30(%rbp),%rax
lea    0x1bb3(%rip),%rdx
lea    0x1c16(%rip),%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   2130 <Xutf8SetWMProperties@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x3a7d(%rip),%rax
mov    (%rax),%edx
call   21b0 <XSelectInput@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x1b0(%rbp)
mov    -0x18(%rbp),%rdi
call   2230 <DefaultScreen@plt>
mov    -0x1b0(%rbp),%rdi
mov    %eax,%esi
call   20e0 <WhitePixel@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x40(%rbp),%r10
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    $0x14,%r9d
mov    %ecx,%edx
mov    %r9d,%r8d
movl   $0x5,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   21c0 <XCreateSimpleWindow@plt>
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    0x3a9e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   2200 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
mov    0x3a4a(%rip),%rax
mov    (%rax),%rdx
lea    0x1add(%rip),%rsi
call   2190 <XInternAtom@plt>
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x3a2c(%rip),%rax
mov    (%rax),%rdx
lea    0x1acc(%rip),%rsi
call   2190 <XInternAtom@plt>
mov    %rax,-0x70(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x70(%rbp),%rdx
mov    $0x1,%ecx
call   2150 <XSetWMProtocols@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   2200 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x397a(%rip),%rax
mov    (%rax),%edx
lea    -0xb0(%rbp),%rcx
call   2210 <XWindowEvent@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x39de(%rip),%rax
mov    (%rax),%edx
mov    0x39dd(%rip),%rax
or     (%rax),%edx
mov    0x3994(%rip),%rax
or     (%rax),%edx
mov    0x3a03(%rip),%rax
or     (%rax),%edx
call   21b0 <XSelectInput@plt>
mov    0x39cd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xb8(%rbp)
mov    0x398c(%rip),%rax
mov    (%rax),%edi
lea    -0xd8(%rbp),%rsi
call   2070 <clock_gettime@plt>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0xd0(%rbp),%eax
mov    %eax,-0xc0(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movq   $0x0,-0xf8(%rbp)
movq   $0x0,-0x100(%rbp)
movl   $0x14,-0x124(%rbp)
movl   $0x0,-0x128(%rbp)
mov    0x3956(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x130(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x3941(%rip),%rax
mov    (%rax),%rdx
lea    0x19ca(%rip),%rsi
call   2190 <XInternAtom@plt>
mov    %rax,-0x138(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x3920(%rip),%rax
mov    (%rax),%rdx
lea    0x19b7(%rip),%rsi
call   2190 <XInternAtom@plt>
mov    %rax,-0x140(%rbp)
lea    -0x180(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   20f0 <memset@plt>
movl   $0x82,-0x180(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x148(%rbp)
mov    -0x138(%rbp),%rax
mov    %rax,-0x160(%rbp)
movl   $0x20,-0x158(%rbp)
mov    -0x150(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x140(%rbp),%rax
mov    %eax,%ecx
mov    -0x150(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x150(%rbp),%rax
movl   $0x0,0x8(%rax)
cmpq   $0x0,-0xb8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    2734 <main+0x404>
jmp    2fd1 <main+0xca1>
mov    0x384d(%rip),%rax
mov    (%rax),%edi
lea    -0xd8(%rbp),%rsi
call   2070 <clock_gettime@plt>
lea    -0xd8(%rbp),%rdi
lea    -0xc8(%rbp),%rsi
call   2220 <timespec_diff@plt>
cvtsi2sd %rax,%xmm0
addsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0x18(%rbp),%rdi
call   2080 <XPending@plt>
cmp    $0x0,%rax
jle    2e15 <main+0xae5>
mov    -0x18(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   2180 <XNextEvent@plt>
mov    -0xb0(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x1c8(%rbp)
sub    $0x4,%eax
ja     2e10 <main+0xae0>
mov    -0x1c8(%rbp),%rax
lea    0x1853(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x90(%rbp),%rax
cmp    -0x68(%rbp),%rax
jne    27fe <main+0x4ce>
mov    -0x80(%rbp),%rax
movslq (%rax),%rax
cmp    -0x70(%rbp),%rax
jne    27f9 <main+0x4c9>
mov    0x37a1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xb8(%rbp)
jmp    27fe <main+0x4ce>
jmp    2e10 <main+0xae0>
lea    -0xb0(%rbp),%rdi
add    $0x18,%rdi
lea    -0x120(%rbp),%rsi
mov    -0x124(%rbp),%edx
lea    -0xec(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   2050 <XLookupString@plt>
mov    %eax,-0x128(%rbp)
lea    -0xb0(%rbp),%rdi
add    $0x18,%rdi
xor    %esi,%esi
call   21a0 <XLookupKeysym@plt>
mov    %eax,-0xe4(%rbp)
lea    -0xb0(%rbp),%rdi
add    $0x18,%rdi
mov    $0x1,%esi
call   21a0 <XLookupKeysym@plt>
mov    %eax,-0xe8(%rbp)
mov    -0xe4(%rbp),%edi
call   2250 <XKeysymToString@plt>
mov    %rax,-0xf8(%rbp)
mov    -0xe8(%rbp),%edi
call   2250 <XKeysymToString@plt>
mov    %rax,-0x100(%rbp)
mov    0x3660(%rip),%rax
mov    (%rax),%eax
cmp    -0xe4(%rbp),%eax
jne    28f4 <main+0x5c4>
cmpq   $0x0,-0x130(%rbp)
je     28d0 <main+0x5a0>
lea    0x17bf(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    0x36f7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x130(%rbp)
jmp    28ef <main+0x5bf>
lea    0x17ad(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    0x36ab(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x130(%rbp)
jmp    29f0 <main+0x6c0>
mov    -0xe4(%rbp),%eax
mov    0x364f(%rip),%rcx
cmp    (%rcx),%eax
jne    292d <main+0x5fd>
mov    0x3680(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xb8(%rbp)
lea    0x176e(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2771 <main+0x441>
mov    0x3664(%rip),%rax
mov    (%rax),%eax
cmp    -0xe4(%rbp),%eax
jne    297e <main+0x64e>
mov    -0x98(%rbp),%eax
mov    0x3671(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     297e <main+0x64e>
mov    0x362f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xb8(%rbp)
lea    0x1738(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2771 <main+0x441>
mov    0x35eb(%rip),%rax
mov    (%rax),%eax
cmp    -0xe4(%rbp),%eax
jne    29e1 <main+0x6b1>
mov    -0x18(%rbp),%rax
mov    %rax,-0x1d0(%rbp)
mov    -0x18(%rbp),%rdi
call   2090 <DefaultRootWindow@plt>
mov    -0x1d0(%rbp),%rdi
mov    %eax,%esi
mov    0x3601(%rip),%rax
mov    (%rax),%rdx
mov    0x3597(%rip),%rax
mov    (%rax),%ecx
mov    0x354e(%rip),%rax
or     (%rax),%ecx
lea    -0x180(%rbp),%r8
call   2030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   21f0 <XFlush@plt>
jmp    29e6 <main+0x6b6>
jmp    29eb <main+0x6bb>
jmp    29f0 <main+0x6c0>
cmpq   $0x0,-0x130(%rbp)
je     2a18 <main+0x6e8>
lea    -0x120(%rbp),%rsi
lea    0x16cb(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2cc6 <main+0x996>
mov    -0xf8(%rbp),%rsi
mov    -0x100(%rbp),%rdx
lea    0x1698(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x3587(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2a5a <main+0x72a>
lea    0x1687(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x34e1(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2a80 <main+0x750>
lea    0x166a(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x3533(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2aa6 <main+0x776>
lea    0x164c(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x34fd(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2acc <main+0x79c>
lea    0x162e(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x342f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2af2 <main+0x7c2>
lea    0x160f(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x3481(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2b18 <main+0x7e8>
lea    0x15f5(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x34c3(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2b3e <main+0x80e>
lea    0x15d7(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    0x33ad(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2b64 <main+0x834>
lea    0x15b9(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe4(%rbp),%edi
call   21d0 <IsCursorKey@plt>
cmp    $0x0,%eax
je     2b86 <main+0x856>
lea    0x159f(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe8(%rbp),%edi
call   21d0 <IsCursorKey@plt>
cmp    $0x0,%eax
je     2ba8 <main+0x878>
lea    0x158f(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe4(%rbp),%edi
call   2060 <IsFunctionKey@plt>
cmp    $0x0,%eax
je     2bca <main+0x89a>
lea    0x157f(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe8(%rbp),%edi
call   2060 <IsFunctionKey@plt>
cmp    $0x0,%eax
je     2bec <main+0x8bc>
lea    0x1571(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe4(%rbp),%edi
call   2120 <IsKeypadKey@plt>
cmp    $0x0,%eax
je     2c0e <main+0x8de>
lea    0x1563(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe8(%rbp),%edi
call   2120 <IsKeypadKey@plt>
cmp    $0x0,%eax
je     2c30 <main+0x900>
lea    0x154f(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe4(%rbp),%edi
call   2100 <IsMiscFunctionKey@plt>
cmp    $0x0,%eax
je     2c52 <main+0x922>
lea    0x153b(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe8(%rbp),%edi
call   2100 <IsMiscFunctionKey@plt>
cmp    $0x0,%eax
je     2c74 <main+0x944>
lea    0x1523(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe4(%rbp),%edi
call   2040 <IsModifierKey@plt>
cmp    $0x0,%eax
je     2c96 <main+0x966>
lea    0x150b(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xe8(%rbp),%edi
call   2040 <IsModifierKey@plt>
cmp    $0x0,%eax
je     2cb8 <main+0x988>
lea    0x14f9(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
lea    0x13ce(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2e10 <main+0xae0>
mov    -0xa4(%rbp),%esi
mov    -0xa0(%rbp),%edx
mov    -0x9c(%rbp),%ecx
lea    0x14d6(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
cmpl   $0x1,-0xa4(%rbp)
jne    2d72 <main+0xa42>
mov    -0xa0(%rbp),%eax
cmp    -0x48(%rbp),%eax
jl     2d72 <main+0xa42>
mov    -0xa0(%rbp),%eax
mov    -0x48(%rbp),%ecx
add    $0x1e,%ecx
cmp    %ecx,%eax
jge    2d72 <main+0xa42>
mov    -0x9c(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jl     2d72 <main+0xa42>
mov    -0x9c(%rbp),%eax
mov    -0x4c(%rbp),%ecx
add    $0x1e,%ecx
cmp    %ecx,%eax
jge    2d72 <main+0xa42>
mov    0x324b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0xa0(%rbp),%eax
sub    -0x48(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x9c(%rbp),%eax
sub    -0x4c(%rbp),%eax
mov    %eax,-0x60(%rbp)
lea    0x1469(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2e10 <main+0xae0>
mov    -0xa4(%rbp),%esi
mov    -0xa0(%rbp),%edx
mov    -0x9c(%rbp),%ecx
lea    0x145c(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
cmpl   $0x1,-0xa4(%rbp)
jne    2de3 <main+0xab3>
cmpq   $0x0,-0x58(%rbp)
je     2de3 <main+0xab3>
mov    0x3202(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0xa0(%rbp),%eax
sub    -0x5c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x9c(%rbp),%eax
sub    -0x60(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
jmp    2e10 <main+0xae0>
cmpq   $0x0,-0x58(%rbp)
je     2e0b <main+0xadb>
mov    -0xa8(%rbp),%eax
sub    -0x5c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0xac(%rbp),%eax
sub    -0x60(%rbp),%eax
mov    %eax,-0x4c(%rbp)
jmp    2e10 <main+0xae0>
jmp    2771 <main+0x441>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  0x11db(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    2ec2 <main+0xb92>
cmpq   $0x0,-0xb8(%rbp)
jne    2ec2 <main+0xb92>
jmp    2e42 <main+0xb12>
movsd  -0xe0(%rbp),%xmm0
ff
xor    %eax,%eax
movsd  0x11ac(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x1d1(%rbp)
jbe    2e77 <main+0xb47>
cmpq   $0x0,-0xb8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x1d1(%rbp)
mov    -0x1d1(%rbp),%al
test   $0x1,%al
jne    2e8a <main+0xb5a>
jmp    2eb0 <main+0xb80>
jmp    2e8f <main+0xb5f>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  0x1161(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    2e42 <main+0xb12>
mov    -0x18(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x4c(%rbp),%ecx
call   20c0 <XMoveWindow@plt>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0xd0(%rbp),%eax
mov    %eax,-0xc0(%rbp)
movsd  0x111a(%rip),%xmm0
ucomisd -0xe0(%rbp),%xmm0
ff
jbe    2fcc <main+0xc9c>
cmpq   $0x0,-0xb8(%rbp)
jne    2fcc <main+0xc9c>
movl   $0x0,-0x1a4(%rbp)
movsd  -0xe0(%rbp),%xmm0
ff
movsd  0x10ec(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1a0(%rbp)
ff
cvttsd2si -0xe0(%rbp),%eax
ff
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0x198(%rbp)
movsd  -0x1a0(%rbp),%xmm0
ff
movsd  %xmm0,-0x190(%rbp)
ff
mov    -0x198(%rbp),%eax
mov    %eax,-0x188(%rbp)
mov    0x2ff9(%rip),%rax
movq   $0x0,(%rax)
lea    -0x190(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
call   20d0 <nanosleep@plt>
mov    %eax,-0x1a4(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x1a4(%rbp)
mov    %al,-0x1d2(%rbp)
jne    2fb9 <main+0xc89>
mov    0x2fbd(%rip),%rax
mov    (%rax),%rax
mov    0x2f8b(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x1d2(%rbp)
mov    -0x1d2(%rbp),%al
test   $0x1,%al
jne    2f44 <main+0xc14>
jmp    2fcc <main+0xc9c>
jmp    271a <main+0x3ea>
mov    -0x38(%rbp),%rdi
call   20b0 <XFree@plt>
movq   $0x0,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   20b0 <XFree@plt>
movq   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   2110 <XDestroyWindow@plt>
mov    -0x18(%rbp),%rdi
call   2240 <XCloseDisplay@plt>
movq   $0x0,-0x18(%rbp)
mov    0x2f11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
xor    %edi,%edi
call   2160 <XOpenDisplay@plt>
test   %rax,%rax
je     2654 <main+0x304>
mov    %rax,%r15
mov    %rax,%rdi
call   2250 <DefaultScreen@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   2200 <BlackPixel@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   20b0 <DefaultRootWindow@plt>
sub    $0x8,%rsp
mov    %r15,%rdi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x320,%r8d
mov    $0x258,%r9d
push   %rbx
push   %rbx
push   $0x0
call   21e0 <XCreateSimpleWindow@plt>
add    $0x20,%rsp
mov    %eax,%r13d
xor    %eax,%eax
call   2190 <XAllocWMHints@plt>
mov    0x2c08(%rip),%rcx
mov    0x2c29(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    %rax,%rbp
mov    %edx,(%rax)
mov    0x2bb1(%rip),%r12
mov    (%r12),%rax
mov    %rax,0x10(%rbp)
mov    0x2b42(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rbp)
xor    %eax,%eax
call   2180 <XAllocSizeHints@plt>
mov    0x2b0f(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
movabs $0x12c00000190,%rcx
mov    %rcx,0x4(%rax)
sub    $0x8,%rsp
lea    0xc0e(%rip),%rdx
lea    0xd80(%rip),%rcx
mov    %r15,%rdi
mov    %r13d,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
mov    %rbp,0xe0(%rsp)
push   %rbp
mov    %rax,0xe0(%rsp)
push   %rax
call   2150 <Xutf8SetWMProperties@plt>
add    $0x20,%rsp
mov    0x2acb(%rip),%r14
mov    (%r14),%edx
mov    %r15,%rdi
mov    %r13d,%esi
call   21d0 <XSelectInput@plt>
mov    %r15,%rdi
call   2250 <DefaultScreen@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   2100 <WhitePixel@plt>
sub    $0x8,%rsp
mov    %r15,%rdi
mov    %r13d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x14,%r8d
mov    $0x14,%r9d
push   %rbx
push   %rax
push   $0x5
call   21e0 <XCreateSimpleWindow@plt>
add    $0x20,%rsp
mov    0x2b15(%rip),%rbp
mov    0x0(%rbp),%rcx
mov    %rcx,0x10(%rsp)
mov    %r15,%rdi
mov    %eax,0x3c(%rsp)
mov    %eax,%esi
call   2220 <XMapWindow@plt>
mov    (%r12),%rdx
lea    0xb70(%rip),%rsi
mov    %r15,%rdi
call   21b0 <XInternAtom@plt>
mov    %rax,0xd8(%rsp)
mov    (%r12),%rdx
lea    0xb62(%rip),%rsi
mov    %r15,%rdi
call   21b0 <XInternAtom@plt>
mov    %rax,0xb0(%rsp)
lea    0xb0(%rsp),%rdx
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x1,%ecx
call   2170 <XSetWMProtocols@plt>
mov    %r15,%rdi
mov    %r13d,%esi
call   2220 <XMapWindow@plt>
mov    (%r14),%edx
lea    0x40(%rsp),%rcx
mov    %r15,%rdi
mov    %r13d,%esi
call   2230 <XWindowEvent@plt>
mov    0x2a73(%rip),%rax
mov    0x2a74(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2a29(%rip),%rax
or     (%rax),%edx
mov    0x2a98(%rip),%rax
or     (%rax),%edx
mov    %r15,%rdi
mov    %r13d,%esi
call   21d0 <XSelectInput@plt>
mov    0x0(%rbp),%rbx
mov    0x2a28(%rip),%rax
mov    (%rax),%edi
lea    0xa0(%rsp),%rsi
call   2090 <clock_gettime@plt>
movsd  0xa0(%rsp),%xmm0
movsd  %xmm0,0xb8(%rsp)
mov    0xa8(%rsp),%eax
mov    %eax,0xc0(%rsp)
mov    0x0(%rbp),%rdx
lea    0xab9(%rip),%rsi
mov    %r15,%rdi
mov    %rdx,0x18(%rsp)
call   21b0 <XInternAtom@plt>
mov    %rax,%r14
mov    0x0(%rbp),%rdx
lea    0xaac(%rip),%rsi
mov    %r15,%rdi
call   21b0 <XInternAtom@plt>
mov    %rax,%r12
lea    0xf0(%rsp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   2110 <memset@plt>
movl   $0x82,0xf0(%rsp)
mov    %r13d,0x38(%rsp)
mov    %r13d,0x128(%rsp)
mov    %r14,0x110(%rsp)
movl   $0x20,0x118(%rsp)
mov    0x120(%rsp),%rax
movl   $0x2,(%rax)
mov    %r12d,0x4(%rax)
movl   $0x0,0x8(%rax)
test   %rbx,%rbx
je     266f <main+0x31f>
mov    0xc8(%rsp),%rdi
call   20d0 <XFree@plt>
mov    0xd0(%rsp),%rdi
call   20d0 <XFree@plt>
mov    %r15,%rdi
mov    0x38(%rsp),%esi
call   2130 <XDestroyWindow@plt>
mov    %r15,%rdi
call   2260 <XCloseDisplay@plt>
mov    0x28d6(%rip),%rax
jmp    265b <main+0x30b>
mov    0x28e5(%rip),%rax
mov    (%rax),%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xorpd  %xmm1,%xmm1
xor    %eax,%eax
mov    %rax,0x30(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
jmp    26af <main+0x35f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  0x20(%rsp),%xmm1
test   %r12,%r12
jne    261d <main+0x2cd>
movsd  %xmm1,0x20(%rsp)
mov    0x28cc(%rip),%rax
mov    (%rax),%edi
lea    0xa0(%rsp),%rbp
mov    %rbp,%rsi
call   2090 <clock_gettime@plt>
mov    %rbp,%rdi
lea    0xb8(%rsp),%rsi
call   2240 <timespec_diff@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0xe0(%rsp)
mov    %r15,%rdi
call   20a0 <XPending@plt>
xor    %r12d,%r12d
jmp    2717 <main+0x3c7>
nopl   0x0(%rax)
mov    0x2889(%rip),%rax
mov    (%rax),%r12
call   2080 <puts@plt>
mov    %r15,%rdi
call   20a0 <XPending@plt>
test   %rax,%rax
jle    2c30 <main+0x8e0>
mov    %r15,%rdi
lea    0x40(%rsp),%rsi
call   21a0 <XNextEvent@plt>
mov    0x40(%rsp),%eax
cmp    $0x81,%eax
jne    2a43 <main+0x6f3>
mov    %r12,%r14
lea    0x58(%rsp),%rbx
mov    %rbx,%rdi
lea    0x130(%rsp),%rsi
mov    $0x14,%edx
lea    0xec(%rsp),%rcx
xor    %r8d,%r8d
call   2060 <XLookupString@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   21c0 <XLookupKeysym@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
call   21c0 <XLookupKeysym@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   2270 <XKeysymToString@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   2270 <XKeysymToString@plt>
mov    %rax,%r13
mov    0x2756(%rip),%rax
cmp    %ebp,(%rax)
je     2bbd <main+0x86d>
lea    0xa2e(%rip),%rdi
mov    0x27a0(%rip),%rax
cmp    (%rax),%ebp
je     2700 <main+0x3b0>
mov    0x27d9(%rip),%rax
cmp    %ebp,(%rax)
jne    27dd <main+0x48d>
mov    0x27f6(%rip),%rax
mov    (%rax),%eax
lea    0x9ea(%rip),%rdi
test   %eax,0x58(%rsp)
jne    2700 <main+0x3b0>
mov    0x278c(%rip),%rax
cmp    %ebp,(%rax)
jne    2826 <main+0x4d6>
mov    %r15,%rdi
call   20b0 <DefaultRootWindow@plt>
mov    0x27c1(%rip),%rcx
mov    (%rcx),%rdx
mov    0x2717(%rip),%rcx
mov    (%rcx),%ecx
mov    0x274e(%rip),%rsi
or     (%rsi),%ecx
mov    %r15,%rdi
mov    %eax,%esi
lea    0xf0(%rsp),%r8
call   2030 <XSendEvent@plt>
mov    %r15,%rdi
call   2210 <XFlush@plt>
mov    0x18(%rsp),%rax
test   %rax,%rax
jne    2c05 <main+0x8b5>
lea    0x83f(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x2775(%rip),%rcx
test   %eax,(%rcx)
je     2869 <main+0x519>
lea    0x831(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x26d8(%rip),%rcx
test   %eax,(%rcx)
je     2886 <main+0x536>
lea    0x81d(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x2733(%rip),%rcx
test   %eax,(%rcx)
mov    %r14,%r12
je     28a6 <main+0x556>
lea    0x805(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x2703(%rip),%rcx
test   %eax,(%rcx)
je     28c3 <main+0x573>
lea    0x7f0(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x263e(%rip),%rcx
test   %eax,(%rcx)
je     28e0 <main+0x590>
lea    0x7da(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x2699(%rip),%rcx
test   %eax,(%rcx)
je     28fd <main+0x5ad>
lea    0x7c9(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x26e4(%rip),%rcx
test   %eax,(%rcx)
je     291a <main+0x5ca>
lea    0x7b4(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x58(%rsp),%eax
mov    0x25d7(%rip),%rcx
test   %eax,(%rcx)
je     2933 <main+0x5e3>
lea    0x79f(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebp,%edi
call   21f0 <IsCursorKey@plt>
test   %eax,%eax
je     294c <main+0x5fc>
lea    0x78e(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   21f0 <IsCursorKey@plt>
test   %eax,%eax
je     2965 <main+0x615>
lea    0x787(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebp,%edi
call   2070 <IsFunctionKey@plt>
test   %eax,%eax
je     297e <main+0x62e>
lea    0x780(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2070 <IsFunctionKey@plt>
test   %eax,%eax
je     2997 <main+0x647>
lea    0x77b(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebp,%edi
call   2140 <IsKeypadKey@plt>
test   %eax,%eax
je     29b0 <main+0x660>
lea    0x776(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2140 <IsKeypadKey@plt>
test   %eax,%eax
je     29c9 <main+0x679>
lea    0x76b(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebp,%edi
call   2120 <IsMiscFunctionKey@plt>
test   %eax,%eax
je     29e2 <main+0x692>
lea    0x760(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2120 <IsMiscFunctionKey@plt>
test   %eax,%eax
je     29fb <main+0x6ab>
lea    0x751(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebp,%edi
call   2050 <IsModifierKey@plt>
test   %eax,%eax
je     2a14 <main+0x6c4>
lea    0x742(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2050 <IsModifierKey@plt>
test   %eax,%eax
je     2a2d <main+0x6dd>
lea    0x739(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    $0xa,%edi
call   2040 <putchar@plt>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    270f <main+0x3bf>
add    $0xffffff80,%eax
cmp    $0x4,%eax
ja     270f <main+0x3bf>
lea    0x5c2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpq   $0x0,0x10(%rsp)
je     2bda <main+0x88a>
mov    0x44(%rsp),%ecx
mov    0x48(%rsp),%eax
sub    0xc(%rsp),%eax
mov    %rax,0x30(%rsp)
sub    0x8(%rsp),%ecx
mov    %rcx,0x28(%rsp)
jmp    270f <main+0x3bf>
mov    0xd8(%rsp),%rax
cmp    %rax,0x60(%rsp)
jne    270f <main+0x3bf>
mov    0x70(%rsp),%rax
movslq (%rax),%rax
cmp    %rax,0xb0(%rsp)
jne    270f <main+0x3bf>
mov    0x24d6(%rip),%rax
mov    (%rax),%r12
jmp    270f <main+0x3bf>
mov    0x4c(%rsp),%esi
mov    0x50(%rsp),%edx
mov    0x54(%rsp),%ecx
lea    0x6b4(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
cmpl   $0x1,0x4c(%rsp)
jne    270f <main+0x3bf>
cmpq   $0x0,0x10(%rsp)
je     270f <main+0x3bf>
mov    0x24be(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
mov    0x50(%rsp),%eax
mov    0x54(%rsp),%ecx
sub    0xc(%rsp),%eax
mov    %rax,0x30(%rsp)
sub    0x8(%rsp),%ecx
mov    %rcx,0x28(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
jmp    270f <main+0x3bf>
mov    0x4c(%rsp),%esi
mov    0x50(%rsp),%edx
mov    0x54(%rsp),%ecx
lea    0x62b(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
cmpl   $0x1,0x4c(%rsp)
jne    270f <main+0x3bf>
mov    0x50(%rsp),%eax
mov    %eax,%ebp
mov    0x30(%rsp),%rcx
sub    %ecx,%ebp
jl     270f <main+0x3bf>
add    $0x1e,%ecx
cmp    %ecx,%eax
jge    270f <main+0x3bf>
mov    0x54(%rsp),%eax
mov    %eax,%r14d
mov    0x28(%rsp),%rcx
sub    %ecx,%r14d
jl     270f <main+0x3bf>
add    $0x1e,%ecx
cmp    %ecx,%eax
jge    270f <main+0x3bf>
mov    0x23f5(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
lea    0x5fc(%rip),%rdi
call   2080 <puts@plt>
mov    %ebp,0xc(%rsp)
mov    %r14d,0x8(%rsp)
jmp    270f <main+0x3bf>
cmpq   $0x0,0x18(%rsp)
je     2be6 <main+0x896>
lea    0x62f(%rip),%rdi
call   2080 <puts@plt>
mov    0x23e0(%rip),%rax
jmp    2bf9 <main+0x8a9>
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    270f <main+0x3bf>
lea    0x604(%rip),%rdi
call   2080 <puts@plt>
mov    0x2397(%rip),%rax
mov    (%rax),%rax
test   %rax,%rax
je     2834 <main+0x4e4>
mov    %rax,0x18(%rsp)
lea    0x47b(%rip),%rdi
lea    0x130(%rsp),%rsi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %r14,%r12
jmp    270f <main+0x3bf>
nopl   0x0(%rax,%rax,1)
movsd  0x20(%rsp),%xmm1
addsd  0xe0(%rsp),%xmm1
movsd  0x3b9(%rip),%xmm2
ucomisd %xmm2,%xmm1
jbe    2c94 <main+0x944>
test   %r12,%r12
jne    2c94 <main+0x944>
movsd  0x3ae(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
addsd  %xmm0,%xmm1
ucomisd %xmm2,%xmm1
ja     2c60 <main+0x910>
mov    %r15,%rdi
mov    0x3c(%rsp),%esi
mov    0x30(%rsp),%rdx
mov    0x28(%rsp),%rcx
movsd  %xmm1,0x20(%rsp)
call   20e0 <XMoveWindow@plt>
movsd  0x372(%rip),%xmm2
movsd  0x20(%rsp),%xmm1
mov    0x22c5(%rip),%rsi
movsd  0xa0(%rsp),%xmm0
movsd  %xmm0,0xb8(%rsp)
mov    0xa8(%rsp),%eax
mov    %eax,0xc0(%rsp)
ucomisd %xmm1,%xmm2
jbe    26a6 <main+0x356>
test   %r12,%r12
jne    26a6 <main+0x356>
movapd %xmm1,%xmm0
divsd  0x336(%rip),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  %xmm1,0x20(%rsp)
cvttsd2si %xmm1,%eax
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x88(%rsp)
movsd  %xmm0,0x90(%rsp)
mov    %eax,0x98(%rsp)
movq   $0x0,(%rsi)
nop
lea    0x90(%rsp),%rdi
lea    0x80(%rsp),%rsi
call   20f0 <nanosleep@plt>
mov    0x2214(%rip),%rcx
cmp    $0xffffffff,%eax
jne    26a0 <main+0x350>
mov    0x21dc(%rip),%rax
mov    (%rax),%rax
cmp    %rax,(%rcx)
jne    26a0 <main+0x350>
movsd  0x80(%rsp),%xmm0
mov    0x88(%rsp),%eax
movsd  %xmm0,0x90(%rsp)
mov    %eax,0x98(%rsp)
movq   $0x0,(%rcx)
jmp    2d30 <main+0x9e0>

LLVM IR (-O0):
%struct.TYPE_24__ = type { i32, i32, i32, i32, i8* }
%struct.TYPE_25__ = type { i32, %struct.TYPE_23__, %struct.TYPE_22__, %struct.TYPE_19__, %struct.TYPE_21__ }
%struct.TYPE_23__ = type { i32, i32 }
%struct.TYPE_22__ = type { i32, i32, i32 }
%struct.TYPE_19__ = type { i32 }
%struct.TYPE_21__ = type { i8*, i32, %struct.TYPE_20__, i32 }
%struct.TYPE_20__ = type { i32* }
%struct.timespec = type { double, i32 }
@EXIT_FAILURE = global i32 0
@InputHint = global i32 0
@StateHint = global i32 0
@True = global i8* null
@NormalState = global i32 0
@PMinSize = global i32 0
@.str = [9 x i8] c"Phase 01\00"
@.str.1 = [1 x i8] zeroinitializer
@ExposureMask = global i32 0
@False = global i8* null
@.str.2 = [13 x i8] c"WM_PROTOCOLS\00"
@.str.3 = [17 x i8] c"WM_DELETE_WINDOW\00"
@KeyPressMask = global i32 0
@ButtonPressMask = global i32 0
@ButtonReleaseMask = global i32 0
@PointerMotionMask = global i32 0
@CLOCK_MONOTONIC_RAW = global i32 0
@.str.4 = [14 x i8] c"_NET_WM_STATE\00"
@.str.5 = [25 x i8] c"_NET_WM_STATE_FULLSCREEN\00"
@XK_Return = global i32 0
@.str.6 = [18 x i8] c"\0A-Done Chatting-\0A\00"
@.str.7 = [11 x i8] c"Message: \0A\00"
@XK_Escape = global i32 0
@.str.8 = [27 x i8] c"Pressed Escape, quitting.\0A\00"
@XK_q = global i32 0
@ControlMask = global i32 0
@.str.9 = [27 x i8] c"Pressed Ctrl+q, quitting.\0A\00"
@XK_F11 = global i32 0
@SubstructureRedirectMask = global i32 0
@SubstructureNotifyMask = global i32 0
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [21 x i8] c"Key pressed: %s - %s\00"
@ShiftMask = global i32 0
@.str.12 = [9 x i8] c" | Shift\00"
@LockMask = global i32 0
@.str.13 = [8 x i8] c" | Lock\00"
@.str.14 = [8 x i8] c" | Ctrl\00"
@Mod1Mask = global i32 0
@.str.15 = [7 x i8] c" | Alt\00"
@Mod2Mask = global i32 0
@.str.16 = [12 x i8] c" | Num Lock\00"
@Mod3Mask = global i32 0
@.str.17 = [8 x i8] c" | Mod3\00"
@Mod4Mask = global i32 0
@.str.18 = [8 x i8] c" | Mod4\00"
@Mod5Mask = global i32 0
@.str.19 = [8 x i8] c" | Mod5\00"
@.str.20 = [18 x i8] c" | Cursor Key (0)\00"
@.str.21 = [18 x i8] c" | Cursor Key (1)\00"
@.str.22 = [20 x i8] c" | Function key (0)\00"
@.str.23 = [20 x i8] c" | Function key (1)\00"
@.str.24 = [14 x i8] c" | keypad (0)\00"
@.str.25 = [14 x i8] c" | keypad (1)\00"
@.str.26 = [10 x i8] c" | Fn (0)\00"
@.str.27 = [10 x i8] c" | Fn (1)\00"
@.str.28 = [16 x i8] c" | Modifier (0)\00"
@.str.29 = [16 x i8] c" | Modifier (1)\00"
@.str.30 = [2 x i8] c"\0A\00"
@.str.31 = [26 x i8] c"Button %d press at %d,%d\0A\00"
@.str.32 = [24 x i8] c"Clicked in the square!\0A\00"
@.str.33 = [29 x i8] c"Button %d released at %d,%d\0A\00"
@errno = global i64 0
@EINTR = global i64 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
%9 = alloca %struct.TYPE_24__*
%10 = alloca %struct.TYPE_24__*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca %struct.TYPE_25__
%21 = alloca i8*
%22 = alloca %struct.timespec
%23 = alloca %struct.timespec
%24 = alloca double
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i8*
%29 = alloca i8*
%30 = alloca [20 x i8]
%31 = alloca i32
%32 = alloca i32
%33 = alloca i8*
%34 = alloca i8*
%35 = alloca i8*
%36 = alloca %struct.TYPE_25__
%37 = alloca %struct.timespec
%38 = alloca %struct.timespec
%39 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%40 = call i32* @XOpenDisplay(i32* null)
store i32* %40, i32** %6
%41 = load i32*, i32** %6
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %45
43: ; preds = %2
%44 = load i32, i32* @EXIT_FAILURE
store i32 %44, i32* %3
br label %596
45: ; preds = %2
%46 = load i32*, i32** %6
%47 = load i32*, i32** %6
%48 = call i32 @DefaultScreen(i32* %47)
%49 = call i64 @BlackPixel(i32* %46, i32 %48)
store i64 %49, i64* %7
%50 = load i32*, i32** %6
%51 = load i32*, i32** %6
%52 = call i32 @DefaultRootWindow(i32* %51)
%53 = load i64, i64* %7
%54 = load i64, i64* %7
%55 = call i32 @XCreateSimpleWindow(i32* %50, i32 %52, i32 0, i32 0, i32 800, i32 600, i32 0, i64 %53, i64 %54)
store i32 %55, i32* %8
%56 = call %struct.TYPE_24__* (...) @XAllocWMHints()
store %struct.TYPE_24__* %56, %struct.TYPE_24__** %9
%57 = load i32, i32* @InputHint
%58 = load i32, i32* @StateHint
%59 = or i32 %57, %58
%60 = load %struct.TYPE_24__*, %struct.TYPE_24__** %9
%61 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %60, i32 0, i32 0
store i32 %59, i32* %61
%62 = load i8*, i8** @True
%63 = load %struct.TYPE_24__*, %struct.TYPE_24__** %9
%64 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %63, i32 0, i32 4
store i8* %62, i8** %64
%65 = load i32, i32* @NormalState
%66 = load %struct.TYPE_24__*, %struct.TYPE_24__** %9
%67 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %66, i32 0, i32 3
store i32 %65, i32* %67
%68 = call %struct.TYPE_24__* (...) @XAllocSizeHints()
store %struct.TYPE_24__* %68, %struct.TYPE_24__** %10
%69 = load i32, i32* @PMinSize
%70 = load %struct.TYPE_24__*, %struct.TYPE_24__** %10
%71 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %70, i32 0, i32 0
store i32 %69, i32* %71
%72 = load %struct.TYPE_24__*, %struct.TYPE_24__** %10
%73 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %72, i32 0, i32 1
store i32 400, i32* %73
%74 = load %struct.TYPE_24__*, %struct.TYPE_24__** %10
%75 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %74, i32 0, i32 2
store i32 300, i32* %75
%76 = load i32*, i32** %6
%77 = load i32, i32* %8
%78 = load %struct.TYPE_24__*, %struct.TYPE_24__** %10
%79 = load %struct.TYPE_24__*, %struct.TYPE_24__** %9
%80 = call i32 @Xutf8SetWMProperties(i32* %76, i32 %77, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32* null, i32 0, %struct.TYPE_24__* %78, %struct.TYPE_24__* %79, i32* null)
%81 = load i32*, i32** %6
%82 = load i32, i32* %8
%83 = load i32, i32* @ExposureMask
%84 = call i32 @XSelectInput(i32* %81, i32 %82, i32 %83)
%85 = load i32*, i32** %6
%86 = load i32*, i32** %6
%87 = call i32 @DefaultScreen(i32* %86)
%88 = call i64 @WhitePixel(i32* %85, i32 %87)
store i64 %88, i64* %11
%89 = load i32*, i32** %6
%90 = load i32, i32* %8
%91 = load i64, i64* %11
%92 = load i64, i64* %7
%93 = call i32 @XCreateSimpleWindow(i32* %89, i32 %90, i32 0, i32 0, i32 20, i32 20, i32 5, i64 %91, i64 %92)
store i32 %93, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
%94 = load i8*, i8** @False
store i8* %94, i8** %15
store i32 0, i32* %16
store i32 0, i32* %17
%95 = load i32*, i32** %6
%96 = load i32, i32* %12
%97 = call i32 @XMapWindow(i32* %95, i32 %96)
%98 = load i32*, i32** %6
%99 = load i8*, i8** @True
%100 = call i8* @XInternAtom(i32* %98, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %99)
store i8* %100, i8** %18
%101 = load i32*, i32** %6
%102 = load i8*, i8** @True
%103 = call i8* @XInternAtom(i32* %101, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %102)
store i8* %103, i8** %19
%104 = load i32*, i32** %6
%105 = load i32, i32* %8
%106 = call i32 @XSetWMProtocols(i32* %104, i32 %105, i8** %19, i32 1)
%107 = load i32*, i32** %6
%108 = load i32, i32* %8
%109 = call i32 @XMapWindow(i32* %107, i32 %108)
%110 = load i32*, i32** %6
%111 = load i32, i32* %8
%112 = load i32, i32* @ExposureMask
%113 = call i32 @XWindowEvent(i32* %110, i32 %111, i32 %112, %struct.TYPE_25__* %20)
%114 = load i32*, i32** %6
%115 = load i32, i32* %8
%116 = load i32, i32* @KeyPressMask
%117 = load i32, i32* @ButtonPressMask
%118 = or i32 %116, %117
%119 = load i32, i32* @ButtonReleaseMask
%120 = or i32 %118, %119
%121 = load i32, i32* @PointerMotionMask
%122 = or i32 %120, %121
%123 = call i32 @XSelectInput(i32* %114, i32 %115, i32 %122)
%124 = load i8*, i8** @False
store i8* %124, i8** %21
%125 = load i32, i32* @CLOCK_MONOTONIC_RAW
%126 = call i32 @clock_gettime(i32 %125, %struct.timespec* %23)
%127 = getelementptr inbounds %struct.timespec, %struct.timespec* %23, i32 0, i32 0
%128 = load double, double* %127
%129 = getelementptr inbounds %struct.timespec, %struct.timespec* %22, i32 0, i32 0
store double %128, double* %129
%130 = getelementptr inbounds %struct.timespec, %struct.timespec* %23, i32 0, i32 1
%131 = load i32, i32* %130
%132 = getelementptr inbounds %struct.timespec, %struct.timespec* %22, i32 0, i32 1
store i32 %131, i32* %132
store double 0.000000e+00, double* %24
store i8* null, i8** %28
store i8* null, i8** %29
store i32 20, i32* %31
store i32 0, i32* %32
%133 = load i8*, i8** @False
store i8* %133, i8** %33
%134 = load i32*, i32** %6
%135 = load i8*, i8** @False
%136 = call i8* @XInternAtom(i32* %134, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %135)
store i8* %136, i8** %34
%137 = load i32*, i32** %6
%138 = load i8*, i8** @False
%139 = call i8* @XInternAtom(i32* %137, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %138)
store i8* %139, i8** %35
%140 = call i32 @memset(%struct.TYPE_25__* %36, i32 0, i32 64)
%141 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %36, i32 0, i32 0
store i32 130, i32* %141
%142 = load i32, i32* %8
%143 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %36, i32 0, i32 4
%144 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %143, i32 0, i32 3
store i32 %142, i32* %144
%145 = load i8*, i8** %34
%146 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %36, i32 0, i32 4
%147 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %146, i32 0, i32 0
store i8* %145, i8** %147
%148 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %36, i32 0, i32 4
%149 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %148, i32 0, i32 1
store i32 32, i32* %149
%150 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %36, i32 0, i32 4
%151 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %150, i32 0, i32 2
%152 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %151, i32 0, i32 0
%153 = load i32*, i32** %152
%154 = getelementptr inbounds i32, i32* %153, i64 0
store i32 2, i32* %154
%155 = load i8*, i8** %35
%156 = ptrtoint i8* %155 to i32
%157 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %36, i32 0, i32 4
%158 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %157, i32 0, i32 2
%159 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %158, i32 0, i32 0
%160 = load i32*, i32** %159
%161 = getelementptr inbounds i32, i32* %160, i64 1
store i32 %156, i32* %161
%162 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %36, i32 0, i32 4
%163 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %162, i32 0, i32 2
%164 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %163, i32 0, i32 0
%165 = load i32*, i32** %164
%166 = getelementptr inbounds i32, i32* %165, i64 2
store i32 0, i32* %166
br label %167
167: ; preds = %584, %45
%168 = load i8*, i8** %21
%169 = icmp ne i8* %168, null
%170 = xor i1 %169, true
br i1 %170, label %171, label %585
171: ; preds = %167
%172 = load i32, i32* @CLOCK_MONOTONIC_RAW
%173 = call i32 @clock_gettime(i32 %172, %struct.timespec* %23)
%174 = call i64 @timespec_diff(%struct.timespec* %23, %struct.timespec* %22)
%175 = sitofp i64 %174 to double
%176 = load double, double* %24
%177 = fadd double %176, %175
store double %177, double* %24
br label %178
178: ; preds = %518, %252, %238, %171
%179 = load i32*, i32** %6
%180 = call i64 @XPending(i32* %179)
%181 = icmp sgt i64 %180, 0
br i1 %181, label %182, label %519
182: ; preds = %178
%183 = load i32*, i32** %6
%184 = call i32 @XNextEvent(i32* %183, %struct.TYPE_25__* %20)
%185 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 0
%186 = load i32, i32* %185
switch i32 %186, label %518 [
i32 130, label %187
i32 129, label %208
i32 132, label %417
i32 131, label %472
i32 128, label %503
]
187: ; preds = %182
%188 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 4
%189 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %188, i32 0, i32 0
%190 = load i8*, i8** %189
%191 = load i8*, i8** %18
%192 = icmp eq i8* %190, %191
br i1 %192, label %193, label %207
193: ; preds = %187
%194 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 4
%195 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %194, i32 0, i32 2
%196 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %195, i32 0, i32 0
%197 = load i32*, i32** %196
%198 = getelementptr inbounds i32, i32* %197, i64 0
%199 = load i32, i32* %198
%200 = sext i32 %199 to i64
%201 = inttoptr i64 %200 to i8*
%202 = load i8*, i8** %19
%203 = icmp eq i8* %201, %202
br i1 %203, label %204, label %206
204: ; preds = %193
%205 = load i8*, i8** @True
store i8* %205, i8** %21
br label %206
206: ; preds = %204, %193
br label %207
207: ; preds = %206, %187
br label %518
208: ; preds = %182
%209 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%210 = getelementptr inbounds [20 x i8], [20 x i8]* %30, i64 0, i64 0
%211 = load i32, i32* %31
%212 = call i32 @XLookupString(%struct.TYPE_19__* %209, i8* %210, i32 %211, i32* %27, i32* null)
store i32 %212, i32* %32
%213 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%214 = call i32 @XLookupKeysym(%struct.TYPE_19__* %213, i32 0)
store i32 %214, i32* %25
%215 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%216 = call i32 @XLookupKeysym(%struct.TYPE_19__* %215, i32 1)
store i32 %216, i32* %26
%217 = load i32, i32* %25
%218 = call i8* @XKeysymToString(i32 %217)
store i8* %218, i8** %28
%219 = load i32, i32* %26
%220 = call i8* @XKeysymToString(i32 %219)
store i8* %220, i8** %29
%221 = load i32, i32* @XK_Return
%222 = load i32, i32* %25
%223 = icmp eq i32 %221, %222
br i1 %223, label %224, label %234
224: ; preds = %208
%225 = load i8*, i8** %33
%226 = icmp ne i8* %225, null
br i1 %226, label %227, label %230
227: ; preds = %224
%228 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%229 = load i8*, i8** @False
store i8* %229, i8** %33
br label %233
230: ; preds = %224
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%232 = load i8*, i8** @True
store i8* %232, i8** %33
br label %233
233: ; preds = %230, %227
br label %273
234: ; preds = %208
%235 = load i32, i32* %25
%236 = load i32, i32* @XK_Escape
%237 = icmp eq i32 %235, %236
br i1 %237, label %238, label %241
238: ; preds = %234
%239 = load i8*, i8** @True
store i8* %239, i8** %21
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
br label %178
241: ; preds = %234
%242 = load i32, i32* @XK_q
%243 = load i32, i32* %25
%244 = icmp eq i32 %242, %243
br i1 %244, label %245, label %255
245: ; preds = %241
%246 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%247 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %246, i32 0, i32 0
%248 = load i32, i32* %247
%249 = load i32, i32* @ControlMask
%250 = and i32 %248, %249
%251 = icmp ne i32 %250, 0
br i1 %251, label %252, label %255
252: ; preds = %245
%253 = load i8*, i8** @True
store i8* %253, i8** %21
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %178
255: ; preds = %245, %241
%256 = load i32, i32* @XK_F11
%257 = load i32, i32* %25
%258 = icmp eq i32 %256, %257
br i1 %258, label %259, label %270
259: ; preds = %255
%260 = load i32*, i32** %6
%261 = load i32*, i32** %6
%262 = call i32 @DefaultRootWindow(i32* %261)
%263 = load i8*, i8** @False
%264 = load i32, i32* @SubstructureRedirectMask
%265 = load i32, i32* @SubstructureNotifyMask
%266 = or i32 %264, %265
%267 = call i32 @XSendEvent(i32* %260, i32 %262, i8* %263, i32 %266, %struct.TYPE_25__* %36)
%268 = load i32*, i32** %6
%269 = call i32 @XFlush(i32* %268)
br label %270
270: ; preds = %259, %255
br label %271
271: ; preds = %270
br label %272
272: ; preds = %271
br label %273
273: ; preds = %272, %233
%274 = load i8*, i8** %33
%275 = icmp ne i8* %274, null
br i1 %275, label %276, label %279
276: ; preds = %273
%277 = getelementptr inbounds [20 x i8], [20 x i8]* %30, i64 0, i64 0
%278 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %277)
br label %416
279: ; preds = %273
%280 = load i8*, i8** %28
%281 = load i8*, i8** %29
%282 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %280, i8* %281)
%283 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%284 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %283, i32 0, i32 0
%285 = load i32, i32* %284
%286 = load i32, i32* @ShiftMask
%287 = and i32 %285, %286
%288 = icmp ne i32 %287, 0
br i1 %288, label %289, label %291
289: ; preds = %279
%290 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
br label %291
291: ; preds = %289, %279
%292 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%293 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %292, i32 0, i32 0
%294 = load i32, i32* %293
%295 = load i32, i32* @LockMask
%296 = and i32 %294, %295
%297 = icmp ne i32 %296, 0
br i1 %297, label %298, label %300
298: ; preds = %291
%299 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
br label %300
300: ; preds = %298, %291
%301 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%302 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %301, i32 0, i32 0
%303 = load i32, i32* %302
%304 = load i32, i32* @ControlMask
%305 = and i32 %303, %304
%306 = icmp ne i32 %305, 0
br i1 %306, label %307, label %309
307: ; preds = %300
%308 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
br label %309
309: ; preds = %307, %300
%310 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%311 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %310, i32 0, i32 0
%312 = load i32, i32* %311
%313 = load i32, i32* @Mod1Mask
%314 = and i32 %312, %313
%315 = icmp ne i32 %314, 0
br i1 %315, label %316, label %318
316: ; preds = %309
%317 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %318
318: ; preds = %316, %309
%319 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%320 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %319, i32 0, i32 0
%321 = load i32, i32* %320
%322 = load i32, i32* @Mod2Mask
%323 = and i32 %321, %322
%324 = icmp ne i32 %323, 0
br i1 %324, label %325, label %327
325: ; preds = %318
%326 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
br label %327
327: ; preds = %325, %318
%328 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%329 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %328, i32 0, i32 0
%330 = load i32, i32* %329
%331 = load i32, i32* @Mod3Mask
%332 = and i32 %330, %331
%333 = icmp ne i32 %332, 0
br i1 %333, label %334, label %336
334: ; preds = %327
%335 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %336
336: ; preds = %334, %327
%337 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%338 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %337, i32 0, i32 0
%339 = load i32, i32* %338
%340 = load i32, i32* @Mod4Mask
%341 = and i32 %339, %340
%342 = icmp ne i32 %341, 0
br i1 %342, label %343, label %345
343: ; preds = %336
%344 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
br label %345
345: ; preds = %343, %336
%346 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 3
%347 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %346, i32 0, i32 0
%348 = load i32, i32* %347
%349 = load i32, i32* @Mod5Mask
%350 = and i32 %348, %349
%351 = icmp ne i32 %350, 0
br i1 %351, label %352, label %354
352: ; preds = %345
%353 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %354
354: ; preds = %352, %345
%355 = load i32, i32* %25
%356 = call i32 @IsCursorKey(i32 %355)
%357 = icmp ne i32 %356, 0
br i1 %357, label %358, label %360
358: ; preds = %354
%359 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0))
br label %360
360: ; preds = %358, %354
%361 = load i32, i32* %26
%362 = call i32 @IsCursorKey(i32 %361)
%363 = icmp ne i32 %362, 0
br i1 %363, label %364, label %366
364: ; preds = %360
%365 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0))
br label %366
366: ; preds = %364, %360
%367 = load i32, i32* %25
%368 = call i32 @IsFunctionKey(i32 %367)
%369 = icmp ne i32 %368, 0
br i1 %369, label %370, label %372
370: ; preds = %366
%371 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
br label %372
372: ; preds = %370, %366
%373 = load i32, i32* %26
%374 = call i32 @IsFunctionKey(i32 %373)
%375 = icmp ne i32 %374, 0
br i1 %375, label %376, label %378
376: ; preds = %372
%377 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0))
br label %378
378: ; preds = %376, %372
%379 = load i32, i32* %25
%380 = call i32 @IsKeypadKey(i32 %379)
%381 = icmp ne i32 %380, 0
br i1 %381, label %382, label %384
382: ; preds = %378
%383 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0))
br label %384
384: ; preds = %382, %378
%385 = load i32, i32* %26
%386 = call i32 @IsKeypadKey(i32 %385)
%387 = icmp ne i32 %386, 0
br i1 %387, label %388, label %390
388: ; preds = %384
%389 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0))
br label %390
390: ; preds = %388, %384
%391 = load i32, i32* %25
%392 = call i32 @IsMiscFunctionKey(i32 %391)
%393 = icmp ne i32 %392, 0
br i1 %393, label %394, label %396
394: ; preds = %390
%395 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0))
br label %396
396: ; preds = %394, %390
%397 = load i32, i32* %26
%398 = call i32 @IsMiscFunctionKey(i32 %397)
%399 = icmp ne i32 %398, 0
br i1 %399, label %400, label %402
400: ; preds = %396
%401 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i64 0, i64 0))
br label %402
402: ; preds = %400, %396
%403 = load i32, i32* %25
%404 = call i32 @IsModifierKey(i32 %403)
%405 = icmp ne i32 %404, 0
br i1 %405, label %406, label %408
406: ; preds = %402
%407 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
br label %408
408: ; preds = %406, %402
%409 = load i32, i32* %26
%410 = call i32 @IsModifierKey(i32 %409)
%411 = icmp ne i32 %410, 0
br i1 %411, label %412, label %414
412: ; preds = %408
%413 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i64 0, i64 0))
br label %414
414: ; preds = %412, %408
%415 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.30, i64 0, i64 0))
br label %416
416: ; preds = %414, %276
br label %518
417: ; preds = %182
%418 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%419 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %418, i32 0, i32 0
%420 = load i32, i32* %419
%421 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%422 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %421, i32 0, i32 1
%423 = load i32, i32* %422
%424 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%425 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %424, i32 0, i32 2
%426 = load i32, i32* %425
%427 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.31, i64 0, i64 0), i32 %420, i32 %423, i32 %426)
%428 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%429 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %428, i32 0, i32 0
%430 = load i32, i32* %429
%431 = icmp eq i32 %430, 1
br i1 %431, label %432, label %471
432: ; preds = %417
%433 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%434 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %433, i32 0, i32 1
%435 = load i32, i32* %434
%436 = load i32, i32* %13
%437 = icmp sge i32 %435, %436
br i1 %437, label %438, label %471
438: ; preds = %432
%439 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%440 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %439, i32 0, i32 1
%441 = load i32, i32* %440
%442 = load i32, i32* %13
%443 = add nsw i32 %442, 30
%444 = icmp slt i32 %441, %443
br i1 %444, label %445, label %471
445: ; preds = %438
%446 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%447 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %446, i32 0, i32 2
%448 = load i32, i32* %447
%449 = load i32, i32* %14
%450 = icmp sge i32 %448, %449
br i1 %450, label %451, label %471
451: ; preds = %445
%452 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%453 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %452, i32 0, i32 2
%454 = load i32, i32* %453
%455 = load i32, i32* %14
%456 = add nsw i32 %455, 30
%457 = icmp slt i32 %454, %456
br i1 %457, label %458, label %471
458: ; preds = %451
%459 = load i8*, i8** @True
store i8* %459, i8** %15
%460 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%461 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %460, i32 0, i32 1
%462 = load i32, i32* %461
%463 = load i32, i32* %13
%464 = sub nsw i32 %462, %463
store i32 %464, i32* %16
%465 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%466 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %465, i32 0, i32 2
%467 = load i32, i32* %466
%468 = load i32, i32* %14
%469 = sub nsw i32 %467, %468
store i32 %469, i32* %17
%470 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.32, i64 0, i64 0))
br label %471
471: ; preds = %458, %451, %445, %438, %432, %417
br label %518
472: ; preds = %182
%473 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%474 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %473, i32 0, i32 0
%475 = load i32, i32* %474
%476 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%477 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %476, i32 0, i32 1
%478 = load i32, i32* %477
%479 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%480 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %479, i32 0, i32 2
%481 = load i32, i32* %480
%482 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.33, i64 0, i64 0), i32 %475, i32 %478, i32 %481)
%483 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%484 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %483, i32 0, i32 0
%485 = load i32, i32* %484
%486 = icmp eq i32 %485, 1
br i1 %486, label %487, label %502
487: ; preds = %472
%488 = load i8*, i8** %15
%489 = icmp ne i8* %488, null
br i1 %489, label %490, label %502
490: ; preds = %487
%491 = load i8*, i8** @False
store i8* %491, i8** %15
%492 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%493 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %492, i32 0, i32 1
%494 = load i32, i32* %493
%495 = load i32, i32* %16
%496 = sub nsw i32 %494, %495
store i32 %496, i32* %13
%497 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 2
%498 = getelementptr inbounds %struct.TYPE_22__, %struct.TYPE_22__* %497, i32 0, i32 2
%499 = load i32, i32* %498
%500 = load i32, i32* %17
%501 = sub nsw i32 %499, %500
store i32 %501, i32* %14
store i32 0, i32* %16
store i32 0, i32* %17
br label %502
502: ; preds = %490, %487, %472
br label %518
503: ; preds = %182
%504 = load i8*, i8** %15
%505 = icmp ne i8* %504, null
br i1 %505, label %506, label %517
506: ; preds = %503
%507 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 1
%508 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %507, i32 0, i32 1
%509 = load i32, i32* %508
%510 = load i32, i32* %16
%511 = sub nsw i32 %509, %510
store i32 %511, i32* %13
%512 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %20, i32 0, i32 1
%513 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %512, i32 0, i32 0
%514 = load i32, i32* %513
%515 = load i32, i32* %17
%516 = sub nsw i32 %514, %515
store i32 %516, i32* %14
br label %517
517: ; preds = %506, %503
br label %518
518: ; preds = %182, %517, %502, %471, %416, %207
br label %178
519: ; preds = %178
%520 = load double, double* %24
%521 = fcmp ogt double %520, 1.660000e+01
br i1 %521, label %522, label %545
522: ; preds = %519
%523 = load i8*, i8** %21
%524 = icmp ne i8* %523, null
br i1 %524, label %545, label %525
525: ; preds = %522
br label %526
526: ; preds = %536, %525
%527 = load double, double* %24
%528 = fcmp ogt double %527, 1.660000e+01
br i1 %528, label %529, label %533
529: ; preds = %526
%530 = load i8*, i8** %21
%531 = icmp ne i8* %530, null
%532 = xor i1 %531, true
br label %533
533: ; preds = %529, %526
%534 = phi i1 [ false, %526 ], [ %532, %529 ]
br i1 %534, label %535, label %539
535: ; preds = %533
br label %536
536: ; preds = %535
%537 = load double, double* %24
%538 = fsub double %537, 1.660000e+01
store double %538, double* %24
br label %526
539: ; preds = %533
%540 = load i32*, i32** %6
%541 = load i32, i32* %12
%542 = load i32, i32* %13
%543 = load i32, i32* %14
%544 = call i32 @XMoveWindow(i32* %540, i32 %541, i32 %542, i32 %543)
br label %545
545: ; preds = %539, %522, %519
%546 = getelementptr inbounds %struct.timespec, %struct.timespec* %23, i32 0, i32 0
%547 = load double, double* %546
%548 = getelementptr inbounds %struct.timespec, %struct.timespec* %22, i32 0, i32 0
store double %547, double* %548
%549 = getelementptr inbounds %struct.timespec, %struct.timespec* %23, i32 0, i32 1
%550 = load i32, i32* %549
%551 = getelementptr inbounds %struct.timespec, %struct.timespec* %22, i32 0, i32 1
store i32 %550, i32* %551
%552 = load double, double* %24
%553 = fcmp olt double %552, 1.660000e+01
br i1 %553, label %554, label %584
554: ; preds = %545
%555 = load i8*, i8** %21
%556 = icmp ne i8* %555, null
br i1 %556, label %584, label %557
557: ; preds = %554
store i32 0, i32* %39
%558 = load double, double* %24
%559 = fdiv double %558, 1.000000e+03
%560 = getelementptr inbounds %struct.timespec, %struct.timespec* %38, i32 0, i32 0
store double %559, double* %560
%561 = load double, double* %24
%562 = fptosi double %561 to i32
%563 = srem i32 %562, 1000
%564 = mul nsw i32 %563, 1000000
%565 = getelementptr inbounds %struct.timespec, %struct.timespec* %38, i32 0, i32 1
store i32 %564, i32* %565
br label %566
566: ; preds = %581, %557
%567 = getelementptr inbounds %struct.timespec, %struct.timespec* %38, i32 0, i32 0
%568 = load double, double* %567
%569 = getelementptr inbounds %struct.timespec, %struct.timespec* %37, i32 0, i32 0
store double %568, double* %569
%570 = getelementptr inbounds %struct.timespec, %struct.timespec* %38, i32 0, i32 1
%571 = load i32, i32* %570
%572 = getelementptr inbounds %struct.timespec, %struct.timespec* %37, i32 0, i32 1
store i32 %571, i32* %572
store i64 0, i64* @errno
%573 = call i32 @nanosleep(%struct.timespec* %37, %struct.timespec* %38)
store i32 %573, i32* %39
br label %574
574: ; preds = %566
%575 = load i32, i32* %39
%576 = icmp eq i32 %575, -1
br i1 %576, label %577, label %581
577: ; preds = %574
%578 = load i64, i64* @errno
%579 = load i64, i64* @EINTR
%580 = icmp eq i64 %578, %579
br label %581
581: ; preds = %577, %574
%582 = phi i1 [ false, %574 ], [ %580, %577 ]
br i1 %582, label %566, label %583
583: ; preds = %581
br label %584
584: ; preds = %583, %554, %545
br label %167
585: ; preds = %167
%586 = load %struct.TYPE_24__*, %struct.TYPE_24__** %10
%587 = call i32 @XFree(%struct.TYPE_24__* %586)
store %struct.TYPE_24__* null, %struct.TYPE_24__** %10
%588 = load %struct.TYPE_24__*, %struct.TYPE_24__** %9
%589 = call i32 @XFree(%struct.TYPE_24__* %588)
store %struct.TYPE_24__* null, %struct.TYPE_24__** %9
%590 = load i32*, i32** %6
%591 = load i32, i32* %8
%592 = call i32 @XDestroyWindow(i32* %590, i32 %591)
%593 = load i32*, i32** %6
%594 = call i32 @XCloseDisplay(i32* %593)
store i32* null, i32** %6
%595 = load i32, i32* @EXIT_SUCCESS
store i32 %595, i32* %3
br label %596
596: ; preds = %585, %43
%597 = load i32, i32* %3
ret i32 %597
}

LLVM IR (-O2):
%struct.TYPE_25__ = type { i32, %struct.TYPE_23__, %struct.TYPE_22__, %struct.TYPE_19__, %struct.TYPE_21__ }
%struct.TYPE_23__ = type { i32, i32 }
%struct.TYPE_22__ = type { i32, i32, i32 }
%struct.TYPE_19__ = type { i32 }
%struct.TYPE_21__ = type { i8*, i32, %struct.TYPE_20__, i32 }
%struct.TYPE_20__ = type { i32* }
%struct.timespec = type { double, i32 }
%struct.TYPE_24__ = type { i32, i32, i32, i32, i8* }
@EXIT_FAILURE = global i32 0
@InputHint = global i32 0
@StateHint = global i32 0
@True = global i8* null
@NormalState = global i32 0
@PMinSize = global i32 0
@.str = [9 x i8] c"Phase 01\00"
@.str.1 = [1 x i8] zeroinitializer
@ExposureMask = global i32 0
@False = global i8* null
@.str.2 = [13 x i8] c"WM_PROTOCOLS\00"
@.str.3 = [17 x i8] c"WM_DELETE_WINDOW\00"
@KeyPressMask = global i32 0
@ButtonPressMask = global i32 0
@ButtonReleaseMask = global i32 0
@PointerMotionMask = global i32 0
@CLOCK_MONOTONIC_RAW = global i32 0
@.str.4 = [14 x i8] c"_NET_WM_STATE\00"
@.str.5 = [25 x i8] c"_NET_WM_STATE_FULLSCREEN\00"
@XK_Return = global i32 0
@XK_Escape = global i32 0
@XK_q = global i32 0
@ControlMask = global i32 0
@XK_F11 = global i32 0
@SubstructureRedirectMask = global i32 0
@SubstructureNotifyMask = global i32 0
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [21 x i8] c"Key pressed: %s - %s\00"
@ShiftMask = global i32 0
@.str.12 = [9 x i8] c" | Shift\00"
@LockMask = global i32 0
@.str.13 = [8 x i8] c" | Lock\00"
@.str.14 = [8 x i8] c" | Ctrl\00"
@Mod1Mask = global i32 0
@.str.15 = [7 x i8] c" | Alt\00"
@Mod2Mask = global i32 0
@.str.16 = [12 x i8] c" | Num Lock\00"
@Mod3Mask = global i32 0
@.str.17 = [8 x i8] c" | Mod3\00"
@Mod4Mask = global i32 0
@.str.18 = [8 x i8] c" | Mod4\00"
@Mod5Mask = global i32 0
@.str.19 = [8 x i8] c" | Mod5\00"
@.str.20 = [18 x i8] c" | Cursor Key (0)\00"
@.str.21 = [18 x i8] c" | Cursor Key (1)\00"
@.str.22 = [20 x i8] c" | Function key (0)\00"
@.str.23 = [20 x i8] c" | Function key (1)\00"
@.str.24 = [14 x i8] c" | keypad (0)\00"
@.str.25 = [14 x i8] c" | keypad (1)\00"
@.str.26 = [10 x i8] c" | Fn (0)\00"
@.str.27 = [10 x i8] c" | Fn (1)\00"
@.str.28 = [16 x i8] c" | Modifier (0)\00"
@.str.29 = [16 x i8] c" | Modifier (1)\00"
@.str.31 = [26 x i8] c"Button %d press at %d,%d\0A\00"
@.str.33 = [29 x i8] c"Button %d released at %d,%d\0A\00"
@errno = global i64 0
@EINTR = global i64 0
@EXIT_SUCCESS = global i32 0
@str = [23 x i8] c"Clicked in the square!\00"
@str.34 = [26 x i8] c"Pressed Ctrl+q, quitting.\00"
@str.35 = [26 x i8] c"Pressed Escape, quitting.\00"
@str.36 = [10 x i8] c"Message: \00"
@str.37 = [17 x i8] c"\0A-Done Chatting-\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca %struct.TYPE_25__
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca i32
%8 = alloca [20 x i8]
%9 = alloca %struct.TYPE_25__
%10 = alloca %struct.timespec
%11 = alloca %struct.timespec
%12 = tail call i32* @XOpenDisplay(i32* null)
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* @EXIT_FAILURE
br label %420
16: ; preds = %2
%17 = tail call i32 @DefaultScreen(i32* %12)
%18 = tail call i64 @BlackPixel(i32* %12, i32 %17)
%19 = tail call i32 @DefaultRootWindow(i32* %12)
%20 = tail call i32 @XCreateSimpleWindow(i32* %12, i32 %19, i32 0, i32 0, i32 800, i32 600, i32 0, i64 %18, i64 %18)
%21 = tail call %struct.TYPE_24__* (...) @XAllocWMHints()
%22 = load i32, i32* @InputHint
%23 = load i32, i32* @StateHint
%24 = or i32 %23, %22
%25 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %21, i64 0, i32 0
store i32 %24, i32* %25
%26 = load i8*, i8** @True
%27 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %21, i64 0, i32 4
store i8* %26, i8** %27
%28 = load i32, i32* @NormalState
%29 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %21, i64 0, i32 3
store i32 %28, i32* %29
%30 = tail call %struct.TYPE_24__* (...) @XAllocSizeHints()
%31 = load i32, i32* @PMinSize
%32 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %30, i64 0, i32 0
store i32 %31, i32* %32
%33 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %30, i64 0, i32 1
store i32 400, i32* %33
%34 = getelementptr inbounds %struct.TYPE_24__, %struct.TYPE_24__* %30, i64 0, i32 2
store i32 300, i32* %34
%35 = tail call i32 @Xutf8SetWMProperties(i32* %12, i32 %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32* null, i32 0, %struct.TYPE_24__* %30, %struct.TYPE_24__* %21, i32* null)
%36 = load i32, i32* @ExposureMask
%37 = tail call i32 @XSelectInput(i32* %12, i32 %20, i32 %36)
%38 = tail call i32 @DefaultScreen(i32* %12)
%39 = tail call i64 @WhitePixel(i32* %12, i32 %38)
%40 = tail call i32 @XCreateSimpleWindow(i32* %12, i32 %20, i32 0, i32 0, i32 20, i32 20, i32 5, i64 %39, i64 %18)
%41 = load i8*, i8** @False
%42 = tail call i32 @XMapWindow(i32* %12, i32 %40)
%43 = load i8*, i8** @True
%44 = tail call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %43)
%45 = bitcast i8** %3 to i8*
%46 = load i8*, i8** @True
%47 = tail call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %46)
store i8* %47, i8** %3
%48 = call i32 @XSetWMProtocols(i32* %12, i32 %20, i8** %3, i32 1)
%49 = call i32 @XMapWindow(i32* %12, i32 %20)
%50 = bitcast %struct.TYPE_25__* %4 to i8*
%51 = load i32, i32* @ExposureMask
%52 = call i32 @XWindowEvent(i32* %12, i32 %20, i32 %51, %struct.TYPE_25__* %4)
%53 = load i32, i32* @KeyPressMask
%54 = load i32, i32* @ButtonPressMask
%55 = or i32 %54, %53
%56 = load i32, i32* @ButtonReleaseMask
%57 = or i32 %55, %56
%58 = load i32, i32* @PointerMotionMask
%59 = or i32 %57, %58
%60 = call i32 @XSelectInput(i32* %12, i32 %20, i32 %59)
%61 = load i8*, i8** @False
%62 = bitcast %struct.timespec* %5 to i8*
%63 = bitcast %struct.timespec* %6 to i8*
%64 = load i32, i32* @CLOCK_MONOTONIC_RAW
%65 = call i32 @clock_gettime(i32 %64, %struct.timespec* %6)
%66 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i64 0, i32 0
%67 = load double, double* %66
%68 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 0
store double %67, double* %68
%69 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i64 0, i32 1
%70 = load i32, i32* %69
%71 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 1
store i32 %70, i32* %71
%72 = bitcast i32* %7 to i8*
%73 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%74 = load i8*, i8** @False
%75 = call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %74)
%76 = load i8*, i8** @False
%77 = call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %76)
%78 = bitcast %struct.TYPE_25__* %9 to i8*
%79 = call i32 @memset(%struct.TYPE_25__* %9, i32 0, i32 64)
%80 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %9, i64 0, i32 0
store i32 130, i32* %80
%81 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %9, i64 0, i32 4, i32 3
store i32 %20, i32* %81
%82 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %9, i64 0, i32 4, i32 0
store i8* %75, i8** %82
%83 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %9, i64 0, i32 4, i32 1
store i32 32, i32* %83
%84 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %9, i64 0, i32 4, i32 2, i32 0
%85 = load i32*, i32** %84
store i32 2, i32* %85
%86 = ptrtoint i8* %77 to i64
%87 = trunc i64 %86 to i32
%88 = getelementptr inbounds i32, i32* %85, i64 1
store i32 %87, i32* %88
%89 = getelementptr inbounds i32, i32* %85, i64 2
store i32 0, i32* %89
%90 = icmp eq i8* %61, null
br i1 %90, label %91, label %414
91: ; preds = %16
%92 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 0
%93 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 3
%94 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %93, i64 0, i32 0
%95 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 1, i32 1
%96 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 1, i32 0
%97 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 2, i32 0
%98 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 2, i32 1
%99 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 2, i32 2
%100 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 4, i32 0
%101 = getelementptr inbounds %struct.TYPE_25__, %struct.TYPE_25__* %4, i64 0, i32 4, i32 2, i32 0
%102 = bitcast %struct.timespec* %10 to i8*
%103 = bitcast %struct.timespec* %11 to i8*
%104 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i64 0, i32 0
%105 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i64 0, i32 1
%106 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i64 0, i32 0
%107 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i64 0, i32 1
br label %108
108: ; preds = %91, %412
%109 = phi i8* [ %74, %91 ], [ %374, %412 ]
%110 = phi double [ 0.000000e+00, %91 ], [ %386, %412 ]
%111 = phi i32 [ 0, %91 ], [ %373, %412 ]
%112 = phi i32 [ 0, %91 ], [ %372, %412 ]
%113 = phi i32 [ 0, %91 ], [ %371, %412 ]
%114 = phi i8* [ %41, %91 ], [ %370, %412 ]
%115 = phi i32 [ 0, %91 ], [ %369, %412 ]
%116 = load i32, i32* @CLOCK_MONOTONIC_RAW
%117 = call i32 @clock_gettime(i32 %116, %struct.timespec* %6)
%118 = call i64 @timespec_diff(%struct.timespec* %6, %struct.timespec* %5)
%119 = sitofp i64 %118 to double
%120 = fadd double %110, %119
%121 = call i64 @XPending(i32* %12)
%122 = icmp sgt i64 %121, 0
br i1 %122, label %123, label %368
123: ; preds = %108, %358
%124 = phi i8* [ %365, %358 ], [ %109, %108 ]
%125 = phi i8* [ %364, %358 ], [ null, %108 ]
%126 = phi i32 [ %363, %358 ], [ %111, %108 ]
%127 = phi i32 [ %362, %358 ], [ %112, %108 ]
%128 = phi i32 [ %361, %358 ], [ %113, %108 ]
%129 = phi i8* [ %360, %358 ], [ %114, %108 ]
%130 = phi i32 [ %359, %358 ], [ %115, %108 ]
br label %131
131: ; preds = %123, %166
%132 = phi i8* [ %125, %123 ], [ %168, %166 ]
%133 = call i32 @XNextEvent(i32* %12, %struct.TYPE_25__* %4)
%134 = load i32, i32* %92
switch i32 %134, label %358 [
i32 130, label %135
i32 129, label %147
i32 132, label %312
i32 131, label %336
i32 128, label %351
]
135: ; preds = %131
%136 = load i8*, i8** %100
%137 = icmp eq i8* %136, %44
br i1 %137, label %138, label %358
138: ; preds = %135
%139 = load i32*, i32** %101
%140 = load i32, i32* %139
%141 = sext i32 %140 to i64
%142 = inttoptr i64 %141 to i8*
%143 = load i8*, i8** %3
%144 = icmp eq i8* %143, %142
%145 = load i8*, i8** @True
%146 = select i1 %144, i8* %145, i8* %132
br label %358
147: ; preds = %131
%148 = call i32 @XLookupString(%struct.TYPE_19__* %93, i8* %73, i32 20, i32* %7, i32* null)
%149 = call i32 @XLookupKeysym(%struct.TYPE_19__* %93, i32 0)
%150 = call i32 @XLookupKeysym(%struct.TYPE_19__* %93, i32 1)
%151 = call i8* @XKeysymToString(i32 %149)
%152 = call i8* @XKeysymToString(i32 %150)
%153 = load i32, i32* @XK_Return
%154 = icmp eq i32 %153, %149
br i1 %154, label %155, label %163
155: ; preds = %147
%156 = icmp eq i8* %124, null
br i1 %156, label %160, label %157
157: ; preds = %155
%158 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.37, i64 0, i64 0))
%159 = load i8*, i8** @False
br label %191
160: ; preds = %155
%161 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.36, i64 0, i64 0))
%162 = load i8*, i8** @True
br label %191
163: ; preds = %147
%164 = load i32, i32* @XK_Escape
%165 = icmp eq i32 %149, %164
br i1 %165, label %166, label %172
166: ; preds = %163, %175
%167 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.34, i64 0, i64 0), %175 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.35, i64 0, i64 0), %163 ]
%168 = load i8*, i8** @True
%169 = call i32 @puts(i8* dereferenceable(1) %167)
%170 = call i64 @XPending(i32* %12)
%171 = icmp sgt i64 %170, 0
br i1 %171, label %131, label %368
172: ; preds = %163
%173 = load i32, i32* @XK_q
%174 = icmp eq i32 %173, %149
br i1 %174, label %175, label %180
175: ; preds = %172
%176 = load i32, i32* %94
%177 = load i32, i32* @ControlMask
%178 = and i32 %177, %176
%179 = icmp eq i32 %178, 0
br i1 %179, label %180, label %166
180: ; preds = %175, %172
%181 = load i32, i32* @XK_F11
%182 = icmp eq i32 %181, %149
br i1 %182, label %183, label %191
183: ; preds = %180
%184 = call i32 @DefaultRootWindow(i32* %12)
%185 = load i8*, i8** @False
%186 = load i32, i32* @SubstructureRedirectMask
%187 = load i32, i32* @SubstructureNotifyMask
%188 = or i32 %187, %186
%189 = call i32 @XSendEvent(i32* %12, i32 %184, i8* %185, i32 %188, %struct.TYPE_25__* %9)
%190 = call i32 @XFlush(i32* %12)
br label %191
191: ; preds = %180, %183, %157, %160
%192 = phi i8* [ %159, %157 ], [ %162, %160 ], [ %124, %183 ], [ %124, %180 ]
%193 = icmp eq i8* %192, null
br i1 %193, label %196, label %194
194: ; preds = %191
%195 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %73)
br label %358
196: ; preds = %191
%197 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %151, i8* %152)
%198 = load i32, i32* %94
%199 = load i32, i32* @ShiftMask
%200 = and i32 %199, %198
%201 = icmp eq i32 %200, 0
br i1 %201, label %205, label %202
202: ; preds = %196
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%204 = load i32, i32* %94
br label %205
205: ; preds = %202, %196
%206 = phi i32 [ %204, %202 ], [ %198, %196 ]
%207 = load i32, i32* @LockMask
%208 = and i32 %207, %206
%209 = icmp eq i32 %208, 0
br i1 %209, label %213, label %210
210: ; preds = %205
%211 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
%212 = load i32, i32* %94
br label %213
213: ; preds = %210, %205
%214 = phi i32 [ %212, %210 ], [ %206, %205 ]
%215 = load i32, i32* @ControlMask
%216 = and i32 %215, %214
%217 = icmp eq i32 %216, 0
br i1 %217, label %221, label %218
218: ; preds = %213
%219 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%220 = load i32, i32* %94
br label %221
221: ; preds = %218, %213
%222 = phi i32 [ %220, %218 ], [ %214, %213 ]
%223 = load i32, i32* @Mod1Mask
%224 = and i32 %223, %222
%225 = icmp eq i32 %224, 0
br i1 %225, label %229, label %226
226: ; preds = %221
%227 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%228 = load i32, i32* %94
br label %229
229: ; preds = %226, %221
%230 = phi i32 [ %228, %226 ], [ %222, %221 ]
%231 = load i32, i32* @Mod2Mask
%232 = and i32 %231, %230
%233 = icmp eq i32 %232, 0
br i1 %233, label %237, label %234
234: ; preds = %229
%235 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
%236 = load i32, i32* %94
br label %237
237: ; preds = %234, %229
%238 = phi i32 [ %236, %234 ], [ %230, %229 ]
%239 = load i32, i32* @Mod3Mask
%240 = and i32 %239, %238
%241 = icmp eq i32 %240, 0
br i1 %241, label %245, label %242
242: ; preds = %237
%243 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%244 = load i32, i32* %94
br label %245
245: ; preds = %242, %237
%246 = phi i32 [ %244, %242 ], [ %238, %237 ]
%247 = load i32, i32* @Mod4Mask
%248 = and i32 %247, %246
%249 = icmp eq i32 %248, 0
br i1 %249, label %253, label %250
250: ; preds = %245
%251 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%252 = load i32, i32* %94
br label %253
253: ; preds = %250, %245
%254 = phi i32 [ %252, %250 ], [ %246, %245 ]
%255 = load i32, i32* @Mod5Mask
%256 = and i32 %255, %254
%257 = icmp eq i32 %256, 0
br i1 %257, label %260, label %258
258: ; preds = %253
%259 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %260
260: ; preds = %258, %253
%261 = call i32 @IsCursorKey(i32 %149)
%262 = icmp eq i32 %261, 0
br i1 %262, label %265, label %263
263: ; preds = %260
%264 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0))
br label %265
265: ; preds = %263, %260
%266 = call i32 @IsCursorKey(i32 %150)
%267 = icmp eq i32 %266, 0
br i1 %267, label %270, label %268
268: ; preds = %265
%269 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0))
br label %270
270: ; preds = %268, %265
%271 = call i32 @IsFunctionKey(i32 %149)
%272 = icmp eq i32 %271, 0
br i1 %272, label %275, label %273
273: ; preds = %270
%274 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
br label %275
275: ; preds = %273, %270
%276 = call i32 @IsFunctionKey(i32 %150)
%277 = icmp eq i32 %276, 0
br i1 %277, label %280, label %278
278: ; preds = %275
%279 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0))
br label %280
280: ; preds = %278, %275
%281 = call i32 @IsKeypadKey(i32 %149)
%282 = icmp eq i32 %281, 0
br i1 %282, label %285, label %283
283: ; preds = %280
%284 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0))
br label %285
285: ; preds = %283, %280
%286 = call i32 @IsKeypadKey(i32 %150)
%287 = icmp eq i32 %286, 0
br i1 %287, label %290, label %288
288: ; preds = %285
%289 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0))
br label %290
290: ; preds = %288, %285
%291 = call i32 @IsMiscFunctionKey(i32 %149)
%292 = icmp eq i32 %291, 0
br i1 %292, label %295, label %293
293: ; preds = %290
%294 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0))
br label %295
295: ; preds = %293, %290
%296 = call i32 @IsMiscFunctionKey(i32 %150)
%297 = icmp eq i32 %296, 0
br i1 %297, label %300, label %298
298: ; preds = %295
%299 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i64 0, i64 0))
br label %300
300: ; preds = %298, %295
%301 = call i32 @IsModifierKey(i32 %149)
%302 = icmp eq i32 %301, 0
br i1 %302, label %305, label %303
303: ; preds = %300
%304 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
br label %305
305: ; preds = %303, %300
%306 = call i32 @IsModifierKey(i32 %150)
%307 = icmp eq i32 %306, 0
br i1 %307, label %310, label %308
308: ; preds = %305
%309 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i64 0, i64 0))
br label %310
310: ; preds = %308, %305
%311 = call i32 @putchar(i32 10)
br label %358
312: ; preds = %131
%313 = load i32, i32* %97
%314 = load i32, i32* %98
%315 = load i32, i32* %99
%316 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.31, i64 0, i64 0), i32 %313, i32 %314, i32 %315)
%317 = load i32, i32* %97
%318 = icmp eq i32 %317, 1
br i1 %318, label %319, label %358
319: ; preds = %312
%320 = load i32, i32* %98
%321 = icmp sge i32 %320, %126
%322 = add nsw i32 %126, 30
%323 = icmp slt i32 %320, %322
%324 = select i1 %321, i1 %323, i1 false
br i1 %324, label %325, label %358
325: ; preds = %319
%326 = load i32, i32* %99
%327 = icmp sge i32 %326, %130
%328 = add nsw i32 %130, 30
%329 = icmp slt i32 %326, %328
%330 = select i1 %327, i1 %329, i1 false
br i1 %330, label %331, label %358
331: ; preds = %325
%332 = load i8*, i8** @True
%333 = sub nsw i32 %320, %126
%334 = sub nsw i32 %326, %130
%335 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %358
336: ; preds = %131
%337 = load i32, i32* %97
%338 = load i32, i32* %98
%339 = load i32, i32* %99
%340 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.33, i64 0, i64 0), i32 %337, i32 %338, i32 %339)
%341 = load i32, i32* %97
%342 = icmp eq i32 %341, 1
%343 = icmp ne i8* %129, null
%344 = select i1 %342, i1 %343, i1 false
br i1 %344, label %345, label %358
345: ; preds = %336
%346 = load i8*, i8** @False
%347 = load i32, i32* %98
%348 = sub nsw i32 %347, %128
%349 = load i32, i32* %99
%350 = sub nsw i32 %349, %127
br label %358
351: ; preds = %131
%352 = icmp eq i8* %129, null
br i1 %352, label %358, label %353
353: ; preds = %351
%354 = load i32, i32* %95
%355 = sub nsw i32 %354, %128
%356 = load i32, i32* %96
%357 = sub nsw i32 %356, %127
br label %358
358: ; preds = %131, %138, %351, %353, %336, %345, %312, %319, %325, %331, %194, %310, %135
%359 = phi i32 [ %357, %353 ], [ %130, %351 ], [ %350, %345 ], [ %130, %336 ], [ %130, %331 ], [ %130, %325 ], [ %130, %319 ], [ %130, %312 ], [ %130, %194 ], [ %130, %310 ], [ %130, %135 ], [ %130, %138 ], [ %130, %131 ]
%360 = phi i8* [ %129, %353 ], [ null, %351 ], [ %346, %345 ], [ %129, %336 ], [ %332, %331 ], [ %129, %325 ], [ %129, %319 ], [ %129, %312 ], [ %129, %194 ], [ %129, %310 ], [ %129, %135 ], [ %129, %138 ], [ %129, %131 ]
%361 = phi i32 [ %128, %353 ], [ %128, %351 ], [ 0, %345 ], [ %128, %336 ], [ %333, %331 ], [ %128, %325 ], [ %128, %319 ], [ %128, %312 ], [ %128, %194 ], [ %128, %310 ], [ %128, %135 ], [ %128, %138 ], [ %128, %131 ]
%362 = phi i32 [ %127, %353 ], [ %127, %351 ], [ 0, %345 ], [ %127, %336 ], [ %334, %331 ], [ %127, %325 ], [ %127, %319 ], [ %127, %312 ], [ %127, %194 ], [ %127, %310 ], [ %127, %135 ], [ %127, %138 ], [ %127, %131 ]
%363 = phi i32 [ %355, %353 ], [ %126, %351 ], [ %348, %345 ], [ %126, %336 ], [ %126, %331 ], [ %126, %325 ], [ %126, %319 ], [ %126, %312 ], [ %126, %194 ], [ %126, %310 ], [ %126, %135 ], [ %126, %138 ], [ %126, %131 ]
%364 = phi i8* [ %132, %353 ], [ %132, %351 ], [ %132, %345 ], [ %132, %336 ], [ %132, %331 ], [ %132, %325 ], [ %132, %319 ], [ %132, %312 ], [ %132, %194 ], [ %132, %310 ], [ %132, %135 ], [ %146, %138 ], [ %132, %131 ]
%365 = phi i8* [ %124, %353 ], [ %124, %351 ], [ %124, %345 ], [ %124, %336 ], [ %124, %331 ], [ %124, %325 ], [ %124, %319 ], [ %124, %312 ], [ %192, %194 ], [ null, %310 ], [ %124, %135 ], [ %124, %138 ], [ %124, %131 ]
%366 = call i64 @XPending(i32* %12)
%367 = icmp sgt i64 %366, 0
br i1 %367, label %123, label %368
368: ; preds = %358, %166, %108
%369 = phi i32 [ %115, %108 ], [ %130, %166 ], [ %359, %358 ]
%370 = phi i8* [ %114, %108 ], [ %129, %166 ], [ %360, %358 ]
%371 = phi i32 [ %113, %108 ], [ %128, %166 ], [ %361, %358 ]
%372 = phi i32 [ %112, %108 ], [ %127, %166 ], [ %362, %358 ]
%373 = phi i32 [ %111, %108 ], [ %126, %166 ], [ %363, %358 ]
%374 = phi i8* [ %109, %108 ], [ %124, %166 ], [ %365, %358 ]
%375 = phi i8* [ null, %108 ], [ %168, %166 ], [ %364, %358 ]
%376 = fcmp ule double %120, 1.660000e+01
%377 = icmp ne i8* %375, null
%378 = select i1 %376, i1 true, i1 %377
br i1 %378, label %385, label %379
379: ; preds = %368, %379
%380 = phi double [ %381, %379 ], [ %120, %368 ]
%381 = fadd double %380, -1.660000e+01
%382 = fcmp ogt double %381, 1.660000e+01
br i1 %382, label %379, label %383
383: ; preds = %379
%384 = call i32 @XMoveWindow(i32* %12, i32 %40, i32 %373, i32 %369)
br label %385
385: ; preds = %383, %368
%386 = phi double [ %120, %368 ], [ %381, %383 ]
%387 = load double, double* %66
store double %387, double* %68
%388 = load i32, i32* %69
store i32 %388, i32* %71
%389 = fcmp uge double %386, 1.660000e+01
%390 = select i1 %389, i1 true, i1 %377
br i1 %390, label %412, label %391
391: ; preds = %385
%392 = fdiv double %386, 1.000000e+03
store double %392, double* %104
%393 = fptosi double %386 to i32
%394 = srem i32 %393, 1000
%395 = mul nsw i32 %394, 1000000
store i32 %395, i32* %105
store double %392, double* %106
store i32 %395, i32* %107
store i64 0, i64* @errno
%396 = call i32 @nanosleep(%struct.timespec* %10, %struct.timespec* %11)
%397 = icmp eq i32 %396, -1
%398 = load i64, i64* @errno
%399 = load i64, i64* @EINTR
%400 = icmp eq i64 %398, %399
%401 = select i1 %397, i1 %400, i1 false
br i1 %401, label %402, label %411
402: ; preds = %391, %402
%403 = load double, double* %104
%404 = load i32, i32* %105
store double %403, double* %106
store i32 %404, i32* %107
store i64 0, i64* @errno
%405 = call i32 @nanosleep(%struct.timespec* %10, %struct.timespec* %11)
%406 = icmp eq i32 %405, -1
%407 = load i64, i64* @errno
%408 = load i64, i64* @EINTR
%409 = icmp eq i64 %407, %408
%410 = select i1 %406, i1 %409, i1 false
br i1 %410, label %402, label %411
411: ; preds = %402, %391
br label %412
412: ; preds = %411, %385
%413 = icmp eq i8* %375, null
br i1 %413, label %108, label %414
414: ; preds = %412, %16
%415 = call i32 @XFree(%struct.TYPE_24__* %30)
%416 = call i32 @XFree(%struct.TYPE_24__* %21)
%417 = call i32 @XDestroyWindow(i32* %12, i32 %20)
%418 = call i32 @XCloseDisplay(i32* %12)
%419 = load i32, i32* @EXIT_SUCCESS
br label %420
420: ; preds = %414, %14
%421 = phi i32 [ %15, %14 ], [ %419, %414 ]
ret i32 %421
}