#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*/ printf(char *, unsigned char, unsigned char, ...);
void show_loadfru_error(unsigned char sa, unsigned char fruid, int ret) {
  if (ret == 0)
    return;
  switch (ret) {
  case 0x081:
    printf("\tFRU(%x,%x) device busy\n", sa, fruid);
    break;
  case 0x0C3:
    printf("\tFRU(%x,%x) timeout, not found\n", sa, fruid);
    break;
  case 0x0CB:
    printf("\tFRU(%x,%x) not present\n", sa, fruid);
    break;
  default:
    printf("load_fru(%x,%x) error = %d (0x%x)\n", sa, fruid, ret, ret);
    break;
  }
  return;
}


x86 assembly (clang, -O0):
<show_loadfru_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <show_loadfru_error+0x26>
jmp    11ef <show_loadfru_error+0xdf>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x81,%eax
je     1172 <show_loadfru_error+0x62>
jmp    114c <show_loadfru_error+0x3c>
mov    -0xc(%rbp),%eax
sub    $0xc3,%eax
je     118f <show_loadfru_error+0x7f>
jmp    115f <show_loadfru_error+0x4f>
mov    -0xc(%rbp),%eax
sub    $0xcb,%eax
je     11ac <show_loadfru_error+0x9c>
jmp    11c9 <show_loadfru_error+0xb9>
mov    -0x1(%rbp),%al
lea    0xe84(%rip),%rdi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ea <show_loadfru_error+0xda>
mov    -0x1(%rbp),%al
lea    0xe80(%rip),%rdi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ea <show_loadfru_error+0xda>
mov    -0x1(%rbp),%al
lea    0xe83(%rip),%rdi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ea <show_loadfru_error+0xda>
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%al
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xe75(%rip),%rdi
movzbl %dl,%esi
movzbl %al,%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ef <show_loadfru_error+0xdf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_loadfru_error>:
mov    %edx,%ecx
cmp    $0xc2,%edx
jg     1137 <show_loadfru_error+0x27>
test   %ecx,%ecx
je     1173 <show_loadfru_error+0x63>
cmp    $0x81,%ecx
jne    1158 <show_loadfru_error+0x48>
movzbl %dil,%eax
movzbl %sil,%edx
lea    0xecb(%rip),%rdi
jmp    1183 <show_loadfru_error+0x73>
cmp    $0xc3,%ecx
je     1174 <show_loadfru_error+0x64>
cmp    $0xcb,%ecx
jne    1158 <show_loadfru_error+0x48>
movzbl %dil,%eax
movzbl %sil,%edx
lea    0xee3(%rip),%rdi
jmp    1183 <show_loadfru_error+0x73>
movzbl %dil,%eax
movzbl %sil,%edx
lea    0xeeb(%rip),%rdi
mov    %eax,%esi
mov    %ecx,%r8d
xor    %eax,%eax
jmp    1030 <printf@plt>
ret
movzbl %dil,%eax
movzbl %sil,%edx
lea    0xe96(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\09FRU(%x,%x) device busy\0A\00"
@.str.1 = [32 x i8] c"\09FRU(%x,%x) timeout, not found\0A\00"
@.str.2 = [25 x i8] c"\09FRU(%x,%x) not present\0A\00"
@.str.3 = [35 x i8] c"load_fru(%x,%x) error = %d (0x%x)\0A\00"
define void @show_loadfru_error(i8 zeroext %0, i8 zeroext %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 eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %31
10: ; preds = %3
%11 = load i32, i32* %6
switch i32 %11, label %24 [
i32 129, label %12
i32 195, label %16
i32 203, label %20
]
12: ; preds = %10
%13 = load i8, i8* %4
%14 = load i8, i8* %5
%15 = call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %13, i8 zeroext %14)
br label %30
16: ; preds = %10
%17 = load i8, i8* %4
%18 = load i8, i8* %5
%19 = call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %17, i8 zeroext %18)
br label %30
20: ; preds = %10
%21 = load i8, i8* %4
%22 = load i8, i8* %5
%23 = call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %21, i8 zeroext %22)
br label %30
24: ; preds = %10
%25 = load i8, i8* %4
%26 = load i8, i8* %5
%27 = load i32, i32* %6
%28 = load i32, i32* %6
%29 = call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8 zeroext %25, i8 zeroext %26, i32 %27, i32 %28)
br label %30
30: ; preds = %24, %20, %16, %12
br label %31
31: ; preds = %30, %9
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\09FRU(%x,%x) device busy\0A\00"
@.str.1 = [32 x i8] c"\09FRU(%x,%x) timeout, not found\0A\00"
@.str.2 = [25 x i8] c"\09FRU(%x,%x) not present\0A\00"
@.str.3 = [35 x i8] c"load_fru(%x,%x) error = %d (0x%x)\0A\00"
define void @show_loadfru_error(i8 zeroext %0, i8 zeroext %1, i32 %2) {
switch i32 %2, label %10 [
i32 0, label %12
i32 129, label %4
i32 195, label %6
i32 203, label %8
]
4: ; preds = %3
%5 = tail call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %0, i8 zeroext %1)
br label %12
6: ; preds = %3
%7 = tail call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %0, i8 zeroext %1)
br label %12
8: ; preds = %3
%9 = tail call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %0, i8 zeroext %1)
br label %12
10: ; preds = %3
%11 = tail call i32 (i8*, i8, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %2)
br label %12
12: ; preds = %3, %4, %6, %8, %10
ret void
}