#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 B115200;
int B19200;
int B230400;
int B38400;
int B460800;
int B500000;
int B57600;
int B576000;
int B921600;
int B9600;
int get_baud(int baud) {
  switch (baud) {
  case 9600:
    return B9600;
  case 19200:
    return B19200;
  case 38400:
    return B38400;
  case 57600:
    return B57600;
  case 115200:
    return B115200;
  case 230400:
    return B230400;
  case 460800:
    return B460800;
  case 500000:
    return B500000;
  case 576000:
    return B576000;
  case 921600:
    return B921600;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_baud>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2580,%eax
je     11c8 <get_baud+0xc8>
jmp    111d <get_baud+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     11d9 <get_baud+0xd9>
jmp    1130 <get_baud+0x30>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     11ea <get_baud+0xea>
jmp    1143 <get_baud+0x43>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     11fb <get_baud+0xfb>
jmp    1156 <get_baud+0x56>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     120c <get_baud+0x10c>
jmp    1169 <get_baud+0x69>
mov    -0xc(%rbp),%eax
sub    $0x38400,%eax
je     121d <get_baud+0x11d>
jmp    117c <get_baud+0x7c>
mov    -0xc(%rbp),%eax
sub    $0x70800,%eax
je     122e <get_baud+0x12e>
jmp    118f <get_baud+0x8f>
mov    -0xc(%rbp),%eax
sub    $0x7a120,%eax
je     123f <get_baud+0x13f>
jmp    11a2 <get_baud+0xa2>
mov    -0xc(%rbp),%eax
sub    $0x8ca00,%eax
je     1250 <get_baud+0x150>
jmp    11b5 <get_baud+0xb5>
mov    -0xc(%rbp),%eax
sub    $0xe1000,%eax
je     1261 <get_baud+0x161>
jmp    1272 <get_baud+0x172>
mov    0x2e01(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2e10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2d9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2d74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2d83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2d62(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1279 <get_baud+0x179>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_baud>:
mov    $0xffffffff,%eax
cmp    $0x383ff,%edi
jg     113d <get_baud+0x3d>
cmp    $0x95ff,%edi
jle    1166 <get_baud+0x66>
cmp    $0x9600,%edi
je     1198 <get_baud+0x98>
cmp    $0xe100,%edi
je     11a1 <get_baud+0xa1>
cmp    $0x1c200,%edi
jne    11ce <get_baud+0xce>
mov    0x2e78(%rip),%rax
jmp    11cc <get_baud+0xcc>
cmp    $0x7a11f,%edi
jle    117f <get_baud+0x7f>
cmp    $0x7a120,%edi
je     11aa <get_baud+0xaa>
cmp    $0x8ca00,%edi
je     11b3 <get_baud+0xb3>
cmp    $0xe1000,%edi
jne    11ce <get_baud+0xce>
mov    0x2e7c(%rip),%rax
jmp    11cc <get_baud+0xcc>
cmp    $0x2580,%edi
je     11bc <get_baud+0xbc>
cmp    $0x4b00,%edi
jne    11ce <get_baud+0xce>
mov    0x2e73(%rip),%rax
jmp    11cc <get_baud+0xcc>
cmp    $0x38400,%edi
je     11c5 <get_baud+0xc5>
cmp    $0x70800,%edi
jne    11ce <get_baud+0xce>
mov    0x2e22(%rip),%rax
jmp    11cc <get_baud+0xcc>
mov    0x2df1(%rip),%rax
jmp    11cc <get_baud+0xcc>
mov    0x2e20(%rip),%rax
jmp    11cc <get_baud+0xcc>
mov    0x2df7(%rip),%rax
jmp    11cc <get_baud+0xcc>
mov    0x2e1e(%rip),%rax
jmp    11cc <get_baud+0xcc>
mov    0x2e0d(%rip),%rax
jmp    11cc <get_baud+0xcc>
mov    0x2dcc(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@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
define i32 @get_baud(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %25 [
i32 9600, label %5
i32 19200, label %7
i32 38400, label %9
i32 57600, label %11
i32 115200, label %13
i32 230400, label %15
i32 460800, label %17
i32 500000, label %19
i32 576000, label %21
i32 921600, label %23
]
5: ; preds = %1
%6 = load i32, i32* @B9600
store i32 %6, i32* %2
br label %26
7: ; preds = %1
%8 = load i32, i32* @B19200
store i32 %8, i32* %2
br label %26
9: ; preds = %1
%10 = load i32, i32* @B38400
store i32 %10, i32* %2
br label %26
11: ; preds = %1
%12 = load i32, i32* @B57600
store i32 %12, i32* %2
br label %26
13: ; preds = %1
%14 = load i32, i32* @B115200
store i32 %14, i32* %2
br label %26
15: ; preds = %1
%16 = load i32, i32* @B230400
store i32 %16, i32* %2
br label %26
17: ; preds = %1
%18 = load i32, i32* @B460800
store i32 %18, i32* %2
br label %26
19: ; preds = %1
%20 = load i32, i32* @B500000
store i32 %20, i32* %2
br label %26
21: ; preds = %1
%22 = load i32, i32* @B576000
store i32 %22, i32* %2
br label %26
23: ; preds = %1
%24 = load i32, i32* @B921600
store i32 %24, i32* %2
br label %26
25: ; preds = %1
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@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
define i32 @get_baud(i32 %0) {
switch i32 %0, label %22 [
i32 9600, label %2
i32 19200, label %4
i32 38400, label %6
i32 57600, label %8
i32 115200, label %10
i32 230400, label %12
i32 460800, label %14
i32 500000, label %16
i32 576000, label %18
i32 921600, label %20
]
2: ; preds = %1
%3 = load i32, i32* @B9600
br label %22
4: ; preds = %1
%5 = load i32, i32* @B19200
br label %22
6: ; preds = %1
%7 = load i32, i32* @B38400
br label %22
8: ; preds = %1
%9 = load i32, i32* @B57600
br label %22
10: ; preds = %1
%11 = load i32, i32* @B115200
br label %22
12: ; preds = %1
%13 = load i32, i32* @B230400
br label %22
14: ; preds = %1
%15 = load i32, i32* @B460800
br label %22
16: ; preds = %1
%17 = load i32, i32* @B500000
br label %22
18: ; preds = %1
%19 = load i32, i32* @B576000
br label %22
20: ; preds = %1
%21 = load i32, i32* @B921600
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 ], [ -1, %1 ]
ret i32 %23
}