#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_9__ TYPE_5__;
typedef struct TYPE_8__ TYPE_2__;
typedef struct TYPE_7__ TYPE_1__;

/* Type definitions */
typedef int time_t;
struct TYPE_9__ {
  int keycode;
};
struct TYPE_7__ {
  scalar_t__ type;
  TYPE_5__ xkey;
};
typedef TYPE_1__ XEvent;
struct TYPE_8__ {
  int /*<<< orphan*/ pixel;
};
typedef TYPE_2__ XColor;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ GC;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Colormap;

/* Variables and functions */
int /*<<< orphan*/ BlackPixel(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ DefaultColormap(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ DefaultGC(int /*<<< orphan*/ *, int);
int DefaultScreen(int /*<<< orphan*/ *);
int ExposureMask;
scalar_t__ KeyPress;
int KeyPressMask;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ WhitePixel(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ XAllocColor(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               TYPE_2__ *);
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XCreateGC(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XCreateSimpleWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int, int, int, int, int,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XDrawString(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int /*<<< orphan*/, int, int, char *, int);
int /*<<< orphan*/ XFillRectangle(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int, int, int, int);
char *XKeysymToString(unsigned long);
unsigned long XLookupKeysym(TYPE_5__ *, int /*<<< orphan*/);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, TYPE_1__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XParseColor(int /*<<< orphan*/ *, int /*<<< orphan*/, char *,
                               TYPE_2__ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ XSetForeground(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int time(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  bool q = false;
  if (argv[1] != NULL && strcmp(argv[1], "-q") == 0)
    q = true;
  Display *disp;
  Window win;
  XEvent e;
  int screen;
  int winy = 0;
  int winx = 0;
  int winheight = 300;
  int winwidth = 500;
  int borderwidth = 10;
  int stdcposx = 20;
  int stdcposy = 20;
  int cposx = stdcposx;
  int cposy = stdcposy;
  int lastdeltime = 0;
  int lastrowlength = 0;
  int lastkeysym = 0;
  GC white;
  XColor white_color;
  Colormap colormap;
  char whiteidk[] = "#FFFFFF";
  disp = XOpenDisplay(NULL);
  if (disp == NULL) {
    fprintf(stderr, "Cannot open display\n");
    exit(1);
  }
  screen = DefaultScreen(disp);
  win = XCreateSimpleWindow(disp, RootWindow(disp, screen), winx, winy,
                            winwidth, winheight, borderwidth,
                            BlackPixel(disp, screen), WhitePixel(disp, screen));
  XSelectInput(disp, win, ExposureMask | KeyPressMask);
  XMapWindow(disp, win);
  colormap = DefaultColormap(disp, 0);
  white = XCreateGC(disp, win, 0, 0);
  XParseColor(disp, colormap, whiteidk, &white_color);
  XAllocColor(disp, colormap, &white_color);
  XSetForeground(disp, white, white_color.pixel);
  while (1) {
    XNextEvent(disp, &e);
    if (e.type == KeyPress) {
      if (!q)
        printf("Keycode: %d\n", e.xkey.keycode);
      unsigned long keysym = XLookupKeysym(&e.xkey, 0);
      if (!q)
        printf("Keysym: %lu\n", keysym);
      char *ascii = XKeysymToString(keysym);
      if (!q)
        printf("ASCII: %s\n", ascii);
      if (keysym == 65307 && lastkeysym == 65406) {
        printf("Exiting...\n");
        return 0;
      } else if (keysym == 65307) {
        XFillRectangle(disp, win, white, 0, 0, winwidth, winheight);
        cposx = stdcposx;
        cposy = stdcposy;
      } else if (keysym == 65293) {
        cposy += 10;
        lastrowlength = cposx;
        cposx = stdcposx;
      } else if (keysym == 32) {
        cposx += 6;
      } else if (keysym == 65288) {
        time_t now = time(0);
        if (!q)
          printf("Time: %ld\n", now);
        int diff = now - lastdeltime;
        if (!q)
          printf("Time since last deletion: %d\n", diff);
        XFillRectangle(disp, win, white, cposx - 6, cposy - 9, 6, 11);
        if (diff == 0) {
          XFillRectangle(disp, win, white, cposx - 12, cposy - 9, 6, 11);
        }
        lastdeltime = now;
        if (cposx <= stdcposx) {
          if (cposy != stdcposy) {
            cposy -= 10;
            cposx = lastrowlength;
          }
        } else {
          cposx -= 6;
          if (diff == 0 && cposx - 6 > stdcposx) {
            cposx -= 6;
          }
        }
      } else if (keysym == 43) {
        XDrawString(disp, win, DefaultGC(disp, screen), cposx, cposy, "+", 1);
        cposx += 6;
      } else if (keysym == 44) {
        XDrawString(disp, win, DefaultGC(disp, screen), cposx, cposy, ",", 1);
        cposx += 6;
      } else if (keysym == 45) {
        XDrawString(disp, win, DefaultGC(disp, screen), cposx, cposy, "-", 1);
        cposx += 6;
      } else if (keysym == 46) {
        XDrawString(disp, win, DefaultGC(disp, screen), cposx, cposy, ".", 1);
        cposx += 6;
      } else if (keysym == 65289) {
        XDrawString(disp, win, DefaultGC(disp, screen), cposx, cposy, "   ", 3);
        cposx += 18;
      } else {
        if (lastkeysym != 65506 || lastkeysym != 65505) {
          if (keysym == 49) {
            ascii = "!";
          } else if (keysym == 43) {
            ascii = "?";
          }
        }
        if (keysym != 65506 && keysym != 65505) {
          XDrawString(disp, win, DefaultGC(disp, screen), cposx, cposy, ascii,
                      strlen(ascii));
          cposx += strlen(ascii) * 6;
        }
      }
      lastkeysym = keysym;
    }
  }
  XCloseDisplay(disp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     12e4 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd32(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12e4 <main+0x54>
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x12c,-0x48(%rbp)
movl   $0x1f4,-0x4c(%rbp)
movl   $0xa,-0x50(%rbp)
movl   $0x14,-0x54(%rbp)
movl   $0x14,-0x58(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    0xcc6(%rip),%rax
mov    %rax,-0x84(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <XOpenDisplay@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    137b <main+0xeb>
mov    0x2c6d(%rip),%rax
mov    (%rax),%edi
lea    0xc9f(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1180 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1190 <DefaultScreen@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   10f0 <RootWindow@plt>
mov    %eax,-0xbc(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x50(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1140 <BlackPixel@plt>
mov    %eax,-0xa4(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1080 <WhitePixel@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xbc(%rbp),%esi
mov    -0xb8(%rbp),%edx
mov    -0xb4(%rbp),%ecx
mov    -0xb0(%rbp),%r8d
mov    -0xac(%rbp),%r9d
mov    -0xa8(%rbp),%r11d
mov    -0xa4(%rbp),%r10d
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1130 <XCreateSimpleWindow@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2b81(%rip),%rax
mov    (%rax),%edx
mov    0x2b98(%rip),%rax
or     (%rax),%edx
call   1100 <XSelectInput@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1170 <XMapWindow@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1150 <DefaultColormap@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1120 <XCreateGC@plt>
mov    %eax,-0x70(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x7c(%rbp),%esi
lea    -0x84(%rbp),%rdx
lea    -0x78(%rbp),%rcx
call   11a0 <XParseColor@plt>
mov    -0x20(%rbp),%rdi
mov    -0x7c(%rbp),%esi
lea    -0x78(%rbp),%rdx
call   1030 <XAllocColor@plt>
mov    -0x20(%rbp),%rdi
mov    -0x70(%rbp),%esi
mov    -0x78(%rbp),%edx
call   1160 <XSetForeground@plt>
mov    -0x20(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   10d0 <XNextEvent@plt>
mov    -0x38(%rbp),%rax
mov    0x2b0e(%rip),%rcx
cmp    (%rcx),%rax
jne    1aa4 <main+0x814>
cmpl   $0x0,-0x14(%rbp)
jne    14f6 <main+0x266>
mov    -0x30(%rbp),%esi
lea    0xb31(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x38(%rbp),%rdi
add    $0x8,%rdi
xor    %esi,%esi
call   10e0 <XLookupKeysym@plt>
mov    %rax,-0x90(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    152b <main+0x29b>
mov    -0x90(%rbp),%rsi
lea    0xb09(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x90(%rbp),%rdi
call   11b0 <XKeysymToString@plt>
mov    %rax,-0x98(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    155d <main+0x2cd>
mov    -0x98(%rbp),%rsi
lea    0xae4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpq   $0xff1b,-0x90(%rbp)
jne    1594 <main+0x304>
cmpl   $0xff7e,-0x6c(%rbp)
jne    1594 <main+0x304>
lea    0xac3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret
cmpq   $0xff1b,-0x90(%rbp)
jne    15d5 <main+0x345>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x70(%rbp),%edx
mov    -0x4c(%rbp),%r9d
mov    -0x48(%rbp),%eax
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1060 <XFillRectangle@plt>
mov    -0x54(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x60(%rbp)
jmp    1a95 <main+0x805>
cmpq   $0xff0d,-0x90(%rbp)
jne    1600 <main+0x370>
mov    -0x60(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x60(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    1a90 <main+0x800>
cmpq   $0x20,-0x90(%rbp)
20
jne    161c <main+0x38c>
mov    -0x5c(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x5c(%rbp)
jmp    1a8b <main+0x7fb>
cmpq   $0xff08,-0x90(%rbp)
jne    1753 <main+0x4c3>
xor    %edi,%edi
call   10c0 <time@plt>
mov    %eax,-0x9c(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1658 <main+0x3c8>
mov    -0x9c(%rbp),%esi
lea    0xa00(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x9c(%rbp),%eax
sub    -0x64(%rbp),%eax
mov    %eax,-0xa0(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1685 <main+0x3f5>
mov    -0xa0(%rbp),%esi
lea    0x9de(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x70(%rbp),%edx
mov    -0x5c(%rbp),%ecx
sub    $0x6,%ecx
mov    -0x60(%rbp),%r8d
sub    $0x9,%r8d
mov    $0x6,%r9d
movl   $0xb,(%rsp)
call   1060 <XFillRectangle@plt>
cmpl   $0x0,-0xa0(%rbp)
jne    16e6 <main+0x456>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x70(%rbp),%edx
mov    -0x5c(%rbp),%ecx
sub    $0xc,%ecx
mov    -0x60(%rbp),%r8d
sub    $0x9,%r8d
mov    $0x6,%r9d
movl   $0xb,(%rsp)
call   1060 <XFillRectangle@plt>
mov    -0x9c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     171b <main+0x48b>
mov    -0x60(%rbp),%eax
cmp    -0x58(%rbp),%eax
je     1716 <main+0x486>
mov    -0x60(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x60(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    174e <main+0x4be>
mov    -0x5c(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0xa0(%rbp)
jne    1749 <main+0x4b9>
mov    -0x5c(%rbp),%eax
sub    $0x6,%eax
cmp    -0x54(%rbp),%eax
jle    1749 <main+0x4b9>
mov    -0x5c(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0x5c(%rbp)
jmp    174e <main+0x4be>
jmp    1a86 <main+0x7f6>
cmpq   $0x2b,-0x90(%rbp)
2b
jne    17b8 <main+0x528>
mov    -0x20(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1050 <DefaultGC@plt>
mov    -0xd8(%rbp),%rdi
mov    -0xcc(%rbp),%esi
mov    %eax,%edx
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
lea    0x8dc(%rip),%r9
movl   $0x1,(%rsp)
call   1110 <XDrawString@plt>
mov    -0x5c(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x5c(%rbp)
jmp    1a81 <main+0x7f1>
cmpq   $0x2c,-0x90(%rbp)
2c
jne    181d <main+0x58d>
mov    -0x20(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xdc(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1050 <DefaultGC@plt>
mov    -0xe8(%rbp),%rdi
mov    -0xdc(%rbp),%esi
mov    %eax,%edx
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
lea    0x879(%rip),%r9
movl   $0x1,(%rsp)
call   1110 <XDrawString@plt>
mov    -0x5c(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x5c(%rbp)
jmp    1a7c <main+0x7ec>
cmpq   $0x2d,-0x90(%rbp)
2d
jne    1882 <main+0x5f2>
mov    -0x20(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xec(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1050 <DefaultGC@plt>
mov    -0xf8(%rbp),%rdi
mov    -0xec(%rbp),%esi
mov    %eax,%edx
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
lea    0x816(%rip),%r9
movl   $0x1,(%rsp)
call   1110 <XDrawString@plt>
mov    -0x5c(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x5c(%rbp)
jmp    1a77 <main+0x7e7>
cmpq   $0x2e,-0x90(%rbp)
2e
jne    18e7 <main+0x657>
mov    -0x20(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1050 <DefaultGC@plt>
mov    -0x108(%rbp),%rdi
mov    -0xfc(%rbp),%esi
mov    %eax,%edx
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
lea    0x7b3(%rip),%r9
movl   $0x1,(%rsp)
call   1110 <XDrawString@plt>
mov    -0x5c(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x5c(%rbp)
jmp    1a72 <main+0x7e2>
cmpq   $0xff09,-0x90(%rbp)
jne    194f <main+0x6bf>
mov    -0x20(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x10c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1050 <DefaultGC@plt>
mov    -0x118(%rbp),%rdi
mov    -0x10c(%rbp),%esi
mov    %eax,%edx
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
lea    0x74d(%rip),%r9
movl   $0x3,(%rsp)
call   1110 <XDrawString@plt>
mov    -0x5c(%rbp),%eax
add    $0x12,%eax
mov    %eax,-0x5c(%rbp)
jmp    1a6d <main+0x7dd>
cmpl   $0xffe2,-0x6c(%rbp)
jne    1969 <main+0x6d9>
cmpl   $0xffe1,-0x6c(%rbp)
je     19b0 <main+0x720>
cmpq   $0x31,-0x90(%rbp)
31
jne    198a <main+0x6fa>
lea    0x708(%rip),%rax
mov    %rax,-0x98(%rbp)
jmp    19ab <main+0x71b>
cmpq   $0x2b,-0x90(%rbp)
2b
jne    19a6 <main+0x716>
lea    0x6e9(%rip),%rax
mov    %rax,-0x98(%rbp)
jmp    19ab <main+0x71b>
jmp    19b0 <main+0x720>
cmpq   $0xffe2,-0x90(%rbp)
je     1a68 <main+0x7d8>
cmpq   $0xffe1,-0x90(%rbp)
je     1a68 <main+0x7d8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x138(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x130(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1050 <DefaultGC@plt>
mov    %eax,-0x12c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x128(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x124(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x98(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x138(%rbp),%rdi
mov    -0x130(%rbp),%esi
mov    -0x12c(%rbp),%edx
mov    -0x128(%rbp),%ecx
mov    -0x124(%rbp),%r8d
mov    -0x120(%rbp),%r9
mov    %eax,(%rsp)
call   1110 <XDrawString@plt>
mov    -0x98(%rbp),%rdi
call   1040 <strlen@plt>
imul   $0x6,%eax,%eax
add    -0x5c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    1a6d <main+0x7dd>
jmp    1a72 <main+0x7e2>
jmp    1a77 <main+0x7e7>
jmp    1a7c <main+0x7ec>
jmp    1a81 <main+0x7f1>
jmp    1a86 <main+0x7f6>
jmp    1a8b <main+0x7fb>
jmp    1a90 <main+0x800>
jmp    1a95 <main+0x805>
jmp    1a9a <main+0x80a>
mov    -0x90(%rbp),%rax
mov    %eax,-0x6c(%rbp)
jmp    14ba <main+0x22a>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     12cd <main+0x2d>
lea    0xd8a(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
setne  0x27(%rsp)
jmp    12d2 <main+0x32>
movb   $0x1,0x27(%rsp)
movabs $0x46464646464623,%rax
mov    %rax,0x70(%rsp)
xor    %edi,%edi
call   10b0 <XOpenDisplay@plt>
test   %rax,%rax
je     183b <main+0x59b>
mov    %rax,%rbx
mov    %rax,%rdi
call   11a0 <DefaultScreen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1100 <RootWindow@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1150 <BlackPixel@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %ebp,0x3c(%rsp)
mov    %ebp,%esi
call   1090 <WhitePixel@plt>
mov    %eax,0x10(%rsp)
mov    %r15d,0x8(%rsp)
movl   $0xa,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1f4,%r8d
mov    $0x12c,%r9d
call   1140 <XCreateSimpleWindow@plt>
mov    %eax,%ebp
mov    0x2c6e(%rip),%rax
mov    0x2c87(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1110 <XSelectInput@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1180 <XMapWindow@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1160 <DefaultColormap@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %ebp,0x34(%rsp)
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1130 <XCreateGC@plt>
mov    %eax,%ebp
lea    0x70(%rsp),%rdx
lea    0x58(%rsp),%r14
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14,%rcx
call   11b0 <XParseColor@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <XAllocColor@plt>
mov    0x58(%rsp),%edx
mov    %rbx,%rdi
mov    %ebp,0x4c(%rsp)
mov    %ebp,%esi
call   1170 <XSetForeground@plt>
mov    $0x14,%eax
mov    %rax,0x40(%rsp)
lea    0x60(%rsp),%rbp
mov    0x2bf8(%rip),%r12
movl   $0x0,0x54(%rsp)
xor    %r14d,%r14d
movl   $0x0,0x38(%rsp)
mov    $0x14,%eax
mov    %rax,0x28(%rsp)
jmp    1450 <main+0x1b0>
mov    %rbx,%rdi
mov    0x3c(%rsp),%esi
call   1060 <DefaultGC@plt>
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    %eax,%edx
mov    0x28(%rsp),%r14
mov    %r14d,%ecx
mov    0x40(%rsp),%r8
lea    0xc77(%rip),%r9
call   1120 <XDrawString@plt>
add    $0x6,%r14d
mov    %r14,0x28(%rsp)
mov    %r15d,%r14d
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10e0 <XNextEvent@plt>
mov    0x60(%rsp),%rax
cmp    (%r12),%rax
jne    1450 <main+0x1b0>
cmpb   $0x0,0x27(%rsp)
je     14c6 <main+0x226>
mov    0x68(%rsp),%esi
lea    0xbe8(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x68(%rsp),%rdi
xor    %esi,%esi
call   10f0 <XLookupKeysym@plt>
mov    %rax,%r15
lea    0xbd8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
call   11c0 <XKeysymToString@plt>
mov    %rax,%r13
lea    0xbc9(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
cmp    $0xff1b,%r15
je     14e9 <main+0x249>
jmp    14f6 <main+0x256>
lea    0x68(%rsp),%rdi
xor    %esi,%esi
call   10f0 <XLookupKeysym@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   11c0 <XKeysymToString@plt>
mov    %rax,%r13
cmp    $0xff1b,%r15
jne    14f6 <main+0x256>
cmp    $0xff7e,%r14d
je     181e <main+0x57e>
cmp    $0xff1b,%r15
jne    153d <main+0x29d>
movl   $0x12c,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    0x4c(%rsp),%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x1f4,%r9d
call   1070 <XFillRectangle@plt>
mov    $0x14,%eax
mov    %rax,0x40(%rsp)
mov    $0x14,%eax
mov    %rax,0x28(%rsp)
mov    %r15d,%r14d
jmp    1450 <main+0x1b0>
cmp    $0xff07,%r15
jg     1580 <main+0x2e0>
lea    -0x20(%r15),%rax
cmp    $0x11,%rax
ja     16f1 <main+0x451>
lea    0xaa5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
lea    0xb4f(%rip),%r14
jmp    *%rax
mov    0x28(%rsp),%rax
add    $0x6,%eax
mov    %rax,0x28(%rsp)
mov    %r15d,%r14d
jmp    1450 <main+0x1b0>
cmp    $0xff08,%r15
je     1661 <main+0x3c1>
cmp    $0xff09,%r15
je     16ab <main+0x40b>
cmp    $0xff0d,%r15
jne    16f1 <main+0x451>
mov    0x40(%rsp),%rax
add    $0xa,%eax
mov    %rax,0x40(%rsp)
mov    0x28(%rsp),%rax
mov    %eax,0x54(%rsp)
jmp    152b <main+0x28b>
mov    %rbx,%rdi
mov    0x3c(%rsp),%esi
call   1060 <DefaultGC@plt>
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    %eax,%edx
mov    0x28(%rsp),%r14
mov    %r14d,%ecx
mov    0x40(%rsp),%r8
lea    0xabe(%rip),%r9
jmp    1437 <main+0x197>
mov    %rbx,%rdi
mov    0x3c(%rsp),%esi
call   1060 <DefaultGC@plt>
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    %eax,%edx
mov    0x28(%rsp),%r14
mov    %r14d,%ecx
mov    0x40(%rsp),%r8
lea    0xa8b(%rip),%r9
jmp    1437 <main+0x197>
mov    %rbx,%rdi
mov    0x3c(%rsp),%esi
call   1060 <DefaultGC@plt>
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    %eax,%edx
mov    0x28(%rsp),%r14
mov    %r14d,%ecx
mov    0x40(%rsp),%r8
lea    0xa67(%rip),%r9
jmp    1437 <main+0x197>
xor    %edi,%edi
call   10d0 <time@plt>
mov    %eax,%r13d
cmpb   $0x0,0x27(%rsp)
mov    0x28(%rsp),%r14
mov    %eax,0x50(%rsp)
je     1757 <main+0x4b7>
lea    0x9ff(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
sub    0x38(%rsp),%r13d
lea    0x9f4(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    175c <main+0x4bc>
mov    %rbx,%rdi
mov    0x3c(%rsp),%esi
call   1060 <DefaultGC@plt>
movl   $0x3,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    %eax,%edx
mov    0x28(%rsp),%r14
mov    %r14d,%ecx
mov    0x40(%rsp),%r8
lea    0x9d9(%rip),%r9
call   1120 <XDrawString@plt>
add    $0x12,%r14d
mov    %r14,0x28(%rsp)
mov    %r15d,%r14d
jmp    1450 <main+0x1b0>
lea    -0xffe3(%r15),%rax
mov    %r13,%r14
cmp    $0xfffffffffffffffd,%rax
ja     174f <main+0x4af>
mov    %rbx,%rdi
mov    0x3c(%rsp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,%r13d
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    %r13d,%edx
mov    0x28(%rsp),%r13
mov    %r13d,%ecx
mov    0x40(%rsp),%r8
mov    %r14,%r9
call   1120 <XDrawString@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%rax,%rax,2),%eax
lea    0x0(%r13,%rax,2),%r13d
mov    %r13,0x28(%rsp)
mov    %r15d,%r14d
jmp    1450 <main+0x1b0>
sub    0x38(%rsp),%r13d
lea    -0x6(%r14),%ecx
mov    0x40(%rsp),%rax
lea    -0x9(%rax),%r8d
movl   $0xb,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    0x4c(%rsp),%edx
mov    %ecx,0x38(%rsp)
mov    %r8d,0x5c(%rsp)
mov    $0x6,%r9d
call   1070 <XFillRectangle@plt>
test   %r13d,%r13d
je     17c8 <main+0x528>
cmp    $0x14,%r14d
jg     17f4 <main+0x554>
mov    0x40(%rsp),%rcx
lea    -0xa(%rcx),%eax
cmp    $0x14,%ecx
cmove  %ecx,%eax
cmovne 0x54(%rsp),%r14d
mov    %r14,0x28(%rsp)
mov    0x50(%rsp),%ecx
mov    %ecx,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    %r15d,%r14d
jmp    1450 <main+0x1b0>
lea    -0xc(%r14),%ecx
movl   $0xb,(%rsp)
mov    %rbx,%rdi
mov    0x34(%rsp),%esi
mov    0x4c(%rsp),%edx
mov    0x5c(%rsp),%r8d
mov    $0x6,%r9d
call   1070 <XFillRectangle@plt>
cmp    $0x14,%r14d
jle    179a <main+0x4fa>
cmp    $0x21,%r14d
lea    -0xc(%r14),%eax
mov    0x38(%rsp),%ecx
cmovb  %ecx,%eax
test   %r13d,%r13d
cmovne %ecx,%eax
mov    0x50(%rsp),%ecx
mov    %ecx,0x38(%rsp)
mov    %rax,0x28(%rsp)
mov    %r15d,%r14d
jmp    1450 <main+0x1b0>
lea    0x895(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x278e(%rip),%rax
mov    (%rax),%edi
lea    0x800(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1190 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_7__ = type { i64, %struct.TYPE_9__ }
%struct.TYPE_9__ = type { i32 }
%struct.TYPE_8__ = type { i32 }
@.str = [3 x i8] c"-q\00"
@__const.main.whiteidk = [8 x i8] c"#FFFFFF\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Cannot open display\0A\00"
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@KeyPress = global i64 0
@.str.2 = [13 x i8] c"Keycode: %d\0A\00"
@.str.3 = [13 x i8] c"Keysym: %lu\0A\00"
@.str.4 = [11 x i8] c"ASCII: %s\0A\00"
@.str.5 = [12 x i8] c"Exiting...\0A\00"
@.str.6 = [11 x i8] c"Time: %ld\0A\00"
@.str.7 = [30 x i8] c"Time since last deletion: %d\0A\00"
@.str.8 = [2 x i8] c"+\00"
@.str.9 = [2 x i8] c",\00"
@.str.10 = [2 x i8] c"-\00"
@.str.11 = [2 x i8] c".\00"
@.str.12 = [4 x i8] c" \00"
@.str.13 = [2 x i8] c"!\00"
@.str.14 = [2 x i8] c"?\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca %struct.TYPE_7__
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca %struct.TYPE_8__
%25 = alloca i32
%26 = alloca [8 x i8]
%27 = alloca i64
%28 = alloca i8*
%29 = alloca i32
%30 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %42
35: ; preds = %2
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %35
store i32 1, i32* %6
br label %42
42: ; preds = %41, %35, %2
store i32 0, i32* %11
store i32 0, i32* %12
store i32 300, i32* %13
store i32 500, i32* %14
store i32 10, i32* %15
store i32 20, i32* %16
store i32 20, i32* %17
%43 = load i32, i32* %16
store i32 %43, i32* %18
%44 = load i32, i32* %17
store i32 %44, i32* %19
store i32 0, i32* %20
store i32 0, i32* %21
store i32 0, i32* %22
%45 = bitcast [8 x i8]* %26 to i8*
%46 = call i32* @XOpenDisplay(i32* null)
store i32* %46, i32** %7
%47 = load i32*, i32** %7
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %53
49: ; preds = %42
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %42
%54 = load i32*, i32** %7
%55 = call i32 @DefaultScreen(i32* %54)
store i32 %55, i32* %10
%56 = load i32*, i32** %7
%57 = load i32*, i32** %7
%58 = load i32, i32* %10
%59 = call i32 @RootWindow(i32* %57, i32 %58)
%60 = load i32, i32* %12
%61 = load i32, i32* %11
%62 = load i32, i32* %14
%63 = load i32, i32* %13
%64 = load i32, i32* %15
%65 = load i32*, i32** %7
%66 = load i32, i32* %10
%67 = call i32 @BlackPixel(i32* %65, i32 %66)
%68 = load i32*, i32** %7
%69 = load i32, i32* %10
%70 = call i32 @WhitePixel(i32* %68, i32 %69)
%71 = call i32 @XCreateSimpleWindow(i32* %56, i32 %59, i32 %60, i32 %61, i32 %62, i32 %63, i32 %64, i32 %67, i32 %70)
store i32 %71, i32* %8
%72 = load i32*, i32** %7
%73 = load i32, i32* %8
%74 = load i32, i32* @ExposureMask
%75 = load i32, i32* @KeyPressMask
%76 = or i32 %74, %75
%77 = call i32 @XSelectInput(i32* %72, i32 %73, i32 %76)
%78 = load i32*, i32** %7
%79 = load i32, i32* %8
%80 = call i32 @XMapWindow(i32* %78, i32 %79)
%81 = load i32*, i32** %7
%82 = call i32 @DefaultColormap(i32* %81, i32 0)
store i32 %82, i32* %25
%83 = load i32*, i32** %7
%84 = load i32, i32* %8
%85 = call i32 @XCreateGC(i32* %83, i32 %84, i32 0, i32 0)
store i32 %85, i32* %23
%86 = load i32*, i32** %7
%87 = load i32, i32* %25
%88 = getelementptr inbounds [8 x i8], [8 x i8]* %26, i64 0, i64 0
%89 = call i32 @XParseColor(i32* %86, i32 %87, i8* %88, %struct.TYPE_8__* %24)
%90 = load i32*, i32** %7
%91 = load i32, i32* %25
%92 = call i32 @XAllocColor(i32* %90, i32 %91, %struct.TYPE_8__* %24)
%93 = load i32*, i32** %7
%94 = load i32, i32* %23
%95 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %24, i32 0, i32 0
%96 = load i32, i32* %95
%97 = call i32 @XSetForeground(i32* %93, i32 %94, i32 %96)
br label %98
98: ; preds = %53, %353
%99 = load i32*, i32** %7
%100 = call i32 @XNextEvent(i32* %99, %struct.TYPE_7__* %9)
%101 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %9, i32 0, i32 0
%102 = load i64, i64* %101
%103 = load i64, i64* @KeyPress
%104 = icmp eq i64 %102, %103
br i1 %104, label %105, label %353
105: ; preds = %98
%106 = load i32, i32* %6
%107 = icmp ne i32 %106, 0
br i1 %107, label %113, label %108
108: ; preds = %105
%109 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %9, i32 0, i32 1
%110 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %109, i32 0, i32 0
%111 = load i32, i32* %110
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %111)
br label %113
113: ; preds = %108, %105
%114 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %9, i32 0, i32 1
%115 = call i64 @XLookupKeysym(%struct.TYPE_9__* %114, i32 0)
store i64 %115, i64* %27
%116 = load i32, i32* %6
%117 = icmp ne i32 %116, 0
br i1 %117, label %121, label %118
118: ; preds = %113
%119 = load i64, i64* %27
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i64 %119)
br label %121
121: ; preds = %118, %113
%122 = load i64, i64* %27
%123 = call i8* @XKeysymToString(i64 %122)
store i8* %123, i8** %28
%124 = load i32, i32* %6
%125 = icmp ne i32 %124, 0
br i1 %125, label %129, label %126
126: ; preds = %121
%127 = load i8*, i8** %28
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %127)
br label %129
129: ; preds = %126, %121
%130 = load i64, i64* %27
%131 = icmp eq i64 %130, 65307
br i1 %131, label %132, label %137
132: ; preds = %129
%133 = load i32, i32* %22
%134 = icmp eq i32 %133, 65406
br i1 %134, label %135, label %137
135: ; preds = %132
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
137: ; preds = %132, %129
%138 = load i64, i64* %27
%139 = icmp eq i64 %138, 65307
br i1 %139, label %140, label %149
140: ; preds = %137
%141 = load i32*, i32** %7
%142 = load i32, i32* %8
%143 = load i32, i32* %23
%144 = load i32, i32* %14
%145 = load i32, i32* %13
%146 = call i32 @XFillRectangle(i32* %141, i32 %142, i32 %143, i32 0, i32 0, i32 %144, i32 %145)
%147 = load i32, i32* %16
store i32 %147, i32* %18
%148 = load i32, i32* %17
store i32 %148, i32* %19
br label %349
149: ; preds = %137
%150 = load i64, i64* %27
%151 = icmp eq i64 %150, 65293
br i1 %151, label %152, label %157
152: ; preds = %149
%153 = load i32, i32* %19
%154 = add nsw i32 %153, 10
store i32 %154, i32* %19
%155 = load i32, i32* %18
store i32 %155, i32* %21
%156 = load i32, i32* %16
store i32 %156, i32* %18
br label %348
157: ; preds = %149
%158 = load i64, i64* %27
%159 = icmp eq i64 %158, 32
br i1 %159, label %160, label %163
160: ; preds = %157
%161 = load i32, i32* %18
%162 = add nsw i32 %161, 6
store i32 %162, i32* %18
br label %347
163: ; preds = %157
%164 = load i64, i64* %27
%165 = icmp eq i64 %164, 65288
br i1 %165, label %166, label %231
166: ; preds = %163
%167 = call i32 @time(i32 0)
store i32 %167, i32* %29
%168 = load i32, i32* %6
%169 = icmp ne i32 %168, 0
br i1 %169, label %173, label %170
170: ; preds = %166
%171 = load i32, i32* %29
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %171)
br label %173
173: ; preds = %170, %166
%174 = load i32, i32* %29
%175 = load i32, i32* %20
%176 = sub nsw i32 %174, %175
store i32 %176, i32* %30
%177 = load i32, i32* %6
%178 = icmp ne i32 %177, 0
br i1 %178, label %182, label %179
179: ; preds = %173
%180 = load i32, i32* %30
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %180)
br label %182
182: ; preds = %179, %173
%183 = load i32*, i32** %7
%184 = load i32, i32* %8
%185 = load i32, i32* %23
%186 = load i32, i32* %18
%187 = sub nsw i32 %186, 6
%188 = load i32, i32* %19
%189 = sub nsw i32 %188, 9
%190 = call i32 @XFillRectangle(i32* %183, i32 %184, i32 %185, i32 %187, i32 %189, i32 6, i32 11)
%191 = load i32, i32* %30
%192 = icmp eq i32 %191, 0
br i1 %192, label %193, label %202
193: ; preds = %182
%194 = load i32*, i32** %7
%195 = load i32, i32* %8
%196 = load i32, i32* %23
%197 = load i32, i32* %18
%198 = sub nsw i32 %197, 12
%199 = load i32, i32* %19
%200 = sub nsw i32 %199, 9
%201 = call i32 @XFillRectangle(i32* %194, i32 %195, i32 %196, i32 %198, i32 %200, i32 6, i32 11)
br label %202
202: ; preds = %193, %182
%203 = load i32, i32* %29
store i32 %203, i32* %20
%204 = load i32, i32* %18
%205 = load i32, i32* %16
%206 = icmp sle i32 %204, %205
br i1 %206, label %207, label %216
207: ; preds = %202
%208 = load i32, i32* %19
%209 = load i32, i32* %17
%210 = icmp ne i32 %208, %209
br i1 %210, label %211, label %215
211: ; preds = %207
%212 = load i32, i32* %19
%213 = sub nsw i32 %212, 10
store i32 %213, i32* %19
%214 = load i32, i32* %21
store i32 %214, i32* %18
br label %215
215: ; preds = %211, %207
br label %230
216: ; preds = %202
%217 = load i32, i32* %18
%218 = sub nsw i32 %217, 6
store i32 %218, i32* %18
%219 = load i32, i32* %30
%220 = icmp eq i32 %219, 0
br i1 %220, label %221, label %229
221: ; preds = %216
%222 = load i32, i32* %18
%223 = sub nsw i32 %222, 6
%224 = load i32, i32* %16
%225 = icmp sgt i32 %223, %224
br i1 %225, label %226, label %229
226: ; preds = %221
%227 = load i32, i32* %18
%228 = sub nsw i32 %227, 6
store i32 %228, i32* %18
br label %229
229: ; preds = %226, %221, %216
br label %230
230: ; preds = %229, %215
br label %346
231: ; preds = %163
%232 = load i64, i64* %27
%233 = icmp eq i64 %232, 43
br i1 %233, label %234, label %245
234: ; preds = %231
%235 = load i32*, i32** %7
%236 = load i32, i32* %8
%237 = load i32*, i32** %7
%238 = load i32, i32* %10
%239 = call i32 @DefaultGC(i32* %237, i32 %238)
%240 = load i32, i32* %18
%241 = load i32, i32* %19
%242 = call i32 @XDrawString(i32* %235, i32 %236, i32 %239, i32 %240, i32 %241, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 1)
%243 = load i32, i32* %18
%244 = add nsw i32 %243, 6
store i32 %244, i32* %18
br label %345
245: ; preds = %231
%246 = load i64, i64* %27
%247 = icmp eq i64 %246, 44
br i1 %247, label %248, label %259
248: ; preds = %245
%249 = load i32*, i32** %7
%250 = load i32, i32* %8
%251 = load i32*, i32** %7
%252 = load i32, i32* %10
%253 = call i32 @DefaultGC(i32* %251, i32 %252)
%254 = load i32, i32* %18
%255 = load i32, i32* %19
%256 = call i32 @XDrawString(i32* %249, i32 %250, i32 %253, i32 %254, i32 %255, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 1)
%257 = load i32, i32* %18
%258 = add nsw i32 %257, 6
store i32 %258, i32* %18
br label %344
259: ; preds = %245
%260 = load i64, i64* %27
%261 = icmp eq i64 %260, 45
br i1 %261, label %262, label %273
262: ; preds = %259
%263 = load i32*, i32** %7
%264 = load i32, i32* %8
%265 = load i32*, i32** %7
%266 = load i32, i32* %10
%267 = call i32 @DefaultGC(i32* %265, i32 %266)
%268 = load i32, i32* %18
%269 = load i32, i32* %19
%270 = call i32 @XDrawString(i32* %263, i32 %264, i32 %267, i32 %268, i32 %269, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 1)
%271 = load i32, i32* %18
%272 = add nsw i32 %271, 6
store i32 %272, i32* %18
br label %343
273: ; preds = %259
%274 = load i64, i64* %27
%275 = icmp eq i64 %274, 46
br i1 %275, label %276, label %287
276: ; preds = %273
%277 = load i32*, i32** %7
%278 = load i32, i32* %8
%279 = load i32*, i32** %7
%280 = load i32, i32* %10
%281 = call i32 @DefaultGC(i32* %279, i32 %280)
%282 = load i32, i32* %18
%283 = load i32, i32* %19
%284 = call i32 @XDrawString(i32* %277, i32 %278, i32 %281, i32 %282, i32 %283, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1)
%285 = load i32, i32* %18
%286 = add nsw i32 %285, 6
store i32 %286, i32* %18
br label %342
287: ; preds = %273
%288 = load i64, i64* %27
%289 = icmp eq i64 %288, 65289
br i1 %289, label %290, label %301
290: ; preds = %287
%291 = load i32*, i32** %7
%292 = load i32, i32* %8
%293 = load i32*, i32** %7
%294 = load i32, i32* %10
%295 = call i32 @DefaultGC(i32* %293, i32 %294)
%296 = load i32, i32* %18
%297 = load i32, i32* %19
%298 = call i32 @XDrawString(i32* %291, i32 %292, i32 %295, i32 %296, i32 %297, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 3)
%299 = load i32, i32* %18
%300 = add nsw i32 %299, 18
store i32 %300, i32* %18
br label %341
301: ; preds = %287
%302 = load i32, i32* %22
%303 = icmp ne i32 %302, 65506
br i1 %303, label %307, label %304
304: ; preds = %301
%305 = load i32, i32* %22
%306 = icmp ne i32 %305, 65505
br i1 %306, label %307, label %317
307: ; preds = %304, %301
%308 = load i64, i64* %27
%309 = icmp eq i64 %308, 49
br i1 %309, label %310, label %311
310: ; preds = %307
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8** %28
br label %316
311: ; preds = %307
%312 = load i64, i64* %27
%313 = icmp eq i64 %312, 43
br i1 %313, label %314, label %315
314: ; preds = %311
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i8** %28
br label %315
315: ; preds = %314, %311
br label %316
316: ; preds = %315, %310
br label %317
317: ; preds = %316, %304
%318 = load i64, i64* %27
%319 = icmp ne i64 %318, 65506
br i1 %319, label %320, label %340
320: ; preds = %317
%321 = load i64, i64* %27
%322 = icmp ne i64 %321, 65505
br i1 %322, label %323, label %340
323: ; preds = %320
%324 = load i32*, i32** %7
%325 = load i32, i32* %8
%326 = load i32*, i32** %7
%327 = load i32, i32* %10
%328 = call i32 @DefaultGC(i32* %326, i32 %327)
%329 = load i32, i32* %18
%330 = load i32, i32* %19
%331 = load i8*, i8** %28
%332 = load i8*, i8** %28
%333 = call i32 @strlen(i8* %332)
%334 = call i32 @XDrawString(i32* %324, i32 %325, i32 %328, i32 %329, i32 %330, i8* %331, i32 %333)
%335 = load i8*, i8** %28
%336 = call i32 @strlen(i8* %335)
%337 = mul nsw i32 %336, 6
%338 = load i32, i32* %18
%339 = add nsw i32 %338, %337
store i32 %339, i32* %18
br label %340
340: ; preds = %323, %320, %317
br label %341
341: ; preds = %340, %290
br label %342
342: ; preds = %341, %276
br label %343
343: ; preds = %342, %262
br label %344
344: ; preds = %343, %248
br label %345
345: ; preds = %344, %234
br label %346
346: ; preds = %345, %230
br label %347
347: ; preds = %346, %160
br label %348
348: ; preds = %347, %152
br label %349
349: ; preds = %348, %140
br label %350
350: ; preds = %349
%351 = load i64, i64* %27
%352 = trunc i64 %351 to i32
store i32 %352, i32* %22
br label %353
353: ; preds = %350, %98
br label %98
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i64, %struct.TYPE_9__ }
%struct.TYPE_9__ = type { i32 }
%struct.TYPE_8__ = type { i32 }
@.str = [3 x i8] c"-q\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Cannot open display\0A\00"
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@KeyPress = global i64 0
@.str.2 = [13 x i8] c"Keycode: %d\0A\00"
@.str.3 = [13 x i8] c"Keysym: %lu\0A\00"
@.str.4 = [11 x i8] c"ASCII: %s\0A\00"
@.str.6 = [11 x i8] c"Time: %ld\0A\00"
@.str.7 = [30 x i8] c"Time since last deletion: %d\0A\00"
@.str.8 = [2 x i8] c"+\00"
@.str.9 = [2 x i8] c",\00"
@.str.10 = [2 x i8] c"-\00"
@.str.11 = [2 x i8] c".\00"
@.str.12 = [4 x i8] c" \00"
@.str.13 = [2 x i8] c"!\00"
@str = [11 x i8] c"Exiting...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_7__
%4 = alloca %struct.TYPE_8__
%5 = alloca i64
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %9, %2
%13 = phi i1 [ true, %2 ], [ %11, %9 ]
%14 = bitcast %struct.TYPE_7__* %3 to i8*
%15 = bitcast %struct.TYPE_8__* %4 to i8*
%16 = bitcast i64* %5 to i8*
store i64 19780516010411555, i64* %5
%17 = tail call i32* @XOpenDisplay(i32* null)
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %23
19: ; preds = %12
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %12
%24 = tail call i32 @DefaultScreen(i32* %17)
%25 = tail call i32 @RootWindow(i32* %17, i32 %24)
%26 = tail call i32 @BlackPixel(i32* %17, i32 %24)
%27 = tail call i32 @WhitePixel(i32* %17, i32 %24)
%28 = tail call i32 @XCreateSimpleWindow(i32* %17, i32 %25, i32 0, i32 0, i32 500, i32 300, i32 10, i32 %26, i32 %27)
%29 = load i32, i32* @ExposureMask
%30 = load i32, i32* @KeyPressMask
%31 = or i32 %30, %29
%32 = tail call i32 @XSelectInput(i32* %17, i32 %28, i32 %31)
%33 = tail call i32 @XMapWindow(i32* %17, i32 %28)
%34 = tail call i32 @DefaultColormap(i32* %17, i32 0)
%35 = tail call i32 @XCreateGC(i32* %17, i32 %28, i32 0, i32 0)
%36 = call i32 @XParseColor(i32* %17, i32 %34, i8* %16, %struct.TYPE_8__* %4)
%37 = call i32 @XAllocColor(i32* %17, i32 %34, %struct.TYPE_8__* %4)
%38 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %4, i64 0, i32 0
%39 = load i32, i32* %38
%40 = call i32 @XSetForeground(i32* %17, i32 %35, i32 %39)
%41 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %3, i64 0, i32 0
%42 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %3, i64 0, i32 1
%43 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %3, i64 0, i32 1, i32 0
br label %44
44: ; preds = %140, %23
%45 = phi i32 [ %141, %140 ], [ 0, %23 ]
%46 = phi i32 [ %145, %140 ], [ 0, %23 ]
%47 = phi i32 [ %142, %140 ], [ 0, %23 ]
%48 = phi i32 [ %143, %140 ], [ 20, %23 ]
%49 = phi i32 [ %144, %140 ], [ 20, %23 ]
br label %50
50: ; preds = %44, %50
%51 = call i32 @XNextEvent(i32* %17, %struct.TYPE_7__* %3)
%52 = load i64, i64* %41
%53 = load i64, i64* @KeyPress
%54 = icmp eq i64 %52, %53
br i1 %54, label %55, label %50
55: ; preds = %50
br i1 %13, label %59, label %56
56: ; preds = %55
%57 = call i64 @XLookupKeysym(%struct.TYPE_9__* %42, i32 0)
%58 = call i8* @XKeysymToString(i64 %57)
br label %66
59: ; preds = %55
%60 = load i32, i32* %43
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%62 = call i64 @XLookupKeysym(%struct.TYPE_9__* %42, i32 0)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i64 %62)
%64 = call i8* @XKeysymToString(i64 %62)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %64)
br label %66
66: ; preds = %56, %59
%67 = phi i8* [ %64, %59 ], [ %58, %56 ]
%68 = phi i64 [ %62, %59 ], [ %57, %56 ]
%69 = icmp eq i64 %68, 65307
%70 = icmp eq i32 %46, 65406
%71 = and i1 %69, %70
br i1 %71, label %146, label %72
72: ; preds = %66
br i1 %69, label %73, label %75
73: ; preds = %72
%74 = call i32 @XFillRectangle(i32* %17, i32 %28, i32 %35, i32 0, i32 0, i32 500, i32 300)
br label %140
75: ; preds = %72
switch i64 %68, label %129 [
i64 65293, label %76
i64 32, label %78
i64 65288, label %80
i64 43, label %109
i64 44, label %113
i64 45, label %117
i64 46, label %121
i64 65289, label %125
i64 49, label %132
]
76: ; preds = %75
%77 = add nsw i32 %48, 10
br label %140
78: ; preds = %75
%79 = add nsw i32 %49, 6
br label %140
80: ; preds = %75
%81 = call i32 @time(i32 0)
br i1 %13, label %84, label %82
82: ; preds = %80
%83 = sub nsw i32 %81, %47
br label %88
84: ; preds = %80
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %81)
%86 = sub nsw i32 %81, %47
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %86)
br label %88
88: ; preds = %82, %84
%89 = phi i32 [ %86, %84 ], [ %83, %82 ]
%90 = add nsw i32 %49, -6
%91 = add nsw i32 %48, -9
%92 = call i32 @XFillRectangle(i32* %17, i32 %28, i32 %35, i32 %90, i32 %91, i32 6, i32 11)
%93 = icmp eq i32 %89, 0
br i1 %93, label %94, label %97
94: ; preds = %88
%95 = add nsw i32 %49, -12
%96 = call i32 @XFillRectangle(i32* %17, i32 %28, i32 %35, i32 %95, i32 %91, i32 6, i32 11)
br label %97
97: ; preds = %94, %88
%98 = icmp slt i32 %49, 21
br i1 %98, label %99, label %104
99: ; preds = %97
%100 = icmp eq i32 %48, 20
%101 = add nsw i32 %48, -10
%102 = select i1 %100, i32 20, i32 %101
%103 = select i1 %100, i32 %49, i32 %45
br label %140
104: ; preds = %97
%105 = icmp ugt i32 %49, 32
%106 = select i1 %93, i1 %105, i1 false
%107 = add nsw i32 %49, -12
%108 = select i1 %106, i32 %107, i32 %90
br label %140
109: ; preds = %75
%110 = call i32 @DefaultGC(i32* %17, i32 %24)
%111 = call i32 @XDrawString(i32* %17, i32 %28, i32 %110, i32 %49, i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 1)
%112 = add nsw i32 %49, 6
br label %140
113: ; preds = %75
%114 = call i32 @DefaultGC(i32* %17, i32 %24)
%115 = call i32 @XDrawString(i32* %17, i32 %28, i32 %114, i32 %49, i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 1)
%116 = add nsw i32 %49, 6
br label %140
117: ; preds = %75
%118 = call i32 @DefaultGC(i32* %17, i32 %24)
%119 = call i32 @XDrawString(i32* %17, i32 %28, i32 %118, i32 %49, i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 1)
%120 = add nsw i32 %49, 6
br label %140
121: ; preds = %75
%122 = call i32 @DefaultGC(i32* %17, i32 %24)
%123 = call i32 @XDrawString(i32* %17, i32 %28, i32 %122, i32 %49, i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1)
%124 = add nsw i32 %49, 6
br label %140
125: ; preds = %75
%126 = call i32 @DefaultGC(i32* %17, i32 %24)
%127 = call i32 @XDrawString(i32* %17, i32 %28, i32 %126, i32 %49, i32 %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 3)
%128 = add nsw i32 %49, 18
br label %140
129: ; preds = %75
%130 = add i64 %68, -65507
%131 = icmp ult i64 %130, -2
br i1 %131, label %132, label %140
132: ; preds = %75, %129
%133 = phi i8* [ %67, %129 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), %75 ]
%134 = call i32 @DefaultGC(i32* %17, i32 %24)
%135 = call i32 @strlen(i8* %133)
%136 = call i32 @XDrawString(i32* %17, i32 %28, i32 %134, i32 %49, i32 %48, i8* %133, i32 %135)
%137 = call i32 @strlen(i8* %133)
%138 = mul nsw i32 %137, 6
%139 = add nsw i32 %138, %49
br label %140
140: ; preds = %76, %113, %121, %129, %132, %125, %117, %109, %78, %73, %99, %104
%141 = phi i32 [ %45, %73 ], [ %49, %76 ], [ %45, %78 ], [ %45, %109 ], [ %45, %113 ], [ %45, %117 ], [ %45, %121 ], [ %45, %125 ], [ %45, %132 ], [ %45, %129 ], [ %45, %99 ], [ %45, %104 ]
%142 = phi i32 [ %47, %73 ], [ %47, %76 ], [ %47, %78 ], [ %47, %109 ], [ %47, %113 ], [ %47, %117 ], [ %47, %121 ], [ %47, %125 ], [ %47, %132 ], [ %47, %129 ], [ %81, %99 ], [ %81, %104 ]
%143 = phi i32 [ 20, %73 ], [ %77, %76 ], [ %48, %78 ], [ %48, %109 ], [ %48, %113 ], [ %48, %117 ], [ %48, %121 ], [ %48, %125 ], [ %48, %132 ], [ %48, %129 ], [ %102, %99 ], [ %48, %104 ]
%144 = phi i32 [ 20, %73 ], [ 20, %76 ], [ %79, %78 ], [ %112, %109 ], [ %116, %113 ], [ %120, %117 ], [ %124, %121 ], [ %128, %125 ], [ %139, %132 ], [ %49, %129 ], [ %103, %99 ], [ %108, %104 ]
%145 = trunc i64 %68 to i32
br label %44
146: ; preds = %66
%147 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}