#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 inotify_event {
  int mask;
  scalar_t__ len;
  int /*<<< orphan*/ wd;
  int /*<<< orphan*/ name;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int IN_ACCESS;
int IN_ATTRIB;
int IN_CLOSE;
int IN_CLOSE_WRITE;
int IN_CREATE;
int IN_DELETE;
int IN_IGNORED;
int IN_ISDIR;
int IN_MODIFY;
int IN_OPEN;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ add_watches(int, char *, char *);
int /*<<< orphan*/ closelog();
int inotify_init();
int /*<<< orphan*/ inotify_rm_watch(int, int);
int /*<<< orphan*/ log_data_two(char *, char *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int /*<<< orphan*/ skeleton_daemon();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
int main(int argc, char *argv[]) {
  int length, i = 0;
  int fd;
  int wd;
  char *directory_watch = NULL;
  char *watch_log = NULL;
  if (argc <= 3) {
    printf("Not enough params: fileMonitor -d /root/html -l logFolder");
    return EXIT_FAILURE;
  }
  directory_watch = argv[2];
  watch_log = argv[4];
  printf("%s", watch_log);
  char buffer[(1024 * ((sizeof(struct inotify_event)) + 16))];
  skeleton_daemon();
  syslog(LOG_NOTICE, "------------  First testing daemon started.----------");
  fd = inotify_init();
  if (fd < 0) {
    perror("inotify_init");
  }
  add_watches(fd, directory_watch, watch_log);
  if (wd < 0) {
    syslog(LOG_NOTICE, "wd < 0");
    perror("inotify_add_watch");
  }
  while (1) {
    syslog(LOG_NOTICE, "BEFORE READ IN BUFFER");
    length = read(fd, buffer, (1024 * ((sizeof(struct inotify_event)) + 16)));
    syslog(LOG_NOTICE, "AFTER READ IN BUFFER.");
    if (length < 0) {
      perror("read");
    } else if (length == 0) {
      syslog(LOG_NOTICE, " length =0 ");
      continue;
    }
    while (i < length) {
      struct inotify_event *event = (struct inotify_event *)&buffer[i];
      if (event->len) {
        if (event->mask & IN_IGNORED) {
        }
        if (event->mask & IN_ATTRIB) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, " directory:chaning     ATTRIB .");
            syslog(LOG_NOTICE, " directory:%s ATTRIB .", event->name);
            log_data_two(watch_log, "ATTRIB: directory: ", event->name,
                         event->wd);
          } else {
            syslog(LOG_NOTICE, " directory:chaning     ATTRIB .");
            syslog(LOG_NOTICE, " file:%s ATTRIB .", event->name);
            log_data_two(watch_log, "ATTRIB: file: ", event->name, event->wd);
          }
        }
        if (event->mask & IN_MODIFY) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, " dirtory:chaning    !!!!!!! .");
            syslog(LOG_NOTICE, " directory:%s modify.", event->name);
            log_data_two(watch_log, "MODIFIED file: ", event->name, event->wd);
          } else {
            syslog(LOG_NOTICE, " file  modify:chaning!!! .");
            syslog(LOG_NOTICE, " file:%s modify.", event->name);
            log_data_two(watch_log, "MODIFIED file: ", event->name, event->wd);
          }
        }
        if (event->mask & IN_CLOSE_WRITE) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, " CLSOE WRITE    !!!!!!! .");
            log_data_two(watch_log, "CLOSE directory: ", event->name,
                         event->wd);
          } else {
            syslog(LOG_NOTICE, " CLSOE WRITE    !!!!!!! .");
            log_data_two(watch_log, "CLOSE file: ", event->name, event->wd);
          }
        }
        if (event->mask & IN_OPEN) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, " directory:%s open.", event->name);
            log_data_two(watch_log, "OPEN directory: ", event->name, event->wd);
          } else {
            syslog(LOG_NOTICE, " file:opening.");
            syslog(LOG_NOTICE, " file:%s open.", event->name);
            log_data_two(watch_log, "OPEN file: ", event->name, event->wd);
          }
        }
        if (event->mask & IN_CREATE) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, "new directory:%s created.", event->name);
            log_data_two(watch_log, "NEW directory: ", event->name, event->wd);
          } else {
            syslog(LOG_NOTICE, "new file:%s created.", event->name);
            log_data_two(watch_log, "NEW file: ", event->name, event->wd);
          }
        } else if (event->mask & IN_DELETE) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, "dir:%s is deleted.", event->name);
            log_data_two(watch_log, "DELETED directory: ", event->name,
                         event->wd);
          } else {
            syslog(LOG_NOTICE, "file:%s is deleted.", event->name);
            log_data_two(watch_log, "DELETED file: ", event->name, event->wd);
          }
        } else if (event->mask & IN_ACCESS) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, "dir:%s is accessed.", event->name);
            log_data_two(watch_log, "ACCESSED directory: ", event->name,
                         event->wd);
          } else {
            syslog(LOG_NOTICE, "file:%s is accessed.", event->name);
            log_data_two(watch_log, "ACCESSED file: ", event->name, event->wd);
          }
        }
        if (event->mask & IN_CLOSE) {
          if (event->mask & IN_ISDIR) {
            syslog(LOG_NOTICE, " directory:%s closed.", event->name);
            log_data_two(watch_log, "CLOSED directory: ", event->name,
                         event->wd);
          } else {
            syslog(LOG_NOTICE, " file:%s closed.", event->name);
            log_data_two(watch_log, "CLOSED file: ", event->name, event->wd);
          }
        }
      }
      i += (sizeof(struct inotify_event)) + event->len;
    }
    i = 0;
    syslog(LOG_NOTICE, "~~~~~~one testing daemon ended.~~~~~~~~~~");
    sleep(20);
  }
  inotify_rm_watch(fd, wd);
  syslog(LOG_NOTICE,
         "--------------- first testing daemon terminated.----------------");
  closelog();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     11ea <main+0x5a>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%eax
