#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 */
struct utsname {
  char *sysname;
  char *release;
  char *machine;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ uname(struct utsname *);
void err_quit(char *str, int status, char *version, char *file, int line) {
  struct utsname sname;
  fflush(NULL);
  uname(&sname);
  fprintf(stderr, "************************************************\n"
                  "An error occured, please email David Lawrence \n"
                  "at nogoodpunk@yahoo.com with a copy of the error\n"
                  "messages & info about your system. Thankyou.\n"
                  "************************************************\n");
  fprintf(stderr, " VERSION: %s\n", version);
  fprintf(stderr,
          " OS:      %9s\n"
          " Release: %9s\n"
          " Arch:    %9s\n",
          sname.sysname, sname.release, sname.machine);
  fprintf(stderr,
          " Error: %s (%d)\n"
          " Exit called in %s, line: %d\n",
          str, status, file, line);
  exit(status);
}


x86 assembly (clang, -O0):
<err_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
lea    -0x40(%rbp),%rdi
call   1030 <uname@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xf58(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xf43(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
lea    0xf48(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<err_quit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %esi,%r13d
mov    %rdi,%r12
xor    %edi,%edi
call   1050 <fflush@plt>
mov    %rsp,%rdi
call   1030 <uname@plt>
mov    0x2e6d(%rip),%rbx
mov    (%rbx),%edi
lea    0xe84(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf64(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    (%rsp),%rdx
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%r8
lea    0xf51(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf6c(%rip),%rsi
mov    %r12,%rdx
mov    %r13d,%ecx
mov    %r15,%r8
mov    %r14d,%r9d
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r13d,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8* }
@stderr = global i32 0
@.str = [240 x i8] c"************************************************\0AAn error occured, please email David Lawrence \0Aat nogoodpunk@yahoo.com with a copy of the error\0Amessages & info about your system. Thankyou.\0A************************************************\0A\00"
@.str.1 = [14 x i8] c" VERSION: %s\0A\00"
@.str.2 = [43 x i8] c" OS: %9s\0A Release: %9s\0A Arch: %9s\0A\00"
@.str.3 = [46 x i8] c" Error: %s (%d)\0A Exit called in %s, line: %d\0A\00"
define void @err_quit(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca %struct.utsname
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = call i32 @fflush(i32* null)
%13 = call i32 @uname(%struct.utsname* %11)
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %8
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @stderr
%20 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i32 0, i32 0
%21 = load i8*, i8** %20
%22 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i32 0, i32 1
%23 = load i8*, i8** %22
%24 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i32 0, i32 2
%25 = load i8*, i8** %24
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %21, i8* %23, i8* %25)
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %6
%29 = load i32, i32* %7
%30 = load i8*, i8** %9
%31 = load i32, i32* %10
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* %28, i32 %29, i8* %30, i32 %31)
%33 = load i32, i32* %7
%34 = call i32 @exit(i32 %33)
unreachable
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8* }
@stderr = global i32 0
@.str = [240 x i8] c"************************************************\0AAn error occured, please email David Lawrence \0Aat nogoodpunk@yahoo.com with a copy of the error\0Amessages & info about your system. Thankyou.\0A************************************************\0A\00"
@.str.1 = [14 x i8] c" VERSION: %s\0A\00"
@.str.2 = [43 x i8] c" OS: %9s\0A Release: %9s\0A Arch: %9s\0A\00"
@.str.3 = [46 x i8] c" Error: %s (%d)\0A Exit called in %s, line: %d\0A\00"
define void @err_quit(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca %struct.utsname
%7 = bitcast %struct.utsname* %6 to i8*
%8 = tail call i32 @fflush(i32* null)
%9 = call i32 @uname(%struct.utsname* %6)
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%14 = load i32, i32* @stderr
%15 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i64 0, i32 0
%16 = load i8*, i8** %15
%17 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i64 0, i32 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i64 0, i32 2
%20 = load i8*, i8** %19
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %16, i8* %18, i8* %20)
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* %0, i32 %1, i8* %3, i32 %4)
%24 = tail call i32 @exit(i32 %1)
unreachable
}