#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 */
typedef int uint8_t;

/* Variables and functions */
char *zigbee_get_indicationError(uint8_t indicationStatus) {
  char *errorString;
  errorString = "uknown error";
  switch (indicationStatus) {
  case 0x21:
    errorString = "scan found no PANs";
    break;
  case 0x22:
    errorString =
        "scan found no valid PANs based on current SC and ID settings";
    break;
  case 0x23:
    errorString = "valid coordinator found, but NJ joining time expired";
    break;
  case 0x24:
    errorString = "no joinable beacons were found";
    break;
  case 0x25:
    errorString =
        "Unexpected state, node should not be attempting to join at this time";
    break;
  case 0x27:
    errorString = "Node Joining attempt failed (typically due to incompatible "
                  "security settings)";
    break;
  case 0x2A:
    errorString = "Coordinator Start attempt failed";
    break;
  case 0x2B:
    errorString = "Checking for an existing coordinator";
    break;
  case 0x2C:
    errorString = "Attempt to leave the network failed";
    break;
  case 0xAB:
    errorString = "Attempted to join a device that did not respond.";
    break;
  case 0xAC:
    errorString = "Secure join error - network security key received unsecured";
    break;
  case 0xAD:
    errorString = "Secure join error - network security key not received";
    break;
  case 0xAF:
    errorString = "Secure join error - joining device does not have the right "
                  "preconfigured link key";
    break;
  default:
    errorString = "uknown error";
    break;
  }
  return errorString;
}


