const char *janus_get_api_error(int error) {
  switch (error) {
  case 0:
    return "Success";
  case 403:
    return "Unauthorized request (wrong or missing secret/token)";
  case 405:
    return "Unauthorized access to plugin (token is not allowed to)";
  case 490:
    return "Unknown error";
  case 450:
    return "Use GET";
  case 451:
    return "Use POST";
  case 452:
    return "Missing request";
  case 453:
    return "Unknown request";
  case 454:
    return "Invalid JSON";
  case 455:
    return "Invalid JSON Object";
  case 456:
    return "Missing mandatory element";
  case 457:
    return "Invalid path for this request";
  case 458:
    return "Session not found";
  case 459:
    return "Handle not found";
  case 460:
    return "Plugin not found";
  case 461:
    return "Error attaching plugin";
  case 462:
    return "Error sending message to plugin";
  case 463:
    return "Error detaching from plugin";
  case 464:
    return "Unsupported JSEP type";
  case 465:
    return "Invalid SDP";
  case 466:
    return "Invalid stream";
  case 467:
    return "Invalid element type";
  case 468:
    return "Session ID already in use";
  case 469:
    return "Unexpected ANSWER (no OFFER)";
  case 470:
    return "Token not found";
  default:
    return "Unknown error";
  }
  return "Unknown error";
}


