#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(0x7f)) {
    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    $0x7f,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x0,%eax
je     1215 <PrintErrorCode+0xf5>
mov    $0x1,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1156 <PrintErrorCode+0x36>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1175 <PrintErrorCode+0x55>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1194 <PrintErrorCode+0x74>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11b3 <PrintErrorCode+0x93>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x10,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11d2 <PrintErrorCode+0xb2>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    $0x20,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11f1 <PrintErrorCode+0xd1>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    $0x40,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1210 <PrintErrorCode+0xf0>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    1215 <PrintErrorCode+0xf5>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintErrorCode>:
push   %rax
mov    $0x7f,%edi
call   1040 <dxl_get_rxpacket_error@plt>
test   %eax,%eax
je     11f1 <PrintErrorCode+0xd1>
mov    $0x1,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    114e <PrintErrorCode+0x2e>
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1169 <PrintErrorCode+0x49>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    1184 <PrintErrorCode+0x64>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    119f <PrintErrorCode+0x7f>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x10,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11ba <PrintErrorCode+0x9a>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
mov    $0x20,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11d5 <PrintErrorCode+0xb5>
lea    0xe48(%rip),%rdi
call   1030 <puts@plt>
mov    $0x40,%edi
call   1040 <dxl_get_rxpacket_error@plt>
cmp    $0x1,%eax
jne    11f1 <PrintErrorCode+0xd1>
lea    0xe15(%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 127)
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %39
3: ; preds = %0
%4 = call i32 @dxl_get_rxpacket_error(i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = call i32 @dxl_get_rxpacket_error(i32 2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = call i32 @dxl_get_rxpacket_error(i32 4)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = call i32 @dxl_get_rxpacket_error(i32 8)
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = call i32 @dxl_get_rxpacket_error(i32 16)
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = call i32 @dxl_get_rxpacket_error(i32 32)
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = call i32 @dxl_get_rxpacket_error(i32 64)
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %38
38: ; preds = %36, %33
br label %39
39: ; preds = %38, %0
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 127)
%2 = icmp eq i32 %1, 0
br i1 %2, label %38, label %3
3: ; preds = %0
%4 = tail call i32 @dxl_get_rxpacket_error(i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @dxl_get_rxpacket_error(i32 2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = tail call i32 @dxl_get_rxpacket_error(i32 4)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.10, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = tail call i32 @dxl_get_rxpacket_error(i32 8)
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = tail call i32 @dxl_get_rxpacket_error(i32 16)
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.8, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = tail call i32 @dxl_get_rxpacket_error(i32 32)
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = tail call i32 @dxl_get_rxpacket_error(i32 64)
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %38
38: ; preds = %33, %36, %0
ret void
}