#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_DAEMON;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ LOG_UPTO(int /*<<< orphan*/);
int /*<<< orphan*/ LOG_WARNING;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ unlink(char *);
void SyslogMsgExit(char *msg1, char *msg2) {
  openlog("SSTL_d", LOG_PID, LOG_DAEMON);
  setlogmask(LOG_UPTO(LOG_WARNING));
  syslog(LOG_ERR, msg1, msg2);
  closelog();
  unlink("/tmp/SSTL_d_pid");
  exit(1);
}


x86 assembly (clang, -O0):
<SyslogMsgExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e49(%rip),%rax
mov    (%rax),%esi
mov    0x2e58(%rip),%rax
mov    (%rax),%edx
lea    0xe67(%rip),%rdi
call   1080 <openlog@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
call   1050 <LOG_UPTO@plt>
mov    %eax,%edi
call   1060 <setlogmask@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1070 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
lea    0xe30(%rip),%rdi
call   1040 <unlink@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<SyslogMsgExit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e4f(%rip),%rax
mov    (%rax),%esi
mov    0x2e5e(%rip),%rax
mov    (%rax),%edx
lea    0xe6d(%rip),%rdi
call   1080 <openlog@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1050 <LOG_UPTO@plt>
mov    %eax,%edi
call   1060 <setlogmask@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1070 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
lea    0xe38(%rip),%rdi
call   1040 <unlink@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SSTL_d\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@LOG_WARNING = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [16 x i8] c"/tmp/SSTL_d_pid\00"
define void @SyslogMsgExit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @LOG_PID
%6 = load i32, i32* @LOG_DAEMON
%7 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* @LOG_WARNING
%9 = call i32 @LOG_UPTO(i32 %8)
%10 = call i32 @setlogmask(i32 %9)
%11 = load i32, i32* @LOG_ERR
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @syslog(i32 %11, i8* %12, i8* %13)
%15 = call i32 (...) @closelog()
%16 = call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"SSTL_d\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@LOG_WARNING = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [16 x i8] c"/tmp/SSTL_d_pid\00"
define void @SyslogMsgExit(i8* %0, i8* %1) {
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_DAEMON
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_WARNING
%7 = tail call i32 @LOG_UPTO(i32 %6)
%8 = tail call i32 @setlogmask(i32 %7)
%9 = load i32, i32* @LOG_ERR
%10 = tail call i32 @syslog(i32 %9, i8* %0, i8* %1)
%11 = tail call i32 (...) @closelog()
%12 = tail call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
}