#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_21__ TYPE_5__;
typedef struct TYPE_20__ TYPE_3__;
typedef struct TYPE_19__ TYPE_2__;
typedef struct TYPE_18__ TYPE_1__;
typedef struct TYPE_17__ TYPE_12__;

/* Type definitions */
typedef int /*<<< orphan*/ window_change_event;
struct timespec {
  double tv_sec;
  int tv_nsec;
};
struct TYPE_20__ {
  int flags;
  int min_width;
  int min_height;
  int /*<<< orphan*/ initial_state;
  void *input;
};
typedef TYPE_3__ XWMHints;
typedef TYPE_3__ XSizeHints;
struct TYPE_17__ {
  int state;
};
struct TYPE_18__ {
  int *l;
};
struct TYPE_19__ {
  void *message_type;
  int format;
  TYPE_1__ data;
  int /*<<< orphan*/ window;
};
struct TYPE_21__ {
  int type;
  TYPE_12__ xkey;
  TYPE_2__ xclient;
};
typedef TYPE_5__ 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*/);
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
#define ClientMessage 129
int ControlMask;
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ DefaultScreen(int /*<<< orphan*/ *);
scalar_t__ EINTR;
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ 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 128
int /*<<< orphan*/ KeyPressMask;
int LockMask;
int Mod1Mask;
int Mod2Mask;
int Mod3Mask;
int Mod4Mask;
int Mod5Mask;
int /*<<< orphan*/ NormalState;
int PMinSize;
int ShiftMask;
int StateHint;
int SubstructureNotifyMask;
int SubstructureRedirectMask;
void *True;
TYPE_3__ *XAllocSizeHints();
TYPE_3__ *XAllocWMHints();
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XCreateSimpleWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int, int, int /*<<< orphan*/,
                                       unsigned long, unsigned long);
int /*<<< orphan*/ XDestroyWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XFree(TYPE_3__ *);
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_12__ *, int);
int XLookupString(TYPE_12__ *, char *, int, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, TYPE_5__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
scalar_t__ XPending(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ XSendEvent(int /*<<< orphan*/ *, int /*<<< orphan*/, void *,
                              int, TYPE_5__ *);
int /*<<< orphan*/ XSetWMProtocols(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   void **, int);
int /*<<< orphan*/ XWindowEvent(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, TYPE_5__ *);
int /*<<< orphan*/ Xutf8SetWMProperties(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, char *, char *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, TYPE_3__ *,
                                        TYPE_3__ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
scalar_t__ errno;
int /*<<< orphan*/ memset(TYPE_5__ *, 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);
  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);
  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;
      }
    }
    if (mill_store > 16.6 && !done) {
      for (; mill_store > 16.6 && !done; mill_store -= 16.6) {
      }
    }
    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    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   2120 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    2352 <main+0x42>
