#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 B38400;
int B57600;
int B9600;
int _select_baudrate(int input) {
  switch (input) {
  case 9600:
    return B9600;
  case 38400:
    return B38400;
  case 57600:
    return B57600;
  case 115200:
    return B115200;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<_select_baudrate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2580,%eax
je     1156 <_select_baudrate+0x56>
jmp    111d <_select_baudrate+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     1167 <_select_baudrate+0x67>
jmp    1130 <_select_baudrate+0x30>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     1178 <_select_baudrate+0x78>
jmp    1143 <_select_baudrate+0x43>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     1189 <_select_baudrate+0x89>
jmp    119a <_select_baudrate+0x9a>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <_select_baudrate+0xa1>
mov    0x2e52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <_select_baudrate+0xa1>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <_select_baudrate+0xa1>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <_select_baudrate+0xa1>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_select_baudrate>:
mov    $0xffffffff,%eax
cmp    $0xe0ff,%edi
jg     1126 <_select_baudrate+0x26>
cmp    $0x2580,%edi
je     113f <_select_baudrate+0x3f>
cmp    $0x9600,%edi
jne    1151 <_select_baudrate+0x51>
mov    0x2e9c(%rip),%rax
jmp    114f <_select_baudrate+0x4f>
cmp    $0xe100,%edi
je     1148 <_select_baudrate+0x48>
cmp    $0x1c200,%edi
jne    1151 <_select_baudrate+0x51>
mov    0x2e93(%rip),%rax
jmp    114f <_select_baudrate+0x4f>
mov    0x2ea2(%rip),%rax
jmp    114f <_select_baudrate+0x4f>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@B9600 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
define i32 @_select_baudrate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 9600, label %5
i32 38400, label %7
i32 57600, label %9
i32 115200, label %11
]
5: ; preds = %1
%6 = load i32, i32* @B9600
store i32 %6, i32* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* @B38400
store i32 %8, i32* %2
br label %14
9: ; preds = %1
%10 = load i32, i32* @B57600
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* @B115200
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %11, %9, %7, %5
%15 = load i32, i32* %2
ret i32 %15
}

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