#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*/ B110;
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ B1200;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B2400;
int /*<<< orphan*/ B300;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ B57600;
int /*<<< orphan*/ B9600;
speed_t baudrate_map(unsigned long b) {
  speed_t retval;
  switch (b) {
  case 110:
    retval = B110;
    break;
  case 300:
    retval = B300;
    break;
  case 1200:
    retval = B1200;
    break;
  case 2400:
    retval = B2400;
    break;
  case 4800:
    retval = B4800;
    break;
  case 9600:
    retval = B9600;
    break;
  case 19200:
    retval = B19200;
    break;
  case 38400:
    retval = B38400;
    break;
  case 57600:
    retval = B57600;
    break;
  case 115200:
    retval = B115200;
    break;
  default:
    retval = 0;
    break;
  }
  return (retval);
}


x86 assembly (clang, -O0):
<baudrate_map>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x6e,%rax
je     11dc <baudrate_map+0xdc>
jmp    111f <baudrate_map+0x1f>
mov    -0x18(%rbp),%rax
sub    $0x12c,%rax
je     11ed <baudrate_map+0xed>
jmp    1134 <baudrate_map+0x34>
mov    -0x18(%rbp),%rax
sub    $0x4b0,%rax
je     11fe <baudrate_map+0xfe>
jmp    1149 <baudrate_map+0x49>
mov    -0x18(%rbp),%rax
sub    $0x960,%rax
je     120f <baudrate_map+0x10f>
jmp    115e <baudrate_map+0x5e>
mov    -0x18(%rbp),%rax
sub    $0x12c0,%rax
je     1220 <baudrate_map+0x120>
jmp    1173 <baudrate_map+0x73>
mov    -0x18(%rbp),%rax
sub    $0x2580,%rax
je     1231 <baudrate_map+0x131>
jmp    1188 <baudrate_map+0x88>
mov    -0x18(%rbp),%rax
sub    $0x4b00,%rax
je     1242 <baudrate_map+0x142>
jmp    119d <baudrate_map+0x9d>
mov    -0x18(%rbp),%rax
sub    $0x9600,%rax
je     1253 <baudrate_map+0x153>
jmp    11b2 <baudrate_map+0xb2>
mov    -0x18(%rbp),%rax
sub    $0xe100,%rax
je     1264 <baudrate_map+0x164>
jmp    11c7 <baudrate_map+0xc7>
mov    -0x18(%rbp),%rax
sub    $0x1c200,%rax
je     1275 <baudrate_map+0x175>
jmp    1286 <baudrate_map+0x186>
mov    0x2dfd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2dd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2d9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2d98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2da7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2d36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2d55(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
mov    0x2d24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    128d <baudrate_map+0x18d>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baudrate_map>:
xor    %eax,%eax
cmp    $0x257f,%rdi
jg     1147 <baudrate_map+0x47>
cmp    $0x4af,%rdi
jle    1174 <baudrate_map+0x74>
cmp    $0x4b0,%rdi
je     11a7 <baudrate_map+0xa7>
cmp    $0x960,%rdi
je     11b0 <baudrate_map+0xb0>
cmp    $0x12c0,%rdi
jne    11dd <baudrate_map+0xdd>
mov    0x2e96(%rip),%rax
jmp    11db <baudrate_map+0xdb>
cmp    $0x95ff,%rdi
jle    118c <baudrate_map+0x8c>
cmp    $0x9600,%rdi
je     11b9 <baudrate_map+0xb9>
cmp    $0xe100,%rdi
je     11c2 <baudrate_map+0xc2>
cmp    $0x1c200,%rdi
jne    11dd <baudrate_map+0xdd>
mov    0x2e2e(%rip),%rax
jmp    11db <baudrate_map+0xdb>
cmp    $0x6e,%rdi
je     11cb <baudrate_map+0xcb>
cmp    $0x12c,%rdi
jne    11dd <baudrate_map+0xdd>
mov    0x2e3e(%rip),%rax
jmp    11db <baudrate_map+0xdb>
cmp    $0x2580,%rdi
je     11d4 <baudrate_map+0xd4>
cmp    $0x4b00,%rdi
jne    11dd <baudrate_map+0xdd>
mov    0x2e4b(%rip),%rax
jmp    11db <baudrate_map+0xdb>
mov    0x2dfa(%rip),%rax
jmp    11db <baudrate_map+0xdb>
mov    0x2df9(%rip),%rax
jmp    11db <baudrate_map+0xdb>
mov    0x2dd0(%rip),%rax
jmp    11db <baudrate_map+0xdb>
mov    0x2df7(%rip),%rax
jmp    11db <baudrate_map+0xdb>
mov    0x2e0e(%rip),%rax
jmp    11db <baudrate_map+0xdb>
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@B110 = global i32 0
@B300 = global i32 0
@B1200 = global i32 0
@B2400 = global i32 0
@B4800 = global i32 0
@B9600 = global i32 0
@B19200 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
define i32 @baudrate_map(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
switch i64 %4, label %25 [
i64 110, label %5
i64 300, label %7
i64 1200, label %9
i64 2400, label %11
i64 4800, label %13
i64 9600, label %15
i64 19200, label %17
i64 38400, label %19
i64 57600, label %21
i64 115200, label %23
]
5: ; preds = %1
%6 = load i32, i32* @B110
store i32 %6, i32* %3
br label %26
7: ; preds = %1
%8 = load i32, i32* @B300
store i32 %8, i32* %3
br label %26
9: ; preds = %1
%10 = load i32, i32* @B1200
store i32 %10, i32* %3
br label %26
11: ; preds = %1
%12 = load i32, i32* @B2400
store i32 %12, i32* %3
br label %26
13: ; preds = %1
%14 = load i32, i32* @B4800
store i32 %14, i32* %3
br label %26
15: ; preds = %1
%16 = load i32, i32* @B9600
store i32 %16, i32* %3
br label %26
17: ; preds = %1
%18 = load i32, i32* @B19200
store i32 %18, i32* %3
br label %26
19: ; preds = %1
%20 = load i32, i32* @B38400
store i32 %20, i32* %3
br label %26
21: ; preds = %1
%22 = load i32, i32* @B57600
store i32 %22, i32* %3
br label %26
23: ; preds = %1
%24 = load i32, i32* @B115200
store i32 %24, i32* %3
br label %26
25: ; preds = %1
store i32 0, i32* %3
br label %26
26: ; preds = %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@B110 = global i32 0
@B300 = global i32 0
@B1200 = global i32 0
@B2400 = global i32 0
@B4800 = global i32 0
@B9600 = global i32 0
@B19200 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
define i32 @baudrate_map(i64 %0) {
switch i64 %0, label %22 [
i64 110, label %2
i64 300, label %4
i64 1200, label %6
i64 2400, label %8
i64 4800, label %10
i64 9600, label %12
i64 19200, label %14
i64 38400, label %16
i64 57600, label %18
i64 115200, label %20
]
2: ; preds = %1
%3 = load i32, i32* @B110
br label %22
4: ; preds = %1
%5 = load i32, i32* @B300
br label %22
6: ; preds = %1
%7 = load i32, i32* @B1200
br label %22
8: ; preds = %1
%9 = load i32, i32* @B2400
br label %22
10: ; preds = %1
%11 = load i32, i32* @B4800
br label %22
12: ; preds = %1
%13 = load i32, i32* @B9600
br label %22
14: ; preds = %1
%15 = load i32, i32* @B19200
br label %22
16: ; preds = %1
%17 = load i32, i32* @B38400
br label %22
18: ; preds = %1
%19 = load i32, i32* @B57600
br label %22
20: ; preds = %1
%21 = load i32, i32* @B115200
br label %22
22: ; preds = %1, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
%23 = phi i32 [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ 0, %1 ]
ret i32 %23
}