#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_CONS;
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_LOCAL0;
int LOG_NDELAY;
int LOG_PID;
int LOG_USER;
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void enable_syslog() {
  openlog("httpd", LOG_USER | LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL0);
  syslog(LOG_INFO, "httpd started by user %d", getuid());
}


x86 assembly (clang, -O0):
<enable_syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2e80(%rip),%rax
or     (%rax),%esi
mov    0x2e7f(%rip),%rax
or     (%rax),%esi
mov    0x2e56(%rip),%rax
or     (%rax),%esi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
lea    0xe94(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe76(%rip),%rsi
call   1040 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_syslog>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    0x2e89(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e86(%rip),%rax
or     (%rax),%esi
mov    0x2e5d(%rip),%rax
or     (%rax),%esi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
lea    0xe9b(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getuid@plt>
lea    0xe85(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1040 <syslog@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"httpd\00"
@LOG_USER = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_LOCAL0 = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [25 x i8] c"httpd started by user %d\00"
define void @enable_syslog() {
%1 = load i32, i32* @LOG_USER
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_PID
%5 = or i32 %3, %4
%6 = load i32, i32* @LOG_NDELAY
%7 = or i32 %5, %6
%8 = load i32, i32* @LOG_LOCAL0
%9 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* @LOG_INFO
%11 = call i32 (...) @getuid()
%12 = call i32 @syslog(i32 %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"httpd\00"
@LOG_USER = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_LOCAL0 = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [25 x i8] c"httpd started by user %d\00"
define void @enable_syslog() {
%1 = load i32, i32* @LOG_USER
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_PID
%5 = or i32 %3, %4
%6 = load i32, i32* @LOG_NDELAY
%7 = or i32 %5, %6
%8 = load i32, i32* @LOG_LOCAL0
%9 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* @LOG_INFO
%11 = tail call i32 (...) @getuid()
%12 = tail call i32 @syslog(i32 %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}