#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 event_base {
  int dummy;
};
typedef enum event_method_feature {
  ____Placeholder_event_method_feature
} event_method_feature;

/* Variables and functions */
int EV_FEATURE_ET;
int EV_FEATURE_FDS;
int EV_FEATURE_O1;
int /*<<< orphan*/ assert(struct event_base *);
int /*<<< orphan*/ event_base_free(struct event_base *);
int event_base_get_features(struct event_base *);
char *event_base_get_method(struct event_base *);
struct event_base *event_base_new();
int /*<<< orphan*/ printf(char *, ...);
void feature() {
  struct event_base *eb;
  enum event_method_feature f;
  eb = event_base_new();
  assert(eb);
  printf("event_base_get_method: %s\n", event_base_get_method(eb));
  f = event_base_get_features(eb);
  printf("event_method_feature:\n");
  printf("EV_FEATURE_ET %d: ", EV_FEATURE_ET);
  if (f & EV_FEATURE_ET)
    printf("yes\n");
  else
    printf("no\n");
  printf("EV_FEATURE_O1 %d: ", EV_FEATURE_O1);
  if (f & EV_FEATURE_O1)
    printf("yes\n");
  else
    printf("no\n");
  printf("EV_FEATURE_FDS %d: ", EV_FEATURE_FDS);
  if (f & EV_FEATURE_FDS)
    printf("yes\n");
  else
    printf("no\n");
  event_base_free(eb);
}


x86 assembly (clang, -O0):
<feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <event_base_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1080 <event_base_get_method@plt>
mov    %rax,%rsi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <event_base_get_features@plt>
mov    %eax,-0xc(%rbp)
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
mov    0x2e07(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11ef <feature+0x8f>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11fd <feature+0x9d>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2dc4(%rip),%rax
mov    (%rax),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
mov    0x2daa(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     123c <feature+0xdc>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    124a <feature+0xea>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%esi
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
mov    0x2d7d(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1289 <feature+0x129>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1297 <feature+0x137>
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <event_base_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feature>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1030 <event_base_new@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1080 <assert@plt>
mov    %r14,%rdi
call   1090 <event_base_get_method@plt>
lea    0xe67(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1040 <event_base_get_features@plt>
mov    %eax,%ebp
lea    0xea1(%rip),%rdi
call   1050 <puts@plt>
mov    0x2e18(%rip),%rbx
mov    (%rbx),%esi
lea    0xe52(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rbx),%eax
and    %ebp,%eax
lea    0xe90(%rip),%r15
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
cmove  %r15,%rdi
call   1050 <puts@plt>
mov    0x2dd3(%rip),%r12
mov    (%r12),%esi
lea    0xe2e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r12),%eax
and    %ebp,%eax
mov    %rbx,%rdi
cmove  %r15,%rdi
call   1050 <puts@plt>
mov    0x2dc8(%rip),%r12
mov    (%r12),%esi
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
and    (%r12),%ebp
cmove  %r15,%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <event_base_free@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
@.str = [27 x i8] c"event_base_get_method: %s\0A\00"
@.str.1 = [23 x i8] c"event_method_feature:\0A\00"
@.str.2 = [19 x i8] c"EV_FEATURE_ET %d: \00"
@EV_FEATURE_ET = global i32 0
@.str.3 = [5 x i8] c"yes\0A\00"
@.str.4 = [4 x i8] c"no\0A\00"
@.str.5 = [19 x i8] c"EV_FEATURE_O1 %d: \00"
@EV_FEATURE_O1 = global i32 0
@.str.6 = [20 x i8] c"EV_FEATURE_FDS %d: \00"
@EV_FEATURE_FDS = global i32 0
define void @feature() {
%1 = alloca %struct.event_base*
%2 = alloca i32
%3 = call %struct.event_base* (...) @event_base_new()
store %struct.event_base* %3, %struct.event_base** %1
%4 = load %struct.event_base*, %struct.event_base** %1
%5 = call i32 @assert(%struct.event_base* %4)
%6 = load %struct.event_base*, %struct.event_base** %1
%7 = call i8* @event_base_get_method(%struct.event_base* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load %struct.event_base*, %struct.event_base** %1
%10 = call i32 @event_base_get_features(%struct.event_base* %9)
store i32 %10, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EV_FEATURE_ET
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* @EV_FEATURE_ET
%16 = and i32 %14, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %22
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
%23 = load i32, i32* @EV_FEATURE_O1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %2
%26 = load i32, i32* @EV_FEATURE_O1
%27 = and i32 %25, %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %22
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %33
31: ; preds = %22
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
%34 = load i32, i32* @EV_FEATURE_FDS
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %2
%37 = load i32, i32* @EV_FEATURE_FDS
%38 = and i32 %36, %37
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %44
42: ; preds = %33
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
%45 = load %struct.event_base*, %struct.event_base** %1
%46 = call i32 @event_base_free(%struct.event_base* %45)
ret void
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
@.str = [27 x i8] c"event_base_get_method: %s\0A\00"
@.str.2 = [19 x i8] c"EV_FEATURE_ET %d: \00"
@EV_FEATURE_ET = global i32 0
@.str.5 = [19 x i8] c"EV_FEATURE_O1 %d: \00"
@EV_FEATURE_O1 = global i32 0
@.str.6 = [20 x i8] c"EV_FEATURE_FDS %d: \00"
@EV_FEATURE_FDS = global i32 0
@str = [22 x i8] c"event_method_feature:\00"
@str.9 = [3 x i8] c"no\00"
@str.12 = [4 x i8] c"yes\00"
define void @feature() {
%1 = tail call %struct.event_base* (...) @event_base_new()
%2 = tail call i32 @assert(%struct.event_base* %1)
%3 = tail call i8* @event_base_get_method(%struct.event_base* %1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @event_base_get_features(%struct.event_base* %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @EV_FEATURE_ET
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EV_FEATURE_ET
%10 = and i32 %9, %5
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.12, i64 0, i64 0)
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = load i32, i32* @EV_FEATURE_O1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @EV_FEATURE_O1
%17 = and i32 %16, %5
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.12, i64 0, i64 0)
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
%21 = load i32, i32* @EV_FEATURE_FDS
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = load i32, i32* @EV_FEATURE_FDS
%24 = and i32 %23, %5
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.12, i64 0, i64 0)
%27 = tail call i32 @puts(i8* dereferenceable(1) %26)
%28 = tail call i32 @event_base_free(%struct.event_base* %1)
ret void
}