char *errormsg(const unsigned char code) {
  switch (code) {
  case 1:
    return "too many arguments";
    break;
  case 2:
    return "unable to set UTC mode";
    break;
  case 3:
    return "unable to print result";
    break;
  case 4:
    return "invalid character in time string";
    break;
  case 5:
    return "time formatting failed";
    break;
  case 6:
    return "invalid seconds value";
    break;
  case 7:
    return "invalid time length";
    break;
  case 8:
    return "negative epoch time";
    break;
  case 9:
    return "invalid month";
    break;
  case 10:
    return "invalid day of month";
    break;
  case 11:
    return "invalid hour";
    break;
  case 12:
    return "invalid min";
    break;
  case 13:
    return "unable to set time";
    break;
  case 14:
    return "invalid command line";
    break;
  case 15:
    return "unable to allocate buffer!";
    break;
  case 100:
    return "help requested";
    break;
  default:
    return "unknown error";
    break;
  }
}


x86 assembly (clang, -O0):
<errormsg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x63,%eax
ja     1234 <errormsg+0x134>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1055(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x1058(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x105f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x1066(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x1077(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x107e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x1084(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x1088(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x108c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x108a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x108f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x108c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x1088(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x108b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x1090(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x109b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <errormsg+0x13f>
lea    0x109a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errormsg>:
add    $0xff,%dil
cmp    $0x63,%dil
ja     11a1 <errormsg+0xa1>
lea    0x107b(%rip),%rax
movzbl %dil,%ecx
lea    0xee0(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0x1073(%rip),%rax
ret
lea    0x1082(%rip),%rax
ret
lea    0x1091(%rip),%rax
ret
lea    0x10aa(%rip),%rax
ret
lea    0x10b9(%rip),%rax
ret
lea    0x10c7(%rip),%rax
ret
lea    0x10d3(%rip),%rax
ret
lea    0x10df(%rip),%rax
ret
lea    0x10e5(%rip),%rax
ret
lea    0x10f2(%rip),%rax
ret
lea    0x10f7(%rip),%rax
ret
lea    0x10fb(%rip),%rax
ret
lea    0x1106(%rip),%rax
ret
lea    0x1113(%rip),%rax
ret
lea    0x1126(%rip),%rax
ret
lea    0x112d(%rip),%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"too many arguments\00"
@.str.1 = [23 x i8] c"unable to set UTC mode\00"
@.str.2 = [23 x i8] c"unable to print result\00"
@.str.3 = [33 x i8] c"invalid character in time string\00"
@.str.4 = [23 x i8] c"time formatting failed\00"
@.str.5 = [22 x i8] c"invalid seconds value\00"
@.str.6 = [20 x i8] c"invalid time length\00"
@.str.7 = [20 x i8] c"negative epoch time\00"
@.str.8 = [14 x i8] c"invalid month\00"
@.str.9 = [21 x i8] c"invalid day of month\00"
@.str.10 = [13 x i8] c"invalid hour\00"
@.str.11 = [12 x i8] c"invalid min\00"
@.str.12 = [19 x i8] c"unable to set time\00"
@.str.13 = [21 x i8] c"invalid command line\00"
@.str.14 = [27 x i8] c"unable to allocate buffer!\00"
@.str.15 = [15 x i8] c"help requested\00"
@.str.16 = [14 x i8] c"unknown error\00"
define i8* @errormsg(i8 zeroext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %22 [
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
i32 10, label %15
i32 11, label %16
i32 12, label %17
i32 13, label %18
i32 14, label %19
i32 15, label %20
i32 100, label %21
]
6: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
br label %23
7: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %23
8: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %23
9: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %23
10: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %23
11: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %23
12: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %23
13: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %23
14: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %23
15: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %23
16: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %23
17: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %23
18: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %23
19: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %23
20: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %23
21: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %23
22: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %23
23: ; preds = %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
@.str = [19 x i8] c"too many arguments\00"
@.str.1 = [23 x i8] c"unable to set UTC mode\00"
@.str.2 = [23 x i8] c"unable to print result\00"
@.str.3 = [33 x i8] c"invalid character in time string\00"
@.str.4 = [23 x i8] c"time formatting failed\00"
@.str.5 = [22 x i8] c"invalid seconds value\00"
@.str.6 = [20 x i8] c"invalid time length\00"
@.str.7 = [20 x i8] c"negative epoch time\00"
@.str.8 = [14 x i8] c"invalid month\00"
@.str.9 = [21 x i8] c"invalid day of month\00"
@.str.10 = [13 x i8] c"invalid hour\00"
@.str.11 = [12 x i8] c"invalid min\00"
@.str.12 = [19 x i8] c"unable to set time\00"
@.str.13 = [21 x i8] c"invalid command line\00"
@.str.14 = [27 x i8] c"unable to allocate buffer!\00"
@.str.15 = [15 x i8] c"help requested\00"
@.str.16 = [14 x i8] c"unknown error\00"
define i8* @errormsg(i8 zeroext %0) {
switch i8 %0, label %17 [
i8 1, label %18
i8 2, label %2
i8 3, label %3
i8 4, label %4
i8 5, label %5
i8 6, label %6
i8 7, label %7
i8 8, label %8
i8 9, label %9
i8 10, label %10
i8 11, label %11
i8 12, label %12
i8 13, label %13
i8 14, label %14
i8 15, label %15
i8 100, label %16
]
2: ; preds = %1
br label %18
3: ; preds = %1
br label %18
4: ; preds = %1
br label %18
5: ; preds = %1
br label %18
6: ; preds = %1
br label %18
7: ; preds = %1
br label %18
8: ; preds = %1
br label %18
9: ; preds = %1
br label %18
10: ; preds = %1
br label %18
11: ; preds = %1
br label %18
12: ; preds = %1
br label %18
13: ; preds = %1
br label %18
14: ; preds = %1
br label %18
15: ; preds = %1
br label %18
16: ; preds = %1
br label %18
17: ; preds = %1
br label %18
18: ; preds = %1, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%19 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %19
}