#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*/ xbutton;
  int /*<<< orphan*/ xmotion;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
#define ButtonPress 129
#define MotionNotify 128
int /*<<< orphan*/ buttonpress(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ motionnotify(void *, int /*<<< orphan*/ *);
void event(void *self, XEvent *e) {
  switch (e->type) {
  case MotionNotify:
    motionnotify(self, &e->xmotion);
    break;
  case ButtonPress:
    buttonpress(self, &e->xbutton);
    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
mov    %eax,-0x14(%rbp)
sub    $0x80,%eax
je     115c <event+0x3c>
jmp    1149 <event+0x29>
mov    -0x14(%rbp),%eax
sub    $0x81,%eax
je     1172 <event+0x52>
jmp    1183 <event+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <motionnotify@plt>
jmp    1183 <event+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1030 <buttonpress@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event>:
mov    (%rsi),%eax
cmp    $0x81,%eax
je     1139 <event+0x19>
cmp    $0x80,%eax
jne    1142 <event+0x22>
add    $0x8,%rsi
jmp    1040 <motionnotify@plt>
add    $0x4,%rsi
jmp    1030 <buttonpress@plt>
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { 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 %18 [
i32 128, label %8
i32 129, label %13
]
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 2
%12 = call i32 @motionnotify(i8* %9, i32* %11)
br label %18
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 1
%17 = call i32 @buttonpress(i8* %14, i32* %16)
br label %18
18: ; preds = %2, %13, %8
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { 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 %11 [
i32 128, label %5
i32 129, label %8
]
5: ; preds = %2
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%7 = tail call i32 @motionnotify(i8* %0, i32* %6)
br label %11
8: ; preds = %2
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%10 = tail call i32 @buttonpress(i8* %0, i32* %9)
br label %11
11: ; preds = %2, %8, %5
ret void
}