#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_ERR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
void handle_seg(int signal) {
  syslog(LOG_ERR,
         "Received signal %d,(segmentation fault). The program will die now. "
         "This could be because of a permission "
         "problem to write the pid file to /var/run, or something serious. "
         "Please check if you are "
         "running this program as a privileged user.",
         signal);
  printf("Received signal %d,(segmentation fault). The program will die now. "
         "This could be because of a permission "
         "problem to write the pid file to /var/run, or something serious. "
         "Please check if you are "
         "running this program as a privileged user.\n",
         signal);
  exit(1);
}


x86 assembly (clang, -O0):
<handle_seg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1040 <syslog@plt>
mov    -0x4(%rbp),%esi
lea    0xf90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handle_seg>:
push   %rbx
mov    %edi,%ebx
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    %ebx,%edx
call   1040 <syslog@plt>
lea    0xf9c(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [237 x i8] c"Received signal %d,(segmentation fault). The program will die now. This could be because of a permission problem to write the pid file to /var/run, or something serious. Please check if you are running this program as a privileged user.\00"
@.str.1 = [238 x i8] c"Received signal %d,(segmentation fault). The program will die now. This could be because of a permission problem to write the pid file to /var/run, or something serious. Please check if you are running this program as a privileged user.\0A\00"
define void @handle_seg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_ERR
%4 = load i32, i32* %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([237 x i8], [237 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [237 x i8] c"Received signal %d,(segmentation fault). The program will die now. This could be because of a permission problem to write the pid file to /var/run, or something serious. Please check if you are running this program as a privileged user.\00"
@.str.1 = [238 x i8] c"Received signal %d,(segmentation fault). The program will die now. This could be because of a permission problem to write the pid file to /var/run, or something serious. Please check if you are running this program as a privileged user.\0A\00"
define void @handle_seg(i32 %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([237 x i8], [237 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}