#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*/ abs(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void processLibRc(int rc) {
  if (!rc) {
    fprintf(stderr, "rc=0 AOK...\n");
  } else {
    fprintf(stderr, "***RtnCode: %d=>%s\n", rc, strerror(abs(rc)));
  }
  return;
}


x86 assembly (clang, -O0):
<processLibRc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1161 <processLibRc+0x31>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1199 <processLibRc+0x69>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    %rax,%rcx
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processLibRc>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eb6(%rip),%rax
mov    (%rax),%ebp
test   %edi,%edi
je     1157 <processLibRc+0x37>
mov    %edi,%ebx
neg    %edi
cmovs  %ebx,%edi
call   1040 <strerror@plt>
lea    0xeca(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %rax,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>
lea    0xea2(%rip),%rsi
mov    %ebp,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

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

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