#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 */
int B1000000;
int B110;
int B115200;
int B1200;
int B134;
int B150;
int B1800;
int B19200;
int B200;
int B230400;
int B2400;
int B300;
int B38400;
int B460800;
int B4800;
int B50;
int B500000;
int B57600;
int B576000;
int B600;
int B75;
int B921600;
int B9600;
int /*<<< orphan*/ printf(char *);
int get_baudrate(int baudrate) {
  int baudr;
  switch (baudrate) {
  case 50:
    baudr = B50;
    break;
  case 75:
    baudr = B75;
    break;
  case 110:
    baudr = B110;
    break;
  case 134:
    baudr = B134;
    break;
  case 150:
    baudr = B150;
    break;
  case 200:
    baudr = B200;
    break;
  case 300:
    baudr = B300;
    break;
  case 600:
    baudr = B600;
    break;
  case 1200:
    baudr = B1200;
    break;
  case 1800:
    baudr = B1800;
    break;
  case 2400:
    baudr = B2400;
    break;
  case 4800:
    baudr = B4800;
    break;
  case 9600:
    baudr = B9600;
    break;
  case 19200:
    baudr = B19200;
    break;
  case 38400:
    baudr = B38400;
    break;
  case 57600:
    baudr = B57600;
    break;
  case 115200:
    baudr = B115200;
    break;
  case 230400:
    baudr = B230400;
    break;
  case 460800:
    baudr = B460800;
    break;
  case 500000:
    baudr = B500000;
    break;
  case 576000:
    baudr = B576000;
    break;
  case 921600:
    baudr = B921600;
    break;
  case 1000000:
    baudr = B1000000;
    break;
  default:
    printf("invalid baudrate\n");
    return (1);
    break;
  }
  return baudr;
}


