#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 */
int /*<<< orphan*/ abort();
const char *dm_value_name(uint8_t value) {
  switch (value) {
  case (1 << 2):
    return "Z";
  case (1 << 1):
    return "0R";
  case (1 << 0):
    return "0";
  case (1 << 3):
    return "1R";
  case (1 << 4):
    return "1";
  default:
    abort();
  }
}


x86 assembly (clang, -O0):
<dm_value_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xf,%eax
ja     1194 <dm_value_name+0x84>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119b <dm_value_name+0x8b>
lea    0xee7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119b <dm_value_name+0x8b>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119b <dm_value_name+0x8b>
lea    0xecc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119b <dm_value_name+0x8b>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119b <dm_value_name+0x8b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dm_value_name>:
push   %rax
add    $0xffffffff,%edi
cmp    $0xf,%edi
ja     1154 <dm_value_name+0x44>
lea    0xf20(%rip),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xf0e(%rip),%rax
pop    %rcx
ret
lea    0xf02(%rip),%rax
pop    %rcx
ret
lea    0xefe(%rip),%rax
pop    %rcx
ret
lea    0xef8(%rip),%rax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"Z\00"
@.str.1 = [3 x i8] c"0R\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [3 x i8] c"1R\00"
@.str.4 = [2 x i8] c"1\00"
define i8* @dm_value_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 4, label %5
i32 2, label %6
i32 1, label %7
i32 8, label %8
i32 16, label %9
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %12
9: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %12
10: ; preds = %1
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %9, %8, %7, %6, %5
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"Z\00"
@.str.1 = [3 x i8] c"0R\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [3 x i8] c"1R\00"
@.str.4 = [2 x i8] c"1\00"
define i8* @dm_value_name(i32 %0) {
switch i32 %0, label %6 [
i32 4, label %8
i32 2, label %2
i32 1, label %3
i32 8, label %4
i32 16, label %5
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1, %5, %4, %3, %2
%9 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}