#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 */
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int /*<<< orphan*/ B0;
int /*<<< orphan*/ B110;
int /*<<< orphan*/ B1200;
int /*<<< orphan*/ B134;
int /*<<< orphan*/ B150;
int /*<<< orphan*/ B1800;
int /*<<< orphan*/ B200;
int /*<<< orphan*/ B2400;
int /*<<< orphan*/ B300;
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ B50;
int /*<<< orphan*/ B600;
int /*<<< orphan*/ B75;
int /*<<< orphan*/ B9600;
speed_t baud_to_speed(int baud) {
  switch (baud) {
  case 0:
    return B0;
  case 50:
    return B50;
  case 75:
    return B75;
  case 110:
    return B110;
  case 134:
    return B134;
  case 150:
    return B150;
  case 200:
    return B200;
  case 300:
    return B300;
  case 600:
    return B600;
  case 1200:
    return B1200;
  case 1800:
    return B1800;
  case 2400:
    return B2400;
  case 4800:
    return B4800;
  case 9600:
    return B9600;
  default:
    return B9600;
  }
}


x86 assembly (clang, -O0):
<baud_to_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     120b <baud_to_speed+0x10b>
jmp    111a <baud_to_speed+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
je     121c <baud_to_speed+0x11c>
jmp    112b <baud_to_speed+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x4b,%eax
je     122d <baud_to_speed+0x12d>
jmp    113c <baud_to_speed+0x3c>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     123e <baud_to_speed+0x13e>
jmp    114d <baud_to_speed+0x4d>
mov    -0xc(%rbp),%eax
sub    $0x86,%eax
je     124f <baud_to_speed+0x14f>
jmp    1160 <baud_to_speed+0x60>
mov    -0xc(%rbp),%eax
sub    $0x96,%eax
je     1260 <baud_to_speed+0x160>
jmp    1173 <baud_to_speed+0x73>
mov    -0xc(%rbp),%eax
sub    $0xc8,%eax
je     1271 <baud_to_speed+0x171>
jmp    1186 <baud_to_speed+0x86>
mov    -0xc(%rbp),%eax
sub    $0x12c,%eax
je     1282 <baud_to_speed+0x182>
jmp    1199 <baud_to_speed+0x99>
mov    -0xc(%rbp),%eax
sub    $0x258,%eax
je     1293 <baud_to_speed+0x193>
jmp    11ac <baud_to_speed+0xac>
mov    -0xc(%rbp),%eax
sub    $0x4b0,%eax
je     12a4 <baud_to_speed+0x1a4>
jmp    11bf <baud_to_speed+0xbf>
mov    -0xc(%rbp),%eax
sub    $0x708,%eax
je     12b5 <baud_to_speed+0x1b5>
jmp    11d2 <baud_to_speed+0xd2>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     12c6 <baud_to_speed+0x1c6>
jmp    11e5 <baud_to_speed+0xe5>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     12d7 <baud_to_speed+0x1d7>
jmp    11f8 <baud_to_speed+0xf8>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     12e8 <baud_to_speed+0x1e8>
jmp    12f9 <baud_to_speed+0x1f9>
mov    0x2d86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2d8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2dac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2d7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2d19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2d30(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2d2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2d3e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2ccd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2cd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2cbb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2cea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2cd1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1305 <baud_to_speed+0x205>
mov    0x2cc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baud_to_speed>:
cmp    $0x12b,%edi
jg     1138 <baud_to_speed+0x38>
cmp    $0x6d,%edi
jle    1166 <baud_to_speed+0x66>
cmp    $0x95,%edi
jg     11a8 <baud_to_speed+0xa8>
cmp    $0x6e,%edi
je     11da <baud_to_speed+0xda>
cmp    $0x86,%edi
jne    11d0 <baud_to_speed+0xd0>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x707,%edi
jle    1186 <baud_to_speed+0x86>
cmp    $0x12bf,%edi
jg     11c2 <baud_to_speed+0xc2>
cmp    $0x708,%edi
je     11e4 <baud_to_speed+0xe4>
cmp    $0x960,%edi
jne    11d0 <baud_to_speed+0xd0>
mov    0x2e25(%rip),%rax
mov    (%rax),%eax
ret
test   %edi,%edi
je     11ee <baud_to_speed+0xee>
cmp    $0x32,%edi
je     11f8 <baud_to_speed+0xf8>
cmp    $0x4b,%edi
jne    11d0 <baud_to_speed+0xd0>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x12c,%edi
je     1202 <baud_to_speed+0x102>
cmp    $0x258,%edi
je     120c <baud_to_speed+0x10c>
cmp    $0x4b0,%edi
jne    11d0 <baud_to_speed+0xd0>
mov    0x2dd3(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x96,%edi
je     1216 <baud_to_speed+0x116>
cmp    $0xc8,%edi
jne    11d0 <baud_to_speed+0xd0>
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x12c0,%edi
je     1220 <baud_to_speed+0x120>
cmp    $0x2580,%edi
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2d63(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@B0 = global i32 0
@B50 = global i32 0
@B75 = global i32 0
@B110 = global i32 0
@B134 = global i32 0
@B150 = global i32 0
@B200 = global i32 0
@B300 = global i32 0
@B600 = global i32 0
@B1200 = global i32 0
@B1800 = global i32 0
@B2400 = global i32 0
@B4800 = global i32 0
@B9600 = global i32 0
define i32 @baud_to_speed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %33 [
i32 0, label %5
i32 50, label %7
i32 75, label %9
i32 110, label %11
i32 134, label %13
i32 150, label %15
i32 200, label %17
i32 300, label %19
i32 600, label %21
i32 1200, label %23
i32 1800, label %25
i32 2400, label %27
i32 4800, label %29
i32 9600, label %31
]
5: ; preds = %1
%6 = load i32, i32* @B0
store i32 %6, i32* %2
br label %35
7: ; preds = %1
%8 = load i32, i32* @B50
store i32 %8, i32* %2
br label %35
9: ; preds = %1
%10 = load i32, i32* @B75
store i32 %10, i32* %2
br label %35
11: ; preds = %1
%12 = load i32, i32* @B110
store i32 %12, i32* %2
br label %35
13: ; preds = %1
%14 = load i32, i32* @B134
store i32 %14, i32* %2
br label %35
15: ; preds = %1
%16 = load i32, i32* @B150
store i32 %16, i32* %2
br label %35
17: ; preds = %1
%18 = load i32, i32* @B200
store i32 %18, i32* %2
br label %35
19: ; preds = %1
%20 = load i32, i32* @B300
store i32 %20, i32* %2
br label %35
21: ; preds = %1
%22 = load i32, i32* @B600
store i32 %22, i32* %2
br label %35
23: ; preds = %1
%24 = load i32, i32* @B1200
store i32 %24, i32* %2
br label %35
25: ; preds = %1
%26 = load i32, i32* @B1800
store i32 %26, i32* %2
br label %35
27: ; preds = %1
%28 = load i32, i32* @B2400
store i32 %28, i32* %2
br label %35
29: ; preds = %1
%30 = load i32, i32* @B4800
store i32 %30, i32* %2
br label %35
31: ; preds = %1
%32 = load i32, i32* @B9600
store i32 %32, i32* %2
br label %35
33: ; preds = %1
%34 = load i32, i32* @B9600
store i32 %34, i32* %2
br label %35
35: ; preds = %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
@B0 = global i32 0
@B50 = global i32 0
@B75 = global i32 0
@B110 = global i32 0
@B134 = global i32 0
@B150 = global i32 0
@B200 = global i32 0
@B300 = global i32 0
@B600 = global i32 0
@B1200 = global i32 0
@B1800 = global i32 0
@B2400 = global i32 0
@B4800 = global i32 0
@B9600 = global i32 0
define i32 @baud_to_speed(i32 %0) {
switch i32 %0, label %15 [
i32 0, label %16
i32 50, label %2
i32 75, label %3
i32 110, label %4
i32 134, label %5
i32 150, label %6
i32 200, label %7
i32 300, label %8
i32 600, label %9
i32 1200, label %10
i32 1800, label %11
i32 2400, label %12
i32 4800, label %13
i32 9600, label %14
]
2: ; preds = %1
br label %16
3: ; preds = %1
br label %16
4: ; preds = %1
br label %16
5: ; preds = %1
br label %16
6: ; preds = %1
br label %16
7: ; preds = %1
br label %16
8: ; preds = %1
br label %16
9: ; preds = %1
br label %16
10: ; preds = %1
br label %16
11: ; preds = %1
br label %16
12: ; preds = %1
br label %16
13: ; preds = %1
br label %16
14: ; preds = %1
br label %16
15: ; preds = %1
br label %16
16: ; preds = %1, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%17 = phi i32* [ @B9600, %15 ], [ @B9600, %14 ], [ @B4800, %13 ], [ @B2400, %12 ], [ @B1800, %11 ], [ @B1200, %10 ], [ @B600, %9 ], [ @B300, %8 ], [ @B200, %7 ], [ @B150, %6 ], [ @B134, %5 ], [ @B110, %4 ], [ @B75, %3 ], [ @B50, %2 ], [ @B0, %1 ]
%18 = load i32, i32* %17
ret i32 %18
}