add    $0xa040,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <skeleton_daemon@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
lea    0xe12(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    $0x0,%al
call   1060 <inotify_init@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1252 <main+0xc2>
lea    0xe26(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1070 <add_watches@plt>
cmpl   $0x0,-0x20(%rbp)
jge    128f <main+0xff>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
lea    0xdfd(%rip),%rdi
call   10a0 <perror@plt>
jmp    1294 <main+0x104>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
lea    0xdf5(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x1c(%rbp),%edi
lea    -0xa030(%rbp),%rsi
mov    $0xa000,%edx
call   1050 <read@plt>
mov    %eax,-0x14(%rbp)
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
lea    0xddd(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
cmpl   $0x0,-0x14(%rbp)
jge    12f4 <main+0x164>
lea    0xddb(%rip),%rdi
call   10a0 <perror@plt>
jmp    131f <main+0x18f>
cmpl   $0x0,-0x14(%rbp)
jne    131a <main+0x18a>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
jmp    1294 <main+0x104>
jmp    131f <main+0x18f>
jmp    1324 <main+0x194>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1a53 <main+0x8c3>
movslq -0x18(%rbp),%rcx
lea    -0xa030(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xa038(%rbp)
mov    -0xa038(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1a35 <main+0x8a5>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2c91(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1377 <main+0x1e7>
jmp    1377 <main+0x1e7>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2c51(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     146f <main+0x2df>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2c1e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     140e <main+0x27e>
mov    0x2bdc(%rip),%rax
mov    (%rax),%edi
lea    0xd19(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    0x2bc5(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xd18(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xd09(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    146a <main+0x2da>
mov    0x2b7b(%rip),%rax
mov    (%rax),%edi
lea    0xcb8(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    0x2b64(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xce2(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xcce(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    146f <main+0x2df>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2b69(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1567 <main+0x3d7>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2b26(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1506 <main+0x376>
mov    0x2ae4(%rip),%rax
mov    (%rax),%edi
lea    0xc8d(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    0x2acd(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xc8a(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xc7a(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1562 <main+0x3d2>
mov    0x2a83(%rip),%rax
mov    (%rax),%edi
lea    0xc70(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    0x2a6c(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xc6a(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xc19(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1567 <main+0x3d7>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2a59(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     161d <main+0x48d>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2a2e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     15dd <main+0x44d>
mov    0x29ec(%rip),%rax
mov    (%rax),%edi
lea    0xc05(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xbf9(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1618 <main+0x488>
mov    0x29ac(%rip),%rax
mov    (%rax),%edi
lea    0xbc5(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xbcb(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    161d <main+0x48d>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2953(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     16fe <main+0x56e>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2978(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     169d <main+0x50d>
mov    0x2936(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xb7e(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xb6c(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    16f9 <main+0x569>
mov    0x28ec(%rip),%rax
mov    (%rax),%edi
lea    0xb63(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    0x28d5(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xb51(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xb3a(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    16fe <main+0x56e>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x289a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     17c8 <main+0x638>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2897(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     177e <main+0x5ee>
mov    0x2855(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xaec(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xae0(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    17c3 <main+0x633>
mov    0x280b(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xacc(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xabb(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1966 <main+0x7d6>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x27f0(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1892 <main+0x702>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x27cd(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1848 <main+0x6b8>
mov    0x278b(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xa6c(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xa59(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    188d <main+0x6fd>
mov    0x2741(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xa49(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xa37(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1961 <main+0x7d1>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x270e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     195c <main+0x7cc>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x2703(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1912 <main+0x782>
mov    0x26c1(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0x9ec(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0x9da(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1957 <main+0x7c7>
mov    0x2677(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0x9cb(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0x9ba(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    195c <main+0x7cc>
jmp    1961 <main+0x7d1>
jmp    1966 <main+0x7d6>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x262a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1a30 <main+0x8a0>
mov    -0xa038(%rbp),%rax
mov    (%rax),%eax
mov    0x262f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     19e6 <main+0x856>
mov    0x25ed(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0x966(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0x956(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1a2b <main+0x89b>
mov    0x25a3(%rip),%rax
mov    (%rax),%edi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
lea    0x945(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    -0x30(%rbp),%rdi
mov    -0xa038(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0xa038(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0x930(%rip),%rsi
call   1090 <log_data_two@plt>
jmp    1a30 <main+0x8a0>
jmp    1a35 <main+0x8a5>
mov    -0xa038(%rbp),%rax
mov    0x8(%rax),%rcx
add    $0x18,%rcx
movslq -0x18(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x18(%rbp)
jmp    1324 <main+0x194>
movl   $0x0,-0x18(%rbp)
mov    0x252f(%rip),%rax
mov    (%rax),%edi
lea    0x8fa(%rip),%rsi
mov    $0x0,%al
call   1080 <syslog@plt>
mov    $0x14,%edi
call   10b0 <sleep@plt>
jmp    1294 <main+0x104>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa028,%rsp
cmp    $0x3,%edi
jg     11cf <main+0x3f>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
add    $0xa028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x10(%rsi),%rbp
mov    0x20(%rsi),%rsi
lea    0xe5c(%rip),%rdi
mov    %rsi,(%rsp)
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <skeleton_daemon@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
lea    0xe3d(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
xor    %eax,%eax
call   1060 <inotify_init@plt>
mov    %eax,%r14d
test   %eax,%eax
js     16ac <main+0x51c>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    (%rsp),%rdx
call   1070 <add_watches@plt>
mov    0x2d99(%rip),%r15
mov    %r14d,0x8(%rsp)
jmp    1276 <main+0xe6>
lea    0xe6f(%rip),%rdi
call   10a0 <perror@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0x10eb(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
mov    $0x14,%edi
call   10b0 <sleep@plt>
mov    0x8(%rsp),%r14d
mov    0x2d1b(%rip),%rbx
mov    (%rbx),%edi
lea    0xdfa(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
mov    %r14d,%edi
lea    0x20(%rsp),%rsi
mov    $0xa000,%edx
call   1050 <read@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
lea    0xdec(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
mov    %ebp,0xc(%rsp)
test   %ebp,%ebp
js     1236 <main+0xa6>
je     1690 <main+0x500>
xor    %r13d,%r13d
jmp    12e7 <main+0x157>
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%rax
add    %eax,%r13d
add    $0x18,%r13d
cmp    0xc(%rsp),%r13d
jge    1250 <main+0xc0>
movslq %r13d,%rax
mov    0x28(%rsp,%rax,1),%rdx
mov    %rdx,%rcx
mov    %rdx,0x18(%rsp)
test   %rdx,%rdx
je     12d0 <main+0x140>
mov    %r13,0x10(%rsp)
lea    (%rsp,%rax,1),%r13
add    $0x20,%r13
mov    0x0(%r13),%r12d
mov    0x2ccc(%rip),%rax
test   %r12d,(%rax)
je     1384 <main+0x1f4>
mov    (%r15),%ebp
and    %r12d,%ebp
mov    0x2c72(%rip),%rbx
mov    (%rbx),%edi
lea    0xd8e(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
test   %ebp,%ebp
mov    (%rbx),%edi
mov    0x14(%r13),%ebp
lea    0xd98(%rip),%rsi
lea    0xdbc(%rip),%rax
cmove  %rax,%rsi
lea    0xd9d(%rip),%r14
lea    0xdbc(%rip),%rax
cmove  %rax,%r14
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%r13),%ecx
mov    (%rsp),%rdi
mov    %r14,%rsi
mov    0x2c4b(%rip),%r15
mov    %ebp,%edx
call   1090 <log_data_two@plt>
mov    %r13,%r14
mov    0x2c62(%rip),%rax
test   %r12d,(%rax)
mov    0x10(%rsp),%r13
je     1411 <main+0x281>
mov    0x2bf9(%rip),%rax
mov    (%rax),%edi
test   %r12d,(%r15)
je     13cd <main+0x23d>
lea    0xd7c(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x2bdd(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rbx
mov    0x14(%r14),%ebp
lea    0xd7c(%rip),%rsi
jmp    13f2 <main+0x262>
lea    0xd99(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rbx
mov    0x14(%r14),%ebp
lea    0xd96(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%r14),%ecx
mov    (%rsp),%rdi
lea    0xd53(%rip),%rsi
mov    %ebp,%edx
call   1090 <log_data_two@plt>
mov    0x2bc0(%rip),%rax
test   %r12d,(%rax)
je     145f <main+0x2cf>
mov    (%r15),%ebp
and    %r12d,%ebp
mov    0x2b6e(%rip),%rax
mov    (%rax),%edi
lea    0xd66(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
test   %ebp,%ebp
mov    0x10(%r14),%ecx
mov    0x14(%r14),%edx
lea    0xd68(%rip),%rsi
lea    0xd73(%rip),%rax
cmove  %rax,%rsi
mov    (%rsp),%rdi
call   1090 <log_data_two@plt>
mov    0x2b22(%rip),%rax
test   %r12d,(%rax)
je     14e5 <main+0x355>
mov    0x2b26(%rip),%rax
mov    (%rax),%edi
test   %r12d,(%r15)
je     14a1 <main+0x311>
mov    %r14,%rbx
mov    0x14(%r14),%ebp
lea    0xd4b(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%r14),%ecx
mov    (%rsp),%rdi
lea    0xd47(%rip),%rsi
jmp    14de <main+0x34e>
lea    0xd4f(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x2ae2(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rbx
mov    0x14(%r14),%ebp
lea    0xd40(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%r14),%ecx
mov    (%rsp),%rdi
lea    0xd37(%rip),%rsi
mov    %ebp,%edx
call   1090 <log_data_two@plt>
mov    0x2ac4(%rip),%rax
test   %r12d,(%rax)
je     1530 <main+0x3a0>
mov    0x2aa0(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rbx
mov    0x14(%r14),%ebp
test   %r12d,(%r15)
je     1578 <main+0x3e8>
lea    0xd14(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%rbx),%ecx
mov    (%rsp),%rdi
lea    0xd17(%rip),%rsi
jmp    1620 <main+0x490>
nopl   0x0(%rax)
mov    0x2a99(%rip),%rax
test   %r12d,(%rax)
je     159b <main+0x40b>
mov    0x2a55(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rbx
mov    0x14(%r14),%ebp
test   %r12d,(%r15)
je     15e0 <main+0x450>
lea    0xd0f(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%rbx),%ecx
mov    (%rsp),%rdi
lea    0xd0b(%rip),%rsi
jmp    1620 <main+0x490>
lea    0xccc(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%rbx),%ecx
mov    (%rsp),%rdi
lea    0xcca(%rip),%rsi
jmp    1620 <main+0x490>
mov    0x2a16(%rip),%rax
test   %r12d,(%rax)
je     1627 <main+0x497>
mov    0x29e6(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rbx
mov    0x14(%r14),%ebp
test   %r12d,(%r15)
je     1600 <main+0x470>
lea    0xcee(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%rbx),%ecx
mov    (%rsp),%rdi
lea    0xceb(%rip),%rsi
jmp    1620 <main+0x490>
lea    0xcab(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%rbx),%ecx
mov    (%rsp),%rdi
lea    0xca8(%rip),%rsi
jmp    1620 <main+0x490>
lea    0xcd7(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%rbx),%ecx
mov    (%rsp),%rdi
lea    0xcd5(%rip),%rsi
xchg   %ax,%ax
mov    %ebp,%edx
call   1090 <log_data_two@plt>
mov    0x297a(%rip),%rax
test   %r12d,(%rax)
je     12d0 <main+0x140>
and    (%r15),%r12d
mov    0x2957(%rip),%rax
mov    (%rax),%edi
mov    0x14(%r14),%ebp
lea    0xcb5(%rip),%rsi
lea    0xcd7(%rip),%rax
cmove  %rax,%rsi
lea    0xcb9(%rip),%rbx
lea    0xcd6(%rip),%rax
cmove  %rax,%rbx
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <syslog@plt>
mov    0x10(%r14),%ecx
mov    (%rsp),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1090 <log_data_two@plt>
jmp    12d0 <main+0x140>
nopl   0x0(%rax,%rax,1)
mov    0x2901(%rip),%rax
mov    (%rax),%edi
lea    0xa11(%rip),%rsi
xor    %eax,%eax
call   1080 <syslog@plt>
jmp    1276 <main+0xe6>
lea    0x9c0(%rip),%rdi
call   10a0 <perror@plt>
jmp    1219 <main+0x89>

LLVM IR (-O0):
%struct.inotify_event = type { i32, i64, i32, i32 }
@.str = [58 x i8] c"Not enough params: fileMonitor -d /root/html -l logFolder\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@LOG_NOTICE = global i32 0
@.str.2 = [54 x i8] c"------------ First testing daemon started.----------\00"
@.str.3 = [13 x i8] c"inotify_init\00"
@.str.4 = [7 x i8] c"wd < 0\00"
@.str.5 = [18 x i8] c"inotify_add_watch\00"
@.str.6 = [22 x i8] c"BEFORE READ IN BUFFER\00"
@.str.7 = [22 x i8] c"AFTER READ IN BUFFER.\00"
@.str.8 = [5 x i8] c"read\00"
@.str.9 = [12 x i8] c" length =0 \00"
@IN_IGNORED = global i32 0
@IN_ATTRIB = global i32 0
@IN_ISDIR = global i32 0
@.str.10 = [32 x i8] c" directory:chaning ATTRIB .\00"
@.str.11 = [23 x i8] c" directory:%s ATTRIB .\00"
@.str.12 = [20 x i8] c"ATTRIB: directory: \00"
@.str.13 = [18 x i8] c" file:%s ATTRIB .\00"
@.str.14 = [15 x i8] c"ATTRIB: file: \00"
@IN_MODIFY = global i32 0
@.str.15 = [30 x i8] c" dirtory:chaning !!!!!!! .\00"
@.str.16 = [22 x i8] c" directory:%s modify.\00"
@.str.17 = [16 x i8] c"MODIFIED file: \00"
@.str.18 = [27 x i8] c" file modify:chaning!!! .\00"
@.str.19 = [17 x i8] c" file:%s modify.\00"
@IN_CLOSE_WRITE = global i32 0
@.str.20 = [26 x i8] c" CLSOE WRITE !!!!!!! .\00"
@.str.21 = [18 x i8] c"CLOSE directory: \00"
@.str.22 = [13 x i8] c"CLOSE file: \00"
@IN_OPEN = global i32 0
@.str.23 = [20 x i8] c" directory:%s open.\00"
@.str.24 = [17 x i8] c"OPEN directory: \00"
@.str.25 = [15 x i8] c" file:opening.\00"
@.str.26 = [15 x i8] c" file:%s open.\00"
@.str.27 = [12 x i8] c"OPEN file: \00"
@IN_CREATE = global i32 0
@.str.28 = [26 x i8] c"new directory:%s created.\00"
@.str.29 = [16 x i8] c"NEW directory: \00"
@.str.30 = [21 x i8] c"new file:%s created.\00"
@.str.31 = [11 x i8] c"NEW file: \00"
@IN_DELETE = global i32 0
@.str.32 = [19 x i8] c"dir:%s is deleted.\00"
@.str.33 = [20 x i8] c"DELETED directory: \00"
@.str.34 = [20 x i8] c"file:%s is deleted.\00"
@.str.35 = [15 x i8] c"DELETED file: \00"
@IN_ACCESS = global i32 0
@.str.36 = [20 x i8] c"dir:%s is accessed.\00"
@.str.37 = [21 x i8] c"ACCESSED directory: \00"
@.str.38 = [21 x i8] c"file:%s is accessed.\00"
@.str.39 = [16 x i8] c"ACCESSED file: \00"
@IN_CLOSE = global i32 0
@.str.40 = [22 x i8] c" directory:%s closed.\00"
@.str.41 = [19 x i8] c"CLOSED directory: \00"
@.str.42 = [17 x i8] c" file:%s closed.\00"
@.str.43 = [14 x i8] c"CLOSED file: \00"
@.str.44 = [42 x i8] c"~~~~~~one testing daemon ended.~~~~~~~~~~\00"
@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
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [40960 x i8]
%13 = alloca %struct.inotify_event*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i8* null, i8** %10
store i8* null, i8** %11
%14 = load i32, i32* %4
%15 = icmp sle i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
ret i32 %18
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
store i8* %22, i8** %10
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 4
%25 = load i8*, i8** %24
store i8* %25, i8** %11
%26 = load i8*, i8** %11
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = call i32 (...) @skeleton_daemon()
%29 = load i32, i32* @LOG_NOTICE
%30 = call i32 (i32, i8*, ...) @syslog(i32 %29, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 (...) @inotify_init()
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %19
%35 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %34, %19
%37 = load i32, i32* %8
%38 = load i8*, i8** %10
%39 = load i8*, i8** %11
%40 = call i32 @add_watches(i32 %37, i8* %38, i8* %39)
%41 = load i32, i32* %9
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %36
%44 = load i32, i32* @LOG_NOTICE
%45 = call i32 (i32, i8*, ...) @syslog(i32 %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%46 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %47
47: ; preds = %43, %36
br label %48
48: ; preds = %47, %63, %449
%49 = load i32, i32* @LOG_NOTICE
%50 = call i32 (i32, i8*, ...) @syslog(i32 %49, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%51 = load i32, i32* %8
%52 = getelementptr inbounds [40960 x i8], [40960 x i8]* %12, i64 0, i64 0
%53 = call i32 @read(i32 %51, i8* %52, i32 40960)
store i32 %53, i32* %6
%54 = load i32, i32* @LOG_NOTICE
%55 = call i32 (i32, i8*, ...) @syslog(i32 %54, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%56 = load i32, i32* %6
%57 = icmp slt i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %48
%59 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %67
60: ; preds = %48
%61 = load i32, i32* %6
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i32, i32* @LOG_NOTICE
%65 = call i32 (i32, i8*, ...) @syslog(i32 %64, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %48
66: ; preds = %60
br label %67
67: ; preds = %66, %58
br label %68
68: ; preds = %440, %67
%69 = load i32, i32* %7
%70 = load i32, i32* %6
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %449
72: ; preds = %68
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [40960 x i8], [40960 x i8]* %12, i64 0, i64 %74
%76 = bitcast i8* %75 to %struct.inotify_event*
store %struct.inotify_event* %76, %struct.inotify_event** %13
%77 = load %struct.inotify_event*, %struct.inotify_event** %13
%78 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %77, i32 0, i32 1
%79 = load i64, i64* %78
%80 = icmp ne i64 %79, 0
br i1 %80, label %81, label %440
81: ; preds = %72
%82 = load %struct.inotify_event*, %struct.inotify_event** %13
%83 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %82, i32 0, i32 0
%84 = load i32, i32* %83
%85 = load i32, i32* @IN_IGNORED
%86 = and i32 %84, %85
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %89
88: ; preds = %81
br label %89
89: ; preds = %88, %81
%90 = load %struct.inotify_event*, %struct.inotify_event** %13
%91 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %90, i32 0, i32 0
%92 = load i32, i32* %91
%93 = load i32, i32* @IN_ATTRIB
%94 = and i32 %92, %93
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %136
96: ; preds = %89
%97 = load %struct.inotify_event*, %struct.inotify_event** %13
%98 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %97, i32 0, i32 0
%99 = load i32, i32* %98
%100 = load i32, i32* @IN_ISDIR
%101 = and i32 %99, %100
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %119
103: ; preds = %96
%104 = load i32, i32* @LOG_NOTICE
%105 = call i32 (i32, i8*, ...) @syslog(i32 %104, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
%106 = load i32, i32* @LOG_NOTICE
%107 = load %struct.inotify_event*, %struct.inotify_event** %13
%108 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %107, i32 0, i32 3
%109 = load i32, i32* %108
%110 = call i32 (i32, i8*, ...) @syslog(i32 %106, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i32 %109)
%111 = load i8*, i8** %11
%112 = load %struct.inotify_event*, %struct.inotify_event** %13
%113 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %112, i32 0, i32 3
%114 = load i32, i32* %113
%115 = load %struct.inotify_event*, %struct.inotify_event** %13
%116 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %115, i32 0, i32 2
%117 = load i32, i32* %116
%118 = call i32 @log_data_two(i8* %111, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i32 %114, i32 %117)
br label %135
119: ; preds = %96
%120 = load i32, i32* @LOG_NOTICE
%121 = call i32 (i32, i8*, ...) @syslog(i32 %120, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
%122 = load i32, i32* @LOG_NOTICE
%123 = load %struct.inotify_event*, %struct.inotify_event** %13
%124 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %123, i32 0, i32 3
%125 = load i32, i32* %124
%126 = call i32 (i32, i8*, ...) @syslog(i32 %122, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i32 %125)
%127 = load i8*, i8** %11
%128 = load %struct.inotify_event*, %struct.inotify_event** %13
%129 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %128, i32 0, i32 3
%130 = load i32, i32* %129
%131 = load %struct.inotify_event*, %struct.inotify_event** %13
%132 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %131, i32 0, i32 2
%133 = load i32, i32* %132
%134 = call i32 @log_data_two(i8* %127, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), i32 %130, i32 %133)
br label %135
135: ; preds = %119, %103
br label %136
136: ; preds = %135, %89
%137 = load %struct.inotify_event*, %struct.inotify_event** %13
%138 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %137, i32 0, i32 0
%139 = load i32, i32* %138
%140 = load i32, i32* @IN_MODIFY
%141 = and i32 %139, %140
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %183
143: ; preds = %136
%144 = load %struct.inotify_event*, %struct.inotify_event** %13
%145 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %144, i32 0, i32 0
%146 = load i32, i32* %145
%147 = load i32, i32* @IN_ISDIR
%148 = and i32 %146, %147
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %166
150: ; preds = %143
%151 = load i32, i32* @LOG_NOTICE
%152 = call i32 (i32, i8*, ...) @syslog(i32 %151, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0))
%153 = load i32, i32* @LOG_NOTICE
%154 = load %struct.inotify_event*, %struct.inotify_event** %13
%155 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %154, i32 0, i32 3
%156 = load i32, i32* %155
%157 = call i32 (i32, i8*, ...) @syslog(i32 %153, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), i32 %156)
%158 = load i8*, i8** %11
%159 = load %struct.inotify_event*, %struct.inotify_event** %13
%160 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %159, i32 0, i32 3
%161 = load i32, i32* %160
%162 = load %struct.inotify_event*, %struct.inotify_event** %13
%163 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %162, i32 0, i32 2
%164 = load i32, i32* %163
%165 = call i32 @log_data_two(i8* %158, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i32 %161, i32 %164)
br label %182
166: ; preds = %143
%167 = load i32, i32* @LOG_NOTICE
%168 = call i32 (i32, i8*, ...) @syslog(i32 %167, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0))
%169 = load i32, i32* @LOG_NOTICE
%170 = load %struct.inotify_event*, %struct.inotify_event** %13
%171 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %170, i32 0, i32 3
%172 = load i32, i32* %171
%173 = call i32 (i32, i8*, ...) @syslog(i32 %169, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i32 %172)
%174 = load i8*, i8** %11
%175 = load %struct.inotify_event*, %struct.inotify_event** %13
%176 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %175, i32 0, i32 3
%177 = load i32, i32* %176
%178 = load %struct.inotify_event*, %struct.inotify_event** %13
%179 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %178, i32 0, i32 2
%180 = load i32, i32* %179
%181 = call i32 @log_data_two(i8* %174, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i32 %177, i32 %180)
br label %182
182: ; preds = %166, %150
br label %183
183: ; preds = %182, %136
%184 = load %struct.inotify_event*, %struct.inotify_event** %13
%185 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %184, i32 0, i32 0
%186 = load i32, i32* %185
%187 = load i32, i32* @IN_CLOSE_WRITE
%188 = and i32 %186, %187
%189 = icmp ne i32 %188, 0
br i1 %189, label %190, label %220
190: ; preds = %183
%191 = load %struct.inotify_event*, %struct.inotify_event** %13
%192 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %191, i32 0, i32 0
%193 = load i32, i32* %192
%194 = load i32, i32* @IN_ISDIR
%195 = and i32 %193, %194
%196 = icmp ne i32 %195, 0
br i1 %196, label %197, label %208
197: ; preds = %190
%198 = load i32, i32* @LOG_NOTICE
%199 = call i32 (i32, i8*, ...) @syslog(i32 %198, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
%200 = load i8*, i8** %11
%201 = load %struct.inotify_event*, %struct.inotify_event** %13
%202 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %201, i32 0, i32 3
%203 = load i32, i32* %202
%204 = load %struct.inotify_event*, %struct.inotify_event** %13
%205 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %204, i32 0, i32 2
%206 = load i32, i32* %205
%207 = call i32 @log_data_two(i8* %200, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0), i32 %203, i32 %206)
br label %219
208: ; preds = %190
%209 = load i32, i32* @LOG_NOTICE
%210 = call i32 (i32, i8*, ...) @syslog(i32 %209, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
%211 = load i8*, i8** %11
%212 = load %struct.inotify_event*, %struct.inotify_event** %13
%213 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %212, i32 0, i32 3
%214 = load i32, i32* %213
%215 = load %struct.inotify_event*, %struct.inotify_event** %13
%216 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %215, i32 0, i32 2
%217 = load i32, i32* %216
%218 = call i32 @log_data_two(i8* %211, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i32 %214, i32 %217)
br label %219
219: ; preds = %208, %197
br label %220
220: ; preds = %219, %183
%221 = load %struct.inotify_event*, %struct.inotify_event** %13
%222 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %221, i32 0, i32 0
%223 = load i32, i32* %222
%224 = load i32, i32* @IN_OPEN
%225 = and i32 %223, %224
%226 = icmp ne i32 %225, 0
br i1 %226, label %227, label %265
227: ; preds = %220
%228 = load %struct.inotify_event*, %struct.inotify_event** %13
%229 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %228, i32 0, i32 0
%230 = load i32, i32* %229
%231 = load i32, i32* @IN_ISDIR
%232 = and i32 %230, %231
%233 = icmp ne i32 %232, 0
br i1 %233, label %234, label %248
234: ; preds = %227
%235 = load i32, i32* @LOG_NOTICE
%236 = load %struct.inotify_event*, %struct.inotify_event** %13
%237 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %236, i32 0, i32 3
%238 = load i32, i32* %237
%239 = call i32 (i32, i8*, ...) @syslog(i32 %235, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i32 %238)
%240 = load i8*, i8** %11
%241 = load %struct.inotify_event*, %struct.inotify_event** %13
%242 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %241, i32 0, i32 3
%243 = load i32, i32* %242
%244 = load %struct.inotify_event*, %struct.inotify_event** %13
%245 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %244, i32 0, i32 2
%246 = load i32, i32* %245
%247 = call i32 @log_data_two(i8* %240, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i32 %243, i32 %246)
br label %264
248: ; preds = %227
%249 = load i32, i32* @LOG_NOTICE
%250 = call i32 (i32, i8*, ...) @syslog(i32 %249, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0))
%251 = load i32, i32* @LOG_NOTICE
%252 = load %struct.inotify_event*, %struct.inotify_event** %13
%253 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %252, i32 0, i32 3
%254 = load i32, i32* %253
%255 = call i32 (i32, i8*, ...) @syslog(i32 %251, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0), i32 %254)
%256 = load i8*, i8** %11
%257 = load %struct.inotify_event*, %struct.inotify_event** %13
%258 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %257, i32 0, i32 3
%259 = load i32, i32* %258
%260 = load %struct.inotify_event*, %struct.inotify_event** %13
%261 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %260, i32 0, i32 2
%262 = load i32, i32* %261
%263 = call i32 @log_data_two(i8* %256, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), i32 %259, i32 %262)
br label %264
264: ; preds = %248, %234
br label %265
265: ; preds = %264, %220
%266 = load %struct.inotify_event*, %struct.inotify_event** %13
%267 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %266, i32 0, i32 0
%268 = load i32, i32* %267
%269 = load i32, i32* @IN_CREATE
%270 = and i32 %268, %269
%271 = icmp ne i32 %270, 0
br i1 %271, label %272, label %308
272: ; preds = %265
%273 = load %struct.inotify_event*, %struct.inotify_event** %13
%274 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %273, i32 0, i32 0
%275 = load i32, i32* %274
%276 = load i32, i32* @IN_ISDIR
%277 = and i32 %275, %276
%278 = icmp ne i32 %277, 0
br i1 %278, label %279, label %293
279: ; preds = %272
%280 = load i32, i32* @LOG_NOTICE
%281 = load %struct.inotify_event*, %struct.inotify_event** %13
%282 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %281, i32 0, i32 3
%283 = load i32, i32* %282
%284 = call i32 (i32, i8*, ...) @syslog(i32 %280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.28, i64 0, i64 0), i32 %283)
%285 = load i8*, i8** %11
%286 = load %struct.inotify_event*, %struct.inotify_event** %13
%287 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %286, i32 0, i32 3
%288 = load i32, i32* %287
%289 = load %struct.inotify_event*, %struct.inotify_event** %13
%290 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %289, i32 0, i32 2
%291 = load i32, i32* %290
%292 = call i32 @log_data_two(i8* %285, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i64 0, i64 0), i32 %288, i32 %291)
br label %307
293: ; preds = %272
%294 = load i32, i32* @LOG_NOTICE
%295 = load %struct.inotify_event*, %struct.inotify_event** %13
%296 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %295, i32 0, i32 3
%297 = load i32, i32* %296
%298 = call i32 (i32, i8*, ...) @syslog(i32 %294, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.30, i64 0, i64 0), i32 %297)
%299 = load i8*, i8** %11
%300 = load %struct.inotify_event*, %struct.inotify_event** %13
%301 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %300, i32 0, i32 3
%302 = load i32, i32* %301
%303 = load %struct.inotify_event*, %struct.inotify_event** %13
%304 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %303, i32 0, i32 2
%305 = load i32, i32* %304
%306 = call i32 @log_data_two(i8* %299, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.31, i64 0, i64 0), i32 %302, i32 %305)
br label %307
307: ; preds = %293, %279
br label %396
308: ; preds = %265
%309 = load %struct.inotify_event*, %struct.inotify_event** %13
%310 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %309, i32 0, i32 0
%311 = load i32, i32* %310
%312 = load i32, i32* @IN_DELETE
%313 = and i32 %311, %312
%314 = icmp ne i32 %313, 0
br i1 %314, label %315, label %351
315: ; preds = %308
%316 = load %struct.inotify_event*, %struct.inotify_event** %13
%317 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %316, i32 0, i32 0
%318 = load i32, i32* %317
%319 = load i32, i32* @IN_ISDIR
%320 = and i32 %318, %319
%321 = icmp ne i32 %320, 0
br i1 %321, label %322, label %336
322: ; preds = %315
%323 = load i32, i32* @LOG_NOTICE
%324 = load %struct.inotify_event*, %struct.inotify_event** %13
%325 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %324, i32 0, i32 3
%326 = load i32, i32* %325
%327 = call i32 (i32, i8*, ...) @syslog(i32 %323, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.32, i64 0, i64 0), i32 %326)
%328 = load i8*, i8** %11
%329 = load %struct.inotify_event*, %struct.inotify_event** %13
%330 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %329, i32 0, i32 3
%331 = load i32, i32* %330
%332 = load %struct.inotify_event*, %struct.inotify_event** %13
%333 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %332, i32 0, i32 2
%334 = load i32, i32* %333
%335 = call i32 @log_data_two(i8* %328, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.33, i64 0, i64 0), i32 %331, i32 %334)
br label %350
336: ; preds = %315
%337 = load i32, i32* @LOG_NOTICE
%338 = load %struct.inotify_event*, %struct.inotify_event** %13
%339 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %338, i32 0, i32 3
%340 = load i32, i32* %339
%341 = call i32 (i32, i8*, ...) @syslog(i32 %337, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.34, i64 0, i64 0), i32 %340)
%342 = load i8*, i8** %11
%343 = load %struct.inotify_event*, %struct.inotify_event** %13
%344 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %343, i32 0, i32 3
%345 = load i32, i32* %344
%346 = load %struct.inotify_event*, %struct.inotify_event** %13
%347 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %346, i32 0, i32 2
%348 = load i32, i32* %347
%349 = call i32 @log_data_two(i8* %342, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.35, i64 0, i64 0), i32 %345, i32 %348)
br label %350
350: ; preds = %336, %322
br label %395
351: ; preds = %308
%352 = load %struct.inotify_event*, %struct.inotify_event** %13
%353 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %352, i32 0, i32 0
%354 = load i32, i32* %353
%355 = load i32, i32* @IN_ACCESS
%356 = and i32 %354, %355
%357 = icmp ne i32 %356, 0
br i1 %357, label %358, label %394
358: ; preds = %351
%359 = load %struct.inotify_event*, %struct.inotify_event** %13
%360 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %359, i32 0, i32 0
%361 = load i32, i32* %360
%362 = load i32, i32* @IN_ISDIR
%363 = and i32 %361, %362
%364 = icmp ne i32 %363, 0
br i1 %364, label %365, label %379
365: ; preds = %358
%366 = load i32, i32* @LOG_NOTICE
%367 = load %struct.inotify_event*, %struct.inotify_event** %13
%368 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %367, i32 0, i32 3
%369 = load i32, i32* %368
%370 = call i32 (i32, i8*, ...) @syslog(i32 %366, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.36, i64 0, i64 0), i32 %369)
%371 = load i8*, i8** %11
%372 = load %struct.inotify_event*, %struct.inotify_event** %13
%373 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %372, i32 0, i32 3
%374 = load i32, i32* %373
%375 = load %struct.inotify_event*, %struct.inotify_event** %13
%376 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %375, i32 0, i32 2
%377 = load i32, i32* %376
%378 = call i32 @log_data_two(i8* %371, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.37, i64 0, i64 0), i32 %374, i32 %377)
br label %393
379: ; preds = %358
%380 = load i32, i32* @LOG_NOTICE
%381 = load %struct.inotify_event*, %struct.inotify_event** %13
%382 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %381, i32 0, i32 3
%383 = load i32, i32* %382
%384 = call i32 (i32, i8*, ...) @syslog(i32 %380, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.38, i64 0, i64 0), i32 %383)
%385 = load i8*, i8** %11
%386 = load %struct.inotify_event*, %struct.inotify_event** %13
%387 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %386, i32 0, i32 3
%388 = load i32, i32* %387
%389 = load %struct.inotify_event*, %struct.inotify_event** %13
%390 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %389, i32 0, i32 2
%391 = load i32, i32* %390
%392 = call i32 @log_data_two(i8* %385, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.39, i64 0, i64 0), i32 %388, i32 %391)
br label %393
393: ; preds = %379, %365
br label %394
394: ; preds = %393, %351
br label %395
395: ; preds = %394, %350
br label %396
396: ; preds = %395, %307
%397 = load %struct.inotify_event*, %struct.inotify_event** %13
%398 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %397, i32 0, i32 0
%399 = load i32, i32* %398
%400 = load i32, i32* @IN_CLOSE
%401 = and i32 %399, %400
%402 = icmp ne i32 %401, 0
br i1 %402, label %403, label %439
403: ; preds = %396
%404 = load %struct.inotify_event*, %struct.inotify_event** %13
%405 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %404, i32 0, i32 0
%406 = load i32, i32* %405
%407 = load i32, i32* @IN_ISDIR
%408 = and i32 %406, %407
%409 = icmp ne i32 %408, 0
br i1 %409, label %410, label %424
410: ; preds = %403
%411 = load i32, i32* @LOG_NOTICE
%412 = load %struct.inotify_event*, %struct.inotify_event** %13
%413 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %412, i32 0, i32 3
%414 = load i32, i32* %413
%415 = call i32 (i32, i8*, ...) @syslog(i32 %411, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.40, i64 0, i64 0), i32 %414)
%416 = load i8*, i8** %11
%417 = load %struct.inotify_event*, %struct.inotify_event** %13
%418 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %417, i32 0, i32 3
%419 = load i32, i32* %418
%420 = load %struct.inotify_event*, %struct.inotify_event** %13
%421 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %420, i32 0, i32 2
%422 = load i32, i32* %421
%423 = call i32 @log_data_two(i8* %416, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.41, i64 0, i64 0), i32 %419, i32 %422)
br label %438
424: ; preds = %403
%425 = load i32, i32* @LOG_NOTICE
%426 = load %struct.inotify_event*, %struct.inotify_event** %13
%427 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %426, i32 0, i32 3
%428 = load i32, i32* %427
%429 = call i32 (i32, i8*, ...) @syslog(i32 %425, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.42, i64 0, i64 0), i32 %428)
%430 = load i8*, i8** %11
%431 = load %struct.inotify_event*, %struct.inotify_event** %13
%432 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %431, i32 0, i32 3
%433 = load i32, i32* %432
%434 = load %struct.inotify_event*, %struct.inotify_event** %13
%435 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %434, i32 0, i32 2
%436 = load i32, i32* %435
%437 = call i32 @log_data_two(i8* %430, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.43, i64 0, i64 0), i32 %433, i32 %436)
br label %438
438: ; preds = %424, %410
br label %439
439: ; preds = %438, %396
br label %440
440: ; preds = %439, %72
%441 = load %struct.inotify_event*, %struct.inotify_event** %13
%442 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %441, i32 0, i32 1
%443 = load i64, i64* %442
%444 = add i64 24, %443
%445 = load i32, i32* %7
%446 = sext i32 %445 to i64
%447 = add i64 %446, %444
%448 = trunc i64 %447 to i32
store i32 %448, i32* %7
br label %68
449: ; preds = %68
store i32 0, i32* %7
%450 = load i32, i32* @LOG_NOTICE
%451 = call i32 (i32, i8*, ...) @syslog(i32 %450, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.44, i64 0, i64 0))
%452 = call i32 @sleep(i32 20)
br label %48
}

LLVM IR (-O2):
@.str = [58 x i8] c"Not enough params: fileMonitor -d /root/html -l logFolder\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@LOG_NOTICE = global i32 0
@.str.2 = [54 x i8] c"------------ First testing daemon started.----------\00"
@.str.3 = [13 x i8] c"inotify_init\00"
@.str.6 = [22 x i8] c"BEFORE READ IN BUFFER\00"
@.str.7 = [22 x i8] c"AFTER READ IN BUFFER.\00"
@.str.8 = [5 x i8] c"read\00"
@.str.9 = [12 x i8] c" length =0 \00"
@IN_IGNORED = global i32 0
@IN_ATTRIB = global i32 0
@IN_ISDIR = global i32 0
@.str.10 = [32 x i8] c" directory:chaning ATTRIB .\00"
@.str.11 = [23 x i8] c" directory:%s ATTRIB .\00"
@.str.12 = [20 x i8] c"ATTRIB: directory: \00"
@.str.13 = [18 x i8] c" file:%s ATTRIB .\00"
@.str.14 = [15 x i8] c"ATTRIB: file: \00"
@IN_MODIFY = global i32 0
@.str.15 = [30 x i8] c" dirtory:chaning !!!!!!! .\00"
@.str.16 = [22 x i8] c" directory:%s modify.\00"
@.str.17 = [16 x i8] c"MODIFIED file: \00"
@.str.18 = [27 x i8] c" file modify:chaning!!! .\00"
@.str.19 = [17 x i8] c" file:%s modify.\00"
@IN_CLOSE_WRITE = global i32 0
@.str.20 = [26 x i8] c" CLSOE WRITE !!!!!!! .\00"
@.str.21 = [18 x i8] c"CLOSE directory: \00"
@.str.22 = [13 x i8] c"CLOSE file: \00"
@IN_OPEN = global i32 0
@.str.23 = [20 x i8] c" directory:%s open.\00"
@.str.24 = [17 x i8] c"OPEN directory: \00"
@.str.25 = [15 x i8] c" file:opening.\00"
@.str.26 = [15 x i8] c" file:%s open.\00"
@.str.27 = [12 x i8] c"OPEN file: \00"
@IN_CREATE = global i32 0
@.str.28 = [26 x i8] c"new directory:%s created.\00"
@.str.29 = [16 x i8] c"NEW directory: \00"
@.str.30 = [21 x i8] c"new file:%s created.\00"
@.str.31 = [11 x i8] c"NEW file: \00"
@IN_DELETE = global i32 0
@.str.32 = [19 x i8] c"dir:%s is deleted.\00"
@.str.33 = [20 x i8] c"DELETED directory: \00"
@.str.34 = [20 x i8] c"file:%s is deleted.\00"
@.str.35 = [15 x i8] c"DELETED file: \00"
@IN_ACCESS = global i32 0
@.str.36 = [20 x i8] c"dir:%s is accessed.\00"
@.str.37 = [21 x i8] c"ACCESSED directory: \00"
@.str.38 = [21 x i8] c"file:%s is accessed.\00"
@.str.39 = [16 x i8] c"ACCESSED file: \00"
@IN_CLOSE = global i32 0
@.str.40 = [22 x i8] c" directory:%s closed.\00"
@.str.41 = [19 x i8] c"CLOSED directory: \00"
@.str.42 = [17 x i8] c" file:%s closed.\00"
@.str.43 = [14 x i8] c"CLOSED file: \00"
@.str.44 = [42 x i8] c"~~~~~~one testing daemon ended.~~~~~~~~~~\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [40960 x i8]
%4 = icmp slt i32 %0, 4
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
ret i32 %7
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 4
%12 = load i8*, i8** %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [40960 x i8], [40960 x i8]* %3, i64 0, i64 0
%15 = tail call i32 (...) @skeleton_daemon()
%16 = load i32, i32* @LOG_NOTICE
%17 = tail call i32 (i32, i8*, ...) @syslog(i32 %16, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 (...) @inotify_init()
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %8
%21 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %8
%23 = tail call i32 @add_watches(i32 %18, i8* %10, i8* %12)
br label %24
24: ; preds = %36, %22
%25 = load i32, i32* @LOG_NOTICE
%26 = tail call i32 (i32, i8*, ...) @syslog(i32 %25, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 @read(i32 %18, i8* %14, i32 40960)
%28 = load i32, i32* @LOG_NOTICE
%29 = tail call i32 (i32, i8*, ...) @syslog(i32 %28, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp slt i32 %27, 0
br i1 %30, label %37, label %31
31: ; preds = %24
%32 = icmp eq i32 %27, 0
br i1 %32, label %33, label %39
33: ; preds = %31
%34 = load i32, i32* @LOG_NOTICE
%35 = tail call i32 (i32, i8*, ...) @syslog(i32 %34, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %36
36: ; preds = %33, %242
br label %24
37: ; preds = %24
%38 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %242
39: ; preds = %31, %237
%40 = phi i32 [ %240, %237 ], [ 0, %31 ]
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [40960 x i8], [40960 x i8]* %3, i64 0, i64 %41
%43 = getelementptr inbounds i8, i8* %42, i64 8
%44 = bitcast i8* %43 to i64*
%45 = load i64, i64* %44
%46 = icmp eq i64 %45, 0
br i1 %46, label %237, label %47
47: ; preds = %39
%48 = bitcast i8* %42 to i32*
%49 = load i32, i32* %48
%50 = load i32, i32* @IN_ATTRIB
%51 = and i32 %50, %49
%52 = icmp eq i32 %51, 0
br i1 %52, label %70, label %53
53: ; preds = %47
%54 = load i32, i32* @IN_ISDIR
%55 = and i32 %54, %49
%56 = icmp eq i32 %55, 0
%57 = load i32, i32* @LOG_NOTICE
%58 = tail call i32 (i32, i8*, ...) @syslog(i32 %57, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
%59 = load i32, i32* @LOG_NOTICE
%60 = getelementptr inbounds i8, i8* %42, i64 20
%61 = bitcast i8* %60 to i32*
%62 = load i32, i32* %61
%63 = select i1 %56, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0)
%64 = select i1 %56, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0)
%65 = tail call i32 (i32, i8*, ...) @syslog(i32 %59, i8* %63, i32 %62)
%66 = getelementptr inbounds i8, i8* %42, i64 16
%67 = bitcast i8* %66 to i32*
%68 = load i32, i32* %67
%69 = tail call i32 @log_data_two(i8* %12, i8* %64, i32 %62, i32 %68)
br label %70
70: ; preds = %53, %47
%71 = load i32, i32* @IN_MODIFY
%72 = and i32 %71, %49
%73 = icmp eq i32 %72, 0
br i1 %73, label %99, label %74
74: ; preds = %70
%75 = load i32, i32* @IN_ISDIR
%76 = and i32 %75, %49
%77 = icmp eq i32 %76, 0
%78 = load i32, i32* @LOG_NOTICE
br i1 %77, label %86, label %79
79: ; preds = %74
%80 = tail call i32 (i32, i8*, ...) @syslog(i32 %78, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0))
%81 = load i32, i32* @LOG_NOTICE
%82 = getelementptr inbounds i8, i8* %42, i64 20
%83 = bitcast i8* %82 to i32*
%84 = load i32, i32* %83
%85 = tail call i32 (i32, i8*, ...) @syslog(i32 %81, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), i32 %84)
br label %93
86: ; preds = %74
%87 = tail call i32 (i32, i8*, ...) @syslog(i32 %78, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0))
%88 = load i32, i32* @LOG_NOTICE
%89 = getelementptr inbounds i8, i8* %42, i64 20
%90 = bitcast i8* %89 to i32*
%91 = load i32, i32* %90
%92 = tail call i32 (i32, i8*, ...) @syslog(i32 %88, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i32 %91)
br label %93
93: ; preds = %86, %79
%94 = phi i32 [ %84, %79 ], [ %91, %86 ]
%95 = getelementptr inbounds i8, i8* %42, i64 16
%96 = bitcast i8* %95 to i32*
%97 = load i32, i32* %96
%98 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i32 %94, i32 %97)
br label %99
99: ; preds = %93, %70
%100 = load i32, i32* @IN_CLOSE_WRITE
%101 = and i32 %100, %49
%102 = icmp eq i32 %101, 0
br i1 %102, label %117, label %103
103: ; preds = %99
%104 = load i32, i32* @IN_ISDIR
%105 = and i32 %104, %49
%106 = icmp eq i32 %105, 0
%107 = load i32, i32* @LOG_NOTICE
%108 = tail call i32 (i32, i8*, ...) @syslog(i32 %107, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
%109 = getelementptr inbounds i8, i8* %42, i64 20
%110 = bitcast i8* %109 to i32*
%111 = load i32, i32* %110
%112 = getelementptr inbounds i8, i8* %42, i64 16
%113 = bitcast i8* %112 to i32*
%114 = load i32, i32* %113
%115 = select i1 %106, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0)
%116 = tail call i32 @log_data_two(i8* %12, i8* %115, i32 %111, i32 %114)
br label %117
117: ; preds = %103, %99
%118 = load i32, i32* @IN_OPEN
%119 = and i32 %118, %49
%120 = icmp eq i32 %119, 0
br i1 %120, label %146, label %121
121: ; preds = %117
%122 = load i32, i32* @IN_ISDIR
%123 = and i32 %122, %49
%124 = icmp eq i32 %123, 0
%125 = load i32, i32* @LOG_NOTICE
br i1 %124, label %135, label %126
126: ; preds = %121
%127 = getelementptr inbounds i8, i8* %42, i64 20
%128 = bitcast i8* %127 to i32*
%129 = load i32, i32* %128
%130 = tail call i32 (i32, i8*, ...) @syslog(i32 %125, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i32 %129)
%131 = getelementptr inbounds i8, i8* %42, i64 16
%132 = bitcast i8* %131 to i32*
%133 = load i32, i32* %132
%134 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i32 %129, i32 %133)
br label %146
135: ; preds = %121
%136 = tail call i32 (i32, i8*, ...) @syslog(i32 %125, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0))
%137 = load i32, i32* @LOG_NOTICE
%138 = getelementptr inbounds i8, i8* %42, i64 20
%139 = bitcast i8* %138 to i32*
%140 = load i32, i32* %139
%141 = tail call i32 (i32, i8*, ...) @syslog(i32 %137, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0), i32 %140)
%142 = getelementptr inbounds i8, i8* %42, i64 16
%143 = bitcast i8* %142 to i32*
%144 = load i32, i32* %143
%145 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), i32 %140, i32 %144)
br label %146
146: ; preds = %126, %135, %117
%147 = load i32, i32* @IN_CREATE
%148 = and i32 %147, %49
%149 = icmp eq i32 %148, 0
br i1 %149, label %170, label %150
150: ; preds = %146
%151 = load i32, i32* @IN_ISDIR
%152 = and i32 %151, %49
%153 = icmp eq i32 %152, 0
%154 = load i32, i32* @LOG_NOTICE
%155 = getelementptr inbounds i8, i8* %42, i64 20
%156 = bitcast i8* %155 to i32*
%157 = load i32, i32* %156
br i1 %153, label %164, label %158
158: ; preds = %150
%159 = tail call i32 (i32, i8*, ...) @syslog(i32 %154, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.28, i64 0, i64 0), i32 %157)
%160 = getelementptr inbounds i8, i8* %42, i64 16
%161 = bitcast i8* %160 to i32*
%162 = load i32, i32* %161
%163 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i64 0, i64 0), i32 %157, i32 %162)
br label %218
164: ; preds = %150
%165 = tail call i32 (i32, i8*, ...) @syslog(i32 %154, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.30, i64 0, i64 0), i32 %157)
%166 = getelementptr inbounds i8, i8* %42, i64 16
%167 = bitcast i8* %166 to i32*
%168 = load i32, i32* %167
%169 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.31, i64 0, i64 0), i32 %157, i32 %168)
br label %218
170: ; preds = %146
%171 = load i32, i32* @IN_DELETE
%172 = and i32 %171, %49
%173 = icmp eq i32 %172, 0
br i1 %173, label %194, label %174
174: ; preds = %170
%175 = load i32, i32* @IN_ISDIR
%176 = and i32 %175, %49
%177 = icmp eq i32 %176, 0
%178 = load i32, i32* @LOG_NOTICE
%179 = getelementptr inbounds i8, i8* %42, i64 20
%180 = bitcast i8* %179 to i32*
%181 = load i32, i32* %180
br i1 %177, label %188, label %182
182: ; preds = %174
%183 = tail call i32 (i32, i8*, ...) @syslog(i32 %178, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.32, i64 0, i64 0), i32 %181)
%184 = getelementptr inbounds i8, i8* %42, i64 16
%185 = bitcast i8* %184 to i32*
%186 = load i32, i32* %185
%187 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.33, i64 0, i64 0), i32 %181, i32 %186)
br label %218
188: ; preds = %174
%189 = tail call i32 (i32, i8*, ...) @syslog(i32 %178, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.34, i64 0, i64 0), i32 %181)
%190 = getelementptr inbounds i8, i8* %42, i64 16
%191 = bitcast i8* %190 to i32*
%192 = load i32, i32* %191
%193 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.35, i64 0, i64 0), i32 %181, i32 %192)
br label %218
194: ; preds = %170
%195 = load i32, i32* @IN_ACCESS
%196 = and i32 %195, %49
%197 = icmp eq i32 %196, 0
br i1 %197, label %218, label %198
198: ; preds = %194
%199 = load i32, i32* @IN_ISDIR
%200 = and i32 %199, %49
%201 = icmp eq i32 %200, 0
%202 = load i32, i32* @LOG_NOTICE
%203 = getelementptr inbounds i8, i8* %42, i64 20
%204 = bitcast i8* %203 to i32*
%205 = load i32, i32* %204
br i1 %201, label %212, label %206
206: ; preds = %198
%207 = tail call i32 (i32, i8*, ...) @syslog(i32 %202, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.36, i64 0, i64 0), i32 %205)
%208 = getelementptr inbounds i8, i8* %42, i64 16
%209 = bitcast i8* %208 to i32*
%210 = load i32, i32* %209
%211 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.37, i64 0, i64 0), i32 %205, i32 %210)
br label %218
212: ; preds = %198
%213 = tail call i32 (i32, i8*, ...) @syslog(i32 %202, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.38, i64 0, i64 0), i32 %205)
%214 = getelementptr inbounds i8, i8* %42, i64 16
%215 = bitcast i8* %214 to i32*
%216 = load i32, i32* %215
%217 = tail call i32 @log_data_two(i8* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.39, i64 0, i64 0), i32 %205, i32 %216)
br label %218
218: ; preds = %188, %182, %206, %212, %194, %158, %164
%219 = load i32, i32* @IN_CLOSE
%220 = and i32 %219, %49
%221 = icmp eq i32 %220, 0
br i1 %221, label %237, label %222
222: ; preds = %218
%223 = load i32, i32* @IN_ISDIR
%224 = and i32 %223, %49
%225 = icmp eq i32 %224, 0
%226 = load i32, i32* @LOG_NOTICE
%227 = getelementptr inbounds i8, i8* %42, i64 20
%228 = bitcast i8* %227 to i32*
%229 = load i32, i32* %228
%230 = select i1 %225, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.42, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.40, i64 0, i64 0)
%231 = select i1 %225, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.43, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.41, i64 0, i64 0)
%232 = tail call i32 (i32, i8*, ...) @syslog(i32 %226, i8* %230, i32 %229)
%233 = getelementptr inbounds i8, i8* %42, i64 16
%234 = bitcast i8* %233 to i32*
%235 = load i32, i32* %234
%236 = tail call i32 @log_data_two(i8* %12, i8* %231, i32 %229, i32 %235)
br label %237
237: ; preds = %222, %218, %39
%238 = trunc i64 %45 to i32
%239 = add i32 %40, 24
%240 = add i32 %239, %238
%241 = icmp slt i32 %240, %27
br i1 %241, label %39, label %242
242: ; preds = %237, %37
%243 = load i32, i32* @LOG_NOTICE
%244 = tail call i32 (i32, i8*, ...) @syslog(i32 %243, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.44, i64 0, i64 0))
%245 = tail call i32 @sleep(i32 20)
br label %36
}