#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
const char *get_keylayout_name(int keylayout) {
  const char *layout_name;
  switch (keylayout) {
  case 0x409:
    layout_name = "us";
    break;
  case 0x40c:
    layout_name = "fr";
    break;
  case 0x809:
    layout_name = "uk";
    break;
  case 0x407:
    layout_name = "de";
    break;
  case 0x416:
    layout_name = "pt";
    break;
  case 0x410:
    layout_name = "it";
    break;
  case 0x41d:
    layout_name = "sv";
    break;
  case 0x405:
    layout_name = "cs";
    break;
  case 0x419:
    layout_name = "su";
    break;
  default:
    layout_name = NULL;
  }
  return layout_name;
}


x86 assembly (clang, -O0):
<get_keylayout_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x405,%eax
je     1225 <get_keylayout_name+0x125>
jmp    111d <get_keylayout_name+0x1d>
mov    -0x14(%rbp),%eax
sub    $0x407,%eax
je     11e5 <get_keylayout_name+0xe5>
jmp    1130 <get_keylayout_name+0x30>
mov    -0x14(%rbp),%eax
sub    $0x409,%eax
je     11b5 <get_keylayout_name+0xb5>
jmp    1143 <get_keylayout_name+0x43>
mov    -0x14(%rbp),%eax
sub    $0x40c,%eax
je     11c5 <get_keylayout_name+0xc5>
jmp    1156 <get_keylayout_name+0x56>
mov    -0x14(%rbp),%eax
sub    $0x410,%eax
je     1205 <get_keylayout_name+0x105>
jmp    1169 <get_keylayout_name+0x69>
mov    -0x14(%rbp),%eax
sub    $0x416,%eax
je     11f5 <get_keylayout_name+0xf5>
jmp    117c <get_keylayout_name+0x7c>
mov    -0x14(%rbp),%eax
sub    $0x419,%eax
je     1235 <get_keylayout_name+0x135>
jmp    118f <get_keylayout_name+0x8f>
mov    -0x14(%rbp),%eax
sub    $0x41d,%eax
je     1215 <get_keylayout_name+0x115>
jmp    11a2 <get_keylayout_name+0xa2>
mov    -0x14(%rbp),%eax
sub    $0x809,%eax
je     11d5 <get_keylayout_name+0xd5>
jmp    1245 <get_keylayout_name+0x145>
lea    0xe44(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xe37(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xe2a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xe1d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xe10(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xe03(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xdf6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xde9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
lea    0xddc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124d <get_keylayout_name+0x14d>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_keylayout_name>:
lea    -0x405(%rdi),%ecx
cmp    $0x18,%ecx
ja     112a <get_keylayout_name+0x2a>
lea    0xf52(%rip),%rax
lea    0xee7(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf50(%rip),%rax
ret
cmp    $0x809,%edi
jne    113a <get_keylayout_name+0x3a>
lea    0xf31(%rip),%rax
ret
xor    %eax,%eax
ret
lea    0xf29(%rip),%rax
ret
lea    0xf1b(%rip),%rax
ret
lea    0xf1f(%rip),%rax
ret
lea    0xf14(%rip),%rax
ret
lea    0xf18(%rip),%rax
ret
lea    0xf0a(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"us\00"
@.str.1 = [3 x i8] c"fr\00"
@.str.2 = [3 x i8] c"uk\00"
@.str.3 = [3 x i8] c"de\00"
@.str.4 = [3 x i8] c"pt\00"
@.str.5 = [3 x i8] c"it\00"
@.str.6 = [3 x i8] c"sv\00"
@.str.7 = [3 x i8] c"cs\00"
@.str.8 = [3 x i8] c"su\00"
define i8* @get_keylayout_name(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %14 [
i32 1033, label %5
i32 1036, label %6
i32 2057, label %7
i32 1031, label %8
i32 1046, label %9
i32 1040, label %10
i32 1053, label %11
i32 1029, label %12
i32 1049, label %13
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
br label %15
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %15
12: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %15
14: ; preds = %1
store i8* null, i8** %3
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"us\00"
@.str.1 = [3 x i8] c"fr\00"
@.str.2 = [3 x i8] c"uk\00"
@.str.3 = [3 x i8] c"de\00"
@.str.4 = [3 x i8] c"pt\00"
@.str.5 = [3 x i8] c"it\00"
@.str.6 = [3 x i8] c"sv\00"
@.str.7 = [3 x i8] c"cs\00"
@.str.8 = [3 x i8] c"su\00"
define i8* @get_keylayout_name(i32 %0) {
switch i32 %0, label %10 [
i32 1033, label %11
i32 1036, label %2
i32 2057, label %3
i32 1031, label %4
i32 1046, label %5
i32 1040, label %6
i32 1053, label %7
i32 1029, label %8
i32 1049, label %9
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i8* [ null, %10 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}