#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 *, char const *,
                           char *, char const *);
int /*<<< orphan*/ stderr;
int _error(char const *error1, char const *error2, int ret) {
  fprintf(stderr, "%s: %s%s%s\n", "ldd", error1, (error2 != NULL) ? ": " : "",
          (error2 != NULL) ? error2 : "");
  return ret;
}


x86 assembly (clang, -O0):
<_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xec9(%rip),%rax
lea    0xec7(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <_error+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    117d <_error+0x6d>
lea    0xe97(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    117d <_error+0x6d>
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%edi
mov    -0x38(%rbp),%r9
lea    0xe6d(%rip),%rsi
lea    0xe72(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_error>:
push   %rbx
mov    %edx,%ebx
mov    %rdi,%rcx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
test   %rsi,%rsi
lea    0xee2(%rip),%r9
lea    0xee0(%rip),%r8
cmove  %r9,%r8
cmovne %rsi,%r9
lea    0xec1(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"%s: %s%s%s\0A\00"
@.str.1 = [4 x i8] c"ldd\00"
@.str.2 = [3 x i8] c": \00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @_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* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0)
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i8*, i8** %5
br label %18
17: ; preds = %3
br label %18
18: ; preds = %17, %15
%19 = phi i8* [ %16, %15 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %17 ]
%20 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %12, i8* %19)
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"%s: %s%s%s\0A\00"
@.str.1 = [4 x i8] c"ldd\00"
@.str.2 = [3 x i8] c": \00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @_error(i8* %0, i8* %1, i32 returned %2) {
%4 = load i32, i32* @stderr
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* %1
%8 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %6, i8* %7)
ret i32 %2
}