#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 stat {
  int dummy;
};
struct felement {
  int dummy;
};

/* Variables and functions */
int adaptive_action(int, char const *, struct felement *, struct stat *,
                    unsigned int);
int adaptive_check(int event_mask, const char *path, struct felement *lsptr,
                   struct stat *statdat, unsigned int wd) {
  if (event_mask & (0x00000100 | 0x00000200 | 0x00000400 | 0x00000800 |
                    0x00000040 | 0x00000080)) {
    if (adaptive_action(event_mask, path, lsptr, statdat, wd) == 1)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<adaptive_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfc0,%eax
cmp    $0x0,%eax
je     116e <adaptive_check+0x5e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <adaptive_action@plt>
cmp    $0x1,%eax
jne    1169 <adaptive_check+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1175 <adaptive_check+0x65>
jmp    116e <adaptive_check+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adaptive_check>:
test   $0xfc0,%edi
je     112f <adaptive_check+0x1f>
push   %rax
call   1030 <adaptive_action@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
lea    0x8(%rsp),%rsp
je     1131 <adaptive_check+0x21>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.felement = type { i32 }
%struct.stat = type { i32 }
define i32 @adaptive_check(i32 %0, i8* %1, %struct.felement* %2, %struct.stat* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.felement*
%10 = alloca %struct.stat*
%11 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store %struct.felement* %2, %struct.felement** %9
store %struct.stat* %3, %struct.stat** %10
store i32 %4, i32* %11
%12 = load i32, i32* %7
%13 = and i32 %12, 4032
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %5
%16 = load i32, i32* %7
%17 = load i8*, i8** %8
%18 = load %struct.felement*, %struct.felement** %9
%19 = load %struct.stat*, %struct.stat** %10
%20 = load i32, i32* %11
%21 = call i32 @adaptive_action(i32 %16, i8* %17, %struct.felement* %18, %struct.stat* %19, i32 %20)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %24
23: ; preds = %15
store i32 1, i32* %6
br label %26
24: ; preds = %15
br label %25
25: ; preds = %24, %5
store i32 0, i32* %6
br label %26
26: ; preds = %25, %23
%27 = load i32, i32* %6
ret i32 %27
}

LLVM IR (-O2):
%struct.felement = type { i32 }
%struct.stat = type { i32 }
define i32 @adaptive_check(i32 %0, i8* %1, %struct.felement* %2, %struct.stat* %3, i32 %4) {
%6 = and i32 %0, 4032
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i32 @adaptive_action(i32 %0, i8* %1, %struct.felement* %2, %struct.stat* %3, i32 %4)
%10 = icmp eq i32 %9, 1
br i1 %10, label %12, label %11
11: ; preds = %8, %5
br label %12
12: ; preds = %8, %11
%13 = phi i32 [ 0, %11 ], [ 1, %8 ]
ret i32 %13
}