x86 assembly (clang, -O0):
<zigbee_get_indicationError>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x21,%eax
je     11fa <zigbee_get_indicationError+0xfa>
jmp    1126 <zigbee_get_indicationError+0x26>
mov    -0x14(%rbp),%eax
sub    $0x22,%eax
je     120a <zigbee_get_indicationError+0x10a>
jmp    1137 <zigbee_get_indicationError+0x37>
mov    -0x14(%rbp),%eax
sub    $0x23,%eax
je     121a <zigbee_get_indicationError+0x11a>
jmp    1148 <zigbee_get_indicationError+0x48>
mov    -0x14(%rbp),%eax
sub    $0x24,%eax
je     122a <zigbee_get_indicationError+0x12a>
jmp    1159 <zigbee_get_indicationError+0x59>
mov    -0x14(%rbp),%eax
sub    $0x25,%eax
je     123a <zigbee_get_indicationError+0x13a>
jmp    116a <zigbee_get_indicationError+0x6a>
mov    -0x14(%rbp),%eax
sub    $0x27,%eax
je     124a <zigbee_get_indicationError+0x14a>
jmp    117b <zigbee_get_indicationError+0x7b>
mov    -0x14(%rbp),%eax
sub    $0x2a,%eax
je     125a <zigbee_get_indicationError+0x15a>
jmp    118c <zigbee_get_indicationError+0x8c>
mov    -0x14(%rbp),%eax
sub    $0x2b,%eax
je     126a <zigbee_get_indicationError+0x16a>
jmp    119d <zigbee_get_indicationError+0x9d>
mov    -0x14(%rbp),%eax
sub    $0x2c,%eax
je     127a <zigbee_get_indicationError+0x17a>
jmp    11ae <zigbee_get_indicationError+0xae>
mov    -0x14(%rbp),%eax
sub    $0xab,%eax
je     128a <zigbee_get_indicationError+0x18a>
jmp    11c1 <zigbee_get_indicationError+0xc1>
mov    -0x14(%rbp),%eax
sub    $0xac,%eax
je     129a <zigbee_get_indicationError+0x19a>
jmp    11d4 <zigbee_get_indicationError+0xd4>
mov    -0x14(%rbp),%eax
sub    $0xad,%eax
je     12aa <zigbee_get_indicationError+0x1aa>
jmp    11e7 <zigbee_get_indicationError+0xe7>
mov    -0x14(%rbp),%eax
sub    $0xaf,%eax
je     12ba <zigbee_get_indicationError+0x1ba>
jmp    12ca <zigbee_get_indicationError+0x1ca>
lea    0xe0c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xe0f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xe3c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xe61(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xe70(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xea5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xee3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xef4(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xf09(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xf1d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xf3e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xf6a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xf90(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12d5 <zigbee_get_indicationError+0x1d5>
lea    0xd2f(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigbee_get_indicationError>:
lea    -0x21(%rdi),%ecx
cmp    $0xb,%ecx
ja     1127 <zigbee_get_indicationError+0x27>
lea    0xf42(%rip),%rax
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf3e(%rip),%rax
ret
add    $0xffffff55,%edi
cmp    $0x4,%edi
ja     1192 <zigbee_get_indicationError+0x92>
lea    0xef7(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0x10a9(%rip),%rax
ret
lea    0xf50(%rip),%rax
ret
lea    0xf7d(%rip),%rax
ret
lea    0xf94(%rip),%rax
ret
lea    0xfd1(%rip),%rax
ret
lea    0x1017(%rip),%rax
ret
lea    0x1030(%rip),%rax
ret
lea    0x104d(%rip),%rax
ret
lea    0x109a(%rip),%rax
ret
lea    0x10ce(%rip),%rax
ret
lea    0xeab(%rip),%rax
ret
lea    0x10f4(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"uknown error\00"
@.str.1 = [19 x i8] c"scan found no PANs\00"
@.str.2 = [61 x i8] c"scan found no valid PANs based on current SC and ID settings\00"
@.str.3 = [53 x i8] c"valid coordinator found, but NJ joining time expired\00"
@.str.4 = [31 x i8] c"no joinable beacons were found\00"
@.str.5 = [69 x i8] c"Unexpected state, node should not be attempting to join at this time\00"
@.str.6 = [78 x i8] c"Node Joining attempt failed (typically due to incompatible security settings)\00"
@.str.7 = [33 x i8] c"Coordinator Start attempt failed\00"
@.str.8 = [37 x i8] c"Checking for an existing coordinator\00"
@.str.9 = [36 x i8] c"Attempt to leave the network failed\00"
@.str.10 = [49 x i8] c"Attempted to join a device that did not respond.\00"
@.str.11 = [60 x i8] c"Secure join error - network security key received unsecured\00"
@.str.12 = [54 x i8] c"Secure join error - network security key not received\00"
@.str.13 = [82 x i8] c"Secure join error - joining device does not have the right preconfigured link key\00"
define i8* @zigbee_get_indicationError(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
switch i32 %4, label %18 [
i32 33, label %5
i32 34, label %6
i32 35, label %7
i32 36, label %8
i32 37, label %9
i32 39, label %10
i32 42, label %11
i32 43, label %12
i32 44, label %13
i32 171, label %14
i32 172, label %15
i32 173, label %16
i32 175, label %17
]
5: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %19
6: ; preds = %1
store i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %19
7: ; preds = %1
store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %19
8: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %19
9: ; preds = %1
store i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %19
10: ; preds = %1
store i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %19
11: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %19
12: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %19
13: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %19
14: ; preds = %1
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %19
15: ; preds = %1
store i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %19
16: ; preds = %1
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %19
17: ; preds = %1
store i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %19
18: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %3
br label %19
19: ; preds = %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"uknown error\00"
@.str.1 = [19 x i8] c"scan found no PANs\00"
@.str.2 = [61 x i8] c"scan found no valid PANs based on current SC and ID settings\00"
@.str.3 = [53 x i8] c"valid coordinator found, but NJ joining time expired\00"
@.str.4 = [31 x i8] c"no joinable beacons were found\00"
@.str.5 = [69 x i8] c"Unexpected state, node should not be attempting to join at this time\00"
@.str.6 = [78 x i8] c"Node Joining attempt failed (typically due to incompatible security settings)\00"
@.str.7 = [33 x i8] c"Coordinator Start attempt failed\00"
@.str.8 = [37 x i8] c"Checking for an existing coordinator\00"
@.str.9 = [36 x i8] c"Attempt to leave the network failed\00"
@.str.10 = [49 x i8] c"Attempted to join a device that did not respond.\00"
@.str.11 = [60 x i8] c"Secure join error - network security key received unsecured\00"
@.str.12 = [54 x i8] c"Secure join error - network security key not received\00"
@.str.13 = [82 x i8] c"Secure join error - joining device does not have the right preconfigured link key\00"
define i8* @zigbee_get_indicationError(i32 %0) {
switch i32 %0, label %14 [
i32 33, label %15
i32 34, label %2
i32 35, label %3
i32 36, label %4
i32 37, label %5
i32 39, label %6
i32 42, label %7
i32 43, label %8
i32 44, label %9
i32 171, label %10
i32 172, label %11
i32 173, label %12
i32 175, label %13
]
2: ; preds = %1
br label %15
3: ; preds = %1
br label %15
4: ; preds = %1
br label %15
5: ; preds = %1
br label %15
6: ; preds = %1
br label %15
7: ; preds = %1
br label %15
8: ; preds = %1
br label %15
9: ; preds = %1
br label %15
10: ; preds = %1
br label %15
11: ; preds = %1
br label %15
12: ; preds = %1
br label %15
13: ; preds = %1
br label %15
14: ; preds = %1
br label %15
15: ; preds = %1, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%16 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %14 ], [ getelementptr inbounds ([82 x i8], [82 x i8]* @.str.13, i64 0, i64 0), %13 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0), %12 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @.str.11, i64 0, i64 0), %11 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), %10 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), %9 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), %8 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), %7 ], [ getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0), %6 ], [ getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0), %5 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), %4 ], [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), %3 ], [ getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %1 ]
ret i8* %16
}