x86 assembly (clang, -O0):
<janus_get_api_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     12e2 <janus_get_api_error+0x1e2>
jmp    111a <janus_get_api_error+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x193,%eax
je     12f2 <janus_get_api_error+0x1f2>
jmp    112d <janus_get_api_error+0x2d>
mov    -0x10(%rbp),%eax
sub    $0x195,%eax
je     1302 <janus_get_api_error+0x202>
jmp    1140 <janus_get_api_error+0x40>
mov    -0x10(%rbp),%eax
sub    $0x1c2,%eax
je     1322 <janus_get_api_error+0x222>
jmp    1153 <janus_get_api_error+0x53>
mov    -0x10(%rbp),%eax
sub    $0x1c3,%eax
je     1332 <janus_get_api_error+0x232>
jmp    1166 <janus_get_api_error+0x66>
mov    -0x10(%rbp),%eax
sub    $0x1c4,%eax
je     1342 <janus_get_api_error+0x242>
jmp    1179 <janus_get_api_error+0x79>
mov    -0x10(%rbp),%eax
sub    $0x1c5,%eax
je     1352 <janus_get_api_error+0x252>
jmp    118c <janus_get_api_error+0x8c>
mov    -0x10(%rbp),%eax
sub    $0x1c6,%eax
je     1362 <janus_get_api_error+0x262>
jmp    119f <janus_get_api_error+0x9f>
mov    -0x10(%rbp),%eax
sub    $0x1c7,%eax
je     1372 <janus_get_api_error+0x272>
jmp    11b2 <janus_get_api_error+0xb2>
mov    -0x10(%rbp),%eax
sub    $0x1c8,%eax
je     1382 <janus_get_api_error+0x282>
jmp    11c5 <janus_get_api_error+0xc5>
mov    -0x10(%rbp),%eax
sub    $0x1c9,%eax
je     1392 <janus_get_api_error+0x292>
jmp    11d8 <janus_get_api_error+0xd8>
mov    -0x10(%rbp),%eax
sub    $0x1ca,%eax
je     13a2 <janus_get_api_error+0x2a2>
jmp    11eb <janus_get_api_error+0xeb>
mov    -0x10(%rbp),%eax
sub    $0x1cb,%eax
je     13b2 <janus_get_api_error+0x2b2>
jmp    11fe <janus_get_api_error+0xfe>
mov    -0x10(%rbp),%eax
sub    $0x1cc,%eax
je     13c2 <janus_get_api_error+0x2c2>
jmp    1211 <janus_get_api_error+0x111>
mov    -0x10(%rbp),%eax
sub    $0x1cd,%eax
je     13d2 <janus_get_api_error+0x2d2>
jmp    1224 <janus_get_api_error+0x124>
mov    -0x10(%rbp),%eax
sub    $0x1ce,%eax
je     13e2 <janus_get_api_error+0x2e2>
jmp    1237 <janus_get_api_error+0x137>
mov    -0x10(%rbp),%eax
sub    $0x1cf,%eax
je     13f2 <janus_get_api_error+0x2f2>
jmp    124a <janus_get_api_error+0x14a>
mov    -0x10(%rbp),%eax
sub    $0x1d0,%eax
je     1402 <janus_get_api_error+0x302>
jmp    125d <janus_get_api_error+0x15d>
mov    -0x10(%rbp),%eax
sub    $0x1d1,%eax
je     1412 <janus_get_api_error+0x312>
jmp    1270 <janus_get_api_error+0x170>
mov    -0x10(%rbp),%eax
sub    $0x1d2,%eax
je     1422 <janus_get_api_error+0x322>
jmp    1283 <janus_get_api_error+0x183>
mov    -0x10(%rbp),%eax
sub    $0x1d3,%eax
je     1432 <janus_get_api_error+0x332>
jmp    1296 <janus_get_api_error+0x196>
mov    -0x10(%rbp),%eax
sub    $0x1d4,%eax
je     1442 <janus_get_api_error+0x342>
jmp    12a9 <janus_get_api_error+0x1a9>
mov    -0x10(%rbp),%eax
sub    $0x1d5,%eax
je     1452 <janus_get_api_error+0x352>
jmp    12bc <janus_get_api_error+0x1bc>
mov    -0x10(%rbp),%eax
sub    $0x1d6,%eax
je     1462 <janus_get_api_error+0x362>
jmp    12cf <janus_get_api_error+0x1cf>
mov    -0x10(%rbp),%eax
sub    $0x1ea,%eax
je     1312 <janus_get_api_error+0x212>
jmp    1472 <janus_get_api_error+0x372>
lea    0xd17(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd0f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd34(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd5c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd5a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd52(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd48(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd4c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd56(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd66(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd68(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd6f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd8b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd91(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd8d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd91(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xd9b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xda8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    147d <janus_get_api_error+0x37d>
lea    0xbfc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<janus_get_api_error>:
lea    -0x193(%rdi),%eax
cmp    $0x57,%eax
ja     1123 <janus_get_api_error+0x23>
lea    0xeee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1046(%rip),%rax
ret
test   %edi,%edi
jne    112f <janus_get_api_error+0x2f>
lea    0x1032(%rip),%rax
ret
lea    0x109f(%rip),%rax
ret
lea    0x105f(%rip),%rax
ret
lea    0x109d(%rip),%rax
ret
lea    0x109d(%rip),%rax
ret
lea    0x109e(%rip),%rax
ret
lea    0x10a6(%rip),%rax
ret
lea    0x10ae(%rip),%rax
ret
lea    0x10b3(%rip),%rax
ret
lea    0x10bf(%rip),%rax
ret
lea    0x10d1(%rip),%rax
ret
lea    0x10e7(%rip),%rax
ret
lea    0x10f1(%rip),%rax
ret
lea    0x10fa(%rip),%rax
ret
lea    0x1103(%rip),%rax
ret
lea    0x1112(%rip),%rax
ret
lea    0x112a(%rip),%rax
ret
lea    0x113e(%rip),%rax
ret
lea    0x114c(%rip),%rax
ret
lea    0x1150(%rip),%rax
ret
lea    0x1157(%rip),%rax
ret
lea    0x1164(%rip),%rax
ret
lea    0x1176(%rip),%rax
ret
lea    0x118b(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Success\00"
@.str.1 = [53 x i8] c"Unauthorized request (wrong or missing secret/token)\00"
@.str.2 = [56 x i8] c"Unauthorized access to plugin (token is not allowed to)\00"
@.str.3 = [14 x i8] c"Unknown error\00"
@.str.4 = [8 x i8] c"Use GET\00"
@.str.5 = [9 x i8] c"Use POST\00"
@.str.6 = [16 x i8] c"Missing request\00"
@.str.7 = [16 x i8] c"Unknown request\00"
@.str.8 = [13 x i8] c"Invalid JSON\00"
@.str.9 = [20 x i8] c"Invalid JSON Object\00"
@.str.10 = [26 x i8] c"Missing mandatory element\00"
@.str.11 = [30 x i8] c"Invalid path for this request\00"
@.str.12 = [18 x i8] c"Session not found\00"
@.str.13 = [17 x i8] c"Handle not found\00"
@.str.14 = [17 x i8] c"Plugin not found\00"
@.str.15 = [23 x i8] c"Error attaching plugin\00"
@.str.16 = [32 x i8] c"Error sending message to plugin\00"
@.str.17 = [28 x i8] c"Error detaching from plugin\00"
@.str.18 = [22 x i8] c"Unsupported JSEP type\00"
@.str.19 = [12 x i8] c"Invalid SDP\00"
@.str.20 = [15 x i8] c"Invalid stream\00"
@.str.21 = [21 x i8] c"Invalid element type\00"
@.str.22 = [26 x i8] c"Session ID already in use\00"
@.str.23 = [29 x i8] c"Unexpected ANSWER (no OFFER)\00"
@.str.24 = [16 x i8] c"Token not found\00"
define i8* @janus_get_api_error(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %30 [
i32 0, label %5
i32 403, label %6
i32 405, label %7
i32 490, label %8
i32 450, label %9
i32 451, label %10
i32 452, label %11
i32 453, label %12
i32 454, label %13
i32 455, label %14
i32 456, label %15
i32 457, label %16
i32 458, label %17
i32 459, label %18
i32 460, label %19
i32 461, label %20
i32 462, label %21
i32 463, label %22
i32 464, label %23
i32 465, label %24
i32 466, label %25
i32 467, label %26
i32 468, label %27
i32 469, label %28
i32 470, label %29
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %31
6: ; preds = %1
store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %31
7: ; preds = %1
store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %31
8: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %31
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %31
10: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %31
11: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %31
12: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %31
13: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %31
14: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %31
15: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %31
16: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %31
17: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %31
18: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %31
19: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %31
20: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %31
21: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %31
22: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %31
23: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %31
24: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %31
25: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %31
26: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %31
27: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %31
28: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0), i8** %2
br label %31
29: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.24, i64 0, i64 0), i8** %2
br label %31
30: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %31
31: ; preds = %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
%32 = load i8*, i8** %2
ret i8* %32
}

LLVM IR (-O2):
@.str = [8 x i8] c"Success\00"
@.str.1 = [53 x i8] c"Unauthorized request (wrong or missing secret/token)\00"
@.str.2 = [56 x i8] c"Unauthorized access to plugin (token is not allowed to)\00"
@.str.3 = [14 x i8] c"Unknown error\00"
@.str.4 = [8 x i8] c"Use GET\00"
@.str.5 = [9 x i8] c"Use POST\00"
@.str.6 = [16 x i8] c"Missing request\00"
@.str.7 = [16 x i8] c"Unknown request\00"
@.str.8 = [13 x i8] c"Invalid JSON\00"
@.str.9 = [20 x i8] c"Invalid JSON Object\00"
@.str.10 = [26 x i8] c"Missing mandatory element\00"
@.str.11 = [30 x i8] c"Invalid path for this request\00"
@.str.12 = [18 x i8] c"Session not found\00"
@.str.13 = [17 x i8] c"Handle not found\00"
@.str.14 = [17 x i8] c"Plugin not found\00"
@.str.15 = [23 x i8] c"Error attaching plugin\00"
@.str.16 = [32 x i8] c"Error sending message to plugin\00"
@.str.17 = [28 x i8] c"Error detaching from plugin\00"
@.str.18 = [22 x i8] c"Unsupported JSEP type\00"
@.str.19 = [12 x i8] c"Invalid SDP\00"
@.str.20 = [15 x i8] c"Invalid stream\00"
@.str.21 = [21 x i8] c"Invalid element type\00"
@.str.22 = [26 x i8] c"Session ID already in use\00"
@.str.23 = [29 x i8] c"Unexpected ANSWER (no OFFER)\00"
@.str.24 = [16 x i8] c"Token not found\00"
define i8* @janus_get_api_error(i32 %0) {
switch i32 %0, label %26 [
i32 0, label %27
i32 403, label %2
i32 405, label %3
i32 490, label %4
i32 450, label %5
i32 451, label %6
i32 452, label %7
i32 453, label %8
i32 454, label %9
i32 455, label %10
i32 456, label %11
i32 457, label %12
i32 458, label %13
i32 459, label %14
i32 460, label %15
i32 461, label %16
i32 462, label %17
i32 463, label %18
i32 464, label %19
i32 465, label %20
i32 466, label %21
i32 467, label %22
i32 468, label %23
i32 469, label %24
i32 470, label %25
]
2: ; preds = %1
br label %27
3: ; preds = %1
br label %27
4: ; preds = %1
br label %27
5: ; preds = %1
br label %27
6: ; preds = %1
br label %27
7: ; preds = %1
br label %27
8: ; preds = %1
br label %27
9: ; preds = %1
br label %27
10: ; preds = %1
br label %27
11: ; preds = %1
br label %27
12: ; preds = %1
br label %27
13: ; preds = %1
br label %27
14: ; preds = %1
br label %27
15: ; preds = %1
br label %27
16: ; preds = %1
br label %27
17: ; preds = %1
br label %27
18: ; preds = %1
br label %27
19: ; preds = %1
br label %27
20: ; preds = %1
br label %27
21: ; preds = %1
br label %27
22: ; preds = %1
br label %27
23: ; preds = %1
br label %27
24: ; preds = %1
br label %27
25: ; preds = %1
br label %27
26: ; preds = %1
br label %27
27: ; preds = %1, %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
%28 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %26 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.24, i64 0, i64 0), %25 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0), %24 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0), %23 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), %22 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), %21 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0), %20 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0), %19 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %28
}