#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 */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void vlocerrorexit(const char *filename, unsigned int linenum,
                   const char *format, va_list ap) {
  if (filename)
    fprintf(stderr, linenum ? "%s: %i: " : "%s: ", filename, linenum);
  vfprintf(stderr, format, ap);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<vlocerrorexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118e <vlocerrorexit+0x4e>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%ecx
lea    0xe95(%rip),%rsi
lea    0xe85(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1040 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <vfprintf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<vlocerrorexit>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
test   %rdi,%rdi
je     1176 <vlocerrorexit+0x36>
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
test   %esi,%esi
lea    0xea3(%rip),%rax
lea    0xe93(%rip),%rsi
cmove  %rax,%rsi
call   1040 <fprintf@plt>
mov    0x2e63(%rip),%rbp
mov    0x0(%rbp),%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <vfprintf@plt>
mov    0x0(%rbp),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

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