#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 */
char *iotErrorStringRaw(int err) {
  switch (err) {
  case 0:
    return ("No error");
    break;
  case 4:
    return ("Authorize timeout");
    break;
  case 5:
    return ("Authorize response");
    break;
  case 6:
    return ("No TLS received");
    break;
  case 11:
    return ("No MAC");
    break;
  case 12:
    return ("Non-existing MAC");
    break;
  case 13:
    return ("No tunnel MAC");
    break;
  case 14:
    return ("Already existing MAC");
    break;
  case 20:
    return ("Device has no get");
    break;
  case 21:
    return ("Device has no controls");
    break;
  case 22:
    return ("Device missing");
    break;
  case 30:
    return ("Topo - illegal command");
    break;
  case 31:
    return ("Topo - missing name");
    break;
  case 32:
    return ("Topo - timeout");
    break;
  case 33:
    return ("Topo - not accepted");
    break;
  case 34:
    return ("Topo - overrun");
    break;
  case 60:
    return ("Queue - create");
    break;
  case 61:
    return ("Queue - open");
    break;
  case 62:
    return ("Queue - read");
    break;
  case 63:
    return ("Queue - write");
    break;
  case 66:
    return ("Queue - bufsize");
    break;
  case 67:
    return ("Queue - overrun");
    break;
  case 70:
    return ("Socket - open");
    break;
  case 71:
    return ("Socket - read");
    break;
  case 72:
    return ("Socket - write");
    break;
  case 80:
    return ("DB-open error");
    break;
  default:
    return ("Unknown IoT error");
    break;
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<iotErrorStringRaw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x50,%rax
ja     12cc <iotErrorStringRaw+0x1cc>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1011(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x100a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x100c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x100f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x100f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1006(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1007(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1005(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x100a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x100c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1013(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1012(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1019(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x101d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x101c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1020(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x101f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x101e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x101b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1018(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1016(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1016(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1016(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1014(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1012(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x1011(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12d7 <iotErrorStringRaw+0x1d7>
lea    0x100f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iotErrorStringRaw>:
cmp    $0x50,%edi
ja     1126 <iotErrorStringRaw+0x26>
lea    0x1038(%rip),%rax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0x1028(%rip),%rax
ret
lea    0x11b5(%rip),%rax
ret
lea    0x102a(%rip),%rax
ret
lea    0x1035(%rip),%rax
ret
lea    0x103d(%rip),%rax
ret
lea    0x103c(%rip),%rax
ret
lea    0x1045(%rip),%rax
ret
lea    0x104b(%rip),%rax
ret
lea    0x1058(%rip),%rax
ret
lea    0x1062(%rip),%rax
ret
lea    0x1071(%rip),%rax
ret
lea    0x1078(%rip),%rax
ret
lea    0x1087(%rip),%rax
ret
lea    0x1093(%rip),%rax
ret
lea    0x109a(%rip),%rax
ret
lea    0x10a6(%rip),%rax
ret
lea    0x10ad(%rip),%rax
ret
lea    0x10b4(%rip),%rax
ret
lea    0x10b9(%rip),%rax
ret
lea    0x10be(%rip),%rax
ret
lea    0x10c4(%rip),%rax
ret
lea    0x10cc(%rip),%rax
ret
lea    0x10d4(%rip),%rax
ret
lea    0x10da(%rip),%rax
ret
lea    0x10e0(%rip),%rax
ret
lea    0x10e7(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"No error\00"
@.str.1 = [18 x i8] c"Authorize timeout\00"
@.str.2 = [19 x i8] c"Authorize response\00"
@.str.3 = [16 x i8] c"No TLS received\00"
@.str.4 = [7 x i8] c"No MAC\00"
@.str.5 = [17 x i8] c"Non-existing MAC\00"
@.str.6 = [14 x i8] c"No tunnel MAC\00"
@.str.7 = [21 x i8] c"Already existing MAC\00"
@.str.8 = [18 x i8] c"Device has no get\00"
@.str.9 = [23 x i8] c"Device has no controls\00"
@.str.10 = [15 x i8] c"Device missing\00"
@.str.11 = [23 x i8] c"Topo - illegal command\00"
@.str.12 = [20 x i8] c"Topo - missing name\00"
@.str.13 = [15 x i8] c"Topo - timeout\00"
@.str.14 = [20 x i8] c"Topo - not accepted\00"
@.str.15 = [15 x i8] c"Topo - overrun\00"
@.str.16 = [15 x i8] c"Queue - create\00"
@.str.17 = [13 x i8] c"Queue - open\00"
@.str.18 = [13 x i8] c"Queue - read\00"
@.str.19 = [14 x i8] c"Queue - write\00"
@.str.20 = [16 x i8] c"Queue - bufsize\00"
@.str.21 = [16 x i8] c"Queue - overrun\00"
@.str.22 = [14 x i8] c"Socket - open\00"
@.str.23 = [14 x i8] c"Socket - read\00"
@.str.24 = [15 x i8] c"Socket - write\00"
@.str.25 = [14 x i8] c"DB-open error\00"
@.str.26 = [18 x i8] c"Unknown IoT error\00"
define i8* @iotErrorStringRaw(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %31 [
i32 0, label %5
i32 4, label %6
i32 5, label %7
i32 6, label %8
i32 11, label %9
i32 12, label %10
i32 13, label %11
i32 14, label %12
i32 20, label %13
i32 21, label %14
i32 22, label %15
i32 30, label %16
i32 31, label %17
i32 32, label %18
i32 33, label %19
i32 34, label %20
i32 60, label %21
i32 61, label %22
i32 62, label %23
i32 63, label %24
i32 66, label %25
i32 67, label %26
i32 70, label %27
i32 71, label %28
i32 72, label %29
i32 80, label %30
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %32
6: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %32
7: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %32
8: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %32
9: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %32
10: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %32
11: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %32
12: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %32
13: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %32
14: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %32
15: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %32
16: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %32
17: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %32
18: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %32
19: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %32
20: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %32
21: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %32
22: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %32
23: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %32
24: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %32
25: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %32
26: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %32
27: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %32
28: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0), i8** %2
br label %32
29: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.24, i64 0, i64 0), i8** %2
br label %32
30: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i8** %2
br label %32
31: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.26, i64 0, i64 0), i8** %2
br label %32
32: ; preds = %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%33 = load i8*, i8** %2
ret i8* %33
}

LLVM IR (-O2):
@.str = [9 x i8] c"No error\00"
@.str.1 = [18 x i8] c"Authorize timeout\00"
@.str.2 = [19 x i8] c"Authorize response\00"
@.str.3 = [16 x i8] c"No TLS received\00"
@.str.4 = [7 x i8] c"No MAC\00"
@.str.5 = [17 x i8] c"Non-existing MAC\00"
@.str.6 = [14 x i8] c"No tunnel MAC\00"
@.str.7 = [21 x i8] c"Already existing MAC\00"
@.str.8 = [18 x i8] c"Device has no get\00"
@.str.9 = [23 x i8] c"Device has no controls\00"
@.str.10 = [15 x i8] c"Device missing\00"
@.str.11 = [23 x i8] c"Topo - illegal command\00"
@.str.12 = [20 x i8] c"Topo - missing name\00"
@.str.13 = [15 x i8] c"Topo - timeout\00"
@.str.14 = [20 x i8] c"Topo - not accepted\00"
@.str.15 = [15 x i8] c"Topo - overrun\00"
@.str.16 = [15 x i8] c"Queue - create\00"
@.str.17 = [13 x i8] c"Queue - open\00"
@.str.18 = [13 x i8] c"Queue - read\00"
@.str.19 = [14 x i8] c"Queue - write\00"
@.str.20 = [16 x i8] c"Queue - bufsize\00"
@.str.21 = [16 x i8] c"Queue - overrun\00"
@.str.22 = [14 x i8] c"Socket - open\00"
@.str.23 = [14 x i8] c"Socket - read\00"
@.str.24 = [15 x i8] c"Socket - write\00"
@.str.25 = [14 x i8] c"DB-open error\00"
@.str.26 = [18 x i8] c"Unknown IoT error\00"
define i8* @iotErrorStringRaw(i32 %0) {
switch i32 %0, label %27 [
i32 0, label %28
i32 4, label %2
i32 5, label %3
i32 6, label %4
i32 11, label %5
i32 12, label %6
i32 13, label %7
i32 14, label %8
i32 20, label %9
i32 21, label %10
i32 22, label %11
i32 30, label %12
i32 31, label %13
i32 32, label %14
i32 33, label %15
i32 34, label %16
i32 60, label %17
i32 61, label %18
i32 62, label %19
i32 63, label %20
i32 66, label %21
i32 67, label %22
i32 70, label %23
i32 71, label %24
i32 72, label %25
i32 80, label %26
]
2: ; preds = %1
br label %28
3: ; preds = %1
br label %28
4: ; preds = %1
br label %28
5: ; preds = %1
br label %28
6: ; preds = %1
br label %28
7: ; preds = %1
br label %28
8: ; preds = %1
br label %28
9: ; preds = %1
br label %28
10: ; preds = %1
br label %28
11: ; preds = %1
br label %28
12: ; preds = %1
br label %28
13: ; preds = %1
br label %28
14: ; preds = %1
br label %28
15: ; preds = %1
br label %28
16: ; preds = %1
br label %28
17: ; preds = %1
br label %28
18: ; preds = %1
br label %28
19: ; preds = %1
br label %28
20: ; preds = %1
br label %28
21: ; preds = %1
br label %28
22: ; preds = %1
br label %28
23: ; preds = %1
br label %28
24: ; preds = %1
br label %28
25: ; preds = %1
br label %28
26: ; preds = %1
br label %28
27: ; preds = %1
br label %28
28: ; preds = %1, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%29 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.26, i64 0, i64 0), %27 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), %26 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.24, i64 0, i64 0), %25 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0), %24 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0), %23 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), %22 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.20, i64 0, i64 0), %21 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), %20 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), %19 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %29
}