#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*/ xcrossing;
  int /*<<< orphan*/ xunmap;
  int /*<<< orphan*/ xclient;
  int /*<<< orphan*/ xkey;
  int /*<<< orphan*/ xconfigurerequest;
  int /*<<< orphan*/ xmaprequest;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
#define ClientMessage 134
#define ConfigureRequest 133
#define EnterNotify 132
#define KeyPress 131
#define LeaveNotify 130
#define MapRequest 129
#define UnmapNotify 128
int /*<<< orphan*/ clientmessage(int /*<<< orphan*/ *);
int /*<<< orphan*/ configurerequest(int /*<<< orphan*/ *);
int /*<<< orphan*/ enternotify(int /*<<< orphan*/ *);
int /*<<< orphan*/ keypress(int /*<<< orphan*/ *);
int /*<<< orphan*/ leavenotify(int /*<<< orphan*/ *);
int /*<<< orphan*/ maprequest(int /*<<< orphan*/ *);
int /*<<< orphan*/ unmapnotify(int /*<<< orphan*/ *);
void event(void *self, XEvent *e) {
  switch (e->type) {
  case MapRequest:
    maprequest(&e->xmaprequest);
    break;
  case ConfigureRequest:
    configurerequest(&e->xconfigurerequest);
    break;
  case KeyPress:
    keypress(&e->xkey);
    break;
  case ClientMessage:
    clientmessage(&e->xclient);
    break;
  case UnmapNotify:
    unmapnotify(&e->xunmap);
    break;
  case EnterNotify:
    enternotify(&e->xcrossing);
    break;
  case LeaveNotify:
    leavenotify(&e->xcrossing);
    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    $0x6,%eax
ja     1225 <event+0xb5>
mov    -0x18(%rbp),%rax
lea    0xe5d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
call   1090 <maprequest@plt>
jmp    1225 <event+0xb5>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
call   1040 <configurerequest@plt>
jmp    1225 <event+0xb5>
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
call   1030 <keypress@plt>
jmp    1225 <event+0xb5>
mov    -0x10(%rbp),%rdi
add    $0xc,%rdi
call   1050 <clientmessage@plt>
jmp    1225 <event+0xb5>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1070 <unmapnotify@plt>
jmp    1225 <event+0xb5>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1060 <enternotify@plt>
jmp    1225 <event+0xb5>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1080 <leavenotify@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event>:
mov    (%rsi),%eax
add    $0xffffff80,%eax
cmp    $0x6,%eax
ja     1196 <event+0x26>
lea    0xe7f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0x8,%rsi
mov    %rsi,%rdi
jmp    1070 <unmapnotify@plt>
ret
add    $0x18,%rsi
mov    %rsi,%rdi
jmp    1090 <maprequest@plt>
add    $0x4,%rsi
mov    %rsi,%rdi
jmp    1080 <leavenotify@plt>
add    $0x10,%rsi
mov    %rsi,%rdi
jmp    1030 <keypress@plt>
add    $0x4,%rsi
mov    %rsi,%rdi
jmp    1060 <enternotify@plt>
add    $0x14,%rsi
mov    %rsi,%rdi
jmp    1040 <configurerequest@plt>
add    $0xc,%rsi
mov    %rsi,%rdi
jmp    1050 <clientmessage@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { 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 %36 [
i32 129, label %8
i32 133, label %12
i32 131, label %16
i32 134, label %20
i32 128, label %24
i32 132, label %28
i32 130, label %32
]
8: ; preds = %2
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 6
%11 = call i32 @maprequest(i32* %10)
br label %36
12: ; preds = %2
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 5
%15 = call i32 @configurerequest(i32* %14)
br label %36
16: ; preds = %2
%17 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 4
%19 = call i32 @keypress(i32* %18)
br label %36
20: ; preds = %2
%21 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i32 0, i32 3
%23 = call i32 @clientmessage(i32* %22)
br label %36
24: ; preds = %2
%25 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%26 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %25, i32 0, i32 2
%27 = call i32 @unmapnotify(i32* %26)
br label %36
28: ; preds = %2
%29 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%30 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %29, i32 0, i32 1
%31 = call i32 @enternotify(i32* %30)
br label %36
32: ; preds = %2
%33 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%34 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %33, i32 0, i32 1
%35 = call i32 @leavenotify(i32* %34)
br label %36
36: ; preds = %2, %32, %28, %24, %20, %16, %12, %8
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i32 }
define void @event(i8* nocapture readnone %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 %26 [
i32 129, label %5
i32 133, label %8
i32 131, label %11
i32 134, label %14
i32 128, label %17
i32 132, label %20
i32 130, label %23
]
5: ; preds = %2
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 6
%7 = tail call i32 @maprequest(i32* %6)
br label %26
8: ; preds = %2
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 5
%10 = tail call i32 @configurerequest(i32* %9)
br label %26
11: ; preds = %2
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 4
%13 = tail call i32 @keypress(i32* %12)
br label %26
14: ; preds = %2
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 3
%16 = tail call i32 @clientmessage(i32* %15)
br label %26
17: ; preds = %2
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%19 = tail call i32 @unmapnotify(i32* %18)
br label %26
20: ; preds = %2
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%22 = tail call i32 @enternotify(i32* %21)
br label %26
23: ; preds = %2
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%25 = tail call i32 @leavenotify(i32* %24)
br label %26
26: ; preds = %2, %23, %20, %17, %14, %11, %8, %5
ret void
}