#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_ERR;
int LOG_INFO;
int /*<<< orphan*/ LOG_UPTO(int);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int, char *, ...);
void validator_service(void) {
  setlogmask(LOG_UPTO(LOG_INFO | LOG_ERR));
  syslog(LOG_INFO, "Starting Validator Service... pid:[%d]", getpid());
  syslog(LOG_INFO, "[Validator Service]: Started...");
}


x86 assembly (clang, -O0):
<validator_service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    0x2e78(%rip),%rax
or     (%rax),%edi
call   1040 <LOG_UPTO@plt>
mov    %eax,%edi
call   1050 <setlogmask@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1060 <syslog@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1060 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validator_service>:
push   %r14
push   %rbx
push   %rax
mov    0x2e95(%rip),%r14
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
or     (%r14),%edi
call   1040 <LOG_UPTO@plt>
mov    %eax,%edi
call   1050 <setlogmask@plt>
mov    (%r14),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe8c(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <syslog@plt>
mov    (%r14),%edi
lea    0xe9e(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <syslog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@LOG_ERR = global i32 0
@.str = [39 x i8] c"Starting Validator Service... pid:[%d]\00"
@.str.1 = [32 x i8] c"[Validator Service]: Started...\00"
define void @validator_service() {
%1 = load i32, i32* @LOG_INFO
%2 = load i32, i32* @LOG_ERR
%3 = or i32 %1, %2
%4 = call i32 @LOG_UPTO(i32 %3)
%5 = call i32 @setlogmask(i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = call i32 (...) @getpid()
%8 = call i32 (i32, i8*, ...) @syslog(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @LOG_INFO
%10 = call i32 (i32, i8*, ...) @syslog(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@LOG_ERR = global i32 0
@.str = [39 x i8] c"Starting Validator Service... pid:[%d]\00"
@.str.1 = [32 x i8] c"[Validator Service]: Started...\00"
define void @validator_service() {
%1 = load i32, i32* @LOG_INFO
%2 = load i32, i32* @LOG_ERR
%3 = or i32 %2, %1
%4 = tail call i32 @LOG_UPTO(i32 %3)
%5 = tail call i32 @setlogmask(i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 (i32, i8*, ...) @syslog(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @LOG_INFO
%10 = tail call i32 (i32, i8*, ...) @syslog(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}