#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*/ tcflag_t;

/* Variables and functions */
int /*<<< orphan*/ B0;
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B230400;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B460800;
int /*<<< orphan*/ B57600;
int /*<<< orphan*/ B921600;
int /*<<< orphan*/ B9600;
tcflag_t vncp_determineBaudrateFlag(unsigned int baudrate) {
  switch (baudrate) {
  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 921600:
    return B921600;
  default:
    return B0;
  }
}


x86 assembly (clang, -O0):
<vncp_determineBaudrateFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2580,%eax
je     11a2 <vncp_determineBaudrateFlag+0xa2>
jmp    111d <vncp_determineBaudrateFlag+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     11b3 <vncp_determineBaudrateFlag+0xb3>
jmp    1130 <vncp_determineBaudrateFlag+0x30>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     11c4 <vncp_determineBaudrateFlag+0xc4>
jmp    1143 <vncp_determineBaudrateFlag+0x43>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     11d5 <vncp_determineBaudrateFlag+0xd5>
jmp    1156 <vncp_determineBaudrateFlag+0x56>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     11e6 <vncp_determineBaudrateFlag+0xe6>
jmp    1169 <vncp_determineBaudrateFlag+0x69>
mov    -0xc(%rbp),%eax
sub    $0x38400,%eax
je     11f7 <vncp_determineBaudrateFlag+0xf7>
jmp    117c <vncp_determineBaudrateFlag+0x7c>
mov    -0xc(%rbp),%eax
sub    $0x70800,%eax
je     1208 <vncp_determineBaudrateFlag+0x108>
jmp    118f <vncp_determineBaudrateFlag+0x8f>
mov    -0xc(%rbp),%eax
sub    $0xe1000,%eax
je     1219 <vncp_determineBaudrateFlag+0x119>
jmp    122a <vncp_determineBaudrateFlag+0x12a>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2dcd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2df4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2dc3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2da2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2da9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2dc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1236 <vncp_determineBaudrateFlag+0x136>
mov    0x2d8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vncp_determineBaudrateFlag>:
cmp    $0x1c1ff,%edi
jg     112e <vncp_determineBaudrateFlag+0x2e>
cmp    $0x95ff,%edi
jg     1150 <vncp_determineBaudrateFlag+0x50>
cmp    $0x2580,%edi
je     1184 <vncp_determineBaudrateFlag+0x84>
cmp    $0x4b00,%edi
jne    11ac <vncp_determineBaudrateFlag+0xac>
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x707ff,%edi
jg     116a <vncp_determineBaudrateFlag+0x6a>
cmp    $0x1c200,%edi
je     118e <vncp_determineBaudrateFlag+0x8e>
cmp    $0x38400,%edi
jne    11ac <vncp_determineBaudrateFlag+0xac>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x9600,%edi
je     1198 <vncp_determineBaudrateFlag+0x98>
cmp    $0xe100,%edi
jne    11ac <vncp_determineBaudrateFlag+0xac>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x70800,%edi
je     11a2 <vncp_determineBaudrateFlag+0xa2>
cmp    $0xe1000,%edi
jne    11ac <vncp_determineBaudrateFlag+0xac>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e4d(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e1b(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2df9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e0f(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e0d(%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
@B921600 = global i32 0
@B0 = global i32 0
define i32 @vncp_determineBaudrateFlag(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %21 [
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 921600, label %19
]
5: ; preds = %1
%6 = load i32, i32* @B9600
store i32 %6, i32* %2
br label %23
7: ; preds = %1
%8 = load i32, i32* @B19200
store i32 %8, i32* %2
br label %23
9: ; preds = %1
%10 = load i32, i32* @B38400
store i32 %10, i32* %2
br label %23
11: ; preds = %1
%12 = load i32, i32* @B57600
store i32 %12, i32* %2
br label %23
13: ; preds = %1
%14 = load i32, i32* @B115200
store i32 %14, i32* %2
br label %23
15: ; preds = %1
%16 = load i32, i32* @B230400
store i32 %16, i32* %2
br label %23
17: ; preds = %1
%18 = load i32, i32* @B460800
store i32 %18, i32* %2
br label %23
19: ; preds = %1
%20 = load i32, i32* @B921600
store i32 %20, i32* %2
br label %23
21: ; preds = %1
%22 = load i32, i32* @B0
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %19, %17, %15, %13, %11, %9, %7, %5
%24 = load i32, i32* %2
ret i32 %24
}

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
@B921600 = global i32 0
@B0 = global i32 0
define i32 @vncp_determineBaudrateFlag(i32 %0) {
switch i32 %0, label %9 [
i32 9600, label %10
i32 19200, label %2
i32 38400, label %3
i32 57600, label %4
i32 115200, label %5
i32 230400, label %6
i32 460800, label %7
i32 921600, label %8
]
2: ; preds = %1
br label %10
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3, %2
%11 = phi i32* [ @B0, %9 ], [ @B921600, %8 ], [ @B460800, %7 ], [ @B230400, %6 ], [ @B115200, %5 ], [ @B57600, %4 ], [ @B38400, %3 ], [ @B19200, %2 ], [ @B9600, %1 ]
%12 = load i32, i32* %11
ret i32 %12
}