#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 B0;
int B115200;
int B1200;
int B19200;
int B2400;
int B300;
int B38400;
int B460800;
int B4800;
int B57600;
int B600;
int B9600;
int cBaudrate(int baudrate) {
  switch (baudrate) {
  case 0:
    return (B0);
    break;
  case 300:
    return (B300);
    break;
  case 600:
    return (B600);
    break;
  case 1200:
    return (B1200);
    break;
  case 2400:
    return (B2400);
    break;
  case 4800:
    return (B4800);
    break;
  case 9600:
    return (B9600);
    break;
  case 19200:
    return (B19200);
    break;
  case 38400:
    return (B38400);
    break;
  case 57600:
    return (B57600);
    break;
  case 115200:
    return (B115200);
    break;
  case 500000:
    return (B460800);
    break;
  default:
    return (B9600);
    break;
  }
}


x86 assembly (clang, -O0):
<cBaudrate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11eb <cBaudrate+0xeb>
jmp    111a <cBaudrate+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x12c,%eax
je     11fc <cBaudrate+0xfc>
jmp    112d <cBaudrate+0x2d>
mov    -0xc(%rbp),%eax
sub    $0x258,%eax
je     120d <cBaudrate+0x10d>
jmp    1140 <cBaudrate+0x40>
mov    -0xc(%rbp),%eax
sub    $0x4b0,%eax
je     121e <cBaudrate+0x11e>
jmp    1153 <cBaudrate+0x53>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     122f <cBaudrate+0x12f>
jmp    1166 <cBaudrate+0x66>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     1240 <cBaudrate+0x140>
jmp    1179 <cBaudrate+0x79>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     1251 <cBaudrate+0x151>
jmp    118c <cBaudrate+0x8c>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     1262 <cBaudrate+0x162>
jmp    119f <cBaudrate+0x9f>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     1273 <cBaudrate+0x173>
jmp    11b2 <cBaudrate+0xb2>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     1284 <cBaudrate+0x184>
jmp    11c5 <cBaudrate+0xc5>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     1295 <cBaudrate+0x195>
jmp    11d8 <cBaudrate+0xd8>
mov    -0xc(%rbp),%eax
sub    $0x7a120,%eax
je     12a6 <cBaudrate+0x1a6>
jmp    12b7 <cBaudrate+0x1b7>
mov    0x2dbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2dcc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2cf4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2cf3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c3 <cBaudrate+0x1c3>
mov    0x2d12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cBaudrate>:
cmp    $0x257f,%edi
jg     1136 <cBaudrate+0x36>
cmp    $0x4af,%edi
jg     1160 <cBaudrate+0x60>
test   %edi,%edi
je     11ae <cBaudrate+0xae>
cmp    $0x12c,%edi
je     11b8 <cBaudrate+0xb8>
cmp    $0x258,%edi
jne    11a4 <cBaudrate+0xa4>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0xe0ff,%edi
jg     1182 <cBaudrate+0x82>
cmp    $0x2580,%edi
je     11a4 <cBaudrate+0xa4>
cmp    $0x4b00,%edi
je     11c2 <cBaudrate+0xc2>
cmp    $0x9600,%edi
jne    11a4 <cBaudrate+0xa4>
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x4b0,%edi
je     11cc <cBaudrate+0xcc>
cmp    $0x960,%edi
je     11d6 <cBaudrate+0xd6>
cmp    $0x12c0,%edi
jne    11a4 <cBaudrate+0xa4>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0xe100,%edi
je     11e0 <cBaudrate+0xe0>
cmp    $0x1c200,%edi
je     11ea <cBaudrate+0xea>
cmp    $0x7a120,%edi
jne    11a4 <cBaudrate+0xa4>
mov    0x2dff(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e25(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2dfb(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e09(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2dcb(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2dd9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
ret

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

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