#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_ALERT;
int LOG_CRIT;
int LOG_DEBUG;
int LOG_EMERG;
int LOG_ERR;
int LOG_INFO;
int LOG_NOTICE;
int LOG_PERROR;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int LOG_WARNING;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ syslog(int, char *);
int main(int argc, char *argv[]) {
  printf("LOG_EMERG      %d\n", LOG_EMERG);
  printf("LOG_ALERT      %d\n", LOG_ALERT);
  printf("LOG_CRIT       %d\n", LOG_CRIT);
  printf("LOG_ERR        %d\n", LOG_ERR);
  printf("LOG_WARNING    %d\n", LOG_WARNING);
  printf("LOG_NOTICE     %d\n", LOG_NOTICE);
  printf("LOG_INFO       %d\n", LOG_INFO);
  printf("LOG_DEBUG      %d\n", LOG_DEBUG);
  openlog("test", LOG_PERROR | LOG_PID, LOG_USER);
  syslog(LOG_EMERG, "LOG_EMERG    ");
  syslog(LOG_ALERT, "LOG_ALERT    ");
  syslog(LOG_CRIT, "LOG_CRIT     ");
  syslog(LOG_ERR, "LOG_ERR      ");
  syslog(LOG_WARNING, "LOG_WARNING  ");
  syslog(LOG_NOTICE, "LOG_NOTICE   ");
  syslog(LOG_INFO, "LOG_INFO     ");
  syslog(LOG_DEBUG, "LOG_DEBUG    ");
  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    0x2e73(%rip),%rax
mov    (%rax),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    0x2de2(%rip),%rax
mov    (%rax),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2db0(%rip),%rax
mov    (%rax),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
mov    0x2da2(%rip),%rax
or     (%rax),%esi
mov    0x2dd1(%rip),%rax
mov    (%rax),%edx
lea    0xe78(%rip),%rdi
call   1060 <openlog@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
lea    0xe68(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
lea    0xe61(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2d82(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
lea    0xe53(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xe4c(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
lea    0xe45(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2cee(%rip),%rax
mov    (%rax),%edi
lea    0xe3e(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
lea    0xe37(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e5c(%rip),%r12
mov    (%r12),%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    0x2df5(%rip),%r13
mov    0x0(%r13),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e1e(%rip),%rbx
mov    (%rbx),%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    0x2de9(%rip),%rbp
mov    0x0(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dc3(%rip),%r14
mov    (%r14),%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    0x2db5(%rip),%r15
mov    (%r15),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dbf(%rip),%rax
mov    0x2da8(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2dd5(%rip),%rax
mov    (%rax),%edx
lea    0xe7c(%rip),%rdi
call   1060 <openlog@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
lea    0xe6c(%rip),%rsi
call   1050 <syslog@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
lea    0xe65(%rip),%rsi
call   1050 <syslog@plt>
mov    (%r12),%edi
lea    0xe63(%rip),%rsi
call   1050 <syslog@plt>
mov    0x0(%r13),%edi
lea    0xe61(%rip),%rsi
call   1050 <syslog@plt>
mov    (%rbx),%edi
lea    0xe61(%rip),%rsi
call   1050 <syslog@plt>
mov    0x0(%rbp),%edi
lea    0xe60(%rip),%rsi
call   1050 <syslog@plt>
mov    (%r14),%edi
lea    0xe5f(%rip),%rsi
call   1050 <syslog@plt>
mov    (%r15),%edi
lea    0xe5e(%rip),%rsi
call   1050 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"LOG_EMERG %d\0A\00"
@LOG_EMERG = global i32 0
@.str.1 = [19 x i8] c"LOG_ALERT %d\0A\00"
@LOG_ALERT = global i32 0
@.str.2 = [19 x i8] c"LOG_CRIT %d\0A\00"
@LOG_CRIT = global i32 0
@.str.3 = [19 x i8] c"LOG_ERR %d\0A\00"
@LOG_ERR = global i32 0
@.str.4 = [19 x i8] c"LOG_WARNING %d\0A\00"
@LOG_WARNING = global i32 0
@.str.5 = [19 x i8] c"LOG_NOTICE %d\0A\00"
@LOG_NOTICE = global i32 0
@.str.6 = [19 x i8] c"LOG_INFO %d\0A\00"
@LOG_INFO = global i32 0
@.str.7 = [19 x i8] c"LOG_DEBUG %d\0A\00"
@LOG_DEBUG = global i32 0
@.str.8 = [5 x i8] c"test\00"
@LOG_PERROR = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@.str.9 = [14 x i8] c"LOG_EMERG \00"
@.str.10 = [14 x i8] c"LOG_ALERT \00"
@.str.11 = [14 x i8] c"LOG_CRIT \00"
@.str.12 = [14 x i8] c"LOG_ERR \00"
@.str.13 = [14 x i8] c"LOG_WARNING \00"
@.str.14 = [14 x i8] c"LOG_NOTICE \00"
@.str.15 = [14 x i8] c"LOG_INFO \00"
@.str.16 = [14 x i8] c"LOG_DEBUG \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_EMERG
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @LOG_ALERT
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @LOG_CRIT
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @LOG_ERR
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @LOG_WARNING
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @LOG_NOTICE
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @LOG_INFO
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%20 = load i32, i32* @LOG_DEBUG
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @LOG_PERROR
%23 = load i32, i32* @LOG_PID
%24 = or i32 %22, %23
%25 = load i32, i32* @LOG_USER
%26 = call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %24, i32 %25)
%27 = load i32, i32* @LOG_EMERG
%28 = call i32 @syslog(i32 %27, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%29 = load i32, i32* @LOG_ALERT
%30 = call i32 @syslog(i32 %29, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%31 = load i32, i32* @LOG_CRIT
%32 = call i32 @syslog(i32 %31, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%33 = load i32, i32* @LOG_ERR
%34 = call i32 @syslog(i32 %33, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
%35 = load i32, i32* @LOG_WARNING
%36 = call i32 @syslog(i32 %35, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%37 = load i32, i32* @LOG_NOTICE
%38 = call i32 @syslog(i32 %37, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
%39 = load i32, i32* @LOG_INFO
%40 = call i32 @syslog(i32 %39, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%41 = load i32, i32* @LOG_DEBUG
%42 = call i32 @syslog(i32 %41, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
%43 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"LOG_EMERG %d\0A\00"
@LOG_EMERG = global i32 0
@.str.1 = [19 x i8] c"LOG_ALERT %d\0A\00"
@LOG_ALERT = global i32 0
@.str.2 = [19 x i8] c"LOG_CRIT %d\0A\00"
@LOG_CRIT = global i32 0
@.str.3 = [19 x i8] c"LOG_ERR %d\0A\00"
@LOG_ERR = global i32 0
@.str.4 = [19 x i8] c"LOG_WARNING %d\0A\00"
@LOG_WARNING = global i32 0
@.str.5 = [19 x i8] c"LOG_NOTICE %d\0A\00"
@LOG_NOTICE = global i32 0
@.str.6 = [19 x i8] c"LOG_INFO %d\0A\00"
@LOG_INFO = global i32 0
@.str.7 = [19 x i8] c"LOG_DEBUG %d\0A\00"
@LOG_DEBUG = global i32 0
@.str.8 = [5 x i8] c"test\00"
@LOG_PERROR = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@.str.9 = [14 x i8] c"LOG_EMERG \00"
@.str.10 = [14 x i8] c"LOG_ALERT \00"
@.str.11 = [14 x i8] c"LOG_CRIT \00"
@.str.12 = [14 x i8] c"LOG_ERR \00"
@.str.13 = [14 x i8] c"LOG_WARNING \00"
@.str.14 = [14 x i8] c"LOG_NOTICE \00"
@.str.15 = [14 x i8] c"LOG_INFO \00"
@.str.16 = [14 x i8] c"LOG_DEBUG \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @LOG_EMERG
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @LOG_ALERT
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @LOG_CRIT
%8 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @LOG_ERR
%10 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @LOG_WARNING
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @LOG_NOTICE
%14 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = load i32, i32* @LOG_INFO
%16 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @LOG_DEBUG
%18 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %17)
%19 = load i32, i32* @LOG_PERROR
%20 = load i32, i32* @LOG_PID
%21 = or i32 %20, %19
%22 = load i32, i32* @LOG_USER
%23 = tail call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* @LOG_EMERG
%25 = tail call i32 @syslog(i32 %24, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%26 = load i32, i32* @LOG_ALERT
%27 = tail call i32 @syslog(i32 %26, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%28 = load i32, i32* @LOG_CRIT
%29 = tail call i32 @syslog(i32 %28, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%30 = load i32, i32* @LOG_ERR
%31 = tail call i32 @syslog(i32 %30, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
%32 = load i32, i32* @LOG_WARNING
%33 = tail call i32 @syslog(i32 %32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%34 = load i32, i32* @LOG_NOTICE
%35 = tail call i32 @syslog(i32 %34, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
%36 = load i32, i32* @LOG_INFO
%37 = tail call i32 @syslog(i32 %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%38 = load i32, i32* @LOG_DEBUG
%39 = tail call i32 @syslog(i32 %38, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
%40 = tail call i32 (...) @closelog()
ret i32 0
}