#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 uint32_t;
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int /*<<< orphan*/ B0;
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B57600;
int /*<<< orphan*/ B9600;
speed_t convert_baudrate_to_baudrate_mask(uint32_t baudrate) {
  switch (baudrate) {
  case 9600:
    return B9600;
  case 19200:
    return B19200;
  case 38400:
    return B38400;
  case 57600:
    return B57600;
  case 115200:
    return B115200;
  default:
    return B0;
  }
}


x86 assembly (clang, -O0):
<convert_baudrate_to_baudrate_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2580,%eax
je     1169 <convert_baudrate_to_baudrate_mask+0x69>
jmp    111d <convert_baudrate_to_baudrate_mask+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     117a <convert_baudrate_to_baudrate_mask+0x7a>
jmp    1130 <convert_baudrate_to_baudrate_mask+0x30>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     118b <convert_baudrate_to_baudrate_mask+0x8b>
jmp    1143 <convert_baudrate_to_baudrate_mask+0x43>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     119c <convert_baudrate_to_baudrate_mask+0x9c>
jmp    1156 <convert_baudrate_to_baudrate_mask+0x56>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     11ad <convert_baudrate_to_baudrate_mask+0xad>
jmp    11be <convert_baudrate_to_baudrate_mask+0xbe>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ca <convert_baudrate_to_baudrate_mask+0xca>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ca <convert_baudrate_to_baudrate_mask+0xca>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ca <convert_baudrate_to_baudrate_mask+0xca>
mov    0x2e35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ca <convert_baudrate_to_baudrate_mask+0xca>
mov    0x2e0c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ca <convert_baudrate_to_baudrate_mask+0xca>
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_baudrate_to_baudrate_mask>:
cmp    $0x95ff,%edi
jle    112a <convert_baudrate_to_baudrate_mask+0x2a>
cmp    $0x9600,%edi
je     1144 <convert_baudrate_to_baudrate_mask+0x44>
cmp    $0xe100,%edi
je     114e <convert_baudrate_to_baudrate_mask+0x4e>
cmp    $0x1c200,%edi
jne    1162 <convert_baudrate_to_baudrate_mask+0x62>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x2580,%edi
je     1158 <convert_baudrate_to_baudrate_mask+0x58>
cmp    $0x4b00,%edi
jne    1162 <convert_baudrate_to_baudrate_mask+0x62>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e5f(%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
@B0 = global i32 0
define i32 @convert_baudrate_to_baudrate_mask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 9600, label %5
i32 19200, label %7
i32 38400, label %9
i32 57600, label %11
i32 115200, label %13
]
5: ; preds = %1
%6 = load i32, i32* @B9600
store i32 %6, i32* %2
br label %17
7: ; preds = %1
%8 = load i32, i32* @B19200
store i32 %8, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* @B38400
store i32 %10, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* @B57600
store i32 %12, i32* %2
br label %17
13: ; preds = %1
%14 = load i32, i32* @B115200
store i32 %14, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* @B0
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %13, %11, %9, %7, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@B9600 = global i32 0
@B19200 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
@B0 = global i32 0
define i32 @convert_baudrate_to_baudrate_mask(i32 %0) {
switch i32 %0, label %6 [
i32 9600, label %7
i32 19200, label %2
i32 38400, label %3
i32 57600, label %4
i32 115200, label %5
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i32* [ @B0, %6 ], [ @B115200, %5 ], [ @B57600, %4 ], [ @B38400, %3 ], [ @B19200, %2 ], [ @B9600, %1 ]
%9 = load i32, i32* %8
ret i32 %9
}