#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
__attribute__((format(printf, 1, 0))) void
vreportf(const char *err, va_list params, int errnum) {
  fprintf(stderr, "bash.preinst: ");
  vfprintf(stderr, err, params);
  if (errnum)
    fprintf(stderr, ": %s", strerror(errnum));
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<vreportf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
cmpl   $0x0,-0x10(%rbp)
je     11a0 <vreportf+0x70>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vreportf>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    0x2e9a(%rip),%r15
mov    (%r15),%edi
lea    0xeb0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1040 <vfprintf@plt>
test   %ebx,%ebx
je     1186 <vreportf+0x56>
mov    (%r15),%ebp
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xe84(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

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

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