#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 */
unsigned int B1000000;
unsigned int B115200;
unsigned int B1152000;
unsigned int B1500000;
unsigned int B19200;
unsigned int B2000000;
unsigned int B230400;
unsigned int B38400;
unsigned int B460800;
unsigned int B500000;
unsigned int B57600;
unsigned int B576000;
unsigned int B921600;
unsigned int B9600;
unsigned int tty_get_speed(int speed) {
  switch (speed) {
  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;
  case 1000000:
    return B1000000;
  case 1152000:
    return B1152000;
  case 1500000:
    return B1500000;
  case 2000000:
    return B2000000;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tty_get_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2580,%eax
je     1214 <tty_get_speed+0x114>
jmp    111d <tty_get_speed+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     1225 <tty_get_speed+0x125>
jmp    1130 <tty_get_speed+0x30>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     1236 <tty_get_speed+0x136>
jmp    1143 <tty_get_speed+0x43>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     1247 <tty_get_speed+0x147>
jmp    1156 <tty_get_speed+0x56>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     1258 <tty_get_speed+0x158>
jmp    1169 <tty_get_speed+0x69>
mov    -0xc(%rbp),%eax
sub    $0x38400,%eax
je     1269 <tty_get_speed+0x169>
jmp    117c <tty_get_speed+0x7c>
mov    -0xc(%rbp),%eax
sub    $0x70800,%eax
je     127a <tty_get_speed+0x17a>
jmp    118f <tty_get_speed+0x8f>
mov    -0xc(%rbp),%eax
sub    $0x7a120,%eax
je     128b <tty_get_speed+0x18b>
jmp    11a2 <tty_get_speed+0xa2>
mov    -0xc(%rbp),%eax
sub    $0x8ca00,%eax
je     129c <tty_get_speed+0x19c>
jmp    11b5 <tty_get_speed+0xb5>
mov    -0xc(%rbp),%eax
sub    $0xe1000,%eax
je     12ad <tty_get_speed+0x1ad>
jmp    11c8 <tty_get_speed+0xc8>
mov    -0xc(%rbp),%eax
sub    $0xf4240,%eax
je     12be <tty_get_speed+0x1be>
jmp    11db <tty_get_speed+0xdb>
mov    -0xc(%rbp),%eax
sub    $0x119400,%eax
je     12cf <tty_get_speed+0x1cf>
jmp    11ee <tty_get_speed+0xee>
mov    -0xc(%rbp),%eax
sub    $0x16e360,%eax
je     12e0 <tty_get_speed+0x1e0>
jmp    1201 <tty_get_speed+0x101>
mov    -0xc(%rbp),%eax
sub    $0x1e8480,%eax
je     12f1 <tty_get_speed+0x1f1>
jmp    1302 <tty_get_speed+0x202>
mov    0x2db5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d33(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d39(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d08(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d1f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2cfe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d2c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2d03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2cd2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2ca1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
mov    0x2cc8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1309 <tty_get_speed+0x209>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_get_speed>:
xor    %eax,%eax
cmp    $0x7a11f,%edi
jg     1142 <tty_get_speed+0x42>
cmp    $0xe0ff,%edi
jle    117a <tty_get_speed+0x7a>
cmp    $0x383ff,%edi
jg     11cf <tty_get_speed+0xcf>
cmp    $0xe100,%edi
je     1201 <tty_get_speed+0x101>
cmp    $0x1c200,%edi
jne    1249 <tty_get_speed+0x149>
mov    0x2e5b(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
cmp    $0xf423f,%edi
jle    11aa <tty_get_speed+0xaa>
cmp    $0x16e35f,%edi
jg     11e8 <tty_get_speed+0xe8>
cmp    $0xf4240,%edi
je     120a <tty_get_speed+0x10a>
cmp    $0x119400,%edi
jne    1249 <tty_get_speed+0x149>
mov    0x2e33(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
cmp    $0x2580,%edi
je     1213 <tty_get_speed+0x113>
cmp    $0x4b00,%edi
je     121c <tty_get_speed+0x11c>
cmp    $0x9600,%edi
jne    1249 <tty_get_speed+0x149>
mov    0x2dcb(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
cmp    $0x7a120,%edi
je     1225 <tty_get_speed+0x125>
cmp    $0x8ca00,%edi
je     122e <tty_get_speed+0x12e>
cmp    $0xe1000,%edi
jne    1249 <tty_get_speed+0x149>
mov    0x2e13(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
cmp    $0x38400,%edi
je     1237 <tty_get_speed+0x137>
cmp    $0x70800,%edi
jne    1249 <tty_get_speed+0x149>
mov    0x2dba(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
cmp    $0x16e360,%edi
je     1240 <tty_get_speed+0x140>
cmp    $0x1e8480,%edi
jne    1249 <tty_get_speed+0x149>
mov    0x2dc1(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2db0(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2db7(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2db6(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2dcd(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2d64(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2da3(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2d3a(%rip),%rax
jmp    1247 <tty_get_speed+0x147>
mov    0x2d41(%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
@B1000000 = global i32 0
@B1152000 = global i32 0
@B1500000 = global i32 0
@B2000000 = global i32 0
define i32 @tty_get_speed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %33 [
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
i32 1000000, label %25
i32 1152000, label %27
i32 1500000, label %29
i32 2000000, label %31
]
5: ; preds = %1
%6 = load i32, i32* @B9600
store i32 %6, i32* %2
br label %34
7: ; preds = %1
%8 = load i32, i32* @B19200
store i32 %8, i32* %2
br label %34
9: ; preds = %1
%10 = load i32, i32* @B38400
store i32 %10, i32* %2
br label %34
11: ; preds = %1
%12 = load i32, i32* @B57600
store i32 %12, i32* %2
br label %34
13: ; preds = %1
%14 = load i32, i32* @B115200
store i32 %14, i32* %2
br label %34
15: ; preds = %1
%16 = load i32, i32* @B230400
store i32 %16, i32* %2
br label %34
17: ; preds = %1
%18 = load i32, i32* @B460800
store i32 %18, i32* %2
br label %34
19: ; preds = %1
%20 = load i32, i32* @B500000
store i32 %20, i32* %2
br label %34
21: ; preds = %1
%22 = load i32, i32* @B576000
store i32 %22, i32* %2
br label %34
23: ; preds = %1
%24 = load i32, i32* @B921600
store i32 %24, i32* %2
br label %34
25: ; preds = %1
%26 = load i32, i32* @B1000000
store i32 %26, i32* %2
br label %34
27: ; preds = %1
%28 = load i32, i32* @B1152000
store i32 %28, i32* %2
br label %34
29: ; preds = %1
%30 = load i32, i32* @B1500000
store i32 %30, i32* %2
br label %34
31: ; preds = %1
%32 = load i32, i32* @B2000000
store i32 %32, i32* %2
br label %34
33: ; preds = %1
store i32 0, i32* %2
br label %34
34: ; preds = %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%35 = load i32, i32* %2
ret i32 %35
}

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
@B1000000 = global i32 0
@B1152000 = global i32 0
@B1500000 = global i32 0
@B2000000 = global i32 0
define i32 @tty_get_speed(i32 %0) {
switch i32 %0, label %30 [
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
i32 1000000, label %22
i32 1152000, label %24
i32 1500000, label %26
i32 2000000, label %28
]
2: ; preds = %1
%3 = load i32, i32* @B9600
br label %30
4: ; preds = %1
%5 = load i32, i32* @B19200
br label %30
6: ; preds = %1
%7 = load i32, i32* @B38400
br label %30
8: ; preds = %1
%9 = load i32, i32* @B57600
br label %30
10: ; preds = %1
%11 = load i32, i32* @B115200
br label %30
12: ; preds = %1
%13 = load i32, i32* @B230400
br label %30
14: ; preds = %1
%15 = load i32, i32* @B460800
br label %30
16: ; preds = %1
%17 = load i32, i32* @B500000
br label %30
18: ; preds = %1
%19 = load i32, i32* @B576000
br label %30
20: ; preds = %1
%21 = load i32, i32* @B921600
br label %30
22: ; preds = %1
%23 = load i32, i32* @B1000000
br label %30
24: ; preds = %1
%25 = load i32, i32* @B1152000
br label %30
26: ; preds = %1
%27 = load i32, i32* @B1500000
br label %30
28: ; preds = %1
%29 = load i32, i32* @B2000000
br label %30
30: ; preds = %1, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
%31 = phi i32 [ %29, %28 ], [ %27, %26 ], [ %25, %24 ], [ %23, %22 ], [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ 0, %1 ]
ret i32 %31
}