#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 LOG_EMERG;
int LOG_INFO;
int /*<<< orphan*/ LOG_PID;
int LOG_SYSLOG;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ syslog(int, char *);
int main(int argc, const char *argv[]) {
  openlog("a.out", LOG_PID, 0);
  syslog(LOG_INFO, "omw?!?!?!?!?");
  openlog("a.out", LOG_PID, 1);
  syslog(LOG_INFO, "omw?!?!?!?!?");
  openlog("a.out", LOG_PID, -1);
  syslog(LOG_SYSLOG, "omw?!?!?!?!?");
  openlog("a.out", LOG_PID, 2);
  syslog(LOG_SYSLOG, "omw?!?!?!?!?");
  openlog("a.out", LOG_PID, LOG_SYSLOG);
  syslog(LOG_SYSLOG, "omw?!?!?!?!?");
  syslog(LOG_EMERG, "omwwww?!?!?!?!?");
  closelog();
  return 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    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
xor    %edx,%edx
call   1050 <openlog@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
lea    0xe7e(%rip),%rdi
mov    $0x1,%edx
call   1050 <openlog@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
lea    0xe6a(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
lea    0xe4f(%rip),%rdi
mov    $0xffffffff,%edx
call   1050 <openlog@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xe3b(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%esi
lea    0xe20(%rip),%rdi
mov    $0x2,%edx
call   1050 <openlog@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
lea    0xe0c(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
mov    0x2dc1(%rip),%rax
mov    (%rax),%edx
lea    0xde8(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
lea    0xdd9(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
lea    0xdd1(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2e99(%rip),%r15
mov    (%r15),%esi
lea    0xeb7(%rip),%r14
mov    %r14,%rdi
xor    %edx,%edx
call   1050 <openlog@plt>
mov    0x2e6e(%rip),%rbx
mov    (%rbx),%edi
lea    0xea3(%rip),%r12
mov    %r12,%rsi
call   1040 <syslog@plt>
mov    (%r15),%esi
mov    %r14,%rdi
mov    $0x1,%edx
call   1050 <openlog@plt>
mov    (%rbx),%edi
mov    %r12,%rsi
call   1040 <syslog@plt>
mov    (%r15),%esi
mov    %r14,%rdi
mov    $0xffffffff,%edx
call   1050 <openlog@plt>
mov    0x2e34(%rip),%rbx
mov    (%rbx),%edi
mov    %r12,%rsi
call   1040 <syslog@plt>
mov    (%r15),%esi
mov    %r14,%rdi
mov    $0x2,%edx
call   1050 <openlog@plt>
mov    (%rbx),%edi
mov    %r12,%rsi
call   1040 <syslog@plt>
mov    (%r15),%esi
mov    (%rbx),%edx
mov    %r14,%rdi
call   1050 <openlog@plt>
mov    (%rbx),%edi
mov    %r12,%rsi
call   1040 <syslog@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
lea    0xe2c(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"a.out\00"
@LOG_PID = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [13 x i8] c"omw?!?!?!?!?\00"
@LOG_SYSLOG = global i32 0
@LOG_EMERG = global i32 0
@.str.2 = [16 x i8] c"omwwww?!?!?!?!?\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 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6, i32 0)
%8 = load i32, i32* @LOG_INFO
%9 = call i32 @syslog(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @LOG_PID
%11 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10, i32 1)
%12 = load i32, i32* @LOG_INFO
%13 = call i32 @syslog(i32 %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @LOG_PID
%15 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %14, i32 -1)
%16 = load i32, i32* @LOG_SYSLOG
%17 = call i32 @syslog(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @LOG_PID
%19 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %18, i32 2)
%20 = load i32, i32* @LOG_SYSLOG
%21 = call i32 @syslog(i32 %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* @LOG_PID
%23 = load i32, i32* @LOG_SYSLOG
%24 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23)
%25 = load i32, i32* @LOG_SYSLOG
%26 = call i32 @syslog(i32 %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @LOG_EMERG
%28 = call i32 @syslog(i32 %27, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a.out\00"
@LOG_PID = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [13 x i8] c"omw?!?!?!?!?\00"
@LOG_SYSLOG = global i32 0
@LOG_EMERG = global i32 0
@.str.2 = [16 x i8] c"omwwww?!?!?!?!?\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @LOG_PID
%4 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
%5 = load i32, i32* @LOG_INFO
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @LOG_PID
%8 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7, i32 1)
%9 = load i32, i32* @LOG_INFO
%10 = tail call i32 @syslog(i32 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @LOG_PID
%12 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11, i32 -1)
%13 = load i32, i32* @LOG_SYSLOG
%14 = tail call i32 @syslog(i32 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @LOG_PID
%16 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15, i32 2)
%17 = load i32, i32* @LOG_SYSLOG
%18 = tail call i32 @syslog(i32 %17, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @LOG_PID
%20 = load i32, i32* @LOG_SYSLOG
%21 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i32, i32* @LOG_SYSLOG
%23 = tail call i32 @syslog(i32 %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @LOG_EMERG
%25 = tail call i32 @syslog(i32 %24, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i32 (...) @closelog()
ret i32 0
}