#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 bufferevent {
  int dummy;
};

/* Variables and functions */
short BEV_EVENT_EOF;
short BEV_EVENT_ERROR;
short BEV_EVENT_TIMEOUT;
int /*<<< orphan*/ bufferevent_free(struct bufferevent *);
void on_error(struct bufferevent *bev, short error, void *ctx) {
  if (error & BEV_EVENT_EOF) {
  } else if (error & BEV_EVENT_ERROR) {
  } else if (error & BEV_EVENT_TIMEOUT) {
  }
  bufferevent_free(bev);
}


x86 assembly (clang, -O0):
<on_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movswl -0xa(%rbp),%eax
mov    0x2eae(%rip),%rcx
movswl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1145 <on_error+0x35>
jmp    118b <on_error+0x7b>
movswl -0xa(%rbp),%eax
mov    0x2ea0(%rip),%rcx
movswl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1163 <on_error+0x53>
jmp    1186 <on_error+0x76>
movswl -0xa(%rbp),%eax
mov    0x2e62(%rip),%rcx
movswl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1181 <on_error+0x71>
jmp    1181 <on_error+0x71>
jmp    1186 <on_error+0x76>
jmp    118b <on_error+0x7b>
mov    -0x8(%rbp),%rdi
call   1030 <bufferevent_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_error>:
jmp    1030 <bufferevent_free@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
@BEV_EVENT_EOF = global i16 0
@BEV_EVENT_ERROR = global i16 0
@BEV_EVENT_TIMEOUT = global i16 0
define void @on_error(%struct.bufferevent* %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.bufferevent*
%5 = alloca i16
%6 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load i16, i16* %5
%8 = sext i16 %7 to i32
%9 = load i16, i16* @BEV_EVENT_EOF
%10 = sext i16 %9 to i32
%11 = and i32 %8, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
br label %32
14: ; preds = %3
%15 = load i16, i16* %5
%16 = sext i16 %15 to i32
%17 = load i16, i16* @BEV_EVENT_ERROR
%18 = sext i16 %17 to i32
%19 = and i32 %16, %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %14
br label %31
22: ; preds = %14
%23 = load i16, i16* %5
%24 = sext i16 %23 to i32
%25 = load i16, i16* @BEV_EVENT_TIMEOUT
%26 = sext i16 %25 to i32
%27 = and i32 %24, %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %22
br label %30
30: ; preds = %29, %22
br label %31
31: ; preds = %30, %21
br label %32
32: ; preds = %31, %13
%33 = load %struct.bufferevent*, %struct.bufferevent** %4
%34 = call i32 @bufferevent_free(%struct.bufferevent* %33)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
@BEV_EVENT_EOF = global i16 0
@BEV_EVENT_ERROR = global i16 0
@BEV_EVENT_TIMEOUT = global i16 0
define void @on_error(%struct.bufferevent* %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @bufferevent_free(%struct.bufferevent* %0)
ret void
}