#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 */
#define B0 139
#define B115200 138
#define B1200 137
#define B150 136
#define B19200 135
#define B2400 134
#define B300 133
#define B4800 132
#define B50 131
#define B600 130
#define B75 129
#define B9600 128
char *pbaud(long x) {
  switch (x) {
  case B0:
    return "0";
  case B50:
    return "50";
  case B75:
    return "75";
  case B150:
    return "150";
  case B300:
    return "300";
  case B600:
    return "600";
  case B1200:
    return "1200";
  case B2400:
    return "2400";
  case B4800:
    return "4800";
  case B9600:
    return "9600";
  case B19200:
    return "19200";
  case B115200:
    return "115200";
  default:
    return "????";
  }
}


x86 assembly (clang, -O0):
<pbaud>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffff80,%rax
mov    %rax,-0x18(%rbp)
sub    $0xb,%rax
ja     11f2 <pbaud+0xf2>
mov    -0x18(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf05(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xeeb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xed7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xeca(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xe8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xe81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xe76(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xe6c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fd <pbaud+0xfd>
lea    0xe63(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbaud>:
add    $0xffffffffffffff80,%rdi
cmp    $0xb,%rdi
ja     1119 <pbaud+0x19>
lea    0xf23(%rip),%rcx
movslq (%rcx,%rdi,4),%rax
add    %rcx,%rax
ret
lea    0xf0c(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [3 x i8] c"50\00"
@.str.2 = [3 x i8] c"75\00"
@.str.3 = [4 x i8] c"150\00"
@.str.4 = [4 x i8] c"300\00"
@.str.5 = [4 x i8] c"600\00"
@.str.6 = [5 x i8] c"1200\00"
@.str.7 = [5 x i8] c"2400\00"
@.str.8 = [5 x i8] c"4800\00"
@.str.9 = [5 x i8] c"9600\00"
@.str.10 = [6 x i8] c"19200\00"
@.str.11 = [7 x i8] c"115200\00"
@.str.12 = [5 x i8] c"????\00"
define i8* @pbaud(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %17 [
i64 139, label %5
i64 131, label %6
i64 129, label %7
i64 136, label %8
i64 133, label %9
i64 130, label %10
i64 137, label %11
i64 134, label %12
i64 132, label %13
i64 128, label %14
i64 135, label %15
i64 138, label %16
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %18
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %18
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %18
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %18
9: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %18
10: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %18
11: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %18
12: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %18
13: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %18
14: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %18
15: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %18
16: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %18
17: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [3 x i8] c"50\00"
@.str.2 = [3 x i8] c"75\00"
@.str.3 = [4 x i8] c"150\00"
@.str.4 = [4 x i8] c"300\00"
@.str.5 = [4 x i8] c"600\00"
@.str.6 = [5 x i8] c"1200\00"
@.str.7 = [5 x i8] c"2400\00"
@.str.8 = [5 x i8] c"4800\00"
@.str.9 = [5 x i8] c"9600\00"
@.str.10 = [6 x i8] c"19200\00"
@.str.11 = [7 x i8] c"115200\00"
@.str.12 = [5 x i8] c"????\00"
@reltable.pbaud = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.pbaud to i64)) to i32)]
define i8* @pbaud(i64 %0) {
%2 = add i64 %0, -128
%3 = icmp ult i64 %2, 12
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = shl i64 %2, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.pbaud to i8*), i64 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), %1 ]
ret i8* %8
}