#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 IN_ACCESS;
int IN_CREATE;
int IN_DELETE;
int IN_MODIFY;
int IN_MOVE;
int /*<<< orphan*/ notify_dir(char *, int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    puts("Usage: notify_dir directory");
    return 2;
  }
  notify_dir(argv[1], IN_ACCESS | IN_CREATE | IN_MOVE | IN_DELETE | IN_MODIFY);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x2,-0x4(%rbp)
jmp    1199 <main+0x79>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
mov    0x2e50(%rip),%rax
or     (%rax),%esi
mov    0x2e67(%rip),%rax
or     (%rax),%esi
mov    0x2e56(%rip),%rax
or     (%rax),%esi
mov    0x2e65(%rip),%rax
or     (%rax),%esi
call   1040 <notify_dir@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1162 <main+0x42>
mov    0x2e9b(%rip),%rcx
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2ea1(%rip),%rcx
or     (%rcx),%eax
mov    0x2e90(%rip),%rcx
or     (%rcx),%eax
mov    0x8(%rsi),%rdi
mov    0x2e9b(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
call   1040 <notify_dir@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: notify_dir directory\00"
@IN_ACCESS = global i32 0
@IN_CREATE = global i32 0
@IN_MOVE = global i32 0
@IN_DELETE = global i32 0
@IN_MODIFY = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %3
br label %24
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i32, i32* @IN_ACCESS
%15 = load i32, i32* @IN_CREATE
%16 = or i32 %14, %15
%17 = load i32, i32* @IN_MOVE
%18 = or i32 %16, %17
%19 = load i32, i32* @IN_DELETE
%20 = or i32 %18, %19
%21 = load i32, i32* @IN_MODIFY
%22 = or i32 %20, %21
%23 = call i32 @notify_dir(i8* %13, i32 %22)
store i32 0, i32* %3
br label %24
24: ; preds = %10, %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: notify_dir directory\00"
@IN_ACCESS = global i32 0
@IN_CREATE = global i32 0
@IN_MOVE = global i32 0
@IN_DELETE = global i32 0
@IN_MODIFY = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %19
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i32, i32* @IN_ACCESS
%10 = load i32, i32* @IN_CREATE
%11 = or i32 %10, %9
%12 = load i32, i32* @IN_MOVE
%13 = or i32 %11, %12
%14 = load i32, i32* @IN_DELETE
%15 = or i32 %13, %14
%16 = load i32, i32* @IN_MODIFY
%17 = or i32 %15, %16
%18 = tail call i32 @notify_dir(i8* %8, i32 %17)
br label %19
19: ; preds = %6, %4
%20 = phi i32 [ 2, %4 ], [ 0, %6 ]
ret i32 %20
}