#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*/ sprintf(char *, char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
void encoding_hash(char enc, char *encstr) {
  switch (enc) {
  case 0:
    strcpy(encstr, "ASCII text (val:0)");
    break;
  case 1:
    strcpy(encstr, "16 bit integers (val:1)");
    break;
  case 2:
    strcpy(encstr, "24 bit integers (val:2)");
    break;
  case 3:
    strcpy(encstr, "32 bit integers (val:3)");
    break;
  case 4:
    strcpy(encstr, "IEEE floating point (val:4)");
    break;
  case 5:
    strcpy(encstr, "IEEE double precision float (val:5)");
    break;
  case 10:
    strcpy(encstr, "STEIM 1 Compression (val:10)");
    break;
  case 11:
    strcpy(encstr, "STEIM 2 Compression (val:11)");
    break;
  case 12:
    strcpy(encstr, "GEOSCOPE Muxed 24 bit int (val:12)");
    break;
  case 13:
    strcpy(encstr, "GEOSCOPE Muxed 16/3 bit gain/exp (val:13)");
    break;
  case 14:
    strcpy(encstr, "GEOSCOPE Muxed 16/4 bit gain/exp (val:14)");
    break;
  case 15:
    strcpy(encstr, "US National Network compression (val:15)");
    break;
  case 16:
    strcpy(encstr, "CDSN 16 bit gain ranged (val:16)");
    break;
  case 17:
    strcpy(encstr, "Graefenberg 16 bit gain ranged (val:17)");
    break;
  case 18:
    strcpy(encstr, "IPG - Strasbourg 16 bit gain (val:18)");
    break;
  case 19:
    strcpy(encstr, "STEIM 3 Compression (val:19)");
    break;
  case 30:
    strcpy(encstr, "SRO Format (val:30)");
    break;
  case 31:
    strcpy(encstr, "HGLP Format (val:31)");
    break;
  case 32:
    strcpy(encstr, "DWWSSN Gain Ranged Format (val:32)");
    break;
  case 33:
    strcpy(encstr, "RSTN 16 bit gain ranged (val:33)");
    break;
  default:
    sprintf(encstr, "Unknown format code: (%d)", enc);
  }
}


