#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 */

/* Type definitions */
struct tag_ev_response {
  int dummy;
};
struct plist_item {
  int dummy;
};
struct move_ev_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ free_move_ev_data(struct move_ev_data *);
int /*<<< orphan*/ free_tag_ev_data(struct tag_ev_response *);
int /*<<< orphan*/ plist_free_item_fields(struct plist_item *);
void free_event_data(const int type, void *data) {
  if (type == 0x50 || type == 0x54) {
    plist_free_item_fields((struct plist_item *)data);
    free(data);
  } else if (type == 0x11)
    free_tag_ev_data((struct tag_ev_response *)data);
  else if (type == 0x51 || type == 0x0f || type == 0x55)
    free(data);
  else if (type == 0x52 || type == 0x56)
    free_move_ev_data((struct move_ev_data *)data);
  else if (data)
    abort();
}


x86 assembly (clang, -O0):
<free_event_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x50,-0x4(%rbp)
je     1173 <free_event_data+0x23>
cmpl   $0x54,-0x4(%rbp)
jne    118a <free_event_data+0x3a>
mov    -0x10(%rbp),%rdi
call   1060 <plist_free_item_fields@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1216 <free_event_data+0xc6>
cmpl   $0x11,-0x4(%rbp)
jne    11a2 <free_event_data+0x52>
mov    -0x10(%rbp),%rdi
call   1050 <free_tag_ev_data@plt>
jmp    1211 <free_event_data+0xc1>
cmpl   $0x51,-0x4(%rbp)
je     11c0 <free_event_data+0x70>
cmpl   $0xf,-0x4(%rbp)
je     11c0 <free_event_data+0x70>
cmpl   $0x55,-0x4(%rbp)
jne    11ce <free_event_data+0x7e>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    120c <free_event_data+0xbc>
cmpl   $0x52,-0x4(%rbp)
je     11e2 <free_event_data+0x92>
cmpl   $0x56,-0x4(%rbp)
jne    11f0 <free_event_data+0xa0>
mov    -0x10(%rbp),%rdi
call   1070 <free_move_ev_data@plt>
jmp    1207 <free_event_data+0xb7>
cmpq   $0x0,-0x10(%rbp)
je     1202 <free_event_data+0xb2>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    1207 <free_event_data+0xb7>
jmp    120c <free_event_data+0xbc>
jmp    1211 <free_event_data+0xc1>
jmp    1216 <free_event_data+0xc6>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_event_data>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%eax
and    $0xfffffffb,%eax
cmp    $0x50,%eax
jne    116f <free_event_data+0x1f>
mov    %rbx,%rdi
call   1060 <plist_free_item_fields@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
cmp    $0x50,%edi
jg     1187 <free_event_data+0x37>
cmp    $0xf,%edi
je     1166 <free_event_data+0x16>
cmp    $0x11,%edi
jne    1191 <free_event_data+0x41>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <free_tag_ev_data@plt>
cmp    $0x51,%edi
je     1166 <free_event_data+0x16>
cmp    $0x55,%edi
je     1166 <free_event_data+0x16>
cmp    $0x52,%eax
jne    119f <free_event_data+0x4f>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <free_move_ev_data@plt>
test   %rbx,%rbx
jne    11a6 <free_event_data+0x56>
pop    %rbx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
%struct.plist_item = type { i32 }
%struct.tag_ev_response = type { i32 }
%struct.move_ev_data = type { i32 }
define void @free_event_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 80
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 84
br i1 %9, label %10, label %16
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to %struct.plist_item*
%13 = call i32 @plist_free_item_fields(%struct.plist_item* %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
br label %54
16: ; preds = %7
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 17
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i8*, i8** %4
%21 = bitcast i8* %20 to %struct.tag_ev_response*
%22 = call i32 @free_tag_ev_data(%struct.tag_ev_response* %21)
br label %53
23: ; preds = %16
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 81
br i1 %25, label %32, label %26
26: ; preds = %23
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 15
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 85
br i1 %31, label %32, label %35
32: ; preds = %29, %26, %23
%33 = load i8*, i8** %4
%34 = call i32 @free(i8* %33)
br label %52
35: ; preds = %29
%36 = load i32, i32* %3
%37 = icmp eq i32 %36, 82
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 86
br i1 %40, label %41, label %45
41: ; preds = %38, %35
%42 = load i8*, i8** %4
%43 = bitcast i8* %42 to %struct.move_ev_data*
%44 = call i32 @free_move_ev_data(%struct.move_ev_data* %43)
br label %51
45: ; preds = %38
%46 = load i8*, i8** %4
%47 = icmp ne i8* %46, null
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (...) @abort()
unreachable
50: ; preds = %45
br label %51
51: ; preds = %50, %41
br label %52
52: ; preds = %51, %32
br label %53
53: ; preds = %52, %19
br label %54
54: ; preds = %53, %10
ret void
}

LLVM IR (-O2):
%struct.plist_item = type { i32 }
%struct.tag_ev_response = type { i32 }
%struct.move_ev_data = type { i32 }
define void @free_event_data(i32 %0, i8* %1) {
%3 = and i32 %0, -5
%4 = icmp eq i32 %3, 80
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = bitcast i8* %1 to %struct.plist_item*
%7 = tail call i32 @plist_free_item_fields(%struct.plist_item* %6)
%8 = tail call i32 @free(i8* %1)
br label %24
9: ; preds = %2
switch i32 %0, label %15 [
i32 17, label %10
i32 85, label %13
i32 81, label %13
i32 15, label %13
]
10: ; preds = %9
%11 = bitcast i8* %1 to %struct.tag_ev_response*
%12 = tail call i32 @free_tag_ev_data(%struct.tag_ev_response* %11)
br label %24
13: ; preds = %9, %9, %9
%14 = tail call i32 @free(i8* %1)
br label %24
15: ; preds = %9
%16 = icmp eq i32 %3, 82
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = bitcast i8* %1 to %struct.move_ev_data*
%19 = tail call i32 @free_move_ev_data(%struct.move_ev_data* %18)
br label %24
20: ; preds = %15
%21 = icmp eq i8* %1, null
br i1 %21, label %24, label %22
22: ; preds = %20
%23 = tail call i32 (...) @abort()
unreachable
24: ; preds = %10, %17, %20, %13, %5
ret void
}