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

/* Variables and functions */
int const FAN_ACCESS;
int const FAN_CLOSE_NOWRITE;
int const FAN_CLOSE_WRITE;
int const FAN_MODIFY;
int const FAN_OPEN;
const char *fnotify_mask_to_str(const int mask) {
  static char modes[5];
  modes[0] = (mask & FAN_OPEN) ? 'O' : '-';
  modes[1] = (mask & (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE)) ? 'C' : '-';
  modes[2] = (mask & FAN_ACCESS) ? 'R' : '-';
  modes[3] = (mask & (FAN_MODIFY | FAN_CLOSE_WRITE)) ? 'W' : '-';
  modes[4] = '\0';
  return modes;
}


x86 assembly (clang, -O0):
<fnotify_mask_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    0x2eaf(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x4f,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,0x2ef8(%rip)
mov    -0x4(%rbp),%edx
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    0x2e94(%rip),%rcx
or     (%rcx),%eax
and    %eax,%edx
mov    $0x2d,%eax
mov    $0x43,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,0x2ecc(%rip)
mov    -0x4(%rbp),%edx
mov    0x2e78(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x52,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,0x2eab(%rip)
mov    -0x4(%rbp),%edx
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
mov    0x2e55(%rip),%rcx
or     (%rcx),%eax
and    %eax,%edx
mov    $0x2d,%eax
mov    $0x57,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,0x2e7f(%rip)
movb   $0x0,0x2e79(%rip)
lea    0x2e6e(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnotify_mask_to_str>:
movl   $0x2d2d2d2d,0x2f1a(%rip)
2d 2d 2d
lea    0x2f13(%rip),%rax
movb   $0x0,0x2f10(%rip)
ret

LLVM IR (-O0):
@fnotify_mask_to_str.modes = internal global [5 x i8] zeroinitializer
@FAN_OPEN = constant i32 0
@FAN_CLOSE_WRITE = constant i32 0
@FAN_CLOSE_NOWRITE = constant i32 0
@FAN_ACCESS = constant i32 0
@FAN_MODIFY = constant i32 0
define i8* @fnotify_mask_to_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @FAN_OPEN
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 79, i32 45
%9 = trunc i32 %8 to i8
store i8 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 0)
%10 = load i32, i32* %2
%11 = load i32, i32* @FAN_CLOSE_WRITE
%12 = load i32, i32* @FAN_CLOSE_NOWRITE
%13 = or i32 %11, %12
%14 = and i32 %10, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 67, i32 45
%18 = trunc i32 %17 to i8
store i8 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 1)
%19 = load i32, i32* %2
%20 = load i32, i32* @FAN_ACCESS
%21 = and i32 %19, %20
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 82, i32 45
%25 = trunc i32 %24 to i8
store i8 %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 2)
%26 = load i32, i32* %2
%27 = load i32, i32* @FAN_MODIFY
%28 = load i32, i32* @FAN_CLOSE_WRITE
%29 = or i32 %27, %28
%30 = and i32 %26, %29
%31 = icmp ne i32 %30, 0
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 87, i32 45
%34 = trunc i32 %33 to i8
store i8 %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 0)
}

LLVM IR (-O2):
@fnotify_mask_to_str.modes = internal global [5 x i8] zeroinitializer
@FAN_OPEN = constant i32 0
@FAN_CLOSE_WRITE = constant i32 0
@FAN_CLOSE_NOWRITE = constant i32 0
@FAN_ACCESS = constant i32 0
@FAN_MODIFY = constant i32 0
define i8* @fnotify_mask_to_str(i32 %0) {
store i32 757935405, i32* bitcast ([5 x i8]* @fnotify_mask_to_str.modes to i32*)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fnotify_mask_to_str.modes, i64 0, i64 0)
}