#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*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void *x_void(void *err, void *res, char *str, char *file, int line) {
  if (res == err) {
    fprintf(stderr, "%s error (%s, %d): %s\n", str, file, line,
            strerror(errno));
    exit(1);
  }
  return (res);
}


x86 assembly (clang, -O0):
<x_void>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    11b2 <x_void+0x82>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%r8d
mov    %rax,%r9
lea    0xe5d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_void>:
cmp    %rdi,%rsi
je     1139 <x_void+0x9>
mov    %rsi,%rax
ret
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    0x2e90(%rip),%rax
mov    (%rax),%r15d
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe98(%rip),%rsi
mov    %r15d,%edi
mov    %rbp,%rdx
mov    %rbx,%rcx
mov    %r14d,%r8d
mov    %rax,%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"%s error (%s, %d): %s\0A\00"
@errno = global i32 0
define i8* @x_void(i8* readnone %0, i8* readnone returned %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i8* %1, %0
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = tail call i8* @strerror(i32 %9)
%11 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i32 %4, i8* %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %5
ret i8* %1
}