#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 */
const char *raw_mtype_str(uint8_t mtype) {
  switch (mtype) {
  case 0x01:
    return "RAW_MTYPE_REQ";
  case 0x02:
    return "RAW_MTYPE_RES";
  case 0x7F:
    return "RAW_MTYPE_ERR";
  case 0x80:
    return "RAW_MTYPE_BSUB";
  case 0x81:
    return "RAW_MTYPE_BSMP";
  default:
    return "<UNKNOWN_MTYPE>";
  }
}


x86 assembly (clang, -O0):
<raw_mtype_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1163 <raw_mtype_str+0x63>
jmp    111b <raw_mtype_str+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1173 <raw_mtype_str+0x73>
jmp    112c <raw_mtype_str+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x7f,%eax
je     1183 <raw_mtype_str+0x83>
jmp    113d <raw_mtype_str+0x3d>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     1193 <raw_mtype_str+0x93>
jmp    1150 <raw_mtype_str+0x50>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     11a3 <raw_mtype_str+0xa3>
jmp    11b3 <raw_mtype_str+0xb3>
lea    0xe96(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11be <raw_mtype_str+0xbe>
lea    0xe94(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11be <raw_mtype_str+0xbe>
lea    0xe92(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11be <raw_mtype_str+0xbe>
lea    0xe90(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11be <raw_mtype_str+0xbe>
lea    0xe8f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11be <raw_mtype_str+0xbe>
lea    0xe8e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_mtype_str>:
cmp    $0x7e,%edi
jle    1122 <raw_mtype_str+0x22>
cmp    $0x7f,%edi
je     1134 <raw_mtype_str+0x34>
cmp    $0x80,%edi
je     113c <raw_mtype_str+0x3c>
cmp    $0x81,%edi
jne    114c <raw_mtype_str+0x4c>
lea    0xf18(%rip),%rax
ret
cmp    $0x1,%edi
je     1144 <raw_mtype_str+0x44>
cmp    $0x2,%edi
jne    114c <raw_mtype_str+0x4c>
lea    0xedb(%rip),%rax
ret
lea    0xee1(%rip),%rax
ret
lea    0xee7(%rip),%rax
ret
lea    0xeb5(%rip),%rax
ret
lea    0xef5(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"RAW_MTYPE_REQ\00"
@.str.1 = [14 x i8] c"RAW_MTYPE_RES\00"
@.str.2 = [14 x i8] c"RAW_MTYPE_ERR\00"
@.str.3 = [15 x i8] c"RAW_MTYPE_BSUB\00"
@.str.4 = [15 x i8] c"RAW_MTYPE_BSMP\00"
@.str.5 = [16 x i8] c"<UNKNOWN_MTYPE>\00"
define i8* @raw_mtype_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %6
i32 127, label %7
i32 128, label %8
i32 129, label %9
]
5: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %11
7: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %11
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"RAW_MTYPE_REQ\00"
@.str.1 = [14 x i8] c"RAW_MTYPE_RES\00"
@.str.2 = [14 x i8] c"RAW_MTYPE_ERR\00"
@.str.3 = [15 x i8] c"RAW_MTYPE_BSUB\00"
@.str.4 = [15 x i8] c"RAW_MTYPE_BSMP\00"
@.str.5 = [16 x i8] c"<UNKNOWN_MTYPE>\00"
define i8* @raw_mtype_str(i32 %0) {
switch i32 %0, label %6 [
i32 1, label %7
i32 2, label %2
i32 127, label %3
i32 128, label %4
i32 129, label %5
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}