#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_14__ TYPE_5__;
typedef struct TYPE_13__ TYPE_4__;
typedef struct TYPE_12__ TYPE_3__;
typedef struct TYPE_11__ TYPE_2__;
typedef struct TYPE_10__ TYPE_1__;

/* Type definitions */
struct TYPE_12__ {
  int foreground;
  int background;
};
typedef TYPE_3__ XGCValues;
struct TYPE_11__ {
  int button;
};
struct TYPE_10__ {
  int /*<<< orphan*/ window;
};
struct TYPE_13__ {
  scalar_t__ type;
  TYPE_2__ xbutton;
  TYPE_1__ xany;
};
typedef TYPE_4__ XEvent;
struct TYPE_14__ {
  int pixel;
};
typedef TYPE_5__ XColor;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ GC;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Colormap;

/* Variables and functions */
int BlackPixel(int /*<<< orphan*/ *, int);
scalar_t__ ButtonPress;
int ButtonPressMask;
scalar_t__ ButtonRelease;
int ButtonReleaseMask;
int ConfigureNotify;
int /*<<< orphan*/ DefaultColormap(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ DefaultGC(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int DefaultScreen(int /*<<< orphan*/ *);
scalar_t__ Expose;
int ExposureMask;
int GCBackground;
int GCForeground;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int StructureNotifyMask;
int WhitePixel(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ XAllocColor(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               TYPE_5__ *);
int /*<<< orphan*/ XCreateGC(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                             TYPE_3__ *);
int /*<<< orphan*/ XCreateSimpleWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int, int, int, int, int, int, int);
int /*<<< orphan*/ XDrawArc(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/, int, int, int, int, int, int);
int /*<<< orphan*/ XDrawLine(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/, int, int, int, int);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, TYPE_4__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XParseColor(int /*<<< orphan*/ *, int /*<<< orphan*/, char *,
                               TYPE_5__ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ XSetForeground(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int);
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ print_display_information(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main() {
  Display *dpy = XOpenDisplay(NULL);
  assert(dpy);
  print_display_information(dpy);
  int screen = DefaultScreen(dpy);
  int blackColor = BlackPixel(dpy, DefaultScreen(dpy));
  int whiteColor = WhitePixel(dpy, DefaultScreen(dpy));
  Window w = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 200, 300, 1,
                                 blackColor, whiteColor);
  XSelectInput(dpy, w, StructureNotifyMask | ConfigureNotify);
  XMapWindow(dpy, w);
  Window cw1 =
      XCreateSimpleWindow(dpy, w, 20, 20, 80, 50, 1, blackColor, whiteColor);
  Window cw2 =
      XCreateSimpleWindow(dpy, w, 110, 20, 80, 50, 1, blackColor, whiteColor);
  int width, height;
  Colormap colormap;
  XColor button_color;
  XColor lightgray_color, darkgray_color;
  XGCValues gcv_lightgray, gcv_darkgray;
  GC gc_lightgray, gc_darkgray;
  XSelectInput(dpy, cw1, StructureNotifyMask | ExposureMask);
  XSelectInput(dpy, cw2, StructureNotifyMask | ExposureMask);
  XMapWindow(dpy, cw1);
  XMapWindow(dpy, cw2);
  GC gc = XCreateGC(dpy, w, 0, NULL);
  XSetForeground(dpy, gc, blackColor);
  colormap = DefaultColormap(dpy, screen);
  XParseColor(dpy, colormap, "rgb:cc/cc/cc", &button_color);
  XAllocColor(dpy, colormap, &button_color);
  XParseColor(dpy, colormap, "rgb:ee/ee/ee", &lightgray_color);
  XAllocColor(dpy, colormap, &lightgray_color);
  gcv_lightgray.foreground = lightgray_color.pixel;
  gcv_lightgray.background = button_color.pixel;
  gc_lightgray = XCreateGC(dpy, RootWindow(dpy, screen),
                           GCForeground | GCBackground, &gcv_lightgray);
  XParseColor(dpy, colormap, "rgb:88/88/88", &darkgray_color);
  XAllocColor(dpy, colormap, &darkgray_color);
  gcv_darkgray.foreground = darkgray_color.pixel;
  gcv_darkgray.background = button_color.pixel;
  gc_darkgray = XCreateGC(dpy, RootWindow(dpy, screen),
                          GCForeground | GCBackground, &gcv_darkgray);
  width = 80;
  height = 30;
  Window button = XCreateSimpleWindow(dpy, w, 20, 120, width, height, 1,
                                      blackColor, button_color.pixel);
  XSelectInput(dpy, button,
               StructureNotifyMask | ExposureMask | ButtonPressMask |
                   ButtonReleaseMask);
  XMapWindow(dpy, button);
  for (;;) {
    XEvent e;
    XNextEvent(dpy, &e);
    if (e.xany.window == cw1) {
      printf("cw1 event\n");
      if (e.type == Expose) {
        printf("expose win 1 event\n");
        XDrawLine(dpy, cw1, DefaultGC(dpy, screen), 10, 10, 140, 40);
        XDrawArc(dpy, cw1, gc, 10, 10, 40, 40, 10, 90);
      }
    }
    if (e.xany.window == cw2) {
      printf("cw2 event\n");
      if (e.type == Expose) {
        printf("expose win 2 event\n");
        XDrawLine(dpy, cw2, DefaultGC(dpy, screen), 10, 10, 140, 40);
      }
    }
    if (e.xany.window == button && e.type == Expose) {
      XDrawLine(dpy, button, gc_lightgray, 0, 0, width - 1, 0);
      XDrawLine(dpy, button, gc_lightgray, 0, 0, 0, height - 1);
      XDrawLine(dpy, button, gc_darkgray, width - 1, width - 1, width - 1, 0);
      XDrawLine(dpy, button, gc_darkgray, 1, height - 1, width - 1, height - 1);
    }
    if (e.type == ButtonPress) {
      if (e.xbutton.button == 1) {
        XDrawLine(dpy, button, gc_darkgray, 0, 0, width - 1, 0);
        XDrawLine(dpy, button, gc_darkgray, 0, 0, 0, height - 1);
        XDrawLine(dpy, button, gc_lightgray, width - 1, width - 1, width - 1,
                  0);
        XDrawLine(dpy, button, gc_lightgray, 1, height - 1, width - 1,
                  height - 1);
      }
    }
    if (e.type == ButtonRelease) {
      if (e.xbutton.button == 1) {
        XDrawLine(dpy, button, gc_lightgray, 0, 0, width - 1, 0);
        XDrawLine(dpy, button, gc_lightgray, 0, 0, 0, height - 1);
        XDrawLine(dpy, button, gc_darkgray, width - 1, width - 1, width - 1, 0);
        XDrawLine(dpy, button, gc_darkgray, 1, height - 1, width - 1,
                  height - 1);
      }
    }
    XFlush(dpy);
  }
  printf("I am totally a menu\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <XOpenDisplay@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1140 <print_display_information@plt>
mov    -0x10(%rbp),%rdi
call   1160 <DefaultScreen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rdi
call   1160 <DefaultScreen@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%esi
call   1100 <BlackPixel@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rdi
call   1160 <DefaultScreen@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%esi
call   1080 <WhitePixel@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <DefaultRootWindow@plt>
mov    -0x90(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
xor    %ecx,%ecx
mov    $0xc8,%r8d
mov    $0x12c,%r9d
mov    %ecx,%edx
movl   $0x1,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    0x2c7f(%rip),%rax
mov    (%rax),%edx
mov    0x2c86(%rip),%rax
or     (%rax),%edx
call   10d0 <XSelectInput@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1150 <XMapWindow@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
mov    $0x14,%ecx
mov    $0x50,%r8d
mov    $0x32,%r9d
mov    %ecx,%edx
movl   $0x1,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
mov    $0x6e,%edx
mov    $0x14,%ecx
mov    $0x50,%r8d
mov    $0x32,%r9d
movl   $0x1,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2be0(%rip),%rax
mov    (%rax),%edx
mov    0x2bb7(%rip),%rax
or     (%rax),%edx
call   10d0 <XSelectInput@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    0x2bc2(%rip),%rax
mov    (%rax),%edx
mov    0x2b99(%rip),%rax
or     (%rax),%edx
call   10d0 <XSelectInput@plt>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1150 <XMapWindow@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1150 <XMapWindow@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   10e0 <XCreateGC@plt>
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1120 <XSetForeground@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1110 <DefaultColormap@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    0xb99(%rip),%rdx
lea    -0x38(%rbp),%rcx
call   1170 <XParseColor@plt>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    -0x38(%rbp),%rdx
call   1030 <XAllocColor@plt>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    0xb7f(%rip),%rdx
lea    -0x40(%rbp),%rcx
call   1170 <XParseColor@plt>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <XAllocColor@plt>
mov    -0x40(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   10c0 <RootWindow@plt>
mov    -0x88(%rbp),%rdi
mov    %eax,%esi
mov    0x2b0e(%rip),%rax
mov    (%rax),%edx
mov    0x2ac5(%rip),%rax
or     (%rax),%edx
lea    -0x50(%rbp),%rcx
call   10e0 <XCreateGC@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    0xb1b(%rip),%rdx
lea    -0x48(%rbp),%rcx
call   1170 <XParseColor@plt>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    -0x48(%rbp),%rdx
call   1030 <XAllocColor@plt>
mov    -0x48(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   10c0 <RootWindow@plt>
mov    -0x80(%rbp),%rdi
mov    %eax,%esi
mov    0x2aa3(%rip),%rax
mov    (%rax),%edx
mov    0x2a5a(%rip),%rax
or     (%rax),%edx
lea    -0x58(%rbp),%rcx
call   10e0 <XCreateGC@plt>
mov    %eax,-0x60(%rbp)
movl   $0x50,-0x2c(%rbp)
movl   $0x1e,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    -0x38(%rbp),%eax
mov    $0x14,%edx
mov    $0x78,%ecx
movl   $0x1,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    0x2a10(%rip),%rax
mov    (%rax),%edx
mov    0x29e7(%rip),%rax
or     (%rax),%edx
mov    0x2a16(%rip),%rax
or     (%rax),%edx
mov    0x29ed(%rip),%rax
or     (%rax),%edx
call   10d0 <XSelectInput@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
call   1150 <XMapWindow@plt>
mov    -0x10(%rbp),%rdi
lea    -0x78(%rbp),%rsi
call   10b0 <XNextEvent@plt>
mov    -0x6c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    16a7 <main+0x447>
lea    0xa29(%rip),%rdi
call   1070 <printf@plt>
mov    -0x78(%rbp),%rax
mov    0x29d2(%rip),%rcx
cmp    (%rcx),%rax
jne    16a2 <main+0x442>
lea    0xa14(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    -0xb0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    %eax,%edx
mov    $0xa,%r8d
mov    $0x8c,%r9d
mov    %r8d,%ecx
movl   $0x28,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x64(%rbp),%edx
mov    $0xa,%r8d
mov    $0x28,%r9d
mov    %r8d,%ecx
movl   $0x28,(%rsp)
movl   $0xa,0x8(%rsp)
movl   $0x5a,0x10(%rsp)
call   1040 <XDrawArc@plt>
jmp    16a7 <main+0x447>
mov    -0x6c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    172e <main+0x4ce>
lea    0x98c(%rip),%rdi
call   1070 <printf@plt>
mov    -0x78(%rbp),%rax
mov    0x2916(%rip),%rcx
cmp    (%rcx),%rax
jne    1729 <main+0x4c9>
lea    0x977(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    -0xc0(%rbp),%rdi
mov    -0xb4(%rbp),%esi
mov    %eax,%edx
mov    $0xa,%r8d
mov    $0x8c,%r9d
mov    %r8d,%ecx
movl   $0x28,(%rsp)
call   1180 <XDrawLine@plt>
jmp    172e <main+0x4ce>
mov    -0x6c(%rbp),%eax
cmp    -0x68(%rbp),%eax
jne    17ee <main+0x58e>
mov    -0x78(%rbp),%rax
mov    0x289b(%rip),%rcx
cmp    (%rcx),%rax
jne    17ee <main+0x58e>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
xor    %r8d,%r8d
mov    %r8d,%ecx
movl   $0x0,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %eax,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x2c(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x30(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    $0x1,%ecx
mov    %eax,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x78(%rbp),%rax
mov    0x27b7(%rip),%rcx
cmp    (%rcx),%rax
jne    18b1 <main+0x651>
cmpl   $0x1,-0x70(%rbp)
jne    18ac <main+0x64c>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
xor    %r8d,%r8d
mov    %r8d,%ecx
movl   $0x0,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %eax,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x2c(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x30(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    $0x1,%ecx
mov    %eax,(%rsp)
call   1180 <XDrawLine@plt>
jmp    18b1 <main+0x651>
mov    -0x78(%rbp),%rax
mov    0x26d4(%rip),%rcx
cmp    (%rcx),%rax
jne    1974 <main+0x714>
cmpl   $0x1,-0x70(%rbp)
jne    196f <main+0x70f>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
xor    %r8d,%r8d
mov    %r8d,%ecx
movl   $0x0,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %eax,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x2c(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1180 <XDrawLine@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x30(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    $0x1,%ecx
mov    %eax,(%rsp)
call   1180 <XDrawLine@plt>
jmp    1974 <main+0x714>
mov    -0x10(%rbp),%rdi
call   1130 <XFlush@plt>
jmp    15de <main+0x37e>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xor    %edi,%edi
call   1090 <XOpenDisplay@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10a0 <assert@plt>
mov    %rbx,%rdi
call   1140 <print_display_information@plt>
mov    %rbx,%rdi
call   1160 <DefaultScreen@plt>
mov    %eax,0x24(%rsp)
mov    %rbx,%rdi
call   1160 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1100 <BlackPixel@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1160 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1080 <WhitePixel@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1060 <DefaultRootWindow@plt>
mov    %r14d,0x10(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0xc8,%r8d
mov    $0x12c,%r9d
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,%r15d
mov    0x2cc7(%rip),%r12
mov    0x2cd0(%rip),%rax
mov    (%rax),%edx
or     (%r12),%edx
mov    %rbx,%rdi
mov    %r15d,%esi
call   10d0 <XSelectInput@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1150 <XMapWindow@plt>
mov    %r14d,0x10(%rsp)
mov    %ebp,0x8(%rsp)
mov    %ebp,0x2c(%rsp)
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    $0x14,%edx
mov    $0x14,%ecx
mov    $0x50,%r8d
mov    $0x32,%r9d
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,%r13d
mov    %r14d,0x10(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r15d,%r14d
mov    %r15d,0x50(%rsp)
mov    $0x6e,%edx
mov    $0x14,%ecx
mov    $0x50,%r8d
mov    $0x32,%r9d
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,%r15d
mov    0x2c09(%rip),%rbp
mov    0x0(%rbp),%edx
or     (%r12),%edx
mov    %rbx,%rdi
mov    %r13d,%esi
call   10d0 <XSelectInput@plt>
mov    0x0(%rbp),%edx
or     (%r12),%edx
mov    %rbx,%rdi
mov    %r15d,%esi
call   10d0 <XSelectInput@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
call   1150 <XMapWindow@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1150 <XMapWindow@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   10e0 <XCreateGC@plt>
mov    %rbx,%rdi
mov    %eax,0x54(%rsp)
mov    %eax,%esi
mov    0x2c(%rsp),%edx
call   1120 <XSetForeground@plt>
mov    %rbx,%rdi
mov    0x24(%rsp),%ebp
mov    %ebp,%esi
call   1110 <DefaultColormap@plt>
mov    %eax,%r12d
lea    0xbf6(%rip),%rdx
lea    0x28(%rsp),%r14
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rcx
call   1170 <XParseColor@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
call   1030 <XAllocColor@plt>
lea    0xbdc(%rip),%rdx
lea    0x48(%rsp),%r14
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r14,%rcx
call   1170 <XParseColor@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
call   1030 <XAllocColor@plt>
mov    0x48(%rsp),%eax
mov    %eax,0x60(%rsp)
mov    0x28(%rsp),%eax
mov    %eax,0x64(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   10c0 <RootWindow@plt>
mov    0x2b75(%rip),%rcx
mov    0x2b2e(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
lea    0x60(%rsp),%rcx
mov    %rbx,%rdi
mov    %eax,%esi
call   10e0 <XCreateGC@plt>
mov    %eax,%ebp
lea    0xb84(%rip),%rdx
lea    0x40(%rsp),%r14
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r14,%rcx
call   1170 <XParseColor@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
call   1030 <XAllocColor@plt>
mov    0x40(%rsp),%eax
mov    %eax,0x58(%rsp)
mov    0x28(%rsp),%eax
mov    %eax,0x5c(%rsp)
mov    %rbx,%rdi
mov    0x24(%rsp),%esi
call   10c0 <RootWindow@plt>
mov    0x2ace(%rip),%rcx
mov    (%rcx),%edx
mov    0x2b05(%rip),%rcx
or     (%rcx),%edx
lea    0x58(%rsp),%rcx
mov    %rbx,%rdi
mov    %eax,%esi
call   10e0 <XCreateGC@plt>
mov    %eax,%r12d
mov    0x28(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x8(%rsp)
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    0x50(%rsp),%esi
mov    $0x14,%edx
mov    $0x78,%ecx
mov    $0x50,%r8d
mov    $0x1e,%r9d
call   10f0 <XCreateSimpleWindow@plt>
mov    0x2a69(%rip),%rcx
mov    (%rcx),%edx
mov    0x2a80(%rip),%rcx
or     (%rcx),%edx
mov    0x2a8f(%rip),%rcx
or     (%rcx),%edx
mov    %eax,%r14d
mov    0x2a63(%rip),%rax
or     (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   10d0 <XSelectInput@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1150 <XMapWindow@plt>
jmp    1578 <main+0x318>
nop
mov    %rbx,%rdi
call   1130 <XFlush@plt>
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
call   10b0 <XNextEvent@plt>
cmp    %r13d,0x3c(%rsp)
jne    1621 <main+0x3c1>
lea    0xaad(%rip),%rdi
call   1040 <puts@plt>
mov    0x30(%rsp),%rax
mov    0x2a38(%rip),%rcx
cmp    (%rcx),%rax
jne    1621 <main+0x3c1>
lea    0xa9a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    0x24(%rsp),%esi
call   1070 <DefaultGC@plt>
movl   $0x28,(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %eax,%edx
mov    $0xa,%ecx
mov    $0xa,%r8d
mov    $0x8c,%r9d
call   1180 <XDrawLine@plt>
movl   $0x5a,0x10(%rsp)
movl   $0xa,0x8(%rsp)
movl   $0x28,(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    0x54(%rsp),%edx
mov    $0xa,%ecx
mov    $0xa,%r8d
mov    $0x28,%r9d
call   1050 <XDrawArc@plt>
cmp    %r15d,0x3c(%rsp)
jne    1682 <main+0x422>
lea    0x9f8(%rip),%rdi
call   1040 <puts@plt>
mov    0x30(%rsp),%rax
mov    0x29a0(%rip),%rcx
cmp    (%rcx),%rax
jne    1682 <main+0x422>
lea    0x9e5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    0x24(%rsp),%esi
call   1070 <DefaultGC@plt>
movl   $0x28,(%rsp)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %eax,%edx
mov    $0xa,%ecx
mov    $0xa,%r8d
mov    $0x8c,%r9d
call   1180 <XDrawLine@plt>
cmp    %r14d,0x3c(%rsp)
jne    1729 <main+0x4c9>
mov    0x30(%rsp),%rax
mov    0x2947(%rip),%rcx
cmp    (%rcx),%rax
jne    1729 <main+0x4c9>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
movl   $0x1d,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1180 <XDrawLine@plt>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    $0x4f,%ecx
mov    $0x4f,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
movl   $0x1d,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    $0x1,%ecx
mov    $0x1d,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%eax
mov    0x2877(%rip),%rdx
cmp    (%rdx),%rcx
jne    17db <main+0x57b>
cmp    $0x1,%eax
jne    17db <main+0x57b>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
movl   $0x1d,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1180 <XDrawLine@plt>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    $0x4f,%ecx
mov    $0x4f,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
movl   $0x1d,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    $0x1d,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%eax
mov    0x27ae(%rip),%rdx
cmp    (%rdx),%rcx
jne    1570 <main+0x310>
cmp    $0x1,%eax
jne    1570 <main+0x310>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
movl   $0x1d,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1180 <XDrawLine@plt>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    $0x4f,%ecx
mov    $0x4f,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
movl   $0x1d,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    $0x1,%ecx
mov    $0x1d,%r8d
mov    $0x4f,%r9d
call   1180 <XDrawLine@plt>
jmp    1570 <main+0x310>

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

LLVM IR (-O2):
%struct.TYPE_14__ = type { i32 }
%struct.TYPE_12__ = type { i32, i32 }
%struct.TYPE_13__ = type { i64, %struct.TYPE_11__, %struct.TYPE_10__ }
%struct.TYPE_11__ = type { i32 }
%struct.TYPE_10__ = type { i32 }
@StructureNotifyMask = global i32 0
@ConfigureNotify = global i32 0
@ExposureMask = global i32 0
@.str = [13 x i8] c"rgb:cc/cc/cc\00"
@.str.1 = [13 x i8] c"rgb:ee/ee/ee\00"
@GCForeground = global i32 0
@GCBackground = global i32 0
@.str.2 = [13 x i8] c"rgb:88/88/88\00"
@ButtonPressMask = global i32 0
@ButtonReleaseMask = global i32 0
@Expose = global i64 0
@ButtonPress = global i64 0
@ButtonRelease = global i64 0
@str = [10 x i8] c"cw2 event\00"
@str.7 = [19 x i8] c"expose win 2 event\00"
@str.8 = [10 x i8] c"cw1 event\00"
@str.9 = [19 x i8] c"expose win 1 event\00"
define i32 @main() {
%1 = alloca %struct.TYPE_14__
%2 = alloca %struct.TYPE_14__
%3 = alloca %struct.TYPE_14__
%4 = alloca %struct.TYPE_12__
%5 = alloca %struct.TYPE_12__
%6 = alloca %struct.TYPE_13__
%7 = tail call i32* @XOpenDisplay(i32* null)
%8 = tail call i32 @assert(i32* %7)
%9 = tail call i32 @print_display_information(i32* %7)
%10 = tail call i32 @DefaultScreen(i32* %7)
%11 = tail call i32 @DefaultScreen(i32* %7)
%12 = tail call i32 @BlackPixel(i32* %7, i32 %11)
%13 = tail call i32 @DefaultScreen(i32* %7)
%14 = tail call i32 @WhitePixel(i32* %7, i32 %13)
%15 = tail call i32 @DefaultRootWindow(i32* %7)
%16 = tail call i32 @XCreateSimpleWindow(i32* %7, i32 %15, i32 0, i32 0, i32 200, i32 300, i32 1, i32 %12, i32 %14)
%17 = load i32, i32* @StructureNotifyMask
%18 = load i32, i32* @ConfigureNotify
%19 = or i32 %18, %17
%20 = tail call i32 @XSelectInput(i32* %7, i32 %16, i32 %19)
%21 = tail call i32 @XMapWindow(i32* %7, i32 %16)
%22 = tail call i32 @XCreateSimpleWindow(i32* %7, i32 %16, i32 20, i32 20, i32 80, i32 50, i32 1, i32 %12, i32 %14)
%23 = tail call i32 @XCreateSimpleWindow(i32* %7, i32 %16, i32 110, i32 20, i32 80, i32 50, i32 1, i32 %12, i32 %14)
%24 = bitcast %struct.TYPE_14__* %1 to i8*
%25 = bitcast %struct.TYPE_14__* %2 to i8*
%26 = bitcast %struct.TYPE_14__* %3 to i8*
%27 = bitcast %struct.TYPE_12__* %4 to i8*
%28 = bitcast %struct.TYPE_12__* %5 to i8*
%29 = load i32, i32* @StructureNotifyMask
%30 = load i32, i32* @ExposureMask
%31 = or i32 %30, %29
%32 = tail call i32 @XSelectInput(i32* %7, i32 %22, i32 %31)
%33 = load i32, i32* @StructureNotifyMask
%34 = load i32, i32* @ExposureMask
%35 = or i32 %34, %33
%36 = tail call i32 @XSelectInput(i32* %7, i32 %23, i32 %35)
%37 = tail call i32 @XMapWindow(i32* %7, i32 %22)
%38 = tail call i32 @XMapWindow(i32* %7, i32 %23)
%39 = tail call i32 @XCreateGC(i32* %7, i32 %16, i32 0, %struct.TYPE_12__* null)
%40 = tail call i32 @XSetForeground(i32* %7, i32 %39, i32 %12)
%41 = tail call i32 @DefaultColormap(i32* %7, i32 %10)
%42 = call i32 @XParseColor(i32* %7, i32 %41, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.TYPE_14__* %1)
%43 = call i32 @XAllocColor(i32* %7, i32 %41, %struct.TYPE_14__* %1)
%44 = call i32 @XParseColor(i32* %7, i32 %41, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %struct.TYPE_14__* %2)
%45 = call i32 @XAllocColor(i32* %7, i32 %41, %struct.TYPE_14__* %2)
%46 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %2, i64 0, i32 0
%47 = load i32, i32* %46
%48 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %4, i64 0, i32 0
store i32 %47, i32* %48
%49 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %1, i64 0, i32 0
%50 = load i32, i32* %49
%51 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %4, i64 0, i32 1
store i32 %50, i32* %51
%52 = call i32 @RootWindow(i32* %7, i32 %10)
%53 = load i32, i32* @GCForeground
%54 = load i32, i32* @GCBackground
%55 = or i32 %54, %53
%56 = call i32 @XCreateGC(i32* %7, i32 %52, i32 %55, %struct.TYPE_12__* %4)
%57 = call i32 @XParseColor(i32* %7, i32 %41, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_14__* %3)
%58 = call i32 @XAllocColor(i32* %7, i32 %41, %struct.TYPE_14__* %3)
%59 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %3, i64 0, i32 0
%60 = load i32, i32* %59
%61 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %5, i64 0, i32 0
store i32 %60, i32* %61
%62 = load i32, i32* %49
%63 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %5, i64 0, i32 1
store i32 %62, i32* %63
%64 = call i32 @RootWindow(i32* %7, i32 %10)
%65 = load i32, i32* @GCForeground
%66 = load i32, i32* @GCBackground
%67 = or i32 %66, %65
%68 = call i32 @XCreateGC(i32* %7, i32 %64, i32 %67, %struct.TYPE_12__* %5)
%69 = load i32, i32* %49
%70 = call i32 @XCreateSimpleWindow(i32* %7, i32 %16, i32 20, i32 120, i32 80, i32 30, i32 1, i32 %12, i32 %69)
%71 = load i32, i32* @StructureNotifyMask
%72 = load i32, i32* @ExposureMask
%73 = or i32 %72, %71
%74 = load i32, i32* @ButtonPressMask
%75 = or i32 %73, %74
%76 = load i32, i32* @ButtonReleaseMask
%77 = or i32 %75, %76
%78 = call i32 @XSelectInput(i32* %7, i32 %70, i32 %77)
%79 = call i32 @XMapWindow(i32* %7, i32 %70)
%80 = bitcast %struct.TYPE_13__* %6 to i8*
%81 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %6, i64 0, i32 2, i32 0
%82 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %6, i64 0, i32 0
%83 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %6, i64 0, i32 1, i32 0
br label %84
84: ; preds = %148, %0
%85 = call i32 @XNextEvent(i32* %7, %struct.TYPE_13__* %6)
%86 = load i32, i32* %81
%87 = icmp eq i32 %86, %22
br i1 %87, label %88, label %98
88: ; preds = %84
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0))
%90 = load i64, i64* %82
%91 = load i64, i64* @Expose
%92 = icmp eq i64 %90, %91
br i1 %92, label %93, label %98
93: ; preds = %88
%94 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.9, i64 0, i64 0))
%95 = call i32 @DefaultGC(i32* %7, i32 %10)
%96 = call i32 @XDrawLine(i32* %7, i32 %22, i32 %95, i32 10, i32 10, i32 140, i32 40)
%97 = call i32 @XDrawArc(i32* %7, i32 %22, i32 %39, i32 10, i32 10, i32 40, i32 40, i32 10, i32 90)
br label %98
98: ; preds = %88, %93, %84
%99 = load i32, i32* %81
%100 = icmp eq i32 %99, %23
br i1 %100, label %101, label %110
101: ; preds = %98
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%103 = load i64, i64* %82
%104 = load i64, i64* @Expose
%105 = icmp eq i64 %103, %104
br i1 %105, label %106, label %110
106: ; preds = %101
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
%108 = call i32 @DefaultGC(i32* %7, i32 %10)
%109 = call i32 @XDrawLine(i32* %7, i32 %23, i32 %108, i32 10, i32 10, i32 140, i32 40)
br label %110
110: ; preds = %101, %106, %98
%111 = load i32, i32* %81
%112 = icmp eq i32 %111, %70
br i1 %112, label %113, label %122
113: ; preds = %110
%114 = load i64, i64* %82
%115 = load i64, i64* @Expose
%116 = icmp eq i64 %114, %115
br i1 %116, label %117, label %122
117: ; preds = %113
%118 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %56, i32 0, i32 0, i32 79, i32 0)
%119 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %56, i32 0, i32 0, i32 0, i32 29)
%120 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %68, i32 79, i32 79, i32 79, i32 0)
%121 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %68, i32 1, i32 29, i32 79, i32 29)
br label %122
122: ; preds = %117, %113, %110
%123 = load i64, i64* %82
%124 = load i64, i64* @ButtonPress
%125 = icmp eq i64 %123, %124
%126 = load i32, i32* %83
%127 = icmp eq i32 %126, 1
%128 = select i1 %125, i1 %127, i1 false
br i1 %128, label %129, label %136
129: ; preds = %122
%130 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %68, i32 0, i32 0, i32 79, i32 0)
%131 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %68, i32 0, i32 0, i32 0, i32 29)
%132 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %56, i32 79, i32 79, i32 79, i32 0)
%133 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %56, i32 1, i32 29, i32 79, i32 29)
%134 = load i64, i64* %82
%135 = load i32, i32* %83
br label %136
136: ; preds = %129, %122
%137 = phi i32 [ %135, %129 ], [ %126, %122 ]
%138 = phi i64 [ %134, %129 ], [ %123, %122 ]
%139 = load i64, i64* @ButtonRelease
%140 = icmp eq i64 %138, %139
%141 = icmp eq i32 %137, 1
%142 = select i1 %140, i1 %141, i1 false
br i1 %142, label %143, label %148
143: ; preds = %136
%144 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %56, i32 0, i32 0, i32 79, i32 0)
%145 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %56, i32 0, i32 0, i32 0, i32 29)
%146 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %68, i32 79, i32 79, i32 79, i32 0)
%147 = call i32 @XDrawLine(i32* %7, i32 %70, i32 %68, i32 1, i32 29, i32 79, i32 29)
br label %148
148: ; preds = %143, %136
%149 = call i32 @XFlush(i32* %7)
br label %84
}