#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 /*<<< orphan*/ LOG_ALERT;
int LOG_CONS;
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_DEBUG;
int LOG_NDELAY;
int LOG_PERROR;
int LOG_PID;
int /*<<< orphan*/ LOG_UPTO(int /*<<< orphan*/);
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void open_log() {
  setlogmask(LOG_UPTO(LOG_DEBUG));
  openlog("judged", LOG_CONS | LOG_PID | LOG_NDELAY | LOG_PERROR, LOG_DAEMON);
  syslog(LOG_ALERT, "log started.");
}


x86 assembly (clang, -O0):
<open_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
mov    0x2e5f(%rip),%rax
or     (%rax),%esi
mov    0x2e36(%rip),%rax
or     (%rax),%esi
mov    0x2e5d(%rip),%rax
or     (%rax),%esi
mov    0x2e64(%rip),%rax
mov    (%rax),%edx
lea    0xe73(%rip),%rdi
call   1060 <openlog@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xe65(%rip),%rsi
call   1050 <syslog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_log>:
push   %rax
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    0x2e63(%rip),%rax
mov    0x2e64(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e39(%rip),%rax
or     (%rax),%esi
mov    0x2e60(%rip),%rax
or     (%rax),%esi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
lea    0xe76(%rip),%rdi
call   1060 <openlog@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
lea    0xe68(%rip),%rsi
pop    %rax
jmp    1050 <syslog@plt>

LLVM IR (-O0):
@LOG_DEBUG = global i32 0
@.str = [7 x i8] c"judged\00"
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_PERROR = global i32 0
@LOG_DAEMON = global i32 0
@LOG_ALERT = global i32 0
@.str.1 = [13 x i8] c"log started.\00"
define void @open_log() {
%1 = load i32, i32* @LOG_DEBUG
%2 = call i32 @LOG_UPTO(i32 %1)
%3 = call i32 @setlogmask(i32 %2)
%4 = load i32, i32* @LOG_CONS
%5 = load i32, i32* @LOG_PID
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_NDELAY
%8 = or i32 %6, %7
%9 = load i32, i32* @LOG_PERROR
%10 = or i32 %8, %9
%11 = load i32, i32* @LOG_DAEMON
%12 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* @LOG_ALERT
%14 = call i32 @syslog(i32 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@.str = [7 x i8] c"judged\00"
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_PERROR = global i32 0
@LOG_DAEMON = global i32 0
@LOG_ALERT = global i32 0
@.str.1 = [13 x i8] c"log started.\00"
define void @open_log() {
%1 = load i32, i32* @LOG_DEBUG
%2 = tail call i32 @LOG_UPTO(i32 %1)
%3 = tail call i32 @setlogmask(i32 %2)
%4 = load i32, i32* @LOG_CONS
%5 = load i32, i32* @LOG_PID
%6 = or i32 %5, %4
%7 = load i32, i32* @LOG_NDELAY
%8 = or i32 %6, %7
%9 = load i32, i32* @LOG_PERROR
%10 = or i32 %8, %9
%11 = load i32, i32* @LOG_DAEMON
%12 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* @LOG_ALERT
%14 = tail call i32 @syslog(i32 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}