#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*/ B115200;
int /*<<< orphan*/ B1200;
int /*<<< orphan*/ B1800;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B230400;
int /*<<< orphan*/ B2400;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ B57600;
int /*<<< orphan*/ B9600;
speed_t convertBaud(int baud) {
  switch (baud) {
  case 1200:
    return B1200;
  case 1800:
    return B1800;
  case 2400:
    return B2400;
  case 4800:
    return B4800;
  case 9600:
    return B9600;
  case 19200:
    return B19200;
  case 38400:
    return B38400;
  case 57600:
    return B57600;
  case 115200:
    return B115200;
  case 230400:
    return B230400;
  default:
    return B0;
  }
}


x86 assembly (clang, -O0):
<convertBaud>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4b0,%eax
je     11c8 <convertBaud+0xc8>
jmp    111d <convertBaud+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x708,%eax
je     11d9 <convertBaud+0xd9>
jmp    1130 <convertBaud+0x30>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     11ea <convertBaud+0xea>
jmp    1143 <convertBaud+0x43>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     11fb <convertBaud+0xfb>
jmp    1156 <convertBaud+0x56>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     120c <convertBaud+0x10c>
jmp    1169 <convertBaud+0x69>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     121d <convertBaud+0x11d>
jmp    117c <convertBaud+0x7c>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     122e <convertBaud+0x12e>
jmp    118f <convertBaud+0x8f>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     123f <convertBaud+0x13f>
jmp    11a2 <convertBaud+0xa2>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     1250 <convertBaud+0x150>
jmp    11b5 <convertBaud+0xb5>
mov    -0xc(%rbp),%eax
sub    $0x38400,%eax
je     1261 <convertBaud+0x161>
jmp    1272 <convertBaud+0x172>
mov    0x2dd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2dbf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2dde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2dcc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2d53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2d8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2d49(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2d28(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <convertBaud+0x17e>
mov    0x2d47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertBaud>:
cmp    $0x4aff,%edi
jg     1136 <convertBaud+0x36>
cmp    $0x95f,%edi
jle    1160 <convertBaud+0x60>
cmp    $0x960,%edi
je     1194 <convertBaud+0x94>
cmp    $0x12c0,%edi
je     119e <convertBaud+0x9e>
cmp    $0x2580,%edi
jne    11d0 <convertBaud+0xd0>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0xe0ff,%edi
jle    117a <convertBaud+0x7a>
cmp    $0xe100,%edi
je     11a8 <convertBaud+0xa8>
cmp    $0x1c200,%edi
je     11b2 <convertBaud+0xb2>
cmp    $0x38400,%edi
jne    11d0 <convertBaud+0xd0>
mov    0x2e33(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x4b0,%edi
je     11bc <convertBaud+0xbc>
cmp    $0x708,%edi
jne    11d0 <convertBaud+0xd0>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x4b00,%edi
je     11c6 <convertBaud+0xc6>
cmp    $0x9600,%edi
jne    11d0 <convertBaud+0xd0>
mov    0x2df7(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e3b(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2de7(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@B1200 = global i32 0
@B1800 = 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
@B230400 = global i32 0
@B0 = global i32 0
define i32 @convertBaud(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %25 [
i32 1200, label %5
i32 1800, label %7
i32 2400, label %9
i32 4800, label %11
i32 9600, label %13
i32 19200, label %15
i32 38400, label %17
i32 57600, label %19
i32 115200, label %21
i32 230400, label %23
]
5: ; preds = %1
%6 = load i32, i32* @B1200
store i32 %6, i32* %2
br label %27
7: ; preds = %1
%8 = load i32, i32* @B1800
store i32 %8, i32* %2
br label %27
9: ; preds = %1
%10 = load i32, i32* @B2400
store i32 %10, i32* %2
br label %27
11: ; preds = %1
%12 = load i32, i32* @B4800
store i32 %12, i32* %2
br label %27
13: ; preds = %1
%14 = load i32, i32* @B9600
store i32 %14, i32* %2
br label %27
15: ; preds = %1
%16 = load i32, i32* @B19200
store i32 %16, i32* %2
br label %27
17: ; preds = %1
%18 = load i32, i32* @B38400
store i32 %18, i32* %2
br label %27
19: ; preds = %1
%20 = load i32, i32* @B57600
store i32 %20, i32* %2
br label %27
21: ; preds = %1
%22 = load i32, i32* @B115200
store i32 %22, i32* %2
br label %27
23: ; preds = %1
%24 = load i32, i32* @B230400
store i32 %24, i32* %2
br label %27
25: ; preds = %1
%26 = load i32, i32* @B0
store i32 %26, i32* %2
br label %27
27: ; preds = %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@B1200 = global i32 0
@B1800 = 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
@B230400 = global i32 0
@B0 = global i32 0
define i32 @convertBaud(i32 %0) {
switch i32 %0, label %11 [
i32 1200, label %12
i32 1800, label %2
i32 2400, label %3
i32 4800, label %4
i32 9600, label %5
i32 19200, label %6
i32 38400, label %7
i32 57600, label %8
i32 115200, label %9
i32 230400, label %10
]
2: ; preds = %1
br label %12
3: ; preds = %1
br label %12
4: ; preds = %1
br label %12
5: ; preds = %1
br label %12
6: ; preds = %1
br label %12
7: ; preds = %1
br label %12
8: ; preds = %1
br label %12
9: ; preds = %1
br label %12
10: ; preds = %1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %1, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%13 = phi i32* [ @B0, %11 ], [ @B230400, %10 ], [ @B115200, %9 ], [ @B57600, %8 ], [ @B38400, %7 ], [ @B19200, %6 ], [ @B9600, %5 ], [ @B4800, %4 ], [ @B2400, %3 ], [ @B1800, %2 ], [ @B1200, %1 ]
%14 = load i32, i32* %13
ret i32 %14
}