#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 *GetBitmapVersion(size_t headerSize) {
  switch (headerSize) {
  case 12:
    return "OS/2 v1";
  case 64:
    return "OS/2 v2";
  case 40:
    return "Windows v3";
  case 108:
    return "Windows v4";
  case 124:
    return "Windows v5";
  default:
    return "Unknown";
  }
}


x86 assembly (clang, -O0):
<GetBitmapVersion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0xc,%rax
je     116b <GetBitmapVersion+0x6b>
jmp    111f <GetBitmapVersion+0x1f>
mov    -0x18(%rbp),%rax
sub    $0x28,%rax
je     118b <GetBitmapVersion+0x8b>
jmp    1132 <GetBitmapVersion+0x32>
mov    -0x18(%rbp),%rax
sub    $0x40,%rax
je     117b <GetBitmapVersion+0x7b>
jmp    1145 <GetBitmapVersion+0x45>
mov    -0x18(%rbp),%rax
sub    $0x6c,%rax
je     119b <GetBitmapVersion+0x9b>
jmp    1158 <GetBitmapVersion+0x58>
mov    -0x18(%rbp),%rax
sub    $0x7c,%rax
je     11ab <GetBitmapVersion+0xab>
jmp    11bb <GetBitmapVersion+0xbb>
lea    0xe8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <GetBitmapVersion+0xc6>
lea    0xe86(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <GetBitmapVersion+0xc6>
lea    0xe7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <GetBitmapVersion+0xc6>
lea    0xe79(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <GetBitmapVersion+0xc6>
lea    0xe74(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <GetBitmapVersion+0xc6>
lea    0xe6f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBitmapVersion>:
cmp    $0x3f,%rdi
jle    1120 <GetBitmapVersion+0x20>
cmp    $0x7c,%rdi
je     1134 <GetBitmapVersion+0x34>
cmp    $0x6c,%rdi
je     113c <GetBitmapVersion+0x3c>
cmp    $0x40,%rdi
jne    114c <GetBitmapVersion+0x4c>
lea    0xee9(%rip),%rax
ret
cmp    $0xc,%rdi
je     1144 <GetBitmapVersion+0x44>
cmp    $0x28,%rdi
jne    114c <GetBitmapVersion+0x4c>
lea    0xedd(%rip),%rax
ret
lea    0xeeb(%rip),%rax
ret
lea    0xed8(%rip),%rax
ret
lea    0xeb5(%rip),%rax
ret
lea    0xede(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"OS/2 v1\00"
@.str.1 = [8 x i8] c"OS/2 v2\00"
@.str.2 = [11 x i8] c"Windows v3\00"
@.str.3 = [11 x i8] c"Windows v4\00"
@.str.4 = [11 x i8] c"Windows v5\00"
@.str.5 = [8 x i8] c"Unknown\00"
define i8* @GetBitmapVersion(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %10 [
i64 12, label %5
i64 64, label %6
i64 40, label %7
i64 108, label %8
i64 124, label %9
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %11
7: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %11
10: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"OS/2 v1\00"
@.str.1 = [8 x i8] c"OS/2 v2\00"
@.str.2 = [11 x i8] c"Windows v3\00"
@.str.3 = [11 x i8] c"Windows v4\00"
@.str.4 = [11 x i8] c"Windows v5\00"
@.str.5 = [8 x i8] c"Unknown\00"
define i8* @GetBitmapVersion(i64 %0) {
switch i64 %0, label %6 [
i64 12, label %7
i64 64, label %2
i64 40, label %3
i64 108, label %4
i64 124, label %5
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}