mov    0x2c10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    2db0 <main+0xaa0>
mov    -0x18(%rbp),%rax
mov    %rax,-0x160(%rbp)
mov    -0x18(%rbp),%rdi
call   2210 <DefaultScreen@plt>
mov    -0x160(%rbp),%rdi
mov    %eax,%esi
call   21c0 <BlackPixel@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x158(%rbp)
mov    -0x18(%rbp),%rdi
call   2090 <DefaultRootWindow@plt>
mov    -0x158(%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   21a0 <XCreateSimpleWindow@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   2150 <XAllocWMHints@plt>
mov    %rax,-0x30(%rbp)
mov    0x2c00(%rip),%rax
mov    (%rax),%ecx
mov    0x2c17(%rip),%rax
or     (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2bb0(%rip),%rax
mov    (%rax),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    0x2b46(%rip),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    $0x0,%al
call   2140 <XAllocSizeHints@plt>
mov    %rax,-0x38(%rbp)
mov    0x2b0b(%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    0xbbf(%rip),%rdx
lea    0xc22(%rip),%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   2110 <Xutf8SetWMProperties@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2ab5(%rip),%rax
mov    (%rax),%edx
call   2190 <XSelectInput@plt>
mov    -0x18(%rbp),%rdi
mov    0x2b0b(%rip),%rax
mov    (%rax),%rdx
lea    0xb7a(%rip),%rsi
call   2170 <XInternAtom@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2aed(%rip),%rax
mov    (%rax),%rdx
lea    0xb69(%rip),%rsi
call   2170 <XInternAtom@plt>
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x48(%rbp),%rdx
mov    $0x1,%ecx
call   2130 <XSetWMProtocols@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   21e0 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2a43(%rip),%rax
mov    (%rax),%edx
lea    -0x70(%rbp),%rcx
call   21f0 <XWindowEvent@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2aa2(%rip),%rax
mov    (%rax),%edx
call   2190 <XSelectInput@plt>
mov    0x2aa4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    0x2a6e(%rip),%rax
mov    (%rax),%edi
lea    -0x98(%rbp),%rsi
call   2070 <clock_gettime@plt>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x90(%rbp),%eax
mov    %eax,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movq   $0x0,-0xb8(%rbp)
movq   $0x0,-0xc0(%rbp)
movl   $0x14,-0xe4(%rbp)
movl   $0x0,-0xe8(%rbp)
mov    0x2a33(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2a1e(%rip),%rax
mov    (%rax),%rdx
lea    0xa8b(%rip),%rsi
call   2170 <XInternAtom@plt>
mov    %rax,-0xf8(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x29fd(%rip),%rax
mov    (%rax),%rdx
lea    0xa78(%rip),%rsi
call   2170 <XInternAtom@plt>
mov    %rax,-0x100(%rbp)
lea    -0x128(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   20d0 <memset@plt>
movl   $0x81,-0x128(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x108(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0x120(%rbp)
movl   $0x20,-0x118(%rbp)
mov    -0x110(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x100(%rbp),%rax
mov    %eax,%ecx
mov    -0x110(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x110(%rbp),%rax
movl   $0x0,0x8(%rax)
cmpq   $0x0,-0x78(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    265c <main+0x34c>
jmp    2d65 <main+0xa55>
mov    0x2935(%rip),%rax
mov    (%rax),%edi
lea    -0x98(%rbp),%rsi
call   2070 <clock_gettime@plt>
lea    -0x98(%rbp),%rdi
lea    -0x88(%rbp),%rsi
call   2200 <timespec_diff@plt>
cvtsi2sd %rax,%xmm0
addsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x18(%rbp),%rdi
call   2080 <XPending@plt>
cmp    $0x0,%rax
jle    2bc2 <main+0x8b2>
mov    -0x18(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   2160 <XNextEvent@plt>
mov    -0x70(%rbp),%eax
mov    %eax,-0x164(%rbp)
sub    $0x80,%eax
je     271f <main+0x40f>
jmp    26d2 <main+0x3c2>
mov    -0x164(%rbp),%eax
sub    $0x81,%eax
jne    2bbd <main+0x8ad>
jmp    26e8 <main+0x3d8>
mov    -0x68(%rbp),%rax
cmp    -0x40(%rbp),%rax
jne    271a <main+0x40a>
mov    -0x58(%rbp),%rax
movslq (%rax),%rax
cmp    -0x48(%rbp),%rax
jne    2715 <main+0x405>
mov    0x2892(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
jmp    271a <main+0x40a>
jmp    2bbd <main+0x8ad>
lea    -0x70(%rbp),%rdi
add    $0x4,%rdi
lea    -0xe0(%rbp),%rsi
mov    -0xe4(%rbp),%edx
lea    -0xac(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   2050 <XLookupString@plt>
mov    %eax,-0xe8(%rbp)
lea    -0x70(%rbp),%rdi
add    $0x4,%rdi
xor    %esi,%esi
call   2180 <XLookupKeysym@plt>
mov    %eax,-0xa4(%rbp)
lea    -0x70(%rbp),%rdi
add    $0x4,%rdi
mov    $0x1,%esi
call   2180 <XLookupKeysym@plt>
mov    %eax,-0xa8(%rbp)
mov    -0xa4(%rbp),%edi
call   2230 <XKeysymToString@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xa8(%rbp),%edi
call   2230 <XKeysymToString@plt>
mov    %rax,-0xc0(%rbp)
mov    0x2765(%rip),%rax
mov    (%rax),%eax
cmp    -0xa4(%rbp),%eax
jne    2807 <main+0x4f7>
cmpq   $0x0,-0xf0(%rbp)
je     27e3 <main+0x4d3>
lea    0x898(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    0x27ec(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xf0(%rbp)
jmp    2802 <main+0x4f2>
lea    0x886(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    0x27a8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xf0(%rbp)
jmp    28fa <main+0x5ea>
mov    -0xa4(%rbp),%eax
mov    0x2754(%rip),%rcx
cmp    (%rcx),%eax
jne    283d <main+0x52d>
mov    0x277d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
lea    0x84a(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2699 <main+0x389>
mov    0x2764(%rip),%rax
mov    (%rax),%eax
cmp    -0xa4(%rbp),%eax
jne    2888 <main+0x578>
mov    -0x6c(%rbp),%eax
mov    0x276c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2888 <main+0x578>
mov    0x2732(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
lea    0x81a(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2699 <main+0x389>
mov    0x26f1(%rip),%rax
mov    (%rax),%eax
cmp    -0xa4(%rbp),%eax
jne    28eb <main+0x5db>
mov    -0x18(%rbp),%rax
mov    %rax,-0x170(%rbp)
mov    -0x18(%rbp),%rdi
call   2090 <DefaultRootWindow@plt>
mov    -0x170(%rbp),%rdi
mov    %eax,%esi
mov    0x26ff(%rip),%rax
mov    (%rax),%rdx
mov    0x26a5(%rip),%rax
mov    (%rax),%ecx
mov    0x265c(%rip),%rax
or     (%rax),%ecx
lea    -0x128(%rbp),%r8
call   2030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
call   21d0 <XFlush@plt>
jmp    28f0 <main+0x5e0>
jmp    28f5 <main+0x5e5>
jmp    28fa <main+0x5ea>
cmpq   $0x0,-0xf0(%rbp)
je     2922 <main+0x612>
lea    -0xe0(%rbp),%rsi
lea    0x7ad(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2bb8 <main+0x8a8>
mov    -0xb8(%rbp),%rsi
mov    -0xc0(%rbp),%rdx
lea    0x77a(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x2688(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2961 <main+0x651>
lea    0x76c(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x25f5(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2984 <main+0x674>
lea    0x752(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x263a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     29a7 <main+0x697>
lea    0x737(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x2607(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     29ca <main+0x6ba>
lea    0x71c(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x254c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     29ed <main+0x6dd>
lea    0x700(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x2599(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2a10 <main+0x700>
lea    0x6e9(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x25ce(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2a33 <main+0x723>
lea    0x6ce(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0x6c(%rbp),%eax
mov    0x24d3(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     2a56 <main+0x746>
lea    0x6b3(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa4(%rbp),%edi
call   21b0 <IsCursorKey@plt>
cmp    $0x0,%eax
je     2a78 <main+0x768>
lea    0x699(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa8(%rbp),%edi
call   21b0 <IsCursorKey@plt>
cmp    $0x0,%eax
je     2a9a <main+0x78a>
lea    0x689(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa4(%rbp),%edi
call   2060 <IsFunctionKey@plt>
cmp    $0x0,%eax
je     2abc <main+0x7ac>
lea    0x679(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa8(%rbp),%edi
call   2060 <IsFunctionKey@plt>
cmp    $0x0,%eax
je     2ade <main+0x7ce>
lea    0x66b(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa4(%rbp),%edi
call   2100 <IsKeypadKey@plt>
cmp    $0x0,%eax
je     2b00 <main+0x7f0>
lea    0x65d(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa8(%rbp),%edi
call   2100 <IsKeypadKey@plt>
cmp    $0x0,%eax
je     2b22 <main+0x812>
lea    0x649(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa4(%rbp),%edi
call   20e0 <IsMiscFunctionKey@plt>
cmp    $0x0,%eax
je     2b44 <main+0x834>
lea    0x635(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa8(%rbp),%edi
call   20e0 <IsMiscFunctionKey@plt>
cmp    $0x0,%eax
je     2b66 <main+0x856>
lea    0x61d(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa4(%rbp),%edi
call   2040 <IsModifierKey@plt>
cmp    $0x0,%eax
je     2b88 <main+0x878>
lea    0x605(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
mov    -0xa8(%rbp),%edi
call   2040 <IsModifierKey@plt>
cmp    $0x0,%eax
je     2baa <main+0x89a>
lea    0x5f3(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
lea    0x4c8(%rip),%rdi
mov    $0x0,%al
call   20a0 <printf@plt>
jmp    2bbd <main+0x8ad>
jmp    2699 <main+0x389>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0x42e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    2c5c <main+0x94c>
cmpq   $0x0,-0x78(%rbp)
jne    2c5c <main+0x94c>
jmp    2bec <main+0x8dc>
movsd  -0xa0(%rbp),%xmm0
ff
xor    %eax,%eax
movsd  0x402(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x171(%rbp)
jbe    2c1e <main+0x90e>
cmpq   $0x0,-0x78(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x171(%rbp)
mov    -0x171(%rbp),%al
test   $0x1,%al
jne    2c31 <main+0x921>
jmp    2c57 <main+0x947>
jmp    2c36 <main+0x926>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0x3ba(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    2bec <main+0x8dc>
jmp    2c5c <main+0x94c>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x90(%rbp),%eax
mov    %eax,-0x80(%rbp)
movsd  0x383(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    2d60 <main+0xa50>
cmpq   $0x0,-0x78(%rbp)
jne    2d60 <main+0xa50>
movl   $0x0,-0x14c(%rbp)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0x358(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
cvttsd2si -0xa0(%rbp),%eax
ff
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0x140(%rbp)
movsd  -0x148(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
mov    -0x140(%rbp),%eax
mov    %eax,-0x130(%rbp)
mov    0x227d(%rip),%rax
movq   $0x0,(%rax)
lea    -0x138(%rbp),%rdi
lea    -0x148(%rbp),%rsi
call   20c0 <nanosleep@plt>
mov    %eax,-0x14c(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x14c(%rbp)
mov    %al,-0x172(%rbp)
jne    2d4d <main+0xa3d>
mov    0x2241(%rip),%rax
mov    (%rax),%rax
mov    0x220f(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x172(%rbp)
mov    -0x172(%rbp),%al
test   $0x1,%al
jne    2cd8 <main+0x9c8>
jmp    2d60 <main+0xa50>
jmp    2645 <main+0x335>
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   20f0 <XDestroyWindow@plt>
mov    -0x18(%rbp),%rdi
call   2220 <XCloseDisplay@plt>
movq   $0x0,-0x18(%rbp)
mov    0x2195(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
xor    %edi,%edi
call   2140 <XOpenDisplay@plt>
test   %rax,%rax
je     25ba <main+0x28a>
mov    %rax,%rbx
mov    %rax,%rdi
call   2230 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   21e0 <BlackPixel@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   20b0 <DefaultRootWindow@plt>
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x320,%r8d
mov    $0x258,%r9d
push   %rbp
push   %rbp
push   $0x0
call   21c0 <XCreateSimpleWindow@plt>
add    $0x20,%rsp
mov    %eax,%r13d
xor    %eax,%eax
call   2170 <XAllocWMHints@plt>
mov    0x2c30(%rip),%rcx
mov    0x2c49(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    %rax,%rbp
mov    %edx,(%rax)
mov    0x2be1(%rip),%r15
mov    (%r15),%rax
mov    %rax,0x10(%rbp)
mov    0x2b7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rbp)
xor    %eax,%eax
call   2160 <XAllocSizeHints@plt>
mov    0x2b48(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
movabs $0x12c00000190,%rcx
mov    %rcx,0x4(%rax)
sub    $0x8,%rsp
lea    0xc1b(%rip),%rdx
lea    0xd94(%rip),%rcx
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
mov    %rbp,0xa8(%rsp)
push   %rbp
mov    %rax,0xa8(%rsp)
push   %rax
call   2130 <Xutf8SetWMProperties@plt>
add    $0x20,%rsp
mov    0x2b04(%rip),%r14
mov    (%r14),%edx
mov    %rbx,%rdi
mov    %r13d,%esi
call   21b0 <XSelectInput@plt>
mov    (%r15),%rdx
lea    0xbd5(%rip),%rsi
mov    %rbx,%rdi
call   2190 <XInternAtom@plt>
mov    %rax,0xa0(%rsp)
mov    (%r15),%rdx
lea    0xbc8(%rip),%rsi
mov    %rbx,%rdi
call   2190 <XInternAtom@plt>
mov    %rax,0x78(%rsp)
lea    0x78(%rsp),%rdx
mov    %rbx,%rdi
mov    %r13d,%esi
mov    $0x1,%ecx
call   2150 <XSetWMProtocols@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
call   2200 <XMapWindow@plt>
mov    (%r14),%edx
lea    0x50(%rsp),%rcx
mov    %rbx,%rdi
mov    %r13d,%esi
call   2210 <XWindowEvent@plt>
mov    0x2b03(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r13d,%esi
call   21b0 <XSelectInput@plt>
mov    0x2aff(%rip),%rbp
mov    0x0(%rbp),%r15
mov    0x2acc(%rip),%rax
mov    (%rax),%edi
lea    0x40(%rsp),%rsi
call   2090 <clock_gettime@plt>
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
mov    0x48(%rsp),%eax
mov    %eax,0x88(%rsp)
mov    0x0(%rbp),%rdx
lea    0xb42(%rip),%rsi
mov    %rbx,%rdi
mov    %rdx,0x8(%rsp)
call   2190 <XInternAtom@plt>
mov    %rax,%r14
mov    0x0(%rbp),%rdx
mov    %rbx,%rbp
lea    0xb32(%rip),%rsi
mov    %rbx,%rdi
call   2190 <XInternAtom@plt>
mov    %rax,%r12
lea    0xb8(%rsp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   20f0 <memset@plt>
movl   $0x81,0xb8(%rsp)
mov    %r13d,0x1c(%rsp)
mov    %r13d,0xd8(%rsp)
mov    %r14,0xc0(%rsp)
movl   $0x20,0xc8(%rsp)
mov    0xd0(%rsp),%rax
movl   $0x2,(%rax)
mov    %r12d,0x4(%rax)
movl   $0x0,0x8(%rax)
test   %r15,%r15
je     25d5 <main+0x2a5>
mov    0x90(%rsp),%rdi
call   20d0 <XFree@plt>
mov    0x98(%rsp),%rdi
call   20d0 <XFree@plt>
mov    %rbp,%rdi
mov    0x1c(%rsp),%esi
call   2110 <XDestroyWindow@plt>
mov    %rbp,%rdi
call   2240 <XCloseDisplay@plt>
mov    0x2988(%rip),%rax
jmp    25c1 <main+0x291>
mov    0x2997(%rip),%rax
mov    (%rax),%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xorpd  %xmm1,%xmm1
jmp    25eb <main+0x2bb>
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm1
test   %r15,%r15
jne    2583 <main+0x253>
movsd  %xmm1,0x10(%rsp)
mov    0x29a0(%rip),%rax
mov    (%rax),%edi
mov    %rbp,%rbx
lea    0x40(%rsp),%rbp
mov    %rbp,%rsi
call   2090 <clock_gettime@plt>
mov    %rbp,%rdi
mov    %rbx,%rbp
lea    0x80(%rsp),%rsi
call   2220 <timespec_diff@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   20a0 <XPending@plt>
test   %rax,%rax
mov    %rbx,0xa8(%rsp)
jle    2a30 <main+0x700>
xor    %r15d,%r15d
jmp    2660 <main+0x330>
xchg   %ax,%ax
mov    0x2959(%rip),%rax
mov    (%rax),%r15
call   2080 <puts@plt>
mov    %rbp,%rdi
call   20a0 <XPending@plt>
test   %rax,%rax
jle    2a33 <main+0x703>
mov    %rbp,%rdi
lea    0x50(%rsp),%rsi
call   2180 <XNextEvent@plt>
mov    0x50(%rsp),%eax
cmp    $0x80,%eax
jne    2988 <main+0x658>
lea    0x54(%rsp),%rbx
mov    %rbx,%rdi
lea    0xe0(%rsp),%rsi
mov    $0x14,%edx
lea    0xb4(%rsp),%rcx
xor    %r8d,%r8d
call   2060 <XLookupString@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   21a0 <XLookupKeysym@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
mov    $0x1,%esi
call   21a0 <XLookupKeysym@plt>
mov    %eax,%ebx
mov    %r13d,%edi
call   2250 <XKeysymToString@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   2250 <XKeysymToString@plt>
mov    %rax,%r14
mov    0x282f(%rip),%rax
cmp    %r13d,(%rax)
je     29c8 <main+0x698>
lea    0xa8c(%rip),%rdi
mov    0x2878(%rip),%rax
cmp    (%rax),%r13d
je     2640 <main+0x310>
mov    0x28a8(%rip),%rax
cmp    %r13d,(%rax)
jne    271f <main+0x3ef>
mov    0x28bc(%rip),%rax
mov    (%rax),%eax
lea    0xa46(%rip),%rdi
test   %eax,0x54(%rsp)
jne    2640 <main+0x310>
mov    0x285a(%rip),%rax
cmp    %r13d,(%rax)
jne    2769 <main+0x439>
mov    %rbp,%rdi
call   20b0 <DefaultRootWindow@plt>
mov    0x2886(%rip),%rcx
mov    (%rcx),%rdx
mov    0x27ec(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2823(%rip),%rsi
or     (%rsi),%ecx
mov    %rbp,%rdi
mov    %eax,%esi
lea    0xb8(%rsp),%r8
call   2030 <XSendEvent@plt>
mov    %rbp,%rdi
call   21f0 <XFlush@plt>
mov    0x8(%rsp),%rax
test   %rax,%rax
jne    2a04 <main+0x6d4>
lea    0x8e8(%rip),%rdi
mov    %r12,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x283a(%rip),%rcx
test   %eax,(%rcx)
je     27ac <main+0x47c>
lea    0x8da(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x27ad(%rip),%rcx
test   %eax,(%rcx)
je     27c9 <main+0x499>
lea    0x8c6(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x27f8(%rip),%rcx
test   %eax,(%rcx)
je     27e6 <main+0x4b6>
lea    0x8b1(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x27cb(%rip),%rcx
test   %eax,(%rcx)
je     2803 <main+0x4d3>
lea    0x89c(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x2716(%rip),%rcx
test   %eax,(%rcx)
je     2820 <main+0x4f0>
lea    0x886(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x2769(%rip),%rcx
test   %eax,(%rcx)
je     283d <main+0x50d>
lea    0x875(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x27a4(%rip),%rcx
test   %eax,(%rcx)
je     285a <main+0x52a>
lea    0x860(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    0x54(%rsp),%eax
mov    0x26af(%rip),%rcx
test   %eax,(%rcx)
je     2873 <main+0x543>
lea    0x84b(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %r13d,%edi
call   21d0 <IsCursorKey@plt>
test   %eax,%eax
je     288d <main+0x55d>
lea    0x839(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   21d0 <IsCursorKey@plt>
test   %eax,%eax
je     28a6 <main+0x576>
lea    0x832(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %r13d,%edi
call   2070 <IsFunctionKey@plt>
test   %eax,%eax
je     28c0 <main+0x590>
lea    0x82a(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2070 <IsFunctionKey@plt>
test   %eax,%eax
je     28d9 <main+0x5a9>
lea    0x825(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %r13d,%edi
call   2120 <IsKeypadKey@plt>
test   %eax,%eax
je     28f3 <main+0x5c3>
lea    0x81f(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2120 <IsKeypadKey@plt>
test   %eax,%eax
je     290c <main+0x5dc>
lea    0x814(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %r13d,%edi
call   2100 <IsMiscFunctionKey@plt>
test   %eax,%eax
je     2926 <main+0x5f6>
lea    0x808(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2100 <IsMiscFunctionKey@plt>
test   %eax,%eax
je     293f <main+0x60f>
lea    0x7f9(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %r13d,%edi
call   2050 <IsModifierKey@plt>
test   %eax,%eax
je     2959 <main+0x629>
lea    0x7e9(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    %ebx,%edi
call   2050 <IsModifierKey@plt>
test   %eax,%eax
je     2972 <main+0x642>
lea    0x7e0(%rip),%rdi
xor    %eax,%eax
call   20c0 <printf@plt>
mov    $0xa,%edi
call   2040 <putchar@plt>
xor    %eax,%eax
mov    %rax,0x8(%rsp)
jmp    264f <main+0x31f>
cmp    $0x81,%eax
jne    264f <main+0x31f>
mov    0xa0(%rsp),%rax
cmp    %rax,0x58(%rsp)
jne    264f <main+0x31f>
mov    0x68(%rsp),%rax
movslq (%rax),%rax
cmp    %rax,0x78(%rsp)
jne    264f <main+0x31f>
mov    0x25e0(%rip),%rax
mov    (%rax),%r15
jmp    264f <main+0x31f>
cmpq   $0x0,0x8(%rsp)
je     29e5 <main+0x6b5>
lea    0x7c2(%rip),%rdi
call   2080 <puts@plt>
mov    0x25dd(%rip),%rax
jmp    29f8 <main+0x6c8>
lea    0x7a3(%rip),%rdi
call   2080 <puts@plt>
mov    0x25a8(%rip),%rax
mov    (%rax),%rax
test   %rax,%rax
je     2777 <main+0x447>
mov    %rax,0x8(%rsp)
lea    0x668(%rip),%rdi
lea    0xe0(%rsp),%rsi
xor    %eax,%eax
call   20c0 <printf@plt>
jmp    264f <main+0x31f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %r15d,%r15d
xorps  %xmm0,%xmm0
cvtsi2sdq 0xa8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  0x5ae(%rip),%xmm2
ucomisd %xmm2,%xmm1
jbe    2a80 <main+0x750>
test   %r15,%r15
jne    2a80 <main+0x750>
movsd  0x5a3(%rip),%xmm0
mov    0x250c(%rip),%rsi
nopl   0x0(%rax)
addsd  %xmm0,%xmm1
ucomisd %xmm2,%xmm1
ja     2a70 <main+0x740>
jmp    2a87 <main+0x757>
nopl   0x0(%rax)
mov    0x24f1(%rip),%rsi
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
mov    0x48(%rsp),%eax
mov    %eax,0x88(%rsp)
ucomisd %xmm1,%xmm2
jbe    25e6 <main+0x2b6>
test   %r15,%r15
jne    25e6 <main+0x2b6>
movapd %xmm1,%xmm0
divsd  0x550(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x10(%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,0x28(%rsp)
movsd  %xmm0,0x30(%rsp)
mov    %eax,0x38(%rsp)
movq   $0x0,(%rsi)
nopl   0x0(%rax)
lea    0x30(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   20e0 <nanosleep@plt>
mov    0x2452(%rip),%rcx
cmp    $0xffffffff,%eax
jne    25e0 <main+0x2b0>
mov    0x241a(%rip),%rax
mov    (%rax),%rax
cmp    %rax,(%rcx)
jne    25e0 <main+0x2b0>
movsd  0x20(%rsp),%xmm0
mov    0x28(%rsp),%eax
movsd  %xmm0,0x30(%rsp)
mov    %eax,0x38(%rsp)
movq   $0x0,(%rcx)
jmp    2b10 <main+0x7e0>

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

LLVM IR (-O2):
%struct.TYPE_21__ = type { i32, %struct.TYPE_17__, %struct.TYPE_19__ }
%struct.TYPE_17__ = type { i32 }
%struct.TYPE_19__ = type { i8*, i32, %struct.TYPE_18__, i32 }
%struct.TYPE_18__ = type { i32* }
%struct.timespec = type { double, i32 }
%struct.TYPE_20__ = 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
@.str.2 = [13 x i8] c"WM_PROTOCOLS\00"
@.str.3 = [17 x i8] c"WM_DELETE_WINDOW\00"
@KeyPressMask = global i32 0
@False = global i8* null
@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"
@errno = global i64 0
@EINTR = global i64 0
@EXIT_SUCCESS = global i32 0
@str = [26 x i8] c"Pressed Ctrl+q, quitting.\00"
@str.31 = [26 x i8] c"Pressed Escape, quitting.\00"
@str.32 = [10 x i8] c"Message: \00"
@str.33 = [17 x i8] c"\0A-Done Chatting-\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca %struct.TYPE_21__
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca i32
%8 = alloca [20 x i8]
%9 = alloca %struct.TYPE_21__
%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 %336
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_20__* (...) @XAllocWMHints()
%22 = load i32, i32* @InputHint
%23 = load i32, i32* @StateHint
%24 = or i32 %23, %22
%25 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %21, i64 0, i32 0
store i32 %24, i32* %25
%26 = load i8*, i8** @True
%27 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %21, i64 0, i32 4
store i8* %26, i8** %27
%28 = load i32, i32* @NormalState
%29 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %21, i64 0, i32 3
store i32 %28, i32* %29
%30 = tail call %struct.TYPE_20__* (...) @XAllocSizeHints()
%31 = load i32, i32* @PMinSize
%32 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %30, i64 0, i32 0
store i32 %31, i32* %32
%33 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %30, i64 0, i32 1
store i32 400, i32* %33
%34 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %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_20__* %30, %struct.TYPE_20__* %21, i32* null)
%36 = load i32, i32* @ExposureMask
%37 = tail call i32 @XSelectInput(i32* %12, i32 %20, i32 %36)
%38 = load i8*, i8** @True
%39 = tail call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %38)
%40 = bitcast i8** %3 to i8*
%41 = load i8*, i8** @True
%42 = tail call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %41)
store i8* %42, i8** %3
%43 = call i32 @XSetWMProtocols(i32* %12, i32 %20, i8** %3, i32 1)
%44 = call i32 @XMapWindow(i32* %12, i32 %20)
%45 = bitcast %struct.TYPE_21__* %4 to i8*
%46 = load i32, i32* @ExposureMask
%47 = call i32 @XWindowEvent(i32* %12, i32 %20, i32 %46, %struct.TYPE_21__* %4)
%48 = load i32, i32* @KeyPressMask
%49 = call i32 @XSelectInput(i32* %12, i32 %20, i32 %48)
%50 = load i8*, i8** @False
%51 = bitcast %struct.timespec* %5 to i8*
%52 = bitcast %struct.timespec* %6 to i8*
%53 = load i32, i32* @CLOCK_MONOTONIC_RAW
%54 = call i32 @clock_gettime(i32 %53, %struct.timespec* %6)
%55 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i64 0, i32 0
%56 = load double, double* %55
%57 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 0
store double %56, double* %57
%58 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i64 0, i32 1
%59 = load i32, i32* %58
%60 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 1
store i32 %59, i32* %60
%61 = bitcast i32* %7 to i8*
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%63 = load i8*, i8** @False
%64 = call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %63)
%65 = load i8*, i8** @False
%66 = call i8* @XInternAtom(i32* %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %65)
%67 = bitcast %struct.TYPE_21__* %9 to i8*
%68 = call i32 @memset(%struct.TYPE_21__* %9, i32 0, i32 40)
%69 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %9, i64 0, i32 0
store i32 129, i32* %69
%70 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %9, i64 0, i32 2, i32 3
store i32 %20, i32* %70
%71 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %9, i64 0, i32 2, i32 0
store i8* %64, i8** %71
%72 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %9, i64 0, i32 2, i32 1
store i32 32, i32* %72
%73 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %9, i64 0, i32 2, i32 2, i32 0
%74 = load i32*, i32** %73
store i32 2, i32* %74
%75 = ptrtoint i8* %66 to i64
%76 = trunc i64 %75 to i32
%77 = getelementptr inbounds i32, i32* %74, i64 1
store i32 %76, i32* %77
%78 = getelementptr inbounds i32, i32* %74, i64 2
store i32 0, i32* %78
%79 = icmp eq i8* %50, null
br i1 %79, label %80, label %330
80: ; preds = %16
%81 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %4, i64 0, i32 0
%82 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %4, i64 0, i32 1
%83 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %82, i64 0, i32 0
%84 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %4, i64 0, i32 2, i32 0
%85 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %4, i64 0, i32 2, i32 2, i32 0
%86 = bitcast %struct.timespec* %10 to i8*
%87 = bitcast %struct.timespec* %11 to i8*
%88 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i64 0, i32 0
%89 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i64 0, i32 1
%90 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i64 0, i32 0
%91 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i64 0, i32 1
br label %92
92: ; preds = %80, %328
%93 = phi i8* [ %63, %80 ], [ %292, %328 ]
%94 = phi double [ 0.000000e+00, %80 ], [ %302, %328 ]
%95 = load i32, i32* @CLOCK_MONOTONIC_RAW
%96 = call i32 @clock_gettime(i32 %95, %struct.timespec* %6)
%97 = call i64 @timespec_diff(%struct.timespec* %6, %struct.timespec* %5)
%98 = sitofp i64 %97 to double
%99 = fadd double %94, %98
%100 = call i64 @XPending(i32* %12)
%101 = icmp sgt i64 %100, 0
br i1 %101, label %102, label %291
102: ; preds = %92, %286
%103 = phi i8* [ %288, %286 ], [ %93, %92 ]
%104 = phi i8* [ %287, %286 ], [ null, %92 ]
br label %105
105: ; preds = %102, %140
%106 = phi i8* [ %104, %102 ], [ %142, %140 ]
%107 = call i32 @XNextEvent(i32* %12, %struct.TYPE_21__* %4)
%108 = load i32, i32* %81
switch i32 %108, label %286 [
i32 129, label %109
i32 128, label %121
]
109: ; preds = %105
%110 = load i8*, i8** %84
%111 = icmp eq i8* %110, %39
br i1 %111, label %112, label %286
112: ; preds = %109
%113 = load i32*, i32** %85
%114 = load i32, i32* %113
%115 = sext i32 %114 to i64
%116 = inttoptr i64 %115 to i8*
%117 = load i8*, i8** %3
%118 = icmp eq i8* %117, %116
%119 = load i8*, i8** @True
%120 = select i1 %118, i8* %119, i8* %106
br label %286
121: ; preds = %105
%122 = call i32 @XLookupString(%struct.TYPE_17__* %82, i8* %62, i32 20, i32* %7, i32* null)
%123 = call i32 @XLookupKeysym(%struct.TYPE_17__* %82, i32 0)
%124 = call i32 @XLookupKeysym(%struct.TYPE_17__* %82, i32 1)
%125 = call i8* @XKeysymToString(i32 %123)
%126 = call i8* @XKeysymToString(i32 %124)
%127 = load i32, i32* @XK_Return
%128 = icmp eq i32 %127, %123
br i1 %128, label %129, label %137
129: ; preds = %121
%130 = icmp eq i8* %103, null
br i1 %130, label %134, label %131
131: ; preds = %129
%132 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.33, i64 0, i64 0))
%133 = load i8*, i8** @False
br label %165
134: ; preds = %129
%135 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.32, i64 0, i64 0))
%136 = load i8*, i8** @True
br label %165
137: ; preds = %121
%138 = load i32, i32* @XK_Escape
%139 = icmp eq i32 %123, %138
br i1 %139, label %140, label %146
140: ; preds = %137, %149
%141 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0), %149 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.31, i64 0, i64 0), %137 ]
%142 = load i8*, i8** @True
%143 = call i32 @puts(i8* dereferenceable(1) %141)
%144 = call i64 @XPending(i32* %12)
%145 = icmp sgt i64 %144, 0
br i1 %145, label %105, label %291
146: ; preds = %137
%147 = load i32, i32* @XK_q
%148 = icmp eq i32 %147, %123
br i1 %148, label %149, label %154
149: ; preds = %146
%150 = load i32, i32* %83
%151 = load i32, i32* @ControlMask
%152 = and i32 %151, %150
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %140
154: ; preds = %149, %146
%155 = load i32, i32* @XK_F11
%156 = icmp eq i32 %155, %123
br i1 %156, label %157, label %165
157: ; preds = %154
%158 = call i32 @DefaultRootWindow(i32* %12)
%159 = load i8*, i8** @False
%160 = load i32, i32* @SubstructureRedirectMask
%161 = load i32, i32* @SubstructureNotifyMask
%162 = or i32 %161, %160
%163 = call i32 @XSendEvent(i32* %12, i32 %158, i8* %159, i32 %162, %struct.TYPE_21__* %9)
%164 = call i32 @XFlush(i32* %12)
br label %165
165: ; preds = %154, %157, %131, %134
%166 = phi i8* [ %133, %131 ], [ %136, %134 ], [ %103, %157 ], [ %103, %154 ]
%167 = icmp eq i8* %166, null
br i1 %167, label %170, label %168
168: ; preds = %165
%169 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %62)
br label %286
170: ; preds = %165
%171 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %125, i8* %126)
%172 = load i32, i32* %83
%173 = load i32, i32* @ShiftMask
%174 = and i32 %173, %172
%175 = icmp eq i32 %174, 0
br i1 %175, label %179, label %176
176: ; preds = %170
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%178 = load i32, i32* %83
br label %179
179: ; preds = %176, %170
%180 = phi i32 [ %178, %176 ], [ %172, %170 ]
%181 = load i32, i32* @LockMask
%182 = and i32 %181, %180
%183 = icmp eq i32 %182, 0
br i1 %183, label %187, label %184
184: ; preds = %179
%185 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
%186 = load i32, i32* %83
br label %187
187: ; preds = %184, %179
%188 = phi i32 [ %186, %184 ], [ %180, %179 ]
%189 = load i32, i32* @ControlMask
%190 = and i32 %189, %188
%191 = icmp eq i32 %190, 0
br i1 %191, label %195, label %192
192: ; preds = %187
%193 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%194 = load i32, i32* %83
br label %195
195: ; preds = %192, %187
%196 = phi i32 [ %194, %192 ], [ %188, %187 ]
%197 = load i32, i32* @Mod1Mask
%198 = and i32 %197, %196
%199 = icmp eq i32 %198, 0
br i1 %199, label %203, label %200
200: ; preds = %195
%201 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%202 = load i32, i32* %83
br label %203
203: ; preds = %200, %195
%204 = phi i32 [ %202, %200 ], [ %196, %195 ]
%205 = load i32, i32* @Mod2Mask
%206 = and i32 %205, %204
%207 = icmp eq i32 %206, 0
br i1 %207, label %211, label %208
208: ; preds = %203
%209 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
%210 = load i32, i32* %83
br label %211
211: ; preds = %208, %203
%212 = phi i32 [ %210, %208 ], [ %204, %203 ]
%213 = load i32, i32* @Mod3Mask
%214 = and i32 %213, %212
%215 = icmp eq i32 %214, 0
br i1 %215, label %219, label %216
216: ; preds = %211
%217 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%218 = load i32, i32* %83
br label %219
219: ; preds = %216, %211
%220 = phi i32 [ %218, %216 ], [ %212, %211 ]
%221 = load i32, i32* @Mod4Mask
%222 = and i32 %221, %220
%223 = icmp eq i32 %222, 0
br i1 %223, label %227, label %224
224: ; preds = %219
%225 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%226 = load i32, i32* %83
br label %227
227: ; preds = %224, %219
%228 = phi i32 [ %226, %224 ], [ %220, %219 ]
%229 = load i32, i32* @Mod5Mask
%230 = and i32 %229, %228
%231 = icmp eq i32 %230, 0
br i1 %231, label %234, label %232
232: ; preds = %227
%233 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %234
234: ; preds = %232, %227
%235 = call i32 @IsCursorKey(i32 %123)
%236 = icmp eq i32 %235, 0
br i1 %236, label %239, label %237
237: ; preds = %234
%238 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0))
br label %239
239: ; preds = %237, %234
%240 = call i32 @IsCursorKey(i32 %124)
%241 = icmp eq i32 %240, 0
br i1 %241, label %244, label %242
242: ; preds = %239
%243 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0))
br label %244
244: ; preds = %242, %239
%245 = call i32 @IsFunctionKey(i32 %123)
%246 = icmp eq i32 %245, 0
br i1 %246, label %249, label %247
247: ; preds = %244
%248 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
br label %249
249: ; preds = %247, %244
%250 = call i32 @IsFunctionKey(i32 %124)
%251 = icmp eq i32 %250, 0
br i1 %251, label %254, label %252
252: ; preds = %249
%253 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0))
br label %254
254: ; preds = %252, %249
%255 = call i32 @IsKeypadKey(i32 %123)
%256 = icmp eq i32 %255, 0
br i1 %256, label %259, label %257
257: ; preds = %254
%258 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0))
br label %259
259: ; preds = %257, %254
%260 = call i32 @IsKeypadKey(i32 %124)
%261 = icmp eq i32 %260, 0
br i1 %261, label %264, label %262
262: ; preds = %259
%263 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0))
br label %264
264: ; preds = %262, %259
%265 = call i32 @IsMiscFunctionKey(i32 %123)
%266 = icmp eq i32 %265, 0
br i1 %266, label %269, label %267
267: ; preds = %264
%268 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0))
br label %269
269: ; preds = %267, %264
%270 = call i32 @IsMiscFunctionKey(i32 %124)
%271 = icmp eq i32 %270, 0
br i1 %271, label %274, label %272
272: ; preds = %269
%273 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i64 0, i64 0))
br label %274
274: ; preds = %272, %269
%275 = call i32 @IsModifierKey(i32 %123)
%276 = icmp eq i32 %275, 0
br i1 %276, label %279, label %277
277: ; preds = %274
%278 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
br label %279
279: ; preds = %277, %274
%280 = call i32 @IsModifierKey(i32 %124)
%281 = icmp eq i32 %280, 0
br i1 %281, label %284, label %282
282: ; preds = %279
%283 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i64 0, i64 0))
br label %284
284: ; preds = %282, %279
%285 = call i32 @putchar(i32 10)
br label %286
286: ; preds = %105, %112, %168, %284, %109
%287 = phi i8* [ %106, %168 ], [ %106, %284 ], [ %106, %109 ], [ %120, %112 ], [ %106, %105 ]
%288 = phi i8* [ %166, %168 ], [ null, %284 ], [ %103, %109 ], [ %103, %112 ], [ %103, %105 ]
%289 = call i64 @XPending(i32* %12)
%290 = icmp sgt i64 %289, 0
br i1 %290, label %102, label %291
291: ; preds = %286, %140, %92
%292 = phi i8* [ %93, %92 ], [ %103, %140 ], [ %288, %286 ]
%293 = phi i8* [ null, %92 ], [ %142, %140 ], [ %287, %286 ]
%294 = fcmp ule double %99, 1.660000e+01
%295 = icmp ne i8* %293, null
%296 = select i1 %294, i1 true, i1 %295
br i1 %296, label %301, label %297
297: ; preds = %291, %297
%298 = phi double [ %299, %297 ], [ %99, %291 ]
%299 = fadd double %298, -1.660000e+01
%300 = fcmp ogt double %299, 1.660000e+01
br i1 %300, label %297, label %301
301: ; preds = %297, %291
%302 = phi double [ %99, %291 ], [ %299, %297 ]
%303 = load double, double* %55
store double %303, double* %57
%304 = load i32, i32* %58
store i32 %304, i32* %60
%305 = fcmp uge double %302, 1.660000e+01
%306 = select i1 %305, i1 true, i1 %295
br i1 %306, label %328, label %307
307: ; preds = %301
%308 = fdiv double %302, 1.000000e+03
store double %308, double* %88
%309 = fptosi double %302 to i32
%310 = srem i32 %309, 1000
%311 = mul nsw i32 %310, 1000000
store i32 %311, i32* %89
store double %308, double* %90
store i32 %311, i32* %91
store i64 0, i64* @errno
%312 = call i32 @nanosleep(%struct.timespec* %10, %struct.timespec* %11)
%313 = icmp eq i32 %312, -1
%314 = load i64, i64* @errno
%315 = load i64, i64* @EINTR
%316 = icmp eq i64 %314, %315
%317 = select i1 %313, i1 %316, i1 false
br i1 %317, label %318, label %327
318: ; preds = %307, %318
%319 = load double, double* %88
%320 = load i32, i32* %89
store double %319, double* %90
store i32 %320, i32* %91
store i64 0, i64* @errno
%321 = call i32 @nanosleep(%struct.timespec* %10, %struct.timespec* %11)
%322 = icmp eq i32 %321, -1
%323 = load i64, i64* @errno
%324 = load i64, i64* @EINTR
%325 = icmp eq i64 %323, %324
%326 = select i1 %322, i1 %325, i1 false
br i1 %326, label %318, label %327
327: ; preds = %318, %307
br label %328
328: ; preds = %327, %301
%329 = icmp eq i8* %293, null
br i1 %329, label %92, label %330
330: ; preds = %328, %16
%331 = call i32 @XFree(%struct.TYPE_20__* %30)
%332 = call i32 @XFree(%struct.TYPE_20__* %21)
%333 = call i32 @XDestroyWindow(i32* %12, i32 %20)
%334 = call i32 @XCloseDisplay(i32* %12)
%335 = load i32, i32* @EXIT_SUCCESS
br label %336
336: ; preds = %330, %14
%337 = phi i32 [ %15, %14 ], [ %335, %330 ]
ret i32 %337
}