#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 dxl_get_rxpacket_error(int);
int /*<<< orphan*/ printf(char *);
void PrintErrorCode(void) {
  if (dxl_get_rxpacket_error((1)) == 1)
    printf("Input voltage error!\n");
  if (dxl_get_rxpacket_error((2)) == 1)
    printf("Angle limit error!\n");
  if (dxl_get_rxpacket_error((4)) == 1)
    printf("Overheat error!\n");
  if (dxl_get_rxpacket_error((8)) == 1)
    printf("Out of range error!\n");
  if (dxl_get_rxpacket_error((16)) == 1)
    printf("Checksum error!\n");
  if (dxl_get_rxpacket_error((32)) == 1)
    printf("Overload error!\n");
  if (dxl_get_rxpacket_error((64)) == 1)
    printf("Instruction code error!\n");
}


x86 assembly (clang, -O0):
<PrintErrorCode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1143 <PrintErrorCode+0x23>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1162 <PrintErrorCode+0x42>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1181 <PrintErrorCode+0x61>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11a0 <PrintErrorCode+0x80>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x10,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11bf <PrintErrorCode+0x9f>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x20,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11de <PrintErrorCode+0xbe>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    $0x40,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11fd <PrintErrorCode+0xdd>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintErrorCode>:
push   %rax
mov    $0x1,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    113c <PrintErrorCode+0x1c>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1157 <PrintErrorCode+0x37>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1172 <PrintErrorCode+0x52>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    118d <PrintErrorCode+0x6d>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x10,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11a8 <PrintErrorCode+0x88>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
mov    $0x20,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11c3 <PrintErrorCode+0xa3>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x40,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11df <PrintErrorCode+0xbf>
lea    0xe27(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Input voltage error!\0A\00"
@.str.1 = [20 x i8] c"Angle limit error!\0A\00"
@.str.2 = [17 x i8] c"Overheat error!\0A\00"
@.str.3 = [21 x i8] c"Out of range error!\0A\00"
@.str.4 = [17 x i8] c"Checksum error!\0A\00"
@.str.5 = [17 x i8] c"Overload error!\0A\00"
@.str.6 = [25 x i8] c"Instruction code error!\0A\00"
define void @PrintErrorCode() {
%1 = call i32 @dxl_get_rxpacket_error(i32 1)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = call i32 @dxl_get_rxpacket_error(i32 2)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i32 @dxl_get_rxpacket_error(i32 4)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = call i32 @dxl_get_rxpacket_error(i32 8)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = call i32 @dxl_get_rxpacket_error(i32 16)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = call i32 @dxl_get_rxpacket_error(i32 32)
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
%31 = call i32 @dxl_get_rxpacket_error(i32 64)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Instruction code error!\00"
@str.7 = [16 x i8] c"Overload error!\00"
@str.8 = [16 x i8] c"Checksum error!\00"
@str.9 = [20 x i8] c"Out of range error!\00"
@str.10 = [16 x i8] c"Overheat error!\00"
@str.11 = [19 x i8] c"Angle limit error!\00"
@str.12 = [21 x i8] c"Input voltage error!\00"
define void @PrintErrorCode() {
%1 = tail call i32 @dxl_get_rxpacket_error(i32 1)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @dxl_get_rxpacket_error(i32 2)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i32 @dxl_get_rxpacket_error(i32 4)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.10, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = tail call i32 @dxl_get_rxpacket_error(i32 8)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = tail call i32 @dxl_get_rxpacket_error(i32 16)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.8, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = tail call i32 @dxl_get_rxpacket_error(i32 32)
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
%31 = tail call i32 @dxl_get_rxpacket_error(i32 64)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
ret void
}