#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 /*<<< orphan*/ write(int, unsigned char *, long long);
void Platform_DisplayHaltCode(long long code) {
  switch (code) {
  case -1:
    write(1, (unsigned char *)"Assertion failure.", (long long)19 - 1);
    break;
  case -2:
    write(1, (unsigned char *)"Index out of range.", (long long)20 - 1);
    break;
  case -3:
    write(1,
          (unsigned char *)"Reached end of function without reaching RETURN.",
          (long long)49 - 1);
    break;
  case -4:
    write(1, (unsigned char *)"CASE statement: no matching label and no ELSE.",
          (long long)47 - 1);
    break;
  case -5:
    write(1, (unsigned char *)"Type guard failed.", (long long)19 - 1);
    break;
  case -6:
    write(1,
          (unsigned char *)"Implicit type guard in record assignment failed.",
          (long long)49 - 1);
    break;
  case -7:
    write(1, (unsigned char *)"Invalid case in WITH statement.",
          (long long)32 - 1);
    break;
  case -8:
    write(1, (unsigned char *)"Value out of range.", (long long)20 - 1);
    break;
  case -9:
    write(1,
          (unsigned char
               *)"Heap interrupted while locked, but lockdepth = 0 at unlock.",
          (long long)60 - 1);
    break;
  case -10:
    write(1, (unsigned char *)"NIL access.", (long long)12 - 1);
    break;
  case -11:
    write(1, (unsigned char *)"Alignment error.", (long long)17 - 1);
    break;
  case -12:
    write(1, (unsigned char *)"Divide by zero.", (long long)16 - 1);
    break;
  case -13:
    write(1, (unsigned char *)"Arithmetic overflow/underflow.",
          (long long)31 - 1);
    break;
  case -14:
    write(1, (unsigned char *)"Invalid function argument.", (long long)27 - 1);
    break;
  case -15:
    write(
        1,
        (unsigned char *)"Internal error, e.g. Type descriptor size mismatch.",
        (long long)52 - 1);
    break;
  case -20:
    write(1,
          (unsigned char
               *)"Too many, or negative number of, elements in dynamic array.",
          (long long)60 - 1);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<Platform_DisplayHaltCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x10(%rbp)
sub    $0x13,%rax
ja     12f6 <Platform_DisplayHaltCode+0x1e6>
mov    -0x10(%rbp),%rax
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%edi
lea    0xefe(%rip),%rsi
mov    $0x12,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xef6(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xeef(%rip),%rsi
mov    $0x30,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf05(%rip),%rsi
mov    $0x2e,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf19(%rip),%rsi
mov    $0x12,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf11(%rip),%rsi
mov    $0x30,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf27(%rip),%rsi
mov    $0x1f,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf2c(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf25(%rip),%rsi
mov    $0x3b,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf46(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf37(%rip),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf2d(%rip),%rsi
mov    $0xf,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf22(%rip),%rsi
mov    $0x1e,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf26(%rip),%rsi
mov    $0x1a,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf26(%rip),%rsi
mov    $0x33,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
mov    $0x1,%edi
lea    0xf3f(%rip),%rsi
mov    $0x3b,%edx
call   1030 <write@plt>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
jmp    12fb <Platform_DisplayHaltCode+0x1eb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_DisplayHaltCode>:
add    $0x14,%rdi
cmp    $0x13,%rdi
ja     125d <Platform_DisplayHaltCode+0x14d>
lea    0xedb(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0x10f1(%rip),%rsi
jmp    11c5 <Platform_DisplayHaltCode+0xb5>
lea    0x10b1(%rip),%rsi
mov    $0x33,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0x1080(%rip),%rsi
mov    $0x1a,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0x104b(%rip),%rsi
mov    $0x1e,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0x1025(%rip),%rsi
mov    $0xf,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xffe(%rip),%rsi
mov    $0x10,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xfdc(%rip),%rsi
mov    $0xb,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xf8a(%rip),%rsi
mov    $0x3b,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xf60(%rip),%rsi
jmp    1238 <Platform_DisplayHaltCode+0x128>
lea    0xf37(%rip),%rsi
mov    $0x1f,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xef0(%rip),%rsi
jmp    1222 <Platform_DisplayHaltCode+0x112>
lea    0xed4(%rip),%rsi
jmp    124e <Platform_DisplayHaltCode+0x13e>
lea    0xe9c(%rip),%rsi
mov    $0x2e,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xe55(%rip),%rsi
mov    $0x30,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xe2b(%rip),%rsi
mov    $0x13,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
lea    0xe02(%rip),%rsi
mov    $0x12,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Assertion failure.\00"
@.str.1 = [20 x i8] c"Index out of range.\00"
@.str.2 = [49 x i8] c"Reached end of function without reaching RETURN.\00"
@.str.3 = [47 x i8] c"CASE statement: no matching label and no ELSE.\00"
@.str.4 = [19 x i8] c"Type guard failed.\00"
@.str.5 = [49 x i8] c"Implicit type guard in record assignment failed.\00"
@.str.6 = [32 x i8] c"Invalid case in WITH statement.\00"
@.str.7 = [20 x i8] c"Value out of range.\00"
@.str.8 = [60 x i8] c"Heap interrupted while locked, but lockdepth = 0 at unlock.\00"
@.str.9 = [12 x i8] c"NIL access.\00"
@.str.10 = [17 x i8] c"Alignment error.\00"
@.str.11 = [16 x i8] c"Divide by zero.\00"
@.str.12 = [31 x i8] c"Arithmetic overflow/underflow.\00"
@.str.13 = [27 x i8] c"Invalid function argument.\00"
@.str.14 = [52 x i8] c"Internal error, e.g. Type descriptor size mismatch.\00"
@.str.15 = [60 x i8] c"Too many, or negative number of, elements in dynamic array.\00"
define void @Platform_DisplayHaltCode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
switch i64 %3, label %36 [
i64 -1, label %4
i64 -2, label %6
i64 -3, label %8
i64 -4, label %10
i64 -5, label %12
i64 -6, label %14
i64 -7, label %16
i64 -8, label %18
i64 -9, label %20
i64 -10, label %22
i64 -11, label %24
i64 -12, label %26
i64 -13, label %28
i64 -14, label %30
i64 -15, label %32
i64 -20, label %34
]
4: ; preds = %1
%5 = call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 18)
br label %37
6: ; preds = %1
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 19)
br label %37
8: ; preds = %1
%9 = call i32 @write(i32 1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i64 48)
br label %37
10: ; preds = %1
%11 = call i32 @write(i32 1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i64 46)
br label %37
12: ; preds = %1
%13 = call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i64 18)
br label %37
14: ; preds = %1
%15 = call i32 @write(i32 1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i64 48)
br label %37
16: ; preds = %1
%17 = call i32 @write(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 31)
br label %37
18: ; preds = %1
%19 = call i32 @write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i64 19)
br label %37
20: ; preds = %1
%21 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i64 59)
br label %37
22: ; preds = %1
%23 = call i32 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i64 11)
br label %37
24: ; preds = %1
%25 = call i32 @write(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i64 16)
br label %37
26: ; preds = %1
%27 = call i32 @write(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i64 15)
br label %37
28: ; preds = %1
%29 = call i32 @write(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i64 30)
br label %37
30: ; preds = %1
%31 = call i32 @write(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i64 26)
br label %37
32: ; preds = %1
%33 = call i32 @write(i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), i64 51)
br label %37
34: ; preds = %1
%35 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.15, i64 0, i64 0), i64 59)
br label %37
36: ; preds = %1
br label %37
37: ; preds = %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Assertion failure.\00"
@.str.1 = [20 x i8] c"Index out of range.\00"
@.str.2 = [49 x i8] c"Reached end of function without reaching RETURN.\00"
@.str.3 = [47 x i8] c"CASE statement: no matching label and no ELSE.\00"
@.str.4 = [19 x i8] c"Type guard failed.\00"
@.str.5 = [49 x i8] c"Implicit type guard in record assignment failed.\00"
@.str.6 = [32 x i8] c"Invalid case in WITH statement.\00"
@.str.7 = [20 x i8] c"Value out of range.\00"
@.str.8 = [60 x i8] c"Heap interrupted while locked, but lockdepth = 0 at unlock.\00"
@.str.9 = [12 x i8] c"NIL access.\00"
@.str.10 = [17 x i8] c"Alignment error.\00"
@.str.11 = [16 x i8] c"Divide by zero.\00"
@.str.12 = [31 x i8] c"Arithmetic overflow/underflow.\00"
@.str.13 = [27 x i8] c"Invalid function argument.\00"
@.str.14 = [52 x i8] c"Internal error, e.g. Type descriptor size mismatch.\00"
@.str.15 = [60 x i8] c"Too many, or negative number of, elements in dynamic array.\00"
define void @Platform_DisplayHaltCode(i64 %0) {
switch i64 %0, label %34 [
i64 -1, label %2
i64 -2, label %4
i64 -3, label %6
i64 -4, label %8
i64 -5, label %10
i64 -6, label %12
i64 -7, label %14
i64 -8, label %16
i64 -9, label %18
i64 -10, label %20
i64 -11, label %22
i64 -12, label %24
i64 -13, label %26
i64 -14, label %28
i64 -15, label %30
i64 -20, label %32
]
2: ; preds = %1
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 18)
br label %34
4: ; preds = %1
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 19)
br label %34
6: ; preds = %1
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i64 48)
br label %34
8: ; preds = %1
%9 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i64 46)
br label %34
10: ; preds = %1
%11 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i64 18)
br label %34
12: ; preds = %1
%13 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i64 48)
br label %34
14: ; preds = %1
%15 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 31)
br label %34
16: ; preds = %1
%17 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i64 19)
br label %34
18: ; preds = %1
%19 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i64 59)
br label %34
20: ; preds = %1
%21 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i64 11)
br label %34
22: ; preds = %1
%23 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i64 16)
br label %34
24: ; preds = %1
%25 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i64 15)
br label %34
26: ; preds = %1
%27 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i64 30)
br label %34
28: ; preds = %1
%29 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i64 26)
br label %34
30: ; preds = %1
%31 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), i64 51)
br label %34
32: ; preds = %1
%33 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.15, i64 0, i64 0), i64 59)
br label %34
34: ; preds = %1, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}