const char *GetBlockDataTransferTypeString(unsigned int l, unsigned int p,
                                           unsigned int u,
                                           unsigned int baseRegister) {
  int group = (u) + (p * 2) + (l * 4);
  switch (group) {
  case 0x0:
    return baseRegister ? "ED" : "DA";
  case 0x1:
    return baseRegister ? "EA" : "IA";
  case 0x2:
    return baseRegister ? "FD" : "DB";
  case 0x3:
    return baseRegister ? "FA" : "IB";
  case 0x4:
    return baseRegister ? "FA" : "DA";
  case 0x5:
    return baseRegister ? "FD" : "IA";
  case 0x6:
    return baseRegister ? "EA" : "DB";
  case 0x7:
    return baseRegister ? "ED" : "IB";
  default:
    return "";
  }
}


x86 assembly (clang, -O0):
<GetBlockDataTransferTypeString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
mov    %edx,%eax
lea    (%rax,%rcx,2),%ecx
mov    -0xc(%rbp),%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x7,%rax
ja     1257 <GetBlockDataTransferTypeString+0x157>
mov    -0x28(%rbp),%rax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%edx
lea    0xeca(%rip),%rax
lea    0xec0(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rax
lea    0xea5(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
mov    -0x18(%rbp),%edx
lea    0xe94(%rip),%rax
lea    0xe8a(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
mov    -0x18(%rbp),%edx
lea    0xe79(%rip),%rax
lea    0xe6f(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
mov    -0x18(%rbp),%edx
lea    0xe46(%rip),%rax
lea    0xe4e(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
mov    -0x18(%rbp),%edx
lea    0xe2b(%rip),%rax
lea    0xe27(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
mov    -0x18(%rbp),%edx
lea    0xe10(%rip),%rax
lea    0xe00(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
mov    -0x18(%rbp),%edx
lea    0xdf5(%rip),%rax
lea    0xdd9(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1262 <GetBlockDataTransferTypeString+0x162>
lea    0xdc7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBlockDataTransferTypeString>:
lea    (%rdx,%rdi,4),%eax
lea    (%rax,%rsi,2),%eax
cmp    $0x7,%eax
ja     1126 <GetBlockDataTransferTypeString+0x26>
lea    0xeee(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
test   %ecx,%ecx
lea    0xeff(%rip),%rcx
jmp    1197 <GetBlockDataTransferTypeString+0x97>
lea    0xef8(%rip),%rax
ret
test   %ecx,%ecx
lea    0xef2(%rip),%rcx
jmp    1182 <GetBlockDataTransferTypeString+0x82>
test   %ecx,%ecx
lea    0xeed(%rip),%rcx
jmp    116d <GetBlockDataTransferTypeString+0x6d>
test   %ecx,%ecx
lea    0xee8(%rip),%rcx
jmp    1158 <GetBlockDataTransferTypeString+0x58>
test   %ecx,%ecx
lea    0xecb(%rip),%rcx
lea    0xed3(%rip),%rax
cmove  %rcx,%rax
ret
test   %ecx,%ecx
lea    0xebc(%rip),%rcx
lea    0xeb8(%rip),%rax
cmove  %rcx,%rax
ret
test   %ecx,%ecx
lea    0xead(%rip),%rcx
lea    0xe9d(%rip),%rax
cmove  %rcx,%rax
ret
test   %ecx,%ecx
lea    0xe9e(%rip),%rcx
lea    0xe82(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ED\00"
@.str.1 = [3 x i8] c"DA\00"
@.str.2 = [3 x i8] c"EA\00"
@.str.3 = [3 x i8] c"IA\00"
@.str.4 = [3 x i8] c"FD\00"
@.str.5 = [3 x i8] c"DB\00"
@.str.6 = [3 x i8] c"FA\00"
@.str.7 = [3 x i8] c"IB\00"
@.str.8 = [1 x i8] zeroinitializer
define i8* @GetBlockDataTransferTypeString(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %8
%12 = load i32, i32* %7
%13 = mul i32 %12, 2
%14 = add i32 %11, %13
%15 = load i32, i32* %6
%16 = mul i32 %15, 4
%17 = add i32 %14, %16
store i32 %17, i32* %10
%18 = load i32, i32* %10
switch i32 %18, label %59 [
i32 0, label %19
i32 1, label %24
i32 2, label %29
i32 3, label %34
i32 4, label %39
i32 5, label %44
i32 6, label %49
i32 7, label %54
]
19: ; preds = %4
%20 = load i32, i32* %9
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
store i8* %23, i8** %5
br label %60
24: ; preds = %4
%25 = load i32, i32* %9
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
store i8* %28, i8** %5
br label %60
29: ; preds = %4
%30 = load i32, i32* %9
%31 = icmp ne i32 %30, 0
%32 = zext i1 %31 to i64
%33 = select i1 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
store i8* %33, i8** %5
br label %60
34: ; preds = %4
%35 = load i32, i32* %9
%36 = icmp ne i32 %35, 0
%37 = zext i1 %36 to i64
%38 = select i1 %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0)
store i8* %38, i8** %5
br label %60
39: ; preds = %4
%40 = load i32, i32* %9
%41 = icmp ne i32 %40, 0
%42 = zext i1 %41 to i64
%43 = select i1 %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
store i8* %43, i8** %5
br label %60
44: ; preds = %4
%45 = load i32, i32* %9
%46 = icmp ne i32 %45, 0
%47 = zext i1 %46 to i64
%48 = select i1 %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
store i8* %48, i8** %5
br label %60
49: ; preds = %4
%50 = load i32, i32* %9
%51 = icmp ne i32 %50, 0
%52 = zext i1 %51 to i64
%53 = select i1 %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
store i8* %53, i8** %5
br label %60
54: ; preds = %4
%55 = load i32, i32* %9
%56 = icmp ne i32 %55, 0
%57 = zext i1 %56 to i64
%58 = select i1 %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0)
store i8* %58, i8** %5
br label %60
59: ; preds = %4
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i8** %5
br label %60
60: ; preds = %59, %54, %49, %44, %39, %34, %29, %24, %19
%61 = load i8*, i8** %5
ret i8* %61
}

LLVM IR (-O2):
@.str = [3 x i8] c"ED\00"
@.str.1 = [3 x i8] c"DA\00"
@.str.2 = [3 x i8] c"EA\00"
@.str.3 = [3 x i8] c"IA\00"
@.str.4 = [3 x i8] c"FD\00"
@.str.5 = [3 x i8] c"DB\00"
@.str.6 = [3 x i8] c"FA\00"
@.str.7 = [3 x i8] c"IB\00"
@.str.8 = [1 x i8] zeroinitializer
define i8* @GetBlockDataTransferTypeString(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 1
%6 = shl i32 %0, 2
%7 = add i32 %6, %2
%8 = add i32 %7, %5
switch i32 %8, label %33 [
i32 0, label %9
i32 1, label %12
i32 2, label %15
i32 3, label %18
i32 4, label %21
i32 5, label %24
i32 6, label %27
i32 7, label %30
]
9: ; preds = %4
%10 = icmp eq i32 %3, 0
%11 = select i1 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
br label %33
12: ; preds = %4
%13 = icmp eq i32 %3, 0
%14 = select i1 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
br label %33
15: ; preds = %4
%16 = icmp eq i32 %3, 0
%17 = select i1 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
br label %33
18: ; preds = %4
%19 = icmp eq i32 %3, 0
%20 = select i1 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)
br label %33
21: ; preds = %4
%22 = icmp eq i32 %3, 0
%23 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)
br label %33
24: ; preds = %4
%25 = icmp eq i32 %3, 0
%26 = select i1 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
br label %33
27: ; preds = %4
%28 = icmp eq i32 %3, 0
%29 = select i1 %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
br label %33
30: ; preds = %4
%31 = icmp eq i32 %3, 0
%32 = select i1 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
br label %33
33: ; preds = %4, %30, %27, %24, %21, %18, %15, %12, %9
%34 = phi i8* [ %32, %30 ], [ %29, %27 ], [ %26, %24 ], [ %23, %21 ], [ %20, %18 ], [ %17, %15 ], [ %14, %12 ], [ %11, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), %4 ]
ret i8* %34
}