#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*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int);
void print_error(const char *prefix, const char *message, int err) {
  if (err)
    fprintf(stderr, "uradvd: %s: %s: %s\n", prefix, message, strerror(err));
  else
    fprintf(stderr, "uradvd: %s: %s\n", prefix, message);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1182 <print_error+0x62>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    %rax,%r8
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11a1 <print_error+0x81>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ebp
test   %edx,%edx
je     115b <print_error+0x3b>
mov    %edx,%edi
call   1040 <strerror@plt>
lea    0xebb(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %rax,%r8
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>
lea    0xeb2(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

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

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