#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 */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int STDIN_FILENO;
int /*<<< orphan*/ copyRootDirPaths(char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int optind;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ processInotifyEvents(int *);
int reinitialize(int);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fd_set rfds;
  int inotifyFd;
  if (optind >= argc)
    printf("Error Inicial\n");
  copyRootDirPaths(&argv[optind]);
  inotifyFd = reinitialize(-1);
  fflush(stdout);
  for (;;) {
    FD_ZERO(&rfds);
    FD_SET(STDIN_FILENO, &rfds);
    FD_SET(inotifyFd, &rfds);
    if (FD_ISSET(inotifyFd, &rfds))
      processInotifyEvents(&inotifyFd);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jl     11b4 <main+0x34>
lea    0xe51(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e29(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1090 <copyRootDirPaths@plt>
mov    $0xffffffff,%edi
call   1060 <reinitialize@plt>
mov    %eax,-0x18(%rbp)
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
lea    -0x14(%rbp),%rdi
call   1070 <FD_ZERO@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
lea    -0x14(%rbp),%rsi
call   10a0 <FD_SET@plt>
mov    -0x18(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   10a0 <FD_SET@plt>
mov    -0x18(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     122f <main+0xaf>
lea    -0x18(%rbp),%rdi
call   1030 <processInotifyEvents@plt>
jmp    11e9 <main+0x69>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x2e55(%rip),%r14
mov    (%r14),%eax
cmp    %edi,%eax
jl     11a9 <main+0x29>
lea    0xe5f(%rip),%rdi
call   1040 <puts@plt>
mov    (%r14),%eax
cltq
lea    (%rbx,%rax,8),%rdi
call   1090 <copyRootDirPaths@plt>
mov    $0xffffffff,%edi
call   1060 <reinitialize@plt>
mov    %eax,0x8(%rsp)
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
lea    0xc(%rsp),%rbx
mov    0x2df4(%rip),%r15
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <FD_ZERO@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
call   10a0 <FD_SET@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
call   10a0 <FD_SET@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     11f0 <main+0x70>
mov    %r14,%rdi
call   1030 <processInotifyEvents@plt>
jmp    11f0 <main+0x70>

LLVM IR (-O0):
@optind = global i32 0
@.str = [15 x i8] c"Error Inicial\0A\00"
@stdout = global i32 0
@STDIN_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @optind
%9 = load i32, i32* %4
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8**, i8*** %5
%15 = load i32, i32* @optind
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = call i32 @copyRootDirPaths(i8** %17)
%19 = call i32 @reinitialize(i32 -1)
store i32 %19, i32* %7
%20 = load i32, i32* @stdout
%21 = call i32 @fflush(i32 %20)
br label %22
22: ; preds = %33, %13
%23 = call i32 @FD_ZERO(i32* %6)
%24 = load i32, i32* @STDIN_FILENO
%25 = call i32 @FD_SET(i32 %24, i32* %6)
%26 = load i32, i32* %7
%27 = call i32 @FD_SET(i32 %26, i32* %6)
%28 = load i32, i32* %7
%29 = call i64 @FD_ISSET(i32 %28, i32* %6)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %22
%32 = call i32 @processInotifyEvents(i32* %7)
br label %33
33: ; preds = %31, %22
br label %22
}

LLVM IR (-O2):
@optind = global i32 0
@stdout = global i32 0
@STDIN_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"Error Inicial\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = load i32, i32* @optind
%8 = icmp slt i32 %7, %0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%11 = load i32, i32* @optind
br label %12
12: ; preds = %9, %2
%13 = phi i32 [ %11, %9 ], [ %7, %2 ]
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = tail call i32 @copyRootDirPaths(i8** %15)
%17 = tail call i32 @reinitialize(i32 -1)
store i32 %17, i32* %4
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
br label %20
20: ; preds = %31, %12
%21 = call i32 @FD_ZERO(i32* %3)
%22 = load i32, i32* @STDIN_FILENO
%23 = call i32 @FD_SET(i32 %22, i32* %3)
%24 = load i32, i32* %4
%25 = call i32 @FD_SET(i32 %24, i32* %3)
%26 = load i32, i32* %4
%27 = call i64 @FD_ISSET(i32 %26, i32* %3)
%28 = icmp eq i64 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %20
%30 = call i32 @processInotifyEvents(i32* %4)
br label %31
31: ; preds = %29, %20
br label %20
}