#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 EXIT_SUCCESS;
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ _check_linux_version();
int /*<<< orphan*/ _log(int /*<<< orphan*/, char *);
int /*<<< orphan*/ _manage();
int /*<<< orphan*/ _parse_options(int, char **);
int /*<<< orphan*/ basename(char *);
int /*<<< orphan*/ daemon(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ openlog(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  openlog(basename(argv[0]), LOG_PID, LOG_USER);
  _check_linux_version();
  _parse_options(argc, argv);
  daemon(0, 0);
  _log(LOG_INFO, "initialized");
  _manage();
  return EXIT_SUCCESS;
}


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    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
mov    0x2e3d(%rip),%rax
mov    (%rax),%esi
mov    0x2e44(%rip),%rax
mov    (%rax),%edx
call   1080 <openlog@plt>
mov    $0x0,%al
call   1030 <_check_linux_version@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <_parse_options@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <daemon@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
lea    0xe29(%rip),%rsi
call   1040 <_log@plt>
mov    $0x0,%al
call   1070 <_manage@plt>
mov    0x2de6(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
call   1050 <basename@plt>
mov    0x2e51(%rip),%rcx
mov    (%rcx),%esi
mov    0x2e58(%rip),%rcx
mov    (%rcx),%edx
mov    %eax,%edi
call   1080 <openlog@plt>
xor    %eax,%eax
call   1030 <_check_linux_version@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1090 <_parse_options@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <daemon@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xe3d(%rip),%rsi
call   1040 <_log@plt>
xor    %eax,%eax
call   1070 <_manage@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str = [12 x i8] c"initialized\00"
@EXIT_SUCCESS = 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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @basename(i8* %8)
%10 = load i32, i32* @LOG_PID
%11 = load i32, i32* @LOG_USER
%12 = call i32 @openlog(i32 %9, i32 %10, i32 %11)
%13 = call i32 (...) @_check_linux_version()
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @_parse_options(i32 %14, i8** %15)
%17 = call i32 @daemon(i32 0, i32 0)
%18 = load i32, i32* @LOG_INFO
%19 = call i32 @_log(i32 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (...) @_manage()
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str = [12 x i8] c"initialized\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @basename(i8* %3)
%5 = load i32, i32* @LOG_PID
%6 = load i32, i32* @LOG_USER
%7 = tail call i32 @openlog(i32 %4, i32 %5, i32 %6)
%8 = tail call i32 (...) @_check_linux_version()
%9 = tail call i32 @_parse_options(i32 %0, i8** %1)
%10 = tail call i32 @daemon(i32 0, i32 0)
%11 = load i32, i32* @LOG_INFO
%12 = tail call i32 @_log(i32 %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 (...) @_manage()
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}