#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_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int state;
  int /*<<< orphan*/ keycode;
};
struct TYPE_5__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;
typedef int KeySym;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int ControlMask;
int /*<<< orphan*/ CurrentTime;
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ False;
int /*<<< orphan*/ GrabModeAsync;
int /*<<< orphan*/ KeyPressMask;
int Mod1Mask;
int Mod2Mask;
int Mod3Mask;
int Mod4Mask;
int ShiftMask;
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int XGrabKeyboard(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
#define XK_Alt_L 141
#define XK_Alt_R 140
#define XK_Caps_Lock 139
#define XK_Control_L 138
#define XK_Control_R 137
#define XK_Hyper_L 136
#define XK_Hyper_R 135
#define XK_Meta_L 134
#define XK_Meta_R 133
#define XK_Shift_L 132
#define XK_Shift_Lock 131
#define XK_Shift_R 130
#define XK_Super_L 129
#define XK_Super_R 128
char *XKeysymToString(int);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XWindowEvent(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, TYPE_2__ *);
int /*<<< orphan*/ XkbLookupKeySym(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int, unsigned int *, int *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ sprintf(char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  Display *d;
  XEvent ev;
  unsigned int mods;
  KeySym ks;
  char buf[20];
  const char *kss;
  char *bufptr;
  int ret;
  d = XOpenDisplay(NULL);
  ret = XGrabKeyboard(d, DefaultRootWindow(d), False, GrabModeAsync,
                      GrabModeAsync, CurrentTime);
  fprintf(stderr, "XGrabKeyboard returns %d\n", ret);
  while (1) {
    assert(!XWindowEvent(d, DefaultRootWindow(d), KeyPressMask, &ev));
    XkbLookupKeySym(d, ev.xkey.keycode, ev.xkey.state, &mods, &ks);
    switch (ks) {
    case XK_Shift_L:
    case XK_Shift_R:
    case XK_Control_L:
    case XK_Control_R:
    case XK_Caps_Lock:
    case XK_Shift_Lock:
    case XK_Meta_L:
    case XK_Meta_R:
    case XK_Alt_L:
    case XK_Alt_R:
    case XK_Super_L:
    case XK_Super_R:
    case XK_Hyper_L:
    case XK_Hyper_R:
      continue;
    }
    kss = XKeysymToString(ks);
    bufptr = buf;
    if (ev.xkey.state & ShiftMask) {
    }
    if (ev.xkey.state & ControlMask)
      bufptr += sprintf(bufptr, "C-");
    if (ev.xkey.state & Mod1Mask)
      bufptr += sprintf(bufptr, "M-");
    if (ev.xkey.state & Mod2Mask) {
    }
    if (ev.xkey.state & Mod3Mask) {
    }
    if (ev.xkey.state & Mod4Mask)
      bufptr += sprintf(bufptr, "S-");
    bufptr += sprintf(bufptr, kss);
    fprintf(stdout, "%s\n", buf);
    fflush(stdout);
    if (!strcmp(buf, "C-C"))
      break;
  }
  XCloseDisplay(d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <DefaultRootWindow@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
mov    0x2dc7(%rip),%rax
mov    (%rax),%edx
mov    0x2d96(%rip),%rax
mov    (%rax),%ecx
mov    0x2d8d(%rip),%rax
mov    (%rax),%r8d
mov    0x2db3(%rip),%rax
mov    (%rax),%r9d
call   10e0 <XGrabKeyboard@plt>
mov    %eax,-0x54(%rbp)
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
mov    -0x54(%rbp),%edx
lea    0xdc5(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    %rdi,-0x68(%rbp)
call   1030 <DefaultRootWindow@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%esi
mov    0x2d5c(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rcx
call   10a0 <XWindowEvent@plt>
test   %eax,%eax
sete   %al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%esi
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1090 <XkbLookupKeySym@plt>
mov    -0x28(%rbp),%eax
add    $0xffffff80,%eax
sub    $0xd,%eax
ja     12a4 <main+0xe4>
jmp    129f <main+0xdf>
jmp    1242 <main+0x82>
mov    -0x28(%rbp),%edi
call   10d0 <XKeysymToString@plt>
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2d1e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12d2 <main+0x112>
jmp    12d2 <main+0x112>
mov    -0x20(%rbp),%eax
mov    0x2cfc(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1307 <main+0x147>
mov    -0x50(%rbp),%rdi
lea    0xd28(%rip),%rsi
call   10b0 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2caf(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     133c <main+0x17c>
mov    -0x50(%rbp),%rdi
lea    0xcf6(%rip),%rsi
call   10b0 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2c42(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1356 <main+0x196>
jmp    1356 <main+0x196>
mov    -0x20(%rbp),%eax
mov    0x2c50(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1370 <main+0x1b0>
jmp    1370 <main+0x1b0>
mov    -0x20(%rbp),%eax
mov    0x2c76(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     13a5 <main+0x1e5>
mov    -0x50(%rbp),%rdi
lea    0xc90(%rip),%rsi
call   10b0 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   10b0 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    0x2bc7(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rdx
lea    0xc4d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2bac(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
lea    -0x40(%rbp),%rdi
lea    0xc31(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1409 <main+0x249>
jmp    140e <main+0x24e>
jmp    1242 <main+0x82>
mov    -0x18(%rbp),%rdi
call   10c0 <XCloseDisplay@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <DefaultRootWindow@plt>
mov    0x2df9(%rip),%rcx
mov    (%rcx),%edx
mov    0x2dd0(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2def(%rip),%rsi
mov    (%rsi),%r9d
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ecx,%r8d
call   10d0 <XGrabKeyboard@plt>
mov    0x2da8(%rip),%rcx
mov    (%rcx),%edi
lea    0xdf7(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2da7(%rip),%r14
mov    %rsp,%r15
lea    0x24(%rsp),%r12
lea    0xc(%rsp),%r13
mov    0x2d73(%rip),%rbp
jmp    1264 <main+0xb4>
nop
mov    %rax,%rsi
call   10a0 <sprintf@plt>
mov    0x0(%rbp),%edi
lea    0xde1(%rip),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%rbp),%edi
call   1070 <fflush@plt>
cmpl   $0x432d43,0x10(%rsp)
je     130c <main+0x15c>
mov    %rbx,%rdi
call   1030 <DefaultRootWindow@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rcx
call   1090 <XWindowEvent@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
mov    %r12,%rcx
mov    %r13,%r8
call   1080 <XkbLookupKeySym@plt>
mov    0xc(%rsp),%edi
lea    -0x80(%rdi),%eax
cmp    $0xe,%eax
jb     1264 <main+0xb4>
call   10c0 <XKeysymToString@plt>
mov    (%rsp),%ecx
lea    0x10(%rsp),%rdi
mov    0x2d22(%rip),%rdx
test   %ecx,(%rdx)
je     12d3 <main+0x123>
movb   $0x0,0x12(%rsp)
movw   $0x2d43,0x10(%rsp)
lea    0x12(%rsp),%rdi
mov    0x2cee(%rip),%rdx
test   %ecx,(%rdx)
je     12eb <main+0x13b>
movb   $0x0,0x2(%rdi)
movw   $0x2d4d,(%rdi)
add    $0x2,%rdi
mov    0x2cfe(%rip),%rdx
test   %ecx,(%rdx)
je     1230 <main+0x80>
movb   $0x0,0x2(%rdi)
movw   $0x2d53,(%rdi)
add    $0x2,%rdi
jmp    1230 <main+0x80>
mov    %rbx,%rdi
call   10b0 <XCloseDisplay@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32, i32 }
@False = global i32 0
@GrabModeAsync = global i32 0
@CurrentTime = global i32 0
@stderr = global i32 0
@.str = [26 x i8] c"XGrabKeyboard returns %d\0A\00"
@KeyPressMask = global i32 0
@ShiftMask = global i32 0
@ControlMask = global i32 0
@.str.1 = [3 x i8] c"C-\00"
@Mod1Mask = global i32 0
@.str.2 = [3 x i8] c"M-\00"
@Mod2Mask = global i32 0
@Mod3Mask = global i32 0
@Mod4Mask = global i32 0
@.str.3 = [3 x i8] c"S-\00"
@stdout = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [4 x i8] c"C-C\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.TYPE_5__
%8 = alloca i32
%9 = alloca i32
%10 = alloca [20 x i8]
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32* @XOpenDisplay(i32* null)
store i32* %14, i32** %6
%15 = load i32*, i32** %6
%16 = load i32*, i32** %6
%17 = call i32 @DefaultRootWindow(i32* %16)
%18 = load i32, i32* @False
%19 = load i32, i32* @GrabModeAsync
%20 = load i32, i32* @GrabModeAsync
%21 = load i32, i32* @CurrentTime
%22 = call i32 @XGrabKeyboard(i32* %15, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
store i32 %22, i32* %13
%23 = load i32, i32* @stderr
%24 = load i32, i32* %13
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %2, %45, %128
%27 = load i32*, i32** %6
%28 = load i32*, i32** %6
%29 = call i32 @DefaultRootWindow(i32* %28)
%30 = load i32, i32* @KeyPressMask
%31 = call i32 @XWindowEvent(i32* %27, i32 %29, i32 %30, %struct.TYPE_5__* %7)
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = load i32*, i32** %6
%37 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%38 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %37, i32 0, i32 1
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%41 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %40, i32 0, i32 0
%42 = load i32, i32* %41
%43 = call i32 @XkbLookupKeySym(i32* %36, i32 %39, i32 %42, i32* %8, i32* %9)
%44 = load i32, i32* %9
switch i32 %44, label %46 [
i32 132, label %45
i32 130, label %45
i32 138, label %45
i32 137, label %45
i32 139, label %45
i32 131, label %45
i32 134, label %45
i32 133, label %45
i32 141, label %45
i32 140, label %45
i32 129, label %45
i32 128, label %45
i32 136, label %45
i32 135, label %45
]
45: ; preds = %26, %26, %26, %26, %26, %26, %26, %26, %26, %26, %26, %26, %26, %26
br label %26
46: ; preds = %26
%47 = load i32, i32* %9
%48 = call i8* @XKeysymToString(i32 %47)
store i8* %48, i8** %11
%49 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
store i8* %49, i8** %12
%50 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%51 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %50, i32 0, i32 0
%52 = load i32, i32* %51
%53 = load i32, i32* @ShiftMask
%54 = and i32 %52, %53
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %46
br label %57
57: ; preds = %56, %46
%58 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%59 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %58, i32 0, i32 0
%60 = load i32, i32* %59
%61 = load i32, i32* @ControlMask
%62 = and i32 %60, %61
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %70
64: ; preds = %57
%65 = load i8*, i8** %12
%66 = call i32 @sprintf(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%67 = load i8*, i8** %12
%68 = sext i32 %66 to i64
%69 = getelementptr inbounds i8, i8* %67, i64 %68
store i8* %69, i8** %12
br label %70
70: ; preds = %64, %57
%71 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%72 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %71, i32 0, i32 0
%73 = load i32, i32* %72
%74 = load i32, i32* @Mod1Mask
%75 = and i32 %73, %74
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %83
77: ; preds = %70
%78 = load i8*, i8** %12
%79 = call i32 @sprintf(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%80 = load i8*, i8** %12
%81 = sext i32 %79 to i64
%82 = getelementptr inbounds i8, i8* %80, i64 %81
store i8* %82, i8** %12
br label %83
83: ; preds = %77, %70
%84 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%85 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %84, i32 0, i32 0
%86 = load i32, i32* %85
%87 = load i32, i32* @Mod2Mask
%88 = and i32 %86, %87
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %91
90: ; preds = %83
br label %91
91: ; preds = %90, %83
%92 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%93 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %92, i32 0, i32 0
%94 = load i32, i32* %93
%95 = load i32, i32* @Mod3Mask
%96 = and i32 %94, %95
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %99
98: ; preds = %91
br label %99
99: ; preds = %98, %91
%100 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%101 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %100, i32 0, i32 0
%102 = load i32, i32* %101
%103 = load i32, i32* @Mod4Mask
%104 = and i32 %102, %103
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %112
106: ; preds = %99
%107 = load i8*, i8** %12
%108 = call i32 @sprintf(i8* %107, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%109 = load i8*, i8** %12
%110 = sext i32 %108 to i64
%111 = getelementptr inbounds i8, i8* %109, i64 %110
store i8* %111, i8** %12
br label %112
112: ; preds = %106, %99
%113 = load i8*, i8** %12
%114 = load i8*, i8** %11
%115 = call i32 @sprintf(i8* %113, i8* %114)
%116 = load i8*, i8** %12
%117 = sext i32 %115 to i64
%118 = getelementptr inbounds i8, i8* %116, i64 %117
store i8* %118, i8** %12
%119 = load i32, i32* @stdout
%120 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %120)
%122 = load i32, i32* @stdout
%123 = call i32 @fflush(i32 %122)
%124 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%125 = call i32 @strcmp(i8* %124, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%126 = icmp ne i32 %125, 0
br i1 %126, label %128, label %127
127: ; preds = %112
br label %129
128: ; preds = %112
br label %26
129: ; preds = %127
%130 = load i32*, i32** %6
%131 = call i32 @XCloseDisplay(i32* %130)
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32, i32 }
@False = global i32 0
@GrabModeAsync = global i32 0
@CurrentTime = global i32 0
@stderr = global i32 0
@.str = [26 x i8] c"XGrabKeyboard returns %d\0A\00"
@KeyPressMask = global i32 0
@ShiftMask = global i32 0
@ControlMask = global i32 0
@.str.1 = [3 x i8] c"C-\00"
@Mod1Mask = global i32 0
@.str.2 = [3 x i8] c"M-\00"
@Mod2Mask = global i32 0
@Mod3Mask = global i32 0
@Mod4Mask = global i32 0
@.str.3 = [3 x i8] c"S-\00"
@stdout = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.TYPE_5__
%4 = alloca i32
%5 = alloca i32
%6 = alloca [20 x i8]
%7 = bitcast %struct.TYPE_5__* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%11 = tail call i32* @XOpenDisplay(i32* null)
%12 = tail call i32 @DefaultRootWindow(i32* %11)
%13 = load i32, i32* @False
%14 = load i32, i32* @GrabModeAsync
%15 = load i32, i32* @CurrentTime
%16 = tail call i32 @XGrabKeyboard(i32* %11, i32 %12, i32 %13, i32 %14, i32 %14, i32 %15)
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %16)
%19 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 0, i32 1
%20 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 0, i32 0
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 2
%22 = bitcast [20 x i8]* %6 to i32*
br label %23
23: ; preds = %66, %2
%24 = call i32 @DefaultRootWindow(i32* %11)
%25 = load i32, i32* @KeyPressMask
%26 = call i32 @XWindowEvent(i32* %11, i32 %24, i32 %25, %struct.TYPE_5__* %3)
%27 = icmp eq i32 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load i32, i32* %19
%31 = load i32, i32* %20
%32 = call i32 @XkbLookupKeySym(i32* %11, i32 %30, i32 %31, i32* %4, i32* %5)
%33 = load i32, i32* %5
%34 = add i32 %33, -128
%35 = icmp ult i32 %34, 14
br i1 %35, label %66, label %36
36: ; preds = %23
%37 = call i8* @XKeysymToString(i32 %33)
%38 = load i32, i32* %20
%39 = load i32, i32* @ControlMask
%40 = and i32 %39, %38
%41 = icmp eq i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %36
br label %43
43: ; preds = %42, %36
%44 = phi i8* [ %21, %42 ], [ %10, %36 ]
%45 = load i32, i32* @Mod1Mask
%46 = and i32 %45, %38
%47 = icmp eq i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %43
%49 = getelementptr inbounds i8, i8* %44, i64 2
br label %50
50: ; preds = %48, %43
%51 = phi i8* [ %49, %48 ], [ %44, %43 ]
%52 = load i32, i32* @Mod4Mask
%53 = and i32 %52, %38
%54 = icmp eq i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %50
%56 = getelementptr inbounds i8, i8* %51, i64 2
br label %57
57: ; preds = %55, %50
%58 = phi i8* [ %56, %55 ], [ %51, %50 ]
%59 = call i32 @sprintf(i8* dereferenceable(1) %58, i8* dereferenceable(1) %37)
%60 = load i32, i32* @stdout
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%62 = load i32, i32* @stdout
%63 = call i32 @fflush(i32 %62)
%64 = load i32, i32* %22
%65 = icmp eq i32 %64, 4402499
br i1 %65, label %67, label %66
66: ; preds = %57, %23
br label %23
67: ; preds = %57
%68 = call i32 @XCloseDisplay(i32* %11)
ret i32 0
}