#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*/ B110;
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ B1200;
int /*<<< orphan*/ B134;
int /*<<< orphan*/ B150;
int /*<<< orphan*/ B1800;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B200;
int /*<<< orphan*/ B230400;
int /*<<< orphan*/ B2400;
int /*<<< orphan*/ B300;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B460800;
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ B50;
int /*<<< orphan*/ B57600;
int /*<<< orphan*/ B600;
int /*<<< orphan*/ B75;
int /*<<< orphan*/ B9600;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
speed_t determine_baud(int baud) {
  switch (baud) {
  case 0:
    return B0;
  case 50:
    return B50;
  case 75:
    return B75;
  case 110:
    return B110;
  case 134:
    return B134;
  case 150:
    return B150;
  case 200:
    return B200;
  case 300:
    return B300;
  case 600:
    return B600;
  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;
  case 460800:
    return B460800;
  default:
    printf("Invalid baudrate: %d\n", baud);
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<determine_baud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     12a1 <determine_baud+0x181>
jmp    113e <determine_baud+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
je     12b2 <determine_baud+0x192>
jmp    114f <determine_baud+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x4b,%eax
je     12c3 <determine_baud+0x1a3>
jmp    1160 <determine_baud+0x40>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     12d4 <determine_baud+0x1b4>
jmp    1171 <determine_baud+0x51>
mov    -0xc(%rbp),%eax
sub    $0x86,%eax
je     12e5 <determine_baud+0x1c5>
jmp    1184 <determine_baud+0x64>
mov    -0xc(%rbp),%eax
sub    $0x96,%eax
je     12f6 <determine_baud+0x1d6>
jmp    1197 <determine_baud+0x77>
mov    -0xc(%rbp),%eax
sub    $0xc8,%eax
je     1307 <determine_baud+0x1e7>
jmp    11aa <determine_baud+0x8a>
mov    -0xc(%rbp),%eax
sub    $0x12c,%eax
je     1318 <determine_baud+0x1f8>
jmp    11bd <determine_baud+0x9d>
mov    -0xc(%rbp),%eax
sub    $0x258,%eax
je     1329 <determine_baud+0x209>
jmp    11d0 <determine_baud+0xb0>
mov    -0xc(%rbp),%eax
sub    $0x4b0,%eax
je     133a <determine_baud+0x21a>
jmp    11e3 <determine_baud+0xc3>
mov    -0xc(%rbp),%eax
sub    $0x708,%eax
je     134b <determine_baud+0x22b>
jmp    11f6 <determine_baud+0xd6>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     135c <determine_baud+0x23c>
jmp    1209 <determine_baud+0xe9>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     136d <determine_baud+0x24d>
jmp    121c <determine_baud+0xfc>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     137e <determine_baud+0x25e>
jmp    122f <determine_baud+0x10f>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     138f <determine_baud+0x26f>
jmp    1242 <determine_baud+0x122>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     13a0 <determine_baud+0x280>
jmp    1255 <determine_baud+0x135>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     13b1 <determine_baud+0x291>
jmp    1268 <determine_baud+0x148>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     13c2 <determine_baud+0x2a2>
jmp    127b <determine_baud+0x15b>
mov    -0xc(%rbp),%eax
sub    $0x38400,%eax
je     13d3 <determine_baud+0x2b3>
jmp    128e <determine_baud+0x16e>
mov    -0xc(%rbp),%eax
sub    $0x70800,%eax
je     13e4 <determine_baud+0x2c4>
jmp    13f5 <determine_baud+0x2d5>
mov    0x2ce0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2cef(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2d0e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2d05(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2cdc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2ca0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c1f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c2e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c33(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2c5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2b91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2be0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2b87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2b66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    0x2b7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1412 <determine_baud+0x2f2>
mov    -0x8(%rbp),%esi
lea    0xc01(%rip),%rdi
call   1030 <printf@plt>
mov    0x2b4d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determine_baud>:
push   %rax
mov    %edi,%esi
cmp    $0x707,%edi
jg     1166 <determine_baud+0x46>
cmp    $0x95,%esi
jg     11aa <determine_baud+0x8a>
cmp    $0x4a,%esi
jle    1222 <determine_baud+0x102>
cmp    $0x4b,%esi
je     12a0 <determine_baud+0x180>
cmp    $0x6e,%esi
je     12a9 <determine_baud+0x189>
cmp    $0x86,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2e67(%rip),%rax
jmp    130a <determine_baud+0x1ea>
cmp    $0x95ff,%esi
jg     11e6 <determine_baud+0xc6>
cmp    $0x12bf,%esi
jle    123f <determine_baud+0x11f>
cmp    $0x12c0,%esi
je     12b2 <determine_baud+0x192>
cmp    $0x2580,%esi
je     12bb <determine_baud+0x19b>
cmp    $0x4b00,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2e4b(%rip),%rax
jmp    130a <determine_baud+0x1ea>
cmp    $0x12b,%esi
jle    1263 <determine_baud+0x143>
cmp    $0x12c,%esi
je     12c4 <determine_baud+0x1a4>
cmp    $0x258,%esi
je     12cd <determine_baud+0x1ad>
cmp    $0x4b0,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2d7f(%rip),%rax
jmp    130a <determine_baud+0x1ea>
cmp    $0x1c1ff,%esi
jle    1287 <determine_baud+0x167>
cmp    $0x1c200,%esi
je     12d6 <determine_baud+0x1b6>
cmp    $0x38400,%esi
je     12df <determine_baud+0x1bf>
cmp    $0x70800,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2d4b(%rip),%rax
jmp    130a <determine_baud+0x1ea>
test   %esi,%esi
je     12e8 <determine_baud+0x1c8>
cmp    $0x32,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2d6e(%rip),%rax
jmp    130a <determine_baud+0x1ea>
cmp    $0x708,%esi
je     12f1 <determine_baud+0x1d1>
cmp    $0x960,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2d1a(%rip),%rax
jmp    130a <determine_baud+0x1ea>
cmp    $0x96,%esi
je     12fa <determine_baud+0x1da>
cmp    $0xc8,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2d1e(%rip),%rax
jmp    130a <determine_baud+0x1ea>
cmp    $0x9600,%esi
je     1303 <determine_baud+0x1e3>
cmp    $0xe100,%esi
jne    130e <determine_baud+0x1ee>
mov    0x2cfa(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2d31(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2d30(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2d07(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2cf6(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2ce5(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2cfc(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2c73(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2c5a(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2c99(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2c88(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2c6f(%rip),%rax
jmp    130a <determine_baud+0x1ea>
mov    0x2c2e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
lea    0xceb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2c37(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

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