const char *request_get_color(int code) {
  int base = code - (code % 100);
  switch (base) {
  case 200:
  case 300:
    return "32";
  case 500:
    return "31";
  case 400:
  default:
    return "33";
  }
}


x86 assembly (clang, -O0):
<request_get_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0xc8,%eax
je     1174 <request_get_color+0x74>
jmp    113b <request_get_color+0x3b>
mov    -0x14(%rbp),%eax
sub    $0x12c,%eax
je     1174 <request_get_color+0x74>
jmp    114e <request_get_color+0x4e>
mov    -0x14(%rbp),%eax
sub    $0x190,%eax
je     1194 <request_get_color+0x94>
jmp    1161 <request_get_color+0x61>
mov    -0x14(%rbp),%eax
sub    $0x1f4,%eax
je     1184 <request_get_color+0x84>
jmp    1199 <request_get_color+0x99>
lea    0xe85(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <request_get_color+0xa4>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <request_get_color+0xa4>
jmp    1199 <request_get_color+0x99>
lea    0xe66(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_get_color>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
lea    0xedf(%rip),%rax
cmp    $0xc8,%ecx
je     1148 <request_get_color+0x48>
cmp    $0x12c,%ecx
je     1148 <request_get_color+0x48>
cmp    $0x1f4,%ecx
jne    1141 <request_get_color+0x41>
lea    0xec3(%rip),%rax
ret
lea    0xebe(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"32\00"
@.str.1 = [3 x i8] c"31\00"
@.str.2 = [3 x i8] c"33\00"
define i8* @request_get_color(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = srem i32 %6, 100
%8 = sub nsw i32 %5, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
switch i32 %9, label %13 [
i32 200, label %10
i32 300, label %10
i32 500, label %11
i32 400, label %12
]
10: ; preds = %1, %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
11: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %14
12: ; preds = %1
br label %13
13: ; preds = %1, %12
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %14
14: ; preds = %13, %11, %10
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"32\00"
@.str.1 = [3 x i8] c"31\00"
@.str.2 = [3 x i8] c"33\00"
define i8* @request_get_color(i32 %0) {
%2 = srem i32 %0, 100
%3 = sub nsw i32 %0, %2
switch i32 %3, label %5 [
i32 200, label %6
i32 300, label %6
i32 500, label %4
]
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4
%7 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}