#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_10__ TYPE_4__;
typedef struct TYPE_9__ TYPE_3__;
typedef struct TYPE_8__ TYPE_2__;
typedef struct TYPE_7__ TYPE_1__;

/* Type definitions */
struct utsname {
  char *sysname;
  char *release;
  char *version;
  char *machine;
};
struct TYPE_9__ {
  int width;
  int height;
};
typedef TYPE_3__ XWindowAttributes;
struct TYPE_7__ {
  scalar_t__ *l;
};
struct TYPE_8__ {
  TYPE_1__ data;
};
struct TYPE_10__ {
  scalar_t__ type;
  TYPE_2__ xclient;
  int /*<<< orphan*/ xkey;
};
typedef TYPE_4__ XEvent;
typedef int /*<<< orphan*/ Window;
typedef scalar_t__ KeySym;
typedef int /*<<< orphan*/ Display;
typedef unsigned int Atom;

/* Variables and functions */
int /*<<< orphan*/ BlackPixel(int /*<<< orphan*/ *, int);
scalar_t__ ClientMessage;
int /*<<< orphan*/ DefaultGC(int /*<<< orphan*/ *, int);
int DefaultScreen(int /*<<< orphan*/ *);
scalar_t__ Expose;
int ExposureMask;
int /*<<< orphan*/ False;
scalar_t__ KeyPress;
int KeyPressMask;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ WhitePixel(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XCreateSimpleWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int, int, int, int, int,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XDestroyWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XDrawString(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int /*<<< orphan*/, int, int, char const *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ XGetWindowAttributes(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, TYPE_3__ *);
unsigned int XInternAtom(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
scalar_t__ XK_Escape;
int XLookupString(int /*<<< orphan*/ *, char *, int, scalar_t__ *,
                  int /*<<< orphan*/ *);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, TYPE_4__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ XSetWMProtocols(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   unsigned int *, int);
int /*<<< orphan*/ XStoreName(int /*<<< orphan*/ *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char const *);
int uname(struct utsname *);
int main(int argc, char **argv) {
  Display *dpy = XOpenDisplay(NULL);
  if (dpy == NULL) {
    fprintf(stderr, "Cannot open display\n");
    exit(1);
  }
  int s = DefaultScreen(dpy);
  Window win = XCreateSimpleWindow(dpy, RootWindow(dpy, s), 10, 10, 660, 200, 1,
                                   BlackPixel(dpy, s), WhitePixel(dpy, s));
  XSelectInput(dpy, win, ExposureMask | KeyPressMask);
  XMapWindow(dpy, win);
  XStoreName(dpy, win, "Geeks3D.com - X11 window under Linux (Mint 10)");
  Atom WM_DELETE_WINDOW = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
  XSetWMProtocols(dpy, win, &WM_DELETE_WINDOW, 1);
  int uname_ok = 0;
  struct utsname sname;
  int ret = uname(&sname);
  if (ret != -1) {
    uname_ok = 1;
  }
  XEvent e;
  while (1) {
    XNextEvent(dpy, &e);
    if (e.type == Expose) {
      int y_offset = 20;
      const char *s1 = "X11 test app under Linux";
      const char *s2 = "(C)2012 Geeks3D.com";
      XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, s1, strlen(s1));
      y_offset += 20;
      XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, s2, strlen(s2));
      y_offset += 20;
      if (uname_ok) {
        char buf[256] = {0};
        sprintf(buf, "System information:");
        XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, buf,
                    strlen(buf));
        y_offset += 15;
        sprintf(buf, "- System: %s", sname.sysname);
        XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, buf,
                    strlen(buf));
        y_offset += 15;
        sprintf(buf, "- Release: %s", sname.release);
        XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, buf,
                    strlen(buf));
        y_offset += 15;
        sprintf(buf, "- Version: %s", sname.version);
        XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, buf,
                    strlen(buf));
        y_offset += 15;
        sprintf(buf, "- Machine: %s", sname.machine);
        XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, buf,
                    strlen(buf));
        y_offset += 20;
      }
      XWindowAttributes wa;
      XGetWindowAttributes(dpy, win, &wa);
      int width = wa.width;
      int height = wa.height;
      char buf[128] = {0};
      sprintf(buf, "Current window size: %dx%d", width, height);
      XDrawString(dpy, win, DefaultGC(dpy, s), 10, y_offset, buf, strlen(buf));
      y_offset += 20;
    }
    if (e.type == KeyPress) {
      char buf[128] = {0};
      KeySym keysym;
      int len = XLookupString(&e.xkey, buf, sizeof buf, &keysym, NULL);
      if (keysym == XK_Escape)
        break;
    }
    if ((e.type == ClientMessage) &&
        ((unsigned int)e.xclient.data.l[0] == WM_DELETE_WINDOW)) {
      break;
    }
  }
  XDestroyWindow(dpy, win);
  XCloseDisplay(dpy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12d0 <main+0x50>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
lea    0xd3f(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1180 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1190 <DefaultScreen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x2b0(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1100 <RootWindow@plt>
mov    %eax,-0x2a4(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1140 <BlackPixel@plt>
mov    %eax,-0x2a0(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1080 <WhitePixel@plt>
mov    -0x2b0(%rbp),%rdi
mov    -0x2a4(%rbp),%esi
mov    -0x2a0(%rbp),%r10d
mov    $0xa,%ecx
mov    $0x294,%r8d
mov    $0xc8,%r9d
mov    %ecx,%edx
movl   $0x1,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1130 <XCreateSimpleWindow@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    0x2c44(%rip),%rax
mov    (%rax),%edx
mov    0x2c6b(%rip),%rax
or     (%rax),%edx
call   1110 <XSelectInput@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1160 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
lea    0xc87(%rip),%rdx
call   1040 <XStoreName@plt>
mov    -0x18(%rbp),%rdi
mov    0x2c4a(%rip),%rax
mov    (%rax),%edx
lea    0xc9d(%rip),%rsi
call   10f0 <XInternAtom@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
lea    -0x24(%rbp),%rdx
mov    $0x1,%ecx
call   10d0 <XSetWMProtocols@plt>
movl   $0x0,-0x28(%rbp)
lea    -0x48(%rbp),%rdi
call   1070 <uname@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0xffffffff,-0x4c(%rbp)
je     13e8 <main+0x168>
movl   $0x1,-0x28(%rbp)
jmp    13ed <main+0x16d>
mov    -0x18(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   10e0 <XNextEvent@plt>
mov    -0x68(%rbp),%rax
mov    0x2bdb(%rip),%rcx
cmp    (%rcx),%rax
jne    1914 <main+0x694>
movl   $0x14,-0x6c(%rbp)
lea    0xc39(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xc47(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x2f0(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2e4(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x2e0(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x2dc(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x2d8(%rbp)
mov    -0x78(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x2f0(%rbp),%rdi
mov    -0x2e4(%rbp),%esi
mov    -0x2e0(%rbp),%edx
mov    -0x2dc(%rbp),%r8d
mov    -0x2d8(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x2d0(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c4(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x2c0(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x2bc(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x2b8(%rbp)
mov    -0x80(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x2d0(%rbp),%rdi
mov    -0x2c4(%rbp),%esi
mov    -0x2c0(%rbp),%edx
mov    -0x2bc(%rbp),%r8d
mov    -0x2b8(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1835 <main+0x5b5>
lea    -0x180(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1090 <memset@plt>
lea    -0x180(%rbp),%rdi
lea    0xb38(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x390(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x384(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x380(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x37c(%rbp)
lea    -0x180(%rbp),%rax
mov    %rax,-0x378(%rbp)
lea    -0x180(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x390(%rbp),%rdi
mov    -0x384(%rbp),%esi
mov    -0x380(%rbp),%edx
mov    -0x37c(%rbp),%r8d
mov    -0x378(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0x6c(%rbp)
lea    -0x180(%rbp),%rdi
mov    -0x48(%rbp),%rdx
lea    0xab3(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x370(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x364(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x360(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x35c(%rbp)
lea    -0x180(%rbp),%rax
mov    %rax,-0x358(%rbp)
lea    -0x180(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x370(%rbp),%rdi
mov    -0x364(%rbp),%esi
mov    -0x360(%rbp),%edx
mov    -0x35c(%rbp),%r8d
mov    -0x358(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0x6c(%rbp)
lea    -0x180(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xa27(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x350(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x344(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x340(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x33c(%rbp)
lea    -0x180(%rbp),%rax
mov    %rax,-0x338(%rbp)
lea    -0x180(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x350(%rbp),%rdi
mov    -0x344(%rbp),%esi
mov    -0x340(%rbp),%edx
mov    -0x33c(%rbp),%r8d
mov    -0x338(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0x6c(%rbp)
lea    -0x180(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0x99c(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x330(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x324(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x320(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x31c(%rbp)
lea    -0x180(%rbp),%rax
mov    %rax,-0x318(%rbp)
lea    -0x180(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x330(%rbp),%rdi
mov    -0x324(%rbp),%esi
mov    -0x320(%rbp),%edx
mov    -0x31c(%rbp),%r8d
mov    -0x318(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0x6c(%rbp)
lea    -0x180(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0x911(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x310(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x304(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x300(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x2fc(%rbp)
lea    -0x180(%rbp),%rax
mov    %rax,-0x2f8(%rbp)
lea    -0x180(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x310(%rbp),%rdi
mov    -0x304(%rbp),%esi
mov    -0x300(%rbp),%edx
mov    -0x2fc(%rbp),%r8d
mov    -0x2f8(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
lea    -0x188(%rbp),%rdx
call   1150 <XGetWindowAttributes@plt>
mov    -0x188(%rbp),%eax
mov    %eax,-0x18c(%rbp)
mov    -0x184(%rbp),%eax
mov    %eax,-0x190(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1090 <memset@plt>
lea    -0x210(%rbp),%rdi
mov    -0x18c(%rbp),%edx
mov    -0x190(%rbp),%ecx
lea    0x840(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x3b0(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x3a4(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <DefaultGC@plt>
mov    %eax,-0x3a0(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x39c(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x398(%rbp)
lea    -0x210(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x3b0(%rbp),%rdi
mov    -0x3a4(%rbp),%esi
mov    -0x3a0(%rbp),%edx
mov    -0x39c(%rbp),%r8d
mov    -0x398(%rbp),%r9
mov    $0xa,%ecx
mov    %eax,(%rsp)
call   1120 <XDrawString@plt>
mov    -0x6c(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%rax
mov    0x26a9(%rip),%rcx
cmp    (%rcx),%rax
jne    1987 <main+0x707>
lea    -0x290(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1090 <memset@plt>
lea    -0x68(%rbp),%rdi
add    $0x10,%rdi
lea    -0x290(%rbp),%rsi
mov    $0x80,%edx
lea    -0x298(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <XLookupString@plt>
mov    %eax,-0x29c(%rbp)
mov    -0x298(%rbp),%rax
mov    0x263c(%rip),%rcx
cmp    (%rcx),%rax
jne    1982 <main+0x702>
jmp    19b5 <main+0x735>
jmp    1987 <main+0x707>
mov    -0x68(%rbp),%rax
mov    0x263e(%rip),%rcx
cmp    (%rcx),%rax
jne    19b0 <main+0x730>
mov    -0x60(%rbp),%rax
mov    (%rax),%rax
cmp    -0x24(%rbp),%eax
jne    19b0 <main+0x730>
jmp    19b5 <main+0x735>
jmp    13ed <main+0x16d>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   10a0 <XDestroyWindow@plt>
mov    -0x18(%rbp),%rdi
call   11a0 <XCloseDisplay@plt>
xor    %eax,%eax
add    $0x3d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
xor    %edi,%edi
call   10a0 <XOpenDisplay@plt>
test   %rax,%rax
je     17b1 <main+0x541>
mov    %rax,%r14
mov    %rax,%rdi
call   1180 <DefaultScreen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
call   10f0 <RootWindow@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %ebx,%esi
call   1130 <BlackPixel@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,0x30(%rsp)
mov    %ebx,%esi
call   1080 <WhitePixel@plt>
mov    %eax,0x10(%rsp)
mov    %ebp,0x8(%rsp)
movl   $0x1,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0x294,%r8d
mov    $0xc8,%r9d
call   1120 <XCreateSimpleWindow@plt>
mov    %eax,%ebx
mov    0x2caa(%rip),%rax
mov    0x2cd3(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1100 <XSelectInput@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1150 <XMapWindow@plt>
lea    0xcf1(%rip),%rdx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <XStoreName@plt>
mov    0x2cb3(%rip),%rax
mov    (%rax),%edx
lea    0xd06(%rip),%rsi
mov    %r14,%rdi
call   10e0 <XInternAtom@plt>
mov    %eax,0x24(%rsp)
lea    0x24(%rsp),%rdx
mov    %r14,%rdi
mov    %ebx,0x20(%rsp)
mov    %ebx,%esi
mov    $0x1,%ecx
call   10c0 <XSetWMProtocols@plt>
lea    0x70(%rsp),%rdi
call   1070 <uname@plt>
mov    %eax,0x34(%rsp)
mov    0x70(%rsp),%rax
mov    %rax,0x68(%rsp)
mov    0x78(%rsp),%rax
mov    %rax,0x60(%rsp)
mov    0x80(%rsp),%rax
mov    %rax,0x58(%rsp)
mov    0x88(%rsp),%rax
mov    %rax,0x50(%rsp)
lea    0x38(%rsp),%r15
mov    0x2c36(%rip),%r13
lea    0x90(%rsp),%r12
mov    0x2c0f(%rip),%rbp
mov    0x2c10(%rip),%rbx
mov    %r14,%rdi
mov    %r15,%rsi
call   10d0 <XNextEvent@plt>
mov    0x38(%rsp),%rax
cmp    0x0(%r13),%rax
jne    16f6 <main+0x486>
mov    %r14,%rdi
mov    0x30(%rsp),%r13d
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
lea    0xc62(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    0x20(%rsp),%r15d
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x14,%r8d
mov    %rbx,%r9
call   1110 <XDrawString@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
lea    0xc3c(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x28,%r8d
mov    %rbx,%r9
call   1110 <XDrawString@plt>
cmpl   $0xffffffff,0x34(%rsp)
je     1636 <main+0x3c6>
lea    0xa4(%rsp),%rax
xorps  %xmm0,%xmm0
movups %xmm0,0xdc(%rax)
movups %xmm0,0xd0(%rax)
movups %xmm0,0xc0(%rax)
movups %xmm0,0xb0(%rax)
movups %xmm0,0xa0(%rax)
movups %xmm0,0x90(%rax)
movups %xmm0,0x80(%rax)
movups %xmm0,0x70(%rax)
movups %xmm0,0x60(%rax)
movups %xmm0,0x50(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,(%rax)
movups 0xbbd(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movl   $0x3a6e6f,0xa0(%rsp)
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x3c,%r8d
mov    %r12,%r9
call   1110 <XDrawString@plt>
mov    %r12,%rdi
lea    0xb81(%rip),%rsi
mov    0x68(%rsp),%rdx
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x4b,%r8d
mov    %r12,%r9
call   1110 <XDrawString@plt>
mov    %r12,%rdi
lea    0xb45(%rip),%rsi
mov    0x60(%rsp),%rdx
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x5a,%r8d
mov    %r12,%r9
call   1110 <XDrawString@plt>
mov    %r12,%rdi
lea    0xb0a(%rip),%rsi
mov    0x58(%rsp),%rdx
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x69,%r8d
mov    %r12,%r9
call   1110 <XDrawString@plt>
mov    %r12,%rdi
lea    0xacf(%rip),%rsi
mov    0x50(%rsp),%rdx
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x78,%r8d
mov    %r12,%r9
call   1110 <XDrawString@plt>
mov    $0x8c,%ebx
jmp    163b <main+0x3cb>
mov    $0x3c,%ebx
mov    %r14,%rdi
mov    %r15d,%esi
lea    0x28(%rsp),%rdx
call   1140 <XGetWindowAttributes@plt>
mov    0x28(%rsp),%edx
mov    0x2c(%rsp),%ecx
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
mov    %r12,%rdi
lea    0xa2d(%rip),%rsi
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <DefaultGC@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    %ebx,%r8d
mov    %r12,%r9
call   1110 <XDrawString@plt>
mov    0x38(%rsp),%rax
lea    0x38(%rsp),%r15
mov    0x28f8(%rip),%r13
mov    0x28d9(%rip),%rbp
mov    0x28da(%rip),%rbx
cmp    0x0(%rbp),%rax
jne    176f <main+0x4ff>
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
lea    0x48(%rsp),%rdi
mov    %r12,%rsi
mov    $0x80,%edx
lea    0x28(%rsp),%rcx
xor    %r8d,%r8d
call   1030 <XLookupString@plt>
mov    0x28(%rsp),%rax
mov    0x284b(%rip),%rcx
cmp    (%rcx),%rax
je     1789 <main+0x519>
mov    0x38(%rsp),%rax
cmp    (%rbx),%rax
jne    13c0 <main+0x150>
mov    0x40(%rsp),%rax
mov    0x24(%rsp),%ecx
cmp    (%rax),%ecx
jne    13c0 <main+0x150>
mov    %r14,%rdi
mov    0x20(%rsp),%esi
call   1090 <XDestroyWindow@plt>
mov    %r14,%rdi
call   1190 <XCloseDisplay@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2800(%rip),%rax
mov    (%rax),%edi
lea    0x83f(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8* }
%struct.TYPE_10__ = type { i64, %struct.TYPE_8__, i32 }
%struct.TYPE_8__ = type { %struct.TYPE_7__ }
%struct.TYPE_7__ = type { i64* }
%struct.TYPE_9__ = type { i32, i32 }
@stderr = global i32 0
@.str = [21 x i8] c"Cannot open display\0A\00"
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@.str.1 = [47 x i8] c"Geeks3D.com - X11 window under Linux (Mint 10)\00"
@.str.2 = [17 x i8] c"WM_DELETE_WINDOW\00"
@False = global i32 0
@Expose = global i64 0
@.str.3 = [25 x i8] c"X11 test app under Linux\00"
@.str.4 = [20 x i8] c"(C)2012 Geeks3D.com\00"
@.str.5 = [20 x i8] c"System information:\00"
@.str.6 = [13 x i8] c"- System: %s\00"
@.str.7 = [14 x i8] c"- Release: %s\00"
@.str.8 = [14 x i8] c"- Version: %s\00"
@.str.9 = [14 x i8] c"- Machine: %s\00"
@.str.10 = [27 x i8] c"Current window size: %dx%d\00"
@KeyPress = global i64 0
@XK_Escape = global i64 0
@ClientMessage = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.utsname
%12 = alloca i32
%13 = alloca %struct.TYPE_10__
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca [256 x i8]
%18 = alloca %struct.TYPE_9__
%19 = alloca i32
%20 = alloca i32
%21 = alloca [128 x i8]
%22 = alloca [128 x i8]
%23 = alloca i64
%24 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%25 = call i32* @XOpenDisplay(i32* null)
store i32* %25, i32** %6
%26 = load i32*, i32** %6
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %32
28: ; preds = %2
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %2
%33 = load i32*, i32** %6
%34 = call i32 @DefaultScreen(i32* %33)
store i32 %34, i32* %7
%35 = load i32*, i32** %6
%36 = load i32*, i32** %6
%37 = load i32, i32* %7
%38 = call i32 @RootWindow(i32* %36, i32 %37)
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = call i32 @BlackPixel(i32* %39, i32 %40)
%42 = load i32*, i32** %6
%43 = load i32, i32* %7
%44 = call i32 @WhitePixel(i32* %42, i32 %43)
%45 = call i32 @XCreateSimpleWindow(i32* %35, i32 %38, i32 10, i32 10, i32 660, i32 200, i32 1, i32 %41, i32 %44)
store i32 %45, i32* %8
%46 = load i32*, i32** %6
%47 = load i32, i32* %8
%48 = load i32, i32* @ExposureMask
%49 = load i32, i32* @KeyPressMask
%50 = or i32 %48, %49
%51 = call i32 @XSelectInput(i32* %46, i32 %47, i32 %50)
%52 = load i32*, i32** %6
%53 = load i32, i32* %8
%54 = call i32 @XMapWindow(i32* %52, i32 %53)
%55 = load i32*, i32** %6
%56 = load i32, i32* %8
%57 = call i32 @XStoreName(i32* %55, i32 %56, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%58 = load i32*, i32** %6
%59 = load i32, i32* @False
%60 = call i32 @XInternAtom(i32* %58, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %59)
store i32 %60, i32* %9
%61 = load i32*, i32** %6
%62 = load i32, i32* %8
%63 = call i32 @XSetWMProtocols(i32* %61, i32 %62, i32* %9, i32 1)
store i32 0, i32* %10
%64 = call i32 @uname(%struct.utsname* %11)
store i32 %64, i32* %12
%65 = load i32, i32* %12
%66 = icmp ne i32 %65, -1
br i1 %66, label %67, label %68
67: ; preds = %32
store i32 1, i32* %10
br label %68
68: ; preds = %67, %32
br label %69
69: ; preds = %68, %239
%70 = load i32*, i32** %6
%71 = call i32 @XNextEvent(i32* %70, %struct.TYPE_10__* %13)
%72 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i32 0, i32 0
%73 = load i64, i64* %72
%74 = load i64, i64* @Expose
%75 = icmp eq i64 %73, %74
br i1 %75, label %76, label %208
76: ; preds = %69
store i32 20, i32* %14
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8** %15
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8** %16
%77 = load i32*, i32** %6
%78 = load i32, i32* %8
%79 = load i32*, i32** %6
%80 = load i32, i32* %7
%81 = call i32 @DefaultGC(i32* %79, i32 %80)
%82 = load i32, i32* %14
%83 = load i8*, i8** %15
%84 = load i8*, i8** %15
%85 = call i32 @strlen(i8* %84)
%86 = call i32 @XDrawString(i32* %77, i32 %78, i32 %81, i32 10, i32 %82, i8* %83, i32 %85)
%87 = load i32, i32* %14
%88 = add nsw i32 %87, 20
store i32 %88, i32* %14
%89 = load i32*, i32** %6
%90 = load i32, i32* %8
%91 = load i32*, i32** %6
%92 = load i32, i32* %7
%93 = call i32 @DefaultGC(i32* %91, i32 %92)
%94 = load i32, i32* %14
%95 = load i8*, i8** %16
%96 = load i8*, i8** %16
%97 = call i32 @strlen(i8* %96)
%98 = call i32 @XDrawString(i32* %89, i32 %90, i32 %93, i32 10, i32 %94, i8* %95, i32 %97)
%99 = load i32, i32* %14
%100 = add nsw i32 %99, 20
store i32 %100, i32* %14
%101 = load i32, i32* %10
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %183
103: ; preds = %76
%104 = bitcast [256 x i8]* %17 to i8*
%105 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%106 = call i32 (i8*, i8*, ...) @sprintf(i8* %105, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%107 = load i32*, i32** %6
%108 = load i32, i32* %8
%109 = load i32*, i32** %6
%110 = load i32, i32* %7
%111 = call i32 @DefaultGC(i32* %109, i32 %110)
%112 = load i32, i32* %14
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%114 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%115 = call i32 @strlen(i8* %114)
%116 = call i32 @XDrawString(i32* %107, i32 %108, i32 %111, i32 10, i32 %112, i8* %113, i32 %115)
%117 = load i32, i32* %14
%118 = add nsw i32 %117, 15
store i32 %118, i32* %14
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%120 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i32 0, i32 0
%121 = load i8*, i8** %120
%122 = call i32 (i8*, i8*, ...) @sprintf(i8* %119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %121)
%123 = load i32*, i32** %6
%124 = load i32, i32* %8
%125 = load i32*, i32** %6
%126 = load i32, i32* %7
%127 = call i32 @DefaultGC(i32* %125, i32 %126)
%128 = load i32, i32* %14
%129 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%130 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%131 = call i32 @strlen(i8* %130)
%132 = call i32 @XDrawString(i32* %123, i32 %124, i32 %127, i32 10, i32 %128, i8* %129, i32 %131)
%133 = load i32, i32* %14
%134 = add nsw i32 %133, 15
store i32 %134, i32* %14
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%136 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i32 0, i32 1
%137 = load i8*, i8** %136
%138 = call i32 (i8*, i8*, ...) @sprintf(i8* %135, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %137)
%139 = load i32*, i32** %6
%140 = load i32, i32* %8
%141 = load i32*, i32** %6
%142 = load i32, i32* %7
%143 = call i32 @DefaultGC(i32* %141, i32 %142)
%144 = load i32, i32* %14
%145 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%146 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%147 = call i32 @strlen(i8* %146)
%148 = call i32 @XDrawString(i32* %139, i32 %140, i32 %143, i32 10, i32 %144, i8* %145, i32 %147)
%149 = load i32, i32* %14
%150 = add nsw i32 %149, 15
store i32 %150, i32* %14
%151 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%152 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i32 0, i32 2
%153 = load i8*, i8** %152
%154 = call i32 (i8*, i8*, ...) @sprintf(i8* %151, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %153)
%155 = load i32*, i32** %6
%156 = load i32, i32* %8
%157 = load i32*, i32** %6
%158 = load i32, i32* %7
%159 = call i32 @DefaultGC(i32* %157, i32 %158)
%160 = load i32, i32* %14
%161 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%162 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%163 = call i32 @strlen(i8* %162)
%164 = call i32 @XDrawString(i32* %155, i32 %156, i32 %159, i32 10, i32 %160, i8* %161, i32 %163)
%165 = load i32, i32* %14
%166 = add nsw i32 %165, 15
store i32 %166, i32* %14
%167 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%168 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i32 0, i32 3
%169 = load i8*, i8** %168
%170 = call i32 (i8*, i8*, ...) @sprintf(i8* %167, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %169)
%171 = load i32*, i32** %6
%172 = load i32, i32* %8
%173 = load i32*, i32** %6
%174 = load i32, i32* %7
%175 = call i32 @DefaultGC(i32* %173, i32 %174)
%176 = load i32, i32* %14
%177 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%178 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%179 = call i32 @strlen(i8* %178)
%180 = call i32 @XDrawString(i32* %171, i32 %172, i32 %175, i32 10, i32 %176, i8* %177, i32 %179)
%181 = load i32, i32* %14
%182 = add nsw i32 %181, 20
store i32 %182, i32* %14
br label %183
183: ; preds = %103, %76
%184 = load i32*, i32** %6
%185 = load i32, i32* %8
%186 = call i32 @XGetWindowAttributes(i32* %184, i32 %185, %struct.TYPE_9__* %18)
%187 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %18, i32 0, i32 0
%188 = load i32, i32* %187
store i32 %188, i32* %19
%189 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %18, i32 0, i32 1
%190 = load i32, i32* %189
store i32 %190, i32* %20
%191 = bitcast [128 x i8]* %21 to i8*
%192 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 0
%193 = load i32, i32* %19
%194 = load i32, i32* %20
%195 = call i32 (i8*, i8*, ...) @sprintf(i8* %192, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 %193, i32 %194)
%196 = load i32*, i32** %6
%197 = load i32, i32* %8
%198 = load i32*, i32** %6
%199 = load i32, i32* %7
%200 = call i32 @DefaultGC(i32* %198, i32 %199)
%201 = load i32, i32* %14
%202 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 0
%203 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 0
%204 = call i32 @strlen(i8* %203)
%205 = call i32 @XDrawString(i32* %196, i32 %197, i32 %200, i32 10, i32 %201, i8* %202, i32 %204)
%206 = load i32, i32* %14
%207 = add nsw i32 %206, 20
store i32 %207, i32* %14
br label %208
208: ; preds = %183, %69
%209 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i32 0, i32 0
%210 = load i64, i64* %209
%211 = load i64, i64* @KeyPress
%212 = icmp eq i64 %210, %211
br i1 %212, label %213, label %223
213: ; preds = %208
%214 = bitcast [128 x i8]* %22 to i8*
%215 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i32 0, i32 2
%216 = getelementptr inbounds [128 x i8], [128 x i8]* %22, i64 0, i64 0
%217 = call i32 @XLookupString(i32* %215, i8* %216, i32 128, i64* %23, i32* null)
store i32 %217, i32* %24
%218 = load i64, i64* %23
%219 = load i64, i64* @XK_Escape
%220 = icmp eq i64 %218, %219
br i1 %220, label %221, label %222
221: ; preds = %213
br label %240
222: ; preds = %213
br label %223
223: ; preds = %222, %208
%224 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i32 0, i32 0
%225 = load i64, i64* %224
%226 = load i64, i64* @ClientMessage
%227 = icmp eq i64 %225, %226
br i1 %227, label %228, label %239
228: ; preds = %223
%229 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i32 0, i32 1
%230 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %229, i32 0, i32 0
%231 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %230, i32 0, i32 0
%232 = load i64*, i64** %231
%233 = getelementptr inbounds i64, i64* %232, i64 0
%234 = load i64, i64* %233
%235 = trunc i64 %234 to i32
%236 = load i32, i32* %9
%237 = icmp eq i32 %235, %236
br i1 %237, label %238, label %239
238: ; preds = %228
br label %240
239: ; preds = %228, %223
br label %69
240: ; preds = %238, %221
%241 = load i32*, i32** %6
%242 = load i32, i32* %8
%243 = call i32 @XDestroyWindow(i32* %241, i32 %242)
%244 = load i32*, i32** %6
%245 = call i32 @XCloseDisplay(i32* %244)
ret i32 0
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8* }
%struct.TYPE_10__ = type { i64, %struct.TYPE_8__, i32 }
%struct.TYPE_8__ = type { %struct.TYPE_7__ }
%struct.TYPE_7__ = type { i64* }
%struct.TYPE_9__ = type { i32, i32 }
@stderr = global i32 0
@.str = [21 x i8] c"Cannot open display\0A\00"
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@.str.1 = [47 x i8] c"Geeks3D.com - X11 window under Linux (Mint 10)\00"
@.str.2 = [17 x i8] c"WM_DELETE_WINDOW\00"
@False = global i32 0
@Expose = global i64 0
@.str.3 = [25 x i8] c"X11 test app under Linux\00"
@.str.4 = [20 x i8] c"(C)2012 Geeks3D.com\00"
@.str.5 = [20 x i8] c"System information:\00"
@.str.6 = [13 x i8] c"- System: %s\00"
@.str.7 = [14 x i8] c"- Release: %s\00"
@.str.8 = [14 x i8] c"- Version: %s\00"
@.str.9 = [14 x i8] c"- Machine: %s\00"
@.str.10 = [27 x i8] c"Current window size: %dx%d\00"
@KeyPress = global i64 0
@XK_Escape = global i64 0
@ClientMessage = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca %struct.utsname
%5 = alloca %struct.TYPE_10__
%6 = alloca [256 x i8]
%7 = alloca %struct.TYPE_9__
%8 = alloca [128 x i8]
%9 = alloca [128 x i8]
%10 = alloca i64
%11 = tail call i32* @XOpenDisplay(i32* null)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = tail call i32 @DefaultScreen(i32* %11)
%19 = tail call i32 @RootWindow(i32* %11, i32 %18)
%20 = tail call i32 @BlackPixel(i32* %11, i32 %18)
%21 = tail call i32 @WhitePixel(i32* %11, i32 %18)
%22 = tail call i32 @XCreateSimpleWindow(i32* %11, i32 %19, i32 10, i32 10, i32 660, i32 200, i32 1, i32 %20, i32 %21)
%23 = load i32, i32* @ExposureMask
%24 = load i32, i32* @KeyPressMask
%25 = or i32 %24, %23
%26 = tail call i32 @XSelectInput(i32* %11, i32 %22, i32 %25)
%27 = tail call i32 @XMapWindow(i32* %11, i32 %22)
%28 = tail call i32 @XStoreName(i32* %11, i32 %22, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%29 = bitcast i32* %3 to i8*
%30 = load i32, i32* @False
%31 = tail call i32 @XInternAtom(i32* %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %30)
store i32 %31, i32* %3
%32 = call i32 @XSetWMProtocols(i32* %11, i32 %22, i32* %3, i32 1)
%33 = bitcast %struct.utsname* %4 to i8*
%34 = call i32 @uname(%struct.utsname* %4)
%35 = icmp eq i32 %34, -1
%36 = bitcast %struct.TYPE_10__* %5 to i8*
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%38 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %5, i64 0, i32 1, i32 0, i32 0
%39 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %5, i64 0, i32 0
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%41 = getelementptr inbounds %struct.utsname, %struct.utsname* %4, i64 0, i32 0
%42 = load i8*, i8** %41
%43 = getelementptr inbounds %struct.utsname, %struct.utsname* %4, i64 0, i32 1
%44 = load i8*, i8** %43
%45 = getelementptr inbounds %struct.utsname, %struct.utsname* %4, i64 0, i32 2
%46 = load i8*, i8** %45
%47 = getelementptr inbounds %struct.utsname, %struct.utsname* %4, i64 0, i32 3
%48 = load i8*, i8** %47
%49 = bitcast %struct.TYPE_9__* %7 to i8*
%50 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %7, i64 0, i32 0
%51 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %7, i64 0, i32 1
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%53 = bitcast i64* %10 to i8*
%54 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %5, i64 0, i32 2
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 20
br label %56
56: ; preds = %119, %17
%57 = call i32 @XNextEvent(i32* %11, %struct.TYPE_10__* %5)
%58 = load i64, i64* %39
%59 = load i64, i64* @Expose
%60 = icmp eq i64 %58, %59
br i1 %60, label %61, label %98
61: ; preds = %56
%62 = call i32 @DefaultGC(i32* %11, i32 %18)
%63 = call i32 @strlen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%64 = call i32 @XDrawString(i32* %11, i32 %22, i32 %62, i32 10, i32 20, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %63)
%65 = call i32 @DefaultGC(i32* %11, i32 %18)
%66 = call i32 @strlen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%67 = call i32 @XDrawString(i32* %11, i32 %22, i32 %65, i32 10, i32 40, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %66)
br i1 %35, label %88, label %68
68: ; preds = %61
%69 = call i32 @DefaultGC(i32* %11, i32 %18)
%70 = call i32 @strlen(i8* %40)
%71 = call i32 @XDrawString(i32* %11, i32 %22, i32 %69, i32 10, i32 60, i8* %40, i32 %70)
%72 = call i32 (i8*, i8*, ...) @sprintf(i8* %40, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %42)
%73 = call i32 @DefaultGC(i32* %11, i32 %18)
%74 = call i32 @strlen(i8* %40)
%75 = call i32 @XDrawString(i32* %11, i32 %22, i32 %73, i32 10, i32 75, i8* %40, i32 %74)
%76 = call i32 (i8*, i8*, ...) @sprintf(i8* %40, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %44)
%77 = call i32 @DefaultGC(i32* %11, i32 %18)
%78 = call i32 @strlen(i8* %40)
%79 = call i32 @XDrawString(i32* %11, i32 %22, i32 %77, i32 10, i32 90, i8* %40, i32 %78)
%80 = call i32 (i8*, i8*, ...) @sprintf(i8* %40, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %46)
%81 = call i32 @DefaultGC(i32* %11, i32 %18)
%82 = call i32 @strlen(i8* %40)
%83 = call i32 @XDrawString(i32* %11, i32 %22, i32 %81, i32 10, i32 105, i8* %40, i32 %82)
%84 = call i32 (i8*, i8*, ...) @sprintf(i8* %40, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %48)
%85 = call i32 @DefaultGC(i32* %11, i32 %18)
%86 = call i32 @strlen(i8* %40)
%87 = call i32 @XDrawString(i32* %11, i32 %22, i32 %85, i32 10, i32 120, i8* %40, i32 %86)
br label %88
88: ; preds = %68, %61
%89 = phi i32 [ 140, %68 ], [ 60, %61 ]
%90 = call i32 @XGetWindowAttributes(i32* %11, i32 %22, %struct.TYPE_9__* %7)
%91 = load i32, i32* %50
%92 = load i32, i32* %51
%93 = call i32 (i8*, i8*, ...) @sprintf(i8* %52, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 %91, i32 %92)
%94 = call i32 @DefaultGC(i32* %11, i32 %18)
%95 = call i32 @strlen(i8* %52)
%96 = call i32 @XDrawString(i32* %11, i32 %22, i32 %94, i32 10, i32 %89, i8* %52, i32 %95)
%97 = load i64, i64* %39
br label %98
98: ; preds = %88, %56
%99 = phi i64 [ %97, %88 ], [ %58, %56 ]
%100 = load i64, i64* @KeyPress
%101 = icmp eq i64 %99, %100
br i1 %101, label %102, label %109
102: ; preds = %98
%103 = call i32 @XLookupString(i32* %54, i8* %37, i32 128, i64* %10, i32* null)
%104 = load i64, i64* %10
%105 = load i64, i64* @XK_Escape
%106 = icmp eq i64 %104, %105
br i1 %106, label %120, label %107
107: ; preds = %102
%108 = load i64, i64* %39
br label %109
109: ; preds = %107, %98
%110 = phi i64 [ %108, %107 ], [ %99, %98 ]
%111 = load i64, i64* @ClientMessage
%112 = icmp eq i64 %110, %111
br i1 %112, label %113, label %119
113: ; preds = %109
%114 = load i64*, i64** %38
%115 = load i64, i64* %114
%116 = trunc i64 %115 to i32
%117 = load i32, i32* %3
%118 = icmp eq i32 %117, %116
br i1 %118, label %120, label %119
119: ; preds = %113, %109
br label %56
120: ; preds = %102, %113
%121 = call i32 @XDestroyWindow(i32* %11, i32 %22)
%122 = call i32 @XCloseDisplay(i32* %11)
ret i32 0
}