#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 errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void dv_error(const char *message) {
  fputs("Fatal Error: ", stderr);
  if (errno) {
    perror(message);
    exit(errno);
  } else {
    fputs(message, stderr);
    fputc('\n', stderr);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<dv_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xea4(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e70(%rip),%rax
cmpl   $0x0,(%rax)
je     1188 <dv_error+0x48>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e4d(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<dv_error>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2e91(%rip),%r14
mov    (%r14),%esi
lea    0xea7(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e73(%rip),%r15
cmpl   $0x0,(%r15)
jne    118d <dv_error+0x4d>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    (%r15),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Fatal Error: \00"
@stderr = global i32 0
@errno = global i32 0
define void @dv_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @errno
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @perror(i8* %8)
%10 = load i32, i32* @errno
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i32, i32* @stderr
%15 = call i32 @fputs(i8* %13, i32 %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fputc(i8 signext 10, i32 %16)
%18 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Fatal Error: \00"
@stderr = global i32 0
@errno = global i32 0
define void @dv_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @errno
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32 @perror(i8* %0)
%8 = load i32, i32* @errno
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = tail call i32 @fputs(i8* %0, i32 %11)
%13 = load i32, i32* @stderr
%14 = tail call i32 @fputc(i8 signext 10, i32 %13)
%15 = tail call i32 @exit(i32 1)
unreachable
}