#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
  int /*<<< orphan*/ xcolormap;
  int /*<<< orphan*/ xclient;
  int /*<<< orphan*/ xdestroywindow;
  int /*<<< orphan*/ xunmap;
  int /*<<< orphan*/ xmaprequest;
  int /*<<< orphan*/ xproperty;
  int /*<<< orphan*/ xconfigurerequest;
  int /*<<< orphan*/ xfocus;
  int /*<<< orphan*/ xkey;
  int /*<<< orphan*/ xbutton;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
#define ButtonPress 138
#define ClientMessage 137
#define ColormapNotify 136
#define ConfigureRequest 135
#define DestroyNotify 134
#define FocusIn 133
#define FocusOut 132
#define KeyPress 131
#define MapRequest 130
#define PropertyNotify 129
#define UnmapNotify 128
int /*<<< orphan*/ buttonpress(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clientmessage(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ colormapnotify(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ configurerequest(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ destroynotify(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ focusin(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ focusout(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ keypress(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ maprequest(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ propertynotify(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ unmapnotify(void *, int /*<<< orphan*/ *);
void event(void *self, XEvent *e) {
  switch (e->type) {
  case ButtonPress:
    buttonpress(self, &e->xbutton);
    break;
  case KeyPress:
    keypress(self, &e->xkey);
    break;
  case FocusIn:
    focusin(self, &e->xfocus);
    break;
  case FocusOut:
    focusout(self, &e->xfocus);
    break;
  case ConfigureRequest:
    configurerequest(self, &e->xconfigurerequest);
    break;
  case PropertyNotify:
    propertynotify(self, &e->xproperty);
    break;
  case MapRequest:
    maprequest(self, &e->xmaprequest);
    break;
  case UnmapNotify:
    unmapnotify(self, &e->xunmap);
    break;
  case DestroyNotify:
    destroynotify(self, &e->xdestroywindow);
    break;
  case ClientMessage:
    clientmessage(self, &e->xclient);
    break;
  case ColormapNotify:
    colormapnotify(self, &e->xcolormap);
    break;
  }
}


x86 assembly (clang, -O0):
<event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xa,%eax
ja     12d9 <event+0x129>
mov    -0x18(%rbp),%rax
lea    0xe1d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x28,%rsi
call   1030 <buttonpress@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x24,%rsi
call   1040 <keypress@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   10c0 <focusin@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   1050 <focusout@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1c,%rsi
call   1080 <configurerequest@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x18,%rsi
call   1060 <propertynotify@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x14,%rsi
call   10d0 <maprequest@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   10a0 <unmapnotify@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0xc,%rsi
call   10b0 <destroynotify@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1090 <clientmessage@plt>
jmp    12d9 <event+0x129>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1070 <colormapnotify@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event>:
mov    (%rsi),%eax
add    $0xffffff80,%eax
cmp    $0xa,%eax
ja     11d3 <event+0x23>
lea    0xe3f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0x10,%rsi
jmp    10a0 <unmapnotify@plt>
ret
add    $0x18,%rsi
jmp    1060 <propertynotify@plt>
add    $0x14,%rsi
jmp    10d0 <maprequest@plt>
add    $0x24,%rsi
jmp    1040 <keypress@plt>
add    $0x20,%rsi
jmp    1050 <focusout@plt>
add    $0x20,%rsi
jmp    10c0 <focusin@plt>
add    $0xc,%rsi
jmp    10b0 <destroynotify@plt>
add    $0x1c,%rsi
jmp    1080 <configurerequest@plt>
add    $0x4,%rsi
jmp    1070 <colormapnotify@plt>
add    $0x8,%rsi
jmp    1090 <clientmessage@plt>
add    $0x28,%rsi
jmp    1030 <buttonpress@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
define void @event(i8* %0, %struct.TYPE_3__* %1) {
%3 = alloca i8*
%4 = alloca %struct.TYPE_3__*
store i8* %0, i8** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
switch i32 %7, label %63 [
i32 138, label %8
i32 131, label %13
i32 133, label %18
i32 132, label %23
i32 135, label %28
i32 129, label %33
i32 130, label %38
i32 128, label %43
i32 134, label %48
i32 137, label %53
i32 136, label %58
]
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 10
%12 = call i32 @buttonpress(i8* %9, i32* %11)
br label %63
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %15, i32 0, i32 9
%17 = call i32 @keypress(i8* %14, i32* %16)
br label %63
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %20, i32 0, i32 8
%22 = call i32 @focusin(i8* %19, i32* %21)
br label %63
23: ; preds = %2
%24 = load i8*, i8** %3
%25 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%26 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %25, i32 0, i32 8
%27 = call i32 @focusout(i8* %24, i32* %26)
br label %63
28: ; preds = %2
%29 = load i8*, i8** %3
%30 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%31 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %30, i32 0, i32 7
%32 = call i32 @configurerequest(i8* %29, i32* %31)
br label %63
33: ; preds = %2
%34 = load i8*, i8** %3
%35 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%36 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %35, i32 0, i32 6
%37 = call i32 @propertynotify(i8* %34, i32* %36)
br label %63
38: ; preds = %2
%39 = load i8*, i8** %3
%40 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%41 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %40, i32 0, i32 5
%42 = call i32 @maprequest(i8* %39, i32* %41)
br label %63
43: ; preds = %2
%44 = load i8*, i8** %3
%45 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%46 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %45, i32 0, i32 4
%47 = call i32 @unmapnotify(i8* %44, i32* %46)
br label %63
48: ; preds = %2
%49 = load i8*, i8** %3
%50 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%51 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %50, i32 0, i32 3
%52 = call i32 @destroynotify(i8* %49, i32* %51)
br label %63
53: ; preds = %2
%54 = load i8*, i8** %3
%55 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%56 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %55, i32 0, i32 2
%57 = call i32 @clientmessage(i8* %54, i32* %56)
br label %63
58: ; preds = %2
%59 = load i8*, i8** %3
%60 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%61 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %60, i32 0, i32 1
%62 = call i32 @colormapnotify(i8* %59, i32* %61)
br label %63
63: ; preds = %2, %58, %53, %48, %43, %38, %33, %28, %23, %18, %13, %8
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
define void @event(i8* %0, %struct.TYPE_3__* %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%4 = load i32, i32* %3
switch i32 %4, label %38 [
i32 138, label %5
i32 131, label %8
i32 133, label %11
i32 132, label %14
i32 135, label %17
i32 129, label %20
i32 130, label %23
i32 128, label %26
i32 134, label %29
i32 137, label %32
i32 136, label %35
]
5: ; preds = %2
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 10
%7 = tail call i32 @buttonpress(i8* %0, i32* %6)
br label %38
8: ; preds = %2
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 9
%10 = tail call i32 @keypress(i8* %0, i32* %9)
br label %38
11: ; preds = %2
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 8
%13 = tail call i32 @focusin(i8* %0, i32* %12)
br label %38
14: ; preds = %2
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 8
%16 = tail call i32 @focusout(i8* %0, i32* %15)
br label %38
17: ; preds = %2
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 7
%19 = tail call i32 @configurerequest(i8* %0, i32* %18)
br label %38
20: ; preds = %2
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 6
%22 = tail call i32 @propertynotify(i8* %0, i32* %21)
br label %38
23: ; preds = %2
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 5
%25 = tail call i32 @maprequest(i8* %0, i32* %24)
br label %38
26: ; preds = %2
%27 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 4
%28 = tail call i32 @unmapnotify(i8* %0, i32* %27)
br label %38
29: ; preds = %2
%30 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 3
%31 = tail call i32 @destroynotify(i8* %0, i32* %30)
br label %38
32: ; preds = %2
%33 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%34 = tail call i32 @clientmessage(i8* %0, i32* %33)
br label %38
35: ; preds = %2
%36 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%37 = tail call i32 @colormapnotify(i8* %0, i32* %36)
br label %38
38: ; preds = %2, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8, %5
ret void
}