x86 assembly (clang, -O0):
<get_baudrate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x32,%eax
je     12cd <get_baudrate+0x1bd>
jmp    112f <get_baudrate+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x4b,%eax
je     12de <get_baudrate+0x1ce>
jmp    1140 <get_baudrate+0x30>
mov    -0x10(%rbp),%eax
sub    $0x6e,%eax
je     12ef <get_baudrate+0x1df>
jmp    1151 <get_baudrate+0x41>
mov    -0x10(%rbp),%eax
sub    $0x86,%eax
je     1300 <get_baudrate+0x1f0>
jmp    1164 <get_baudrate+0x54>
mov    -0x10(%rbp),%eax
sub    $0x96,%eax
je     1311 <get_baudrate+0x201>
jmp    1177 <get_baudrate+0x67>
mov    -0x10(%rbp),%eax
sub    $0xc8,%eax
je     1322 <get_baudrate+0x212>
jmp    118a <get_baudrate+0x7a>
mov    -0x10(%rbp),%eax
sub    $0x12c,%eax
je     1333 <get_baudrate+0x223>
jmp    119d <get_baudrate+0x8d>
mov    -0x10(%rbp),%eax
sub    $0x258,%eax
je     1344 <get_baudrate+0x234>
jmp    11b0 <get_baudrate+0xa0>
mov    -0x10(%rbp),%eax
sub    $0x4b0,%eax
je     1355 <get_baudrate+0x245>
jmp    11c3 <get_baudrate+0xb3>
mov    -0x10(%rbp),%eax
sub    $0x708,%eax
je     1366 <get_baudrate+0x256>
jmp    11d6 <get_baudrate+0xc6>
mov    -0x10(%rbp),%eax
sub    $0x960,%eax
je     1377 <get_baudrate+0x267>
jmp    11e9 <get_baudrate+0xd9>
mov    -0x10(%rbp),%eax
sub    $0x12c0,%eax
je     1388 <get_baudrate+0x278>
jmp    11fc <get_baudrate+0xec>
mov    -0x10(%rbp),%eax
sub    $0x2580,%eax
je     1399 <get_baudrate+0x289>
jmp    120f <get_baudrate+0xff>
mov    -0x10(%rbp),%eax
sub    $0x4b00,%eax
je     13aa <get_baudrate+0x29a>
jmp    1222 <get_baudrate+0x112>
mov    -0x10(%rbp),%eax
sub    $0x9600,%eax
je     13bb <get_baudrate+0x2ab>
jmp    1235 <get_baudrate+0x125>
mov    -0x10(%rbp),%eax
sub    $0xe100,%eax
je     13cc <get_baudrate+0x2bc>
jmp    1248 <get_baudrate+0x138>
mov    -0x10(%rbp),%eax
sub    $0x1c200,%eax
je     13dd <get_baudrate+0x2cd>
jmp    125b <get_baudrate+0x14b>
mov    -0x10(%rbp),%eax
sub    $0x38400,%eax
je     13ee <get_baudrate+0x2de>
jmp    126e <get_baudrate+0x15e>
mov    -0x10(%rbp),%eax
sub    $0x70800,%eax
je     13ff <get_baudrate+0x2ef>
jmp    1281 <get_baudrate+0x171>
mov    -0x10(%rbp),%eax
sub    $0x7a120,%eax
je     1410 <get_baudrate+0x300>
jmp    1294 <get_baudrate+0x184>
mov    -0x10(%rbp),%eax
sub    $0x8ca00,%eax
je     1421 <get_baudrate+0x311>
jmp    12a7 <get_baudrate+0x197>
mov    -0x10(%rbp),%eax
sub    $0xe1000,%eax
je     1432 <get_baudrate+0x322>
jmp    12ba <get_baudrate+0x1aa>
mov    -0x10(%rbp),%eax
sub    $0xf4240,%eax
je     1443 <get_baudrate+0x333>
jmp    1454 <get_baudrate+0x344>
mov    0x2cc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2cf3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2cea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2cb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2bf4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2bea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c08(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2c3f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2bad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b3b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b29(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
mov    0x2b3e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    146c <get_baudrate+0x35c>
lea    0xba5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1472 <get_baudrate+0x362>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_baudrate>:
push   %rax
cmp    $0x12bf,%edi
jle    1161 <get_baudrate+0x51>
cmp    $0x383ff,%edi
jg     11a5 <get_baudrate+0x95>
cmp    $0x95ff,%edi
jg     1217 <get_baudrate+0x107>
cmp    $0x12c0,%edi
je     12c5 <get_baudrate+0x1b5>
cmp    $0x2580,%edi
je     12ce <get_baudrate+0x1be>
cmp    $0x4b00,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2e94(%rip),%rax
jmp    134a <get_baudrate+0x23a>
cmp    $0xc7,%edi
jle    11e1 <get_baudrate+0xd1>
cmp    $0x4af,%edi
jg     1247 <get_baudrate+0x137>
cmp    $0xc8,%edi
je     12d7 <get_baudrate+0x1c7>
cmp    $0x12c,%edi
je     12e0 <get_baudrate+0x1d0>
cmp    $0x258,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2e30(%rip),%rax
jmp    134a <get_baudrate+0x23a>
cmp    $0x8c9ff,%edi
jg     1277 <get_baudrate+0x167>
cmp    $0x38400,%edi
je     12e9 <get_baudrate+0x1d9>
cmp    $0x70800,%edi
je     12f2 <get_baudrate+0x1e2>
cmp    $0x7a120,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2d64(%rip),%rax
jmp    134a <get_baudrate+0x23a>
cmp    $0x6d,%edi
jle    12a7 <get_baudrate+0x197>
cmp    $0x6e,%edi
je     12fb <get_baudrate+0x1eb>
cmp    $0x86,%edi
je     1304 <get_baudrate+0x1f4>
cmp    $0x96,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2d4e(%rip),%rax
jmp    134a <get_baudrate+0x23a>
cmp    $0x9600,%edi
je     130d <get_baudrate+0x1fd>
cmp    $0xe100,%edi
je     1316 <get_baudrate+0x206>
cmp    $0x1c200,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2d06(%rip),%rax
jmp    134a <get_baudrate+0x23a>
cmp    $0x4b0,%edi
je     131f <get_baudrate+0x20f>
cmp    $0x708,%edi
je     1328 <get_baudrate+0x218>
cmp    $0x960,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2cf6(%rip),%rax
jmp    134a <get_baudrate+0x23a>
cmp    $0x8ca00,%edi
je     1331 <get_baudrate+0x221>
cmp    $0xe1000,%edi
je     133a <get_baudrate+0x22a>
cmp    $0xf4240,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2ce6(%rip),%rax
jmp    134a <get_baudrate+0x23a>
cmp    $0x32,%edi
je     1343 <get_baudrate+0x233>
cmp    $0x4b,%edi
jne    134e <get_baudrate+0x23e>
mov    0x2d18(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2ce4(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2cd3(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2cb2(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2cb9(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c40(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c5f(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2cde(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2cb5(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c14(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c63(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c2a(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c41(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c80(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c87(%rip),%rax
jmp    134a <get_baudrate+0x23a>
mov    0x2c4e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
lea    0xcab(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@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
@B19200 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
@B230400 = global i32 0
@B460800 = global i32 0
@B500000 = global i32 0
@B576000 = global i32 0
@B921600 = global i32 0
@B1000000 = global i32 0
@.str = [18 x i8] c"invalid baudrate\0A\00"
define i32 @get_baudrate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
switch i32 %5, label %52 [
i32 50, label %6
i32 75, label %8
i32 110, label %10
i32 134, label %12
i32 150, label %14
i32 200, label %16
i32 300, label %18
i32 600, label %20
i32 1200, label %22
i32 1800, label %24
i32 2400, label %26
i32 4800, label %28
i32 9600, label %30
i32 19200, label %32
i32 38400, label %34
i32 57600, label %36
i32 115200, label %38
i32 230400, label %40
i32 460800, label %42
i32 500000, label %44
i32 576000, label %46
i32 921600, label %48
i32 1000000, label %50
]
6: ; preds = %1
%7 = load i32, i32* @B50
store i32 %7, i32* %4
br label %54
8: ; preds = %1
%9 = load i32, i32* @B75
store i32 %9, i32* %4
br label %54
10: ; preds = %1
%11 = load i32, i32* @B110
store i32 %11, i32* %4
br label %54
12: ; preds = %1
%13 = load i32, i32* @B134
store i32 %13, i32* %4
br label %54
14: ; preds = %1
%15 = load i32, i32* @B150
store i32 %15, i32* %4
br label %54
16: ; preds = %1
%17 = load i32, i32* @B200
store i32 %17, i32* %4
br label %54
18: ; preds = %1
%19 = load i32, i32* @B300
store i32 %19, i32* %4
br label %54
20: ; preds = %1
%21 = load i32, i32* @B600
store i32 %21, i32* %4
br label %54
22: ; preds = %1
%23 = load i32, i32* @B1200
store i32 %23, i32* %4
br label %54
24: ; preds = %1
%25 = load i32, i32* @B1800
store i32 %25, i32* %4
br label %54
26: ; preds = %1
%27 = load i32, i32* @B2400
store i32 %27, i32* %4
br label %54
28: ; preds = %1
%29 = load i32, i32* @B4800
store i32 %29, i32* %4
br label %54
30: ; preds = %1
%31 = load i32, i32* @B9600
store i32 %31, i32* %4
br label %54
32: ; preds = %1
%33 = load i32, i32* @B19200
store i32 %33, i32* %4
br label %54
34: ; preds = %1
%35 = load i32, i32* @B38400
store i32 %35, i32* %4
br label %54
36: ; preds = %1
%37 = load i32, i32* @B57600
store i32 %37, i32* %4
br label %54
38: ; preds = %1
%39 = load i32, i32* @B115200
store i32 %39, i32* %4
br label %54
40: ; preds = %1
%41 = load i32, i32* @B230400
store i32 %41, i32* %4
br label %54
42: ; preds = %1
%43 = load i32, i32* @B460800
store i32 %43, i32* %4
br label %54
44: ; preds = %1
%45 = load i32, i32* @B500000
store i32 %45, i32* %4
br label %54
46: ; preds = %1
%47 = load i32, i32* @B576000
store i32 %47, i32* %4
br label %54
48: ; preds = %1
%49 = load i32, i32* @B921600
store i32 %49, i32* %4
br label %54
50: ; preds = %1
%51 = load i32, i32* @B1000000
store i32 %51, i32* %4
br label %54
52: ; preds = %1
%53 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %56
54: ; preds = %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6
%55 = load i32, i32* %4
store i32 %55, i32* %2
br label %56
56: ; preds = %54, %52
%57 = load i32, i32* %2
ret i32 %57
}

LLVM IR (-O2):
@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
@B19200 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
@B230400 = global i32 0
@B460800 = global i32 0
@B500000 = global i32 0
@B576000 = global i32 0
@B921600 = global i32 0
@B1000000 = global i32 0
@str = [17 x i8] c"invalid baudrate\00"
define i32 @get_baudrate(i32 %0) {
switch i32 %0, label %24 [
i32 50, label %26
i32 75, label %2
i32 110, label %3
i32 134, label %4
i32 150, label %5
i32 200, label %6
i32 300, label %7
i32 600, label %8
i32 1200, label %9
i32 1800, label %10
i32 2400, label %11
i32 4800, label %12
i32 9600, label %13
i32 19200, label %14
i32 38400, label %15
i32 57600, label %16
i32 115200, label %17
i32 230400, label %18
i32 460800, label %19
i32 500000, label %20
i32 576000, label %21
i32 921600, label %22
i32 1000000, label %23
]
2: ; preds = %1
br label %26
3: ; preds = %1
br label %26
4: ; preds = %1
br label %26
5: ; preds = %1
br label %26
6: ; preds = %1
br label %26
7: ; preds = %1
br label %26
8: ; preds = %1
br label %26
9: ; preds = %1
br label %26
10: ; preds = %1
br label %26
11: ; preds = %1
br label %26
12: ; preds = %1
br label %26
13: ; preds = %1
br label %26
14: ; preds = %1
br label %26
15: ; preds = %1
br label %26
16: ; preds = %1
br label %26
17: ; preds = %1
br label %26
18: ; preds = %1
br label %26
19: ; preds = %1
br label %26
20: ; preds = %1
br label %26
21: ; preds = %1
br label %26
22: ; preds = %1
br label %26
23: ; preds = %1
br label %26
24: ; preds = %1
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %29
26: ; preds = %1, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%27 = phi i32* [ @B1000000, %23 ], [ @B921600, %22 ], [ @B576000, %21 ], [ @B500000, %20 ], [ @B460800, %19 ], [ @B230400, %18 ], [ @B115200, %17 ], [ @B57600, %16 ], [ @B38400, %15 ], [ @B19200, %14 ], [ @B9600, %13 ], [ @B4800, %12 ], [ @B2400, %11 ], [ @B1800, %10 ], [ @B1200, %9 ], [ @B600, %8 ], [ @B300, %7 ], [ @B200, %6 ], [ @B150, %5 ], [ @B134, %4 ], [ @B110, %3 ], [ @B75, %2 ], [ @B50, %1 ]
%28 = load i32, i32* %27
br label %29
29: ; preds = %26, %24
%30 = phi i32 [ 1, %24 ], [ %28, %26 ]
ret i32 %30
}