x86 assembly (clang, -O0):
<encoding_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x21,%eax
ja     12fd <encoding_hash+0x1dd>
mov    -0x18(%rbp),%rax
lea    0xeb0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
lea    0xf24(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf22(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf25(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf28(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf2b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf32(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf41(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf49(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf51(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf5f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf74(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf89(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xf9d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfa9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfbc(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfcd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfd5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfd4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfd4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfe2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1311 <encoding_hash+0x1f1>
mov    -0x10(%rbp),%rdi
lea    0xfee(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoding_hash>:
mov    %rsi,%rax
cmp    $0x21,%edi
ja     1194 <encoding_hash+0x74>
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf47(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xf4b(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xf54(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xf5d(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xf66(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xf73(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
movsbl %dil,%edx
lea    0x1157(%rip),%rsi
mov    %rax,%rdi
jmp    1040 <sprintf@plt>
lea    0xf75(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xf83(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xf91(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xfa5(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xfc0(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xfdb(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xff5(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0x1007(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0x1020(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0x1037(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0x1045(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0x104a(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0x1050(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0x1064(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"ASCII text (val:0)\00"
@.str.1 = [24 x i8] c"16 bit integers (val:1)\00"
@.str.2 = [24 x i8] c"24 bit integers (val:2)\00"
@.str.3 = [24 x i8] c"32 bit integers (val:3)\00"
@.str.4 = [28 x i8] c"IEEE floating point (val:4)\00"
@.str.5 = [36 x i8] c"IEEE double precision float (val:5)\00"
@.str.6 = [29 x i8] c"STEIM 1 Compression (val:10)\00"
@.str.7 = [29 x i8] c"STEIM 2 Compression (val:11)\00"
@.str.8 = [35 x i8] c"GEOSCOPE Muxed 24 bit int (val:12)\00"
@.str.9 = [42 x i8] c"GEOSCOPE Muxed 16/3 bit gain/exp (val:13)\00"
@.str.10 = [42 x i8] c"GEOSCOPE Muxed 16/4 bit gain/exp (val:14)\00"
@.str.11 = [41 x i8] c"US National Network compression (val:15)\00"
@.str.12 = [33 x i8] c"CDSN 16 bit gain ranged (val:16)\00"
@.str.13 = [40 x i8] c"Graefenberg 16 bit gain ranged (val:17)\00"
@.str.14 = [38 x i8] c"IPG - Strasbourg 16 bit gain (val:18)\00"
@.str.15 = [29 x i8] c"STEIM 3 Compression (val:19)\00"
@.str.16 = [20 x i8] c"SRO Format (val:30)\00"
@.str.17 = [21 x i8] c"HGLP Format (val:31)\00"
@.str.18 = [35 x i8] c"DWWSSN Gain Ranged Format (val:32)\00"
@.str.19 = [33 x i8] c"RSTN 16 bit gain ranged (val:33)\00"
@.str.20 = [26 x i8] c"Unknown format code: (%d)\00"
define void @encoding_hash(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %67 [
i32 0, label %7
i32 1, label %10
i32 2, label %13
i32 3, label %16
i32 4, label %19
i32 5, label %22
i32 10, label %25
i32 11, label %28
i32 12, label %31
i32 13, label %34
i32 14, label %37
i32 15, label %40
i32 16, label %43
i32 17, label %46
i32 18, label %49
i32 19, label %52
i32 30, label %55
i32 31, label %58
i32 32, label %61
i32 33, label %64
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %71
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %71
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %71
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %71
19: ; preds = %2
%20 = load i8*, i8** %4
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %71
22: ; preds = %2
%23 = load i8*, i8** %4
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
br label %71
25: ; preds = %2
%26 = load i8*, i8** %4
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %71
28: ; preds = %2
%29 = load i8*, i8** %4
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %71
31: ; preds = %2
%32 = load i8*, i8** %4
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
br label %71
34: ; preds = %2
%35 = load i8*, i8** %4
%36 = call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
br label %71
37: ; preds = %2
%38 = load i8*, i8** %4
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
br label %71
40: ; preds = %2
%41 = load i8*, i8** %4
%42 = call i32 @strcpy(i8* %41, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0))
br label %71
43: ; preds = %2
%44 = load i8*, i8** %4
%45 = call i32 @strcpy(i8* %44, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
br label %71
46: ; preds = %2
%47 = load i8*, i8** %4
%48 = call i32 @strcpy(i8* %47, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
br label %71
49: ; preds = %2
%50 = load i8*, i8** %4
%51 = call i32 @strcpy(i8* %50, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0))
br label %71
52: ; preds = %2
%53 = load i8*, i8** %4
%54 = call i32 @strcpy(i8* %53, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
br label %71
55: ; preds = %2
%56 = load i8*, i8** %4
%57 = call i32 @strcpy(i8* %56, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
br label %71
58: ; preds = %2
%59 = load i8*, i8** %4
%60 = call i32 @strcpy(i8* %59, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0))
br label %71
61: ; preds = %2
%62 = load i8*, i8** %4
%63 = call i32 @strcpy(i8* %62, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.18, i64 0, i64 0))
br label %71
64: ; preds = %2
%65 = load i8*, i8** %4
%66 = call i32 @strcpy(i8* %65, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0))
br label %71
67: ; preds = %2
%68 = load i8*, i8** %4
%69 = load i8, i8* %3
%70 = call i32 @sprintf(i8* %68, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0), i8 signext %69)
br label %71
71: ; preds = %67, %64, %61, %58, %55, %52, %49, %46, %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %7
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"ASCII text (val:0)\00"
@.str.1 = [24 x i8] c"16 bit integers (val:1)\00"
@.str.2 = [24 x i8] c"24 bit integers (val:2)\00"
@.str.3 = [24 x i8] c"32 bit integers (val:3)\00"
@.str.4 = [28 x i8] c"IEEE floating point (val:4)\00"
@.str.5 = [36 x i8] c"IEEE double precision float (val:5)\00"
@.str.6 = [29 x i8] c"STEIM 1 Compression (val:10)\00"
@.str.7 = [29 x i8] c"STEIM 2 Compression (val:11)\00"
@.str.8 = [35 x i8] c"GEOSCOPE Muxed 24 bit int (val:12)\00"
@.str.9 = [42 x i8] c"GEOSCOPE Muxed 16/3 bit gain/exp (val:13)\00"
@.str.10 = [42 x i8] c"GEOSCOPE Muxed 16/4 bit gain/exp (val:14)\00"
@.str.11 = [41 x i8] c"US National Network compression (val:15)\00"
@.str.12 = [33 x i8] c"CDSN 16 bit gain ranged (val:16)\00"
@.str.13 = [40 x i8] c"Graefenberg 16 bit gain ranged (val:17)\00"
@.str.14 = [38 x i8] c"IPG - Strasbourg 16 bit gain (val:18)\00"
@.str.15 = [29 x i8] c"STEIM 3 Compression (val:19)\00"
@.str.16 = [20 x i8] c"SRO Format (val:30)\00"
@.str.17 = [21 x i8] c"HGLP Format (val:31)\00"
@.str.18 = [35 x i8] c"DWWSSN Gain Ranged Format (val:32)\00"
@.str.19 = [33 x i8] c"RSTN 16 bit gain ranged (val:33)\00"
@.str.20 = [26 x i8] c"Unknown format code: (%d)\00"
define void @encoding_hash(i8 signext %0, i8* %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %44 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 5, label %14
i32 10, label %16
i32 11, label %18
i32 12, label %20
i32 13, label %22
i32 14, label %24
i32 15, label %26
i32 16, label %28
i32 17, label %30
i32 18, label %32
i32 19, label %34
i32 30, label %36
i32 31, label %38
i32 32, label %40
i32 33, label %42
]
4: ; preds = %2
%5 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %46
6: ; preds = %2
%7 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %46
8: ; preds = %2
%9 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %46
10: ; preds = %2
%11 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %46
12: ; preds = %2
%13 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %46
14: ; preds = %2
%15 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
br label %46
16: ; preds = %2
%17 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %46
18: ; preds = %2
%19 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %46
20: ; preds = %2
%21 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
br label %46
22: ; preds = %2
%23 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
br label %46
24: ; preds = %2
%25 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
br label %46
26: ; preds = %2
%27 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0))
br label %46
28: ; preds = %2
%29 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
br label %46
30: ; preds = %2
%31 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
br label %46
32: ; preds = %2
%33 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0))
br label %46
34: ; preds = %2
%35 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
br label %46
36: ; preds = %2
%37 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
br label %46
38: ; preds = %2
%39 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0))
br label %46
40: ; preds = %2
%41 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.18, i64 0, i64 0))
br label %46
42: ; preds = %2
%43 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0))
br label %46
44: ; preds = %2
%45 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0), i8 signext %0)
br label %46
46: ; preds = %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret void
}