#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*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ skeleton_daemon();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int main() {
  skeleton_daemon();
  FILE *fp = NULL;
  while (1) {
    syslog(LOG_NOTICE, "First daemon started.");
    sleep(20);
    break;
  }
  syslog(LOG_NOTICE, "First daemon juijui ii");
  syslog(LOG_NOTICE, "First daemon terminated.");
  closelog();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <skeleton_daemon@plt>
movq   $0x0,-0x10(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x14,%edi
call   1060 <sleep@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <skeleton_daemon@plt>
mov    0x2e91(%rip),%rbx
mov    (%rbx),%edi
lea    0xea8(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x14,%edi
call   1060 <sleep@plt>
mov    (%rbx),%edi
lea    0xea6(%rip),%rsi
call   1050 <syslog@plt>
mov    (%rbx),%edi
lea    0xeaf(%rip),%rsi
call   1050 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [22 x i8] c"First daemon started.\00"
@.str.1 = [23 x i8] c"First daemon juijui ii\00"
@.str.2 = [25 x i8] c"First daemon terminated.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 (...) @skeleton_daemon()
store i32* null, i32** %2
br label %4
4: ; preds = %0
%5 = load i32, i32* @LOG_NOTICE
%6 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sleep(i32 20)
br label %8
8: ; preds = %4
%9 = load i32, i32* @LOG_NOTICE
%10 = call i32 @syslog(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @LOG_NOTICE
%12 = call i32 @syslog(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (...) @closelog()
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [22 x i8] c"First daemon started.\00"
@.str.1 = [23 x i8] c"First daemon juijui ii\00"
@.str.2 = [25 x i8] c"First daemon terminated.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @skeleton_daemon()
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 20)
%5 = load i32, i32* @LOG_NOTICE
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @LOG_NOTICE
%8 = tail call i32 @syslog(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 (...) @closelog()
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}