#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 /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ event_init();
int /*<<< orphan*/ event_loop(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ inotify_setup();
int /*<<< orphan*/ openlog(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ parse_config(int const, char **);
int /*<<< orphan*/ set_resource_limits();
int /*<<< orphan*/ setup_events();
int /*<<< orphan*/ signal_setup();
int /*<<< orphan*/ sockfile_setup();
int /*<<< orphan*/ switch_users();
int /*<<< orphan*/ timer_setup();
int /*<<< orphan*/ users_init();
int /*<<< orphan*/ users_sync();
int main(const int argc, const char **argv) {
  openlog(NULL, LOG_PID, LOG_DAEMON);
  chdir("/");
  parse_config(argc, (char **)argv);
  set_resource_limits();
  switch_users();
  inotify_setup();
  signal_setup();
  sockfile_setup();
  timer_setup();
  users_init();
  event_init();
  setup_events();
  users_sync();
  while (1) {
    event_loop(128, -1);
  }
  exit(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)
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
mov    0x2de2(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <openlog@plt>
lea    0xde8(%rip),%rdi
call   1040 <chdir@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10d0 <parse_config@plt>
mov    $0x0,%al
call   1080 <set_resource_limits@plt>
mov    $0x0,%al
call   1050 <switch_users@plt>
mov    $0x0,%al
call   10b0 <inotify_setup@plt>
mov    $0x0,%al
call   1090 <signal_setup@plt>
mov    $0x0,%al
call   1030 <sockfile_setup@plt>
mov    $0x0,%al
call   10a0 <timer_setup@plt>
mov    $0x0,%al
call   1060 <users_init@plt>
mov    $0x0,%al
call   1100 <event_init@plt>
mov    $0x0,%al
call   1070 <setup_events@plt>
mov    $0x0,%al
call   10f0 <users_sync@plt>
mov    $0x80,%edi
mov    $0xffffffff,%esi
call   10c0 <event_loop@plt>
jmp    126f <main+0x8f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
mov    0x2df0(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   10e0 <openlog@plt>
lea    0xdf8(%rip),%rdi
call   1040 <chdir@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10d0 <parse_config@plt>
xor    %eax,%eax
call   1080 <set_resource_limits@plt>
xor    %eax,%eax
call   1050 <switch_users@plt>
xor    %eax,%eax
call   10b0 <inotify_setup@plt>
xor    %eax,%eax
call   1090 <signal_setup@plt>
xor    %eax,%eax
call   1030 <sockfile_setup@plt>
xor    %eax,%eax
call   10a0 <timer_setup@plt>
xor    %eax,%eax
call   1060 <users_init@plt>
xor    %eax,%eax
call   1100 <event_init@plt>
xor    %eax,%eax
call   1070 <setup_events@plt>
xor    %eax,%eax
call   10f0 <users_sync@plt>
nopl   (%rax)
mov    $0x80,%edi
mov    $0xffffffff,%esi
call   10c0 <event_loop@plt>
jmp    1260 <main+0x80>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@.str = [2 x i8] c"/\00"
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* @LOG_PID
%7 = load i32, i32* @LOG_DAEMON
%8 = call i32 @openlog(i32* null, i32 %6, i32 %7)
%9 = call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @parse_config(i32 %10, i8** %11)
%13 = call i32 (...) @set_resource_limits()
%14 = call i32 (...) @switch_users()
%15 = call i32 (...) @inotify_setup()
%16 = call i32 (...) @signal_setup()
%17 = call i32 (...) @sockfile_setup()
%18 = call i32 (...) @timer_setup()
%19 = call i32 (...) @users_init()
%20 = call i32 (...) @event_init()
%21 = call i32 (...) @setup_events()
%22 = call i32 (...) @users_sync()
br label %23
23: ; preds = %2, %23
%24 = call i32 @event_loop(i32 128, i32 -1)
br label %23
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@.str = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_DAEMON
%5 = tail call i32 @openlog(i32* null, i32 %3, i32 %4)
%6 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @parse_config(i32 %0, i8** %1)
%8 = tail call i32 (...) @set_resource_limits()
%9 = tail call i32 (...) @switch_users()
%10 = tail call i32 (...) @inotify_setup()
%11 = tail call i32 (...) @signal_setup()
%12 = tail call i32 (...) @sockfile_setup()
%13 = tail call i32 (...) @timer_setup()
%14 = tail call i32 (...) @users_init()
%15 = tail call i32 (...) @event_init()
%16 = tail call i32 (...) @setup_events()
%17 = tail call i32 (...) @users_sync()
br label %18
18: ; preds = %2, %18
%19 = tail call i32 @event_loop(i32 128, i32 -1)
br label %18
}