#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*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void _pfatal(const char *f, int l, const char *desc) {
  const char *err;
  err = strerror(errno);
  if (f)
    fprintf(stderr, "%s:%i in ", f, l);
  fprintf(stderr, "%s(): %s\n", desc, err);
  fflush(stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<_pfatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118e <_pfatal+0x4e>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<_pfatal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbp
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rbx
test   %rbp,%rbp
je     1183 <_pfatal+0x43>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e56(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe76(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
call   1040 <fflush@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [10 x i8] c"%s:%i in \00"
@.str.1 = [10 x i8] c"%s(): %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @_pfatal(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15)
br label %17
17: ; preds = %12, %3
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %6
%20 = load i8*, i8** %7
%21 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i32, i32* @stderr
%23 = call i32 @fflush(i32 %22)
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [10 x i8] c"%s:%i in \00"
@.str.1 = [10 x i8] c"%s(): %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @_pfatal(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = icmp eq i8* %0, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %10
10: ; preds = %7, %3
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %5)
%13 = load i32, i32* @stderr
%14 = tail call i32 @fflush(i32 %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = tail call i32 @exit(i32 %15)
unreachable
}