#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 B19200;
int B230400;
int B38400;
int B57600;
int B9600;
int _get_baudrate(int baud) {
  if (baud < 19200)
    return B9600;
  else if (baud < 38400)
    return B19200;
  else if (baud < 57600)
    return B38400;
  else if (baud < 115200)
    return B57600;
  else if (baud < 230400)
    return B115200;
  else
    return B230400;
  return -1;
}


x86 assembly (clang, -O0):
<_get_baudrate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4b00,-0x8(%rbp)
jge    1125 <_get_baudrate+0x25>
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a9 <_get_baudrate+0xa9>
cmpl   $0x9600,-0x8(%rbp)
jge    1143 <_get_baudrate+0x43>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a9 <_get_baudrate+0xa9>
cmpl   $0xe100,-0x8(%rbp)
jge    1161 <_get_baudrate+0x61>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a9 <_get_baudrate+0xa9>
cmpl   $0x1c200,-0x8(%rbp)
jge    117f <_get_baudrate+0x7f>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a9 <_get_baudrate+0xa9>
cmpl   $0x38400,-0x8(%rbp)
jge    119d <_get_baudrate+0x9d>
mov    0x2e35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a9 <_get_baudrate+0xa9>
mov    0x2e14(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_baudrate>:
cmp    $0x4b00,%edi
jge    1112 <_get_baudrate+0x12>
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x9600,%edi
jae    1124 <_get_baudrate+0x24>
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0xe100,%edi
jae    1136 <_get_baudrate+0x36>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x1c200,%edi
jae    1148 <_get_baudrate+0x48>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
ret
cmp    $0x38400,%edi
jae    115a <_get_baudrate+0x5a>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e57(%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
define i32 @_get_baudrate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 19200
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @B9600
store i32 %7, i32* %2
br label %30
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 38400
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i32, i32* @B19200
store i32 %12, i32* %2
br label %30
13: ; preds = %8
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 57600
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32, i32* @B38400
store i32 %17, i32* %2
br label %30
18: ; preds = %13
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 115200
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32, i32* @B57600
store i32 %22, i32* %2
br label %30
23: ; preds = %18
%24 = load i32, i32* %3
%25 = icmp slt i32 %24, 230400
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32, i32* @B115200
store i32 %27, i32* %2
br label %30
28: ; preds = %23
%29 = load i32, i32* @B230400
store i32 %29, i32* %2
br label %30
30: ; preds = %28, %26, %21, %16, %11, %6
%31 = load i32, i32* %2
ret i32 %31
}

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
define i32 @_get_baudrate(i32 %0) {
%2 = icmp slt i32 %0, 19200
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 38400
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 57600
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 115200
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 230400
%11 = select i1 %10, i32* @B115200, i32* @B230400
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32* [ @B9600, %1 ], [ @B19200, %3 ], [ @B38400, %5 ], [ @B57600, %7 ], [ %11, %9 ]
%14 = load i32, i32* %13
ret i32 %14
}