char *gsm_network2str(int id) {
  switch (id) {
  case 0:
    return "Not registered";
  case 1:
    return "Registered (Home network)";
  case 2:
    return "Searching";
  case 3:
    return "Registration denied";
  case 4:
    return "Unknown";
  case 5:
    return "Registered (Roaming)";
  case 99:
    return "Registered";
  default:
    return "Unknown Network Status";
  }
}


x86 assembly (clang, -O0):
<gsm_network2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1180 <gsm_network2str+0x80>
jmp    111a <gsm_network2str+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1190 <gsm_network2str+0x90>
jmp    112b <gsm_network2str+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11a0 <gsm_network2str+0xa0>
jmp    113c <gsm_network2str+0x3c>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11b0 <gsm_network2str+0xb0>
jmp    114d <gsm_network2str+0x4d>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     11c0 <gsm_network2str+0xc0>
jmp    115e <gsm_network2str+0x5e>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     11d0 <gsm_network2str+0xd0>
jmp    116f <gsm_network2str+0x6f>
mov    -0x10(%rbp),%eax
sub    $0x63,%eax
je     11e0 <gsm_network2str+0xe0>
jmp    11f0 <gsm_network2str+0xf0>
lea    0xe79(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <gsm_network2str+0xfb>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <gsm_network2str+0xfb>
lea    0xe82(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <gsm_network2str+0xfb>
lea    0xe7c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <gsm_network2str+0xfb>
lea    0xe80(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <gsm_network2str+0xfb>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <gsm_network2str+0xfb>
lea    0xe7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <gsm_network2str+0xfb>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_network2str>:
cmp    $0x5,%edi
ja     1126 <gsm_network2str+0x26>
lea    0xf0c(%rip),%rax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf02(%rip),%rax
ret
cmp    $0x63,%edi
jne    1153 <gsm_network2str+0x53>
lea    0xf4a(%rip),%rax
ret
lea    0xf07(%rip),%rax
ret
lea    0xf09(%rip),%rax
ret
lea    0xf15(%rip),%rax
ret
lea    0xf15(%rip),%rax
ret
lea    0xf2d(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Not registered\00"
@.str.1 = [26 x i8] c"Registered (Home network)\00"
@.str.2 = [10 x i8] c"Searching\00"
@.str.3 = [20 x i8] c"Registration denied\00"
@.str.4 = [8 x i8] c"Unknown\00"
@.str.5 = [21 x i8] c"Registered (Roaming)\00"
@.str.6 = [11 x i8] c"Registered\00"
@.str.7 = [23 x i8] c"Unknown Network Status\00"
define i8* @gsm_network2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 99, label %11
]
5: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
6: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %13
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %13
8: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %13
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %13
10: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %13
11: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %13
12: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"Not registered\00"
@.str.1 = [26 x i8] c"Registered (Home network)\00"
@.str.2 = [10 x i8] c"Searching\00"
@.str.3 = [20 x i8] c"Registration denied\00"
@.str.4 = [8 x i8] c"Unknown\00"
@.str.5 = [21 x i8] c"Registered (Roaming)\00"
@.str.6 = [11 x i8] c"Registered\00"
@.str.7 = [23 x i8] c"Unknown Network Status\00"
define i8* @gsm_network2str(i32 %0) {
switch i32 %0, label %8 [
i32 0, label %9
i32 1, label %2
i32 2, label %3
i32 3, label %4
i32 4, label %5
i32 5, label %6
i32 99, label %7
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3, %2
%10 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %10
}