#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 == 0x04 || 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    1220 <free_event_data+0xd0>
cmpl   $0x11,-0x4(%rbp)
jne    11a2 <free_event_data+0x52>
mov    -0x10(%rbp),%rdi
call   1050 <free_tag_ev_data@plt>
jmp    121b <free_event_data+0xcb>
cmpl   $0x51,-0x4(%rbp)
je     11ca <free_event_data+0x7a>
cmpl   $0xf,-0x4(%rbp)
je     11ca <free_event_data+0x7a>
cmpl   $0x4,-0x4(%rbp)
je     11ca <free_event_data+0x7a>
cmpl   $0x55,-0x4(%rbp)
jne    11d8 <free_event_data+0x88>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1216 <free_event_data+0xc6>
cmpl   $0x52,-0x4(%rbp)
je     11ec <free_event_data+0x9c>
cmpl   $0x56,-0x4(%rbp)
jne    11fa <free_event_data+0xaa>
mov    -0x10(%rbp),%rdi
call   1070 <free_move_ev_data@plt>
jmp    1211 <free_event_data+0xc1>
cmpq   $0x0,-0x10(%rbp)
je     120c <free_event_data+0xbc>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    1211 <free_event_data+0xc1>
jmp    1216 <free_event_data+0xc6>
jmp    121b <free_event_data+0xcb>
jmp    1220 <free_event_data+0xd0>
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    $0x10,%edi
jle    118c <free_event_data+0x3c>
cmp    $0x55,%edi
je     1166 <free_event_data+0x16>
cmp    $0x51,%edi
je     1166 <free_event_data+0x16>
cmp    $0x11,%edi
jne    1196 <free_event_data+0x46>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <free_tag_ev_data@plt>
cmp    $0x4,%edi
je     1166 <free_event_data+0x16>
cmp    $0xf,%edi
je     1166 <free_event_data+0x16>
cmp    $0x52,%eax
jne    11a4 <free_event_data+0x54>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <free_move_ev_data@plt>
test   %rbx,%rbx
jne    11ab <free_event_data+0x5b>
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 %57
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 %56
23: ; preds = %16
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 81
br i1 %25, label %35, label %26
26: ; preds = %23
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 15
br i1 %28, label %35, label %29
29: ; preds = %26
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 4
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 85
br i1 %34, label %35, label %38
35: ; preds = %32, %29, %26, %23
%36 = load i8*, i8** %4
%37 = call i32 @free(i8* %36)
br label %55
38: ; preds = %32
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 82
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 86
br i1 %43, label %44, label %48
44: ; preds = %41, %38
%45 = load i8*, i8** %4
%46 = bitcast i8* %45 to %struct.move_ev_data*
%47 = call i32 @free_move_ev_data(%struct.move_ev_data* %46)
br label %54
48: ; preds = %41
%49 = load i8*, i8** %4
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (...) @abort()
unreachable
53: ; preds = %48
br label %54
54: ; preds = %53, %44
br label %55
55: ; preds = %54, %35
br label %56
56: ; preds = %55, %19
br label %57
57: ; preds = %56, %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
i32 4, 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, %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
}