void die(const char *file, int line, const char *function, const char *message,
         int _errno) {
  if (_errno)
    error("%s:%d: %s: %s: %s", file, line, function, message, strerror(_errno));
  else
    error("%s:%d: %s: %s", file, line, function, message);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1190 <die+0x70>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x48(%rbp),%rsi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    %rax,%r9
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
jmp    11ad <die+0x8d>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
test   %r8d,%r8d
je     1165 <die+0x45>
mov    %r8d,%edi
call   1040 <strerror@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %r14,%r8
mov    %rax,%r9
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <error@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %r14,%r8
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s:%d: %s: %s: %s\00"
@.str.1 = [14 x i8] c"%s:%d: %s: %s\00"
define void @die(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
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
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = load i32, i32* %10
%19 = call i8* @strerror(i32 %18)
%20 = call i32 (i8*, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16, i8* %17, i8* %19)
br label %27
21: ; preds = %5
%22 = load i8*, i8** %6
%23 = load i32, i32* %7
%24 = load i8*, i8** %8
%25 = load i8*, i8** %9
%26 = call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %22, i32 %23, i8* %24, i8* %25)
br label %27
27: ; preds = %21, %13
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s:%d: %s: %s: %s\00"
@.str.1 = [14 x i8] c"%s:%d: %s: %s\00"
define void @die(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = tail call i8* @strerror(i32 %4)
%9 = tail call i32 (i8*, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3, i8* %8)
br label %12
10: ; preds = %5
%11 = tail call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3)
br label %12
12: ; preds = %10, %7
ret void
}