const char *getSectionName(unsigned long section) {
  if (section == 0x100)
    return "IPL";
  if (section == 0x101)
    return "G3IPL";
  if (section == 0x102)
    return "G4IPL";
  if (section == 0x200)
    return "SPL";
  if (section == 0x201)
    return "G3SPL";
  if (section == 0x202)
    return "G4SPL";
  if (section == 0x300 || section == 0x301)
    return "GSM";
  if (section == 0x400 || section == 0x401)
    return "OS";
  if (section == 0x500)
    return "DIAG";
  if (section == 0x600)
    return "MainSplash";
  if (section == 0x601)
    return "SubSplash";
  if (section == 0x700 || section == 0x900)
    return "ExtROM";
  if (section == 0xB05)
    return "Recovery";
  if (section == 0xB06)
    return "UserData";
  if (section == 0xB04)
    return "LinuxBoot";
  if (section == 0xB02)
    return "LinuxSystem";
  if (section == 0xA00)
    return "MCPLD";
  return "unknown";
}


x86 assembly (clang, -O0):
<getSectionName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x100,-0x10(%rbp)
jne    1126 <getSectionName+0x26>
lea    0xee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x101,-0x10(%rbp)
jne    1144 <getSectionName+0x44>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x102,-0x10(%rbp)
jne    1162 <getSectionName+0x62>
lea    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x200,-0x10(%rbp)
jne    1180 <getSectionName+0x80>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x201,-0x10(%rbp)
jne    119e <getSectionName+0x9e>
lea    0xe77(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x202,-0x10(%rbp)
jne    11bc <getSectionName+0xbc>
lea    0xe5f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x300,-0x10(%rbp)
je     11d8 <getSectionName+0xd8>
cmpq   $0x301,-0x10(%rbp)
jne    11e8 <getSectionName+0xe8>
lea    0xe39(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x400,-0x10(%rbp)
je     1204 <getSectionName+0x104>
cmpq   $0x401,-0x10(%rbp)
jne    1214 <getSectionName+0x114>
lea    0xe11(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x500,-0x10(%rbp)
jne    1232 <getSectionName+0x132>
lea    0xdf6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x600,-0x10(%rbp)
jne    1250 <getSectionName+0x150>
lea    0xddd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x601,-0x10(%rbp)
jne    126e <getSectionName+0x16e>
lea    0xdca(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0x700,-0x10(%rbp)
je     128a <getSectionName+0x18a>
cmpq   $0x900,-0x10(%rbp)
jne    129a <getSectionName+0x19a>
lea    0xda8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0xb05,-0x10(%rbp)
jne    12b8 <getSectionName+0x1b8>
lea    0xd91(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0xb06,-0x10(%rbp)
jne    12d6 <getSectionName+0x1d6>
lea    0xd7c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0xb04,-0x10(%rbp)
jne    12f4 <getSectionName+0x1f4>
lea    0xd67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0xb02,-0x10(%rbp)
jne    1312 <getSectionName+0x212>
lea    0xd53(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
cmpq   $0xa00,-0x10(%rbp)
jne    1330 <getSectionName+0x230>
lea    0xd41(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    133b <getSectionName+0x23b>
lea    0xd37(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSectionName>:
cmp    $0x1ff,%rdi
jg     112c <getSectionName+0x2c>
cmp    $0x100,%rdi
je     114f <getSectionName+0x4f>
cmp    $0x101,%rdi
je     1157 <getSectionName+0x57>
cmp    $0x102,%rdi
jne    116f <getSectionName+0x6f>
lea    0xeef(%rip),%rax
ret
cmp    $0x200,%rdi
je     115f <getSectionName+0x5f>
cmp    $0x201,%rdi
je     1167 <getSectionName+0x67>
cmp    $0x202,%rdi
jne    116f <getSectionName+0x6f>
lea    0xed8(%rip),%rax
ret
lea    0xec0(%rip),%rax
ret
lea    0xeb6(%rip),%rax
ret
lea    0xebc(%rip),%rax
ret
lea    0xeb2(%rip),%rax
ret
mov    %rdi,%rax
and    $0xfffffffffffffffe,%rax
cmp    $0x300,%rax
je     118e <getSectionName+0x8e>
cmp    $0x400,%rax
jne    1196 <getSectionName+0x96>
lea    0xea3(%rip),%rax
ret
lea    0xe97(%rip),%rax
ret
cmp    $0x8ff,%rdi
jg     11c2 <getSectionName+0xc2>
cmp    $0x600,%rdi
jg     11e7 <getSectionName+0xe7>
cmp    $0x500,%rdi
je     121d <getSectionName+0x11d>
cmp    $0x600,%rdi
jne    122d <getSectionName+0x12d>
lea    0xe77(%rip),%rax
ret
lea    -0xb02(%rdi),%rax
cmp    $0x4,%rax
ja     11fb <getSectionName+0xfb>
lea    0xe2a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe8a(%rip),%rax
ret
cmp    $0x601,%rdi
je     1225 <getSectionName+0x125>
cmp    $0x700,%rdi
je     1215 <getSectionName+0x115>
jmp    122d <getSectionName+0x12d>
cmp    $0x900,%rdi
je     1215 <getSectionName+0x115>
cmp    $0xa00,%rdi
jne    122d <getSectionName+0x12d>
lea    0xe68(%rip),%rax
ret
lea    0xe31(%rip),%rax
ret
lea    0xe0f(%rip),%rax
ret
lea    0xe17(%rip),%rax
ret
lea    0xe4e(%rip),%rax
ret
lea    0xe2a(%rip),%rax
ret
lea    0xe10(%rip),%rax
ret
lea    0xe11(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"IPL\00"
@.str.1 = [6 x i8] c"G3IPL\00"
@.str.2 = [6 x i8] c"G4IPL\00"
@.str.3 = [4 x i8] c"SPL\00"
@.str.4 = [6 x i8] c"G3SPL\00"
@.str.5 = [6 x i8] c"G4SPL\00"
@.str.6 = [4 x i8] c"GSM\00"
@.str.7 = [3 x i8] c"OS\00"
@.str.8 = [5 x i8] c"DIAG\00"
@.str.9 = [11 x i8] c"MainSplash\00"
@.str.10 = [10 x i8] c"SubSplash\00"
@.str.11 = [7 x i8] c"ExtROM\00"
@.str.12 = [9 x i8] c"Recovery\00"
@.str.13 = [9 x i8] c"UserData\00"
@.str.14 = [10 x i8] c"LinuxBoot\00"
@.str.15 = [12 x i8] c"LinuxSystem\00"
@.str.16 = [6 x i8] c"MCPLD\00"
@.str.17 = [8 x i8] c"unknown\00"
define i8* @getSectionName(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 256
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %81
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 257
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %81
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp eq i64 %12, 258
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %81
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp eq i64 %16, 512
br i1 %17, label %18, label %19
18: ; preds = %15
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %81
19: ; preds = %15
%20 = load i64, i64* %3
%21 = icmp eq i64 %20, 513
br i1 %21, label %22, label %23
22: ; preds = %19
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %81
23: ; preds = %19
%24 = load i64, i64* %3
%25 = icmp eq i64 %24, 514
br i1 %25, label %26, label %27
26: ; preds = %23
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %81
27: ; preds = %23
%28 = load i64, i64* %3
%29 = icmp eq i64 %28, 768
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = load i64, i64* %3
%32 = icmp eq i64 %31, 769
br i1 %32, label %33, label %34
33: ; preds = %30, %27
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %81
34: ; preds = %30
%35 = load i64, i64* %3
%36 = icmp eq i64 %35, 1024
br i1 %36, label %40, label %37
37: ; preds = %34
%38 = load i64, i64* %3
%39 = icmp eq i64 %38, 1025
br i1 %39, label %40, label %41
40: ; preds = %37, %34
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %81
41: ; preds = %37
%42 = load i64, i64* %3
%43 = icmp eq i64 %42, 1280
br i1 %43, label %44, label %45
44: ; preds = %41
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %81
45: ; preds = %41
%46 = load i64, i64* %3
%47 = icmp eq i64 %46, 1536
br i1 %47, label %48, label %49
48: ; preds = %45
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %81
49: ; preds = %45
%50 = load i64, i64* %3
%51 = icmp eq i64 %50, 1537
br i1 %51, label %52, label %53
52: ; preds = %49
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %81
53: ; preds = %49
%54 = load i64, i64* %3
%55 = icmp eq i64 %54, 1792
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = load i64, i64* %3
%58 = icmp eq i64 %57, 2304
br i1 %58, label %59, label %60
59: ; preds = %56, %53
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %81
60: ; preds = %56
%61 = load i64, i64* %3
%62 = icmp eq i64 %61, 2821
br i1 %62, label %63, label %64
63: ; preds = %60
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %81
64: ; preds = %60
%65 = load i64, i64* %3
%66 = icmp eq i64 %65, 2822
br i1 %66, label %67, label %68
67: ; preds = %64
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %81
68: ; preds = %64
%69 = load i64, i64* %3
%70 = icmp eq i64 %69, 2820
br i1 %70, label %71, label %72
71: ; preds = %68
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %81
72: ; preds = %68
%73 = load i64, i64* %3
%74 = icmp eq i64 %73, 2818
br i1 %74, label %75, label %76
75: ; preds = %72
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %81
76: ; preds = %72
%77 = load i64, i64* %3
%78 = icmp eq i64 %77, 2560
br i1 %78, label %79, label %80
79: ; preds = %76
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %81
80: ; preds = %76
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %81
81: ; preds = %80, %79, %75, %71, %67, %63, %59, %52, %48, %44, %40, %33, %26, %22, %18, %14, %10, %6
%82 = load i8*, i8** %2
ret i8* %82
}

LLVM IR (-O2):
@.str = [4 x i8] c"IPL\00"
@.str.1 = [6 x i8] c"G3IPL\00"
@.str.2 = [6 x i8] c"G4IPL\00"
@.str.3 = [4 x i8] c"SPL\00"
@.str.4 = [6 x i8] c"G3SPL\00"
@.str.5 = [6 x i8] c"G4SPL\00"
@.str.6 = [4 x i8] c"GSM\00"
@.str.7 = [3 x i8] c"OS\00"
@.str.8 = [5 x i8] c"DIAG\00"
@.str.9 = [11 x i8] c"MainSplash\00"
@.str.10 = [10 x i8] c"SubSplash\00"
@.str.11 = [7 x i8] c"ExtROM\00"
@.str.12 = [9 x i8] c"Recovery\00"
@.str.13 = [9 x i8] c"UserData\00"
@.str.14 = [10 x i8] c"LinuxBoot\00"
@.str.15 = [12 x i8] c"LinuxSystem\00"
@.str.16 = [6 x i8] c"MCPLD\00"
@.str.17 = [8 x i8] c"unknown\00"
define i8* @getSectionName(i64 %0) {
switch i64 %0, label %7 [
i64 256, label %20
i64 257, label %2
i64 258, label %3
i64 512, label %4
i64 513, label %5
i64 514, label %6
]
2: ; preds = %1
br label %20
3: ; preds = %1
br label %20
4: ; preds = %1
br label %20
5: ; preds = %1
br label %20
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = and i64 %0, -2
switch i64 %8, label %9 [
i64 768, label %20
i64 1024, label %19
]
9: ; preds = %7
switch i64 %0, label %17 [
i64 1280, label %20
i64 1536, label %10
i64 1537, label %11
i64 2304, label %18
i64 1792, label %18
i64 2821, label %12
i64 2822, label %13
i64 2820, label %14
i64 2818, label %15
i64 2560, label %16
]
10: ; preds = %9
br label %20
11: ; preds = %9
br label %20
12: ; preds = %9
br label %20
13: ; preds = %9
br label %20
14: ; preds = %9
br label %20
15: ; preds = %9
br label %20
16: ; preds = %9
br label %20
17: ; preds = %9
br label %20
18: ; preds = %9, %9
br label %20
19: ; preds = %7
br label %20
20: ; preds = %7, %19, %9, %18, %1, %17, %16, %15, %14, %13, %12, %11, %10, %6, %5, %4, %3, %2
%21 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), %12 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), %13 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), %14 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), %15 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), %16 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), %17 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), %18 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %19 ]
ret i8* %21
}