#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_9__ TYPE_4__;
typedef struct TYPE_8__ TYPE_3__;
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  int /*<<< orphan*/ window;
};
struct TYPE_7__ {
  int /*<<< orphan*/ window;
};
struct TYPE_6__ {
  int /*<<< orphan*/ window;
};
struct TYPE_9__ {
  int type;
  TYPE_3__ xbutton;
  TYPE_2__ xcrossing;
  TYPE_1__ xany;
};
typedef TYPE_4__ XEvent;

/* Variables and functions */
#define ButtonPress 132
#define EnterNotify 131
#define Expose 130
#define LeaveNotify 129
#define MapNotify 128
int /*<<< orphan*/ user_button_cross(int /*<<< orphan*/, int);
int /*<<< orphan*/ user_button_draw(int /*<<< orphan*/);
int /*<<< orphan*/ user_button_press(int /*<<< orphan*/);
void user_button_events(XEvent report) {
  switch (report.type) {
  case Expose:
  case MapNotify:
    user_button_draw(report.xany.window);
    break;
  case EnterNotify:
    user_button_cross(report.xcrossing.window, 2);
    break;
  case LeaveNotify:
    user_button_cross(report.xcrossing.window, 1);
    break;
  case ButtonPress:
    user_button_press(report.xbutton.window);
    break;
  }
}


x86 assembly (clang, -O0):
<user_button_events>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11a2 <user_button_events+0x72>
mov    -0x18(%rbp),%rax
lea    0xea0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x4(%rbp),%edi
call   1040 <user_button_draw@plt>
jmp    11a2 <user_button_events+0x72>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <user_button_cross@plt>
jmp    11a2 <user_button_events+0x72>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <user_button_cross@plt>
jmp    11a2 <user_button_events+0x72>
mov    -0xc(%rbp),%edi
call   1050 <user_button_press@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_button_events>:
lea    -0x80(%rdi),%eax
cmp    $0x4,%eax
ja     1153 <user_button_events+0x23>
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
shr    $0x20,%rsi
mov    %esi,%edi
jmp    1040 <user_button_draw@plt>
ret
mov    %esi,%edi
mov    $0x1,%esi
jmp    1030 <user_button_cross@plt>
mov    %esi,%edi
mov    $0x2,%esi
jmp    1030 <user_button_cross@plt>
shr    $0x20,%rdi
jmp    1050 <user_button_press@plt>

LLVM IR (-O0):
%struct.TYPE_9__ = type { i32, %struct.TYPE_8__, %struct.TYPE_7__, %struct.TYPE_6__ }
%struct.TYPE_8__ = type { i32 }
%struct.TYPE_7__ = type { i32 }
%struct.TYPE_6__ = type { i32 }
define void @user_button_events(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_9__
%4 = bitcast %struct.TYPE_9__* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %3, i32 0, i32 0
%8 = load i32, i32* %7
switch i32 %8, label %29 [
i32 130, label %9
i32 128, label %9
i32 131, label %14
i32 129, label %19
i32 132, label %24
]
9: ; preds = %2, %2
%10 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %3, i32 0, i32 3
%11 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @user_button_draw(i32 %12)
br label %29
14: ; preds = %2
%15 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %3, i32 0, i32 2
%16 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @user_button_cross(i32 %17, i32 2)
br label %29
19: ; preds = %2
%20 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %3, i32 0, i32 2
%21 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %20, i32 0, i32 0
%22 = load i32, i32* %21
%23 = call i32 @user_button_cross(i32 %22, i32 1)
br label %29
24: ; preds = %2
%25 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %3, i32 0, i32 1
%26 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %25, i32 0, i32 0
%27 = load i32, i32* %26
%28 = call i32 @user_button_press(i32 %27)
br label %29
29: ; preds = %2, %24, %19, %14, %9
ret void
}

LLVM IR (-O2):
define void @user_button_events(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
switch i32 %3, label %17 [
i32 130, label %5
i32 128, label %5
i32 131, label %9
i32 129, label %11
i32 132, label %13
]
5: ; preds = %2, %2
%6 = lshr i64 %1, 32
%7 = trunc i64 %6 to i32
%8 = tail call i32 @user_button_draw(i32 %7)
br label %17
9: ; preds = %2
%10 = tail call i32 @user_button_cross(i32 %4, i32 2)
br label %17
11: ; preds = %2
%12 = tail call i32 @user_button_cross(i32 %4, i32 1)
br label %17
13: ; preds = %2
%14 = lshr i64 %0, 32
%15 = trunc i64 %14 to i32
%16 = tail call i32 @user_button_press(i32 %15)
br label %17
17: ; preds = %2, %13, %11, %9, %5
ret void
}