#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 */
struct termios {
  int c_cflag;
  double *c_cc;
  scalar_t__ c_lflag;
  scalar_t__ c_oflag;
  scalar_t__ c_iflag;
};
typedef int /*<<< orphan*/ newtio;

/* Variables and functions */
int CLOCAL;
int CREAD;
int CS8;
int /*<<< orphan*/ FNDELAY;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ TCIFLUSH;
int /*<<< orphan*/ TCSANOW;
size_t VMIN;
size_t VTIME;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct termios *, int /*<<< orphan*/, int);
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
int /*<<< orphan*/ tcsetattr(int, int /*<<< orphan*/, struct termios *);
int UART_Baudrate_NonC(int tranceiver, int Baudrate, double C_VTIME,
                       int C_VMIN) {
  int Baudrate_d = 0;
  struct termios newtio;
  switch (Baudrate) {
  case 150:
    Baudrate_d = 5;
    break;
  case 200:
    Baudrate_d = 6;
    break;
  case 300:
    Baudrate_d = 7;
    break;
  case 600:
    Baudrate_d = 8;
    break;
  case 1200:
    Baudrate_d = 9;
    break;
  case 1800:
    Baudrate_d = 10;
    break;
  case 2400:
    Baudrate_d = 11;
    break;
  case 4800:
    Baudrate_d = 12;
    break;
  case 9600:
    Baudrate_d = 13;
    break;
  case 19200:
    Baudrate_d = 14;
    break;
  case 38400:
    Baudrate_d = 15;
    break;
  case 57600:
    Baudrate_d = 4097;
    break;
  case 115200:
    Baudrate_d = 4098;
    break;
  case 230400:
    Baudrate_d = 4099;
    break;
  case 460800:
    Baudrate_d = 4100;
    break;
  case 500000:
    Baudrate_d = 4101;
    break;
  case 576000:
    Baudrate_d = 4102;
    break;
  case 921600:
    Baudrate_d = 4103;
    break;
  case 1000000:
    Baudrate_d = 4104;
    break;
  case 1152000:
    Baudrate_d = 4105;
    break;
  case 1500000:
    Baudrate_d = 4106;
    break;
  case 2000000:
    Baudrate_d = 4107;
    break;
  case 2500000:
    Baudrate_d = 4108;
    break;
  case 3000000:
    Baudrate_d = 4109;
    break;
  }
  memset(&newtio, 0, sizeof(newtio));
  newtio.c_cflag = Baudrate_d | CS8 | CLOCAL | CREAD;
  newtio.c_iflag = 0;
  newtio.c_oflag = 0;
  newtio.c_lflag = 0;
  newtio.c_cc[VTIME] = C_VTIME;
  newtio.c_cc[VMIN] = C_VMIN;
  tcflush(tranceiver, TCIFLUSH);
  tcsetattr(tranceiver, TCSANOW, &newtio);
  fcntl(tranceiver, F_SETFL, FNDELAY);
}


x86 assembly (clang, -O0):
<UART_Baudrate_NonC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4c(%rbp)
sub    $0x96,%eax
je     1328 <UART_Baudrate_NonC+0x1e8>
jmp    1173 <UART_Baudrate_NonC+0x33>
mov    -0x4c(%rbp),%eax
sub    $0xc8,%eax
je     1334 <UART_Baudrate_NonC+0x1f4>
jmp    1186 <UART_Baudrate_NonC+0x46>
mov    -0x4c(%rbp),%eax
sub    $0x12c,%eax
je     1340 <UART_Baudrate_NonC+0x200>
jmp    1199 <UART_Baudrate_NonC+0x59>
mov    -0x4c(%rbp),%eax
sub    $0x258,%eax
je     134c <UART_Baudrate_NonC+0x20c>
jmp    11ac <UART_Baudrate_NonC+0x6c>
mov    -0x4c(%rbp),%eax
sub    $0x4b0,%eax
je     1358 <UART_Baudrate_NonC+0x218>
jmp    11bf <UART_Baudrate_NonC+0x7f>
mov    -0x4c(%rbp),%eax
sub    $0x708,%eax
je     1364 <UART_Baudrate_NonC+0x224>
jmp    11d2 <UART_Baudrate_NonC+0x92>
mov    -0x4c(%rbp),%eax
sub    $0x960,%eax
je     1370 <UART_Baudrate_NonC+0x230>
jmp    11e5 <UART_Baudrate_NonC+0xa5>
mov    -0x4c(%rbp),%eax
sub    $0x12c0,%eax
je     137c <UART_Baudrate_NonC+0x23c>
jmp    11f8 <UART_Baudrate_NonC+0xb8>
mov    -0x4c(%rbp),%eax
sub    $0x2580,%eax
je     1388 <UART_Baudrate_NonC+0x248>
jmp    120b <UART_Baudrate_NonC+0xcb>
mov    -0x4c(%rbp),%eax
sub    $0x4b00,%eax
je     1394 <UART_Baudrate_NonC+0x254>
jmp    121e <UART_Baudrate_NonC+0xde>
mov    -0x4c(%rbp),%eax
sub    $0x9600,%eax
je     13a0 <UART_Baudrate_NonC+0x260>
jmp    1231 <UART_Baudrate_NonC+0xf1>
mov    -0x4c(%rbp),%eax
sub    $0xe100,%eax
je     13ac <UART_Baudrate_NonC+0x26c>
jmp    1244 <UART_Baudrate_NonC+0x104>
mov    -0x4c(%rbp),%eax
sub    $0x1c200,%eax
je     13b8 <UART_Baudrate_NonC+0x278>
jmp    1257 <UART_Baudrate_NonC+0x117>
mov    -0x4c(%rbp),%eax
sub    $0x38400,%eax
je     13c4 <UART_Baudrate_NonC+0x284>
jmp    126a <UART_Baudrate_NonC+0x12a>
mov    -0x4c(%rbp),%eax
sub    $0x70800,%eax
je     13d0 <UART_Baudrate_NonC+0x290>
jmp    127d <UART_Baudrate_NonC+0x13d>
mov    -0x4c(%rbp),%eax
sub    $0x7a120,%eax
je     13dc <UART_Baudrate_NonC+0x29c>
jmp    1290 <UART_Baudrate_NonC+0x150>
mov    -0x4c(%rbp),%eax
sub    $0x8ca00,%eax
je     13e8 <UART_Baudrate_NonC+0x2a8>
jmp    12a3 <UART_Baudrate_NonC+0x163>
mov    -0x4c(%rbp),%eax
sub    $0xe1000,%eax
je     13f4 <UART_Baudrate_NonC+0x2b4>
jmp    12b6 <UART_Baudrate_NonC+0x176>
mov    -0x4c(%rbp),%eax
sub    $0xf4240,%eax
je     1400 <UART_Baudrate_NonC+0x2c0>
jmp    12c9 <UART_Baudrate_NonC+0x189>
mov    -0x4c(%rbp),%eax
sub    $0x119400,%eax
je     140c <UART_Baudrate_NonC+0x2cc>
jmp    12dc <UART_Baudrate_NonC+0x19c>
mov    -0x4c(%rbp),%eax
sub    $0x16e360,%eax
je     1418 <UART_Baudrate_NonC+0x2d8>
jmp    12ef <UART_Baudrate_NonC+0x1af>
mov    -0x4c(%rbp),%eax
sub    $0x1e8480,%eax
je     1424 <UART_Baudrate_NonC+0x2e4>
jmp    1302 <UART_Baudrate_NonC+0x1c2>
mov    -0x4c(%rbp),%eax
sub    $0x2625a0,%eax
je     1430 <UART_Baudrate_NonC+0x2f0>
jmp    1315 <UART_Baudrate_NonC+0x1d5>
mov    -0x4c(%rbp),%eax
sub    $0x2dc6c0,%eax
je     143c <UART_Baudrate_NonC+0x2fc>
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x5,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x6,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x7,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x8,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x9,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0xa,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0xb,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0xc,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0xd,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0xe,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0xf,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1001,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1002,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1003,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1004,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1005,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1006,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1007,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1008,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x1009,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x100a,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x100b,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x100c,-0x20(%rbp)
jmp    1443 <UART_Baudrate_NonC+0x303>
movl   $0x100d,-0x20(%rbp)
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    -0x20(%rbp),%eax
mov    0x2b7b(%rip),%rcx
or     (%rcx),%eax
mov    0x2b32(%rip),%rcx
or     (%rcx),%eax
mov    0x2b71(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x48(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x40(%rbp),%rax
mov    0x2b0c(%rip),%rcx
mov    (%rcx),%rcx
movsd  %xmm0,(%rax,%rcx,8)
cvtsi2sdl -0x1c(%rbp),%xmm0
mov    -0x40(%rbp),%rax
mov    0x2b1c(%rip),%rcx
mov    (%rcx),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%edi
mov    0x2afa(%rip),%rax
mov    (%rax),%esi
call   1040 <tcflush@plt>
mov    -0x8(%rbp),%edi
mov    0x2b11(%rip),%rax
mov    (%rax),%esi
lea    -0x48(%rbp),%rdx
call   1060 <tcsetattr@plt>
mov    -0x8(%rbp),%edi
mov    0x2acc(%rip),%rax
mov    (%rax),%esi
mov    0x2abb(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_Baudrate_NonC>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %edx,%r14d
mov    %edi,%r15d
xor    %ebx,%ebx
cmp    $0x1c1ff,%esi
movsd  %xmm0,0x8(%rsp)
jg     11a2 <UART_Baudrate_NonC+0x62>
cmp    $0x95f,%esi
jg     11e4 <UART_Baudrate_NonC+0xa4>
cmp    $0x257,%esi
jg     1258 <UART_Baudrate_NonC+0x118>
cmp    $0x96,%esi
je     1301 <UART_Baudrate_NonC+0x1c1>
cmp    $0xc8,%esi
je     1308 <UART_Baudrate_NonC+0x1c8>
cmp    $0x12c,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0x7,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
cmp    $0xf423f,%esi
jg     121e <UART_Baudrate_NonC+0xde>
cmp    $0x7a11f,%esi
jg     1286 <UART_Baudrate_NonC+0x146>
cmp    $0x1c200,%esi
je     130f <UART_Baudrate_NonC+0x1cf>
cmp    $0x38400,%esi
je     1316 <UART_Baudrate_NonC+0x1d6>
cmp    $0x70800,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1004,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
cmp    $0x4aff,%esi
jg     12b4 <UART_Baudrate_NonC+0x174>
cmp    $0x960,%esi
je     131d <UART_Baudrate_NonC+0x1dd>
cmp    $0x12c0,%esi
je     1324 <UART_Baudrate_NonC+0x1e4>
cmp    $0x2580,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0xd,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
cmp    $0x1e847f,%esi
jg     12e2 <UART_Baudrate_NonC+0x1a2>
cmp    $0xf4240,%esi
je     132b <UART_Baudrate_NonC+0x1eb>
cmp    $0x119400,%esi
je     1332 <UART_Baudrate_NonC+0x1f2>
cmp    $0x16e360,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0x100a,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
cmp    $0x258,%esi
je     1339 <UART_Baudrate_NonC+0x1f9>
cmp    $0x4b0,%esi
je     1340 <UART_Baudrate_NonC+0x200>
cmp    $0x708,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0xa,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
cmp    $0x7a120,%esi
je     1347 <UART_Baudrate_NonC+0x207>
cmp    $0x8ca00,%esi
je     134e <UART_Baudrate_NonC+0x20e>
cmp    $0xe1000,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1007,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
cmp    $0x4b00,%esi
je     1355 <UART_Baudrate_NonC+0x215>
cmp    $0x9600,%esi
je     135c <UART_Baudrate_NonC+0x21c>
cmp    $0xe100,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1001,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
cmp    $0x1e8480,%esi
je     1363 <UART_Baudrate_NonC+0x223>
cmp    $0x2625a0,%esi
je     136a <UART_Baudrate_NonC+0x22a>
cmp    $0x2dc6c0,%esi
jne    136f <UART_Baudrate_NonC+0x22f>
mov    $0x100d,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x5,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x6,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1002,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1003,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0xb,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0xc,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1008,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1009,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x8,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x9,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1005,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x1006,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0xe,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0xf,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x100b,%ebx
jmp    136f <UART_Baudrate_NonC+0x22f>
mov    $0x100c,%ebx
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    0x2c4e(%rip),%rax
or     (%rax),%ebx
mov    0x2c05(%rip),%rax
or     (%rax),%ebx
mov    0x2c44(%rip),%rax
or     (%rax),%ebx
mov    %ebx,0x10(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
mov    0x18(%rsp),%rax
mov    0x2be9(%rip),%rcx
mov    (%rcx),%rcx
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
mov    0x2bf4(%rip),%rcx
mov    (%rcx),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2bd5(%rip),%rax
mov    (%rax),%esi
mov    %r15d,%edi
call   1040 <tcflush@plt>
mov    0x2bec(%rip),%rax
mov    (%rax),%esi
mov    %r15d,%edi
mov    %rbp,%rdx
call   1060 <tcsetattr@plt>
mov    0x2ba8(%rip),%rax
mov    (%rax),%esi
mov    0x2b97(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
call   1030 <fcntl@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32, double*, i64, i64, i64 }
@CS8 = global i32 0
@CLOCAL = global i32 0
@CREAD = global i32 0
@VTIME = global i64 0
@VMIN = global i64 0
@TCIFLUSH = global i32 0
@TCSANOW = global i32 0
@F_SETFL = global i32 0
@FNDELAY = global i32 0
define i32 @UART_Baudrate_NonC(i32 %0, i32 %1, double %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.termios
store i32 %0, i32* %6
store i32 %1, i32* %7
store double %2, double* %8
store i32 %3, i32* %9
store i32 0, i32* %10
%12 = load i32, i32* %7
switch i32 %12, label %37 [
i32 150, label %13
i32 200, label %14
i32 300, label %15
i32 600, label %16
i32 1200, label %17
i32 1800, label %18
i32 2400, label %19
i32 4800, label %20
i32 9600, label %21
i32 19200, label %22
i32 38400, label %23
i32 57600, label %24
i32 115200, label %25
i32 230400, label %26
i32 460800, label %27
i32 500000, label %28
i32 576000, label %29
i32 921600, label %30
i32 1000000, label %31
i32 1152000, label %32
i32 1500000, label %33
i32 2000000, label %34
i32 2500000, label %35
i32 3000000, label %36
]
13: ; preds = %4
store i32 5, i32* %10
br label %37
14: ; preds = %4
store i32 6, i32* %10
br label %37
15: ; preds = %4
store i32 7, i32* %10
br label %37
16: ; preds = %4
store i32 8, i32* %10
br label %37
17: ; preds = %4
store i32 9, i32* %10
br label %37
18: ; preds = %4
store i32 10, i32* %10
br label %37
19: ; preds = %4
store i32 11, i32* %10
br label %37
20: ; preds = %4
store i32 12, i32* %10
br label %37
21: ; preds = %4
store i32 13, i32* %10
br label %37
22: ; preds = %4
store i32 14, i32* %10
br label %37
23: ; preds = %4
store i32 15, i32* %10
br label %37
24: ; preds = %4
store i32 4097, i32* %10
br label %37
25: ; preds = %4
store i32 4098, i32* %10
br label %37
26: ; preds = %4
store i32 4099, i32* %10
br label %37
27: ; preds = %4
store i32 4100, i32* %10
br label %37
28: ; preds = %4
store i32 4101, i32* %10
br label %37
29: ; preds = %4
store i32 4102, i32* %10
br label %37
30: ; preds = %4
store i32 4103, i32* %10
br label %37
31: ; preds = %4
store i32 4104, i32* %10
br label %37
32: ; preds = %4
store i32 4105, i32* %10
br label %37
33: ; preds = %4
store i32 4106, i32* %10
br label %37
34: ; preds = %4
store i32 4107, i32* %10
br label %37
35: ; preds = %4
store i32 4108, i32* %10
br label %37
36: ; preds = %4
store i32 4109, i32* %10
br label %37
37: ; preds = %4, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13
%38 = call i32 @memset(%struct.termios* %11, i32 0, i32 40)
%39 = load i32, i32* %10
%40 = load i32, i32* @CS8
%41 = or i32 %39, %40
%42 = load i32, i32* @CLOCAL
%43 = or i32 %41, %42
%44 = load i32, i32* @CREAD
%45 = or i32 %43, %44
%46 = getelementptr inbounds %struct.termios, %struct.termios* %11, i32 0, i32 0
store i32 %45, i32* %46
%47 = getelementptr inbounds %struct.termios, %struct.termios* %11, i32 0, i32 4
store i64 0, i64* %47
%48 = getelementptr inbounds %struct.termios, %struct.termios* %11, i32 0, i32 3
store i64 0, i64* %48
%49 = getelementptr inbounds %struct.termios, %struct.termios* %11, i32 0, i32 2
store i64 0, i64* %49
%50 = load double, double* %8
%51 = getelementptr inbounds %struct.termios, %struct.termios* %11, i32 0, i32 1
%52 = load double*, double** %51
%53 = load i64, i64* @VTIME
%54 = getelementptr inbounds double, double* %52, i64 %53
store double %50, double* %54
%55 = load i32, i32* %9
%56 = sitofp i32 %55 to double
%57 = getelementptr inbounds %struct.termios, %struct.termios* %11, i32 0, i32 1
%58 = load double*, double** %57
%59 = load i64, i64* @VMIN
%60 = getelementptr inbounds double, double* %58, i64 %59
store double %56, double* %60
%61 = load i32, i32* %6
%62 = load i32, i32* @TCIFLUSH
%63 = call i32 @tcflush(i32 %61, i32 %62)
%64 = load i32, i32* %6
%65 = load i32, i32* @TCSANOW
%66 = call i32 @tcsetattr(i32 %64, i32 %65, %struct.termios* %11)
%67 = load i32, i32* %6
%68 = load i32, i32* @F_SETFL
%69 = load i32, i32* @FNDELAY
%70 = call i32 @fcntl(i32 %67, i32 %68, i32 %69)
%71 = load i32, i32* %5
ret i32 %71
}

LLVM IR (-O2):
%struct.termios = type { i32, double*, i64, i64, i64 }
@CS8 = global i32 0
@CLOCAL = global i32 0
@CREAD = global i32 0
@VTIME = global i64 0
@VMIN = global i64 0
@TCIFLUSH = global i32 0
@TCSANOW = global i32 0
@F_SETFL = global i32 0
@FNDELAY = global i32 0
define i32 @UART_Baudrate_NonC(i32 %0, i32 %1, double %2, i32 %3) {
%5 = alloca %struct.termios
%6 = bitcast %struct.termios* %5 to i8*
switch i32 %1, label %31 [
i32 150, label %7
i32 200, label %8
i32 300, label %9
i32 600, label %10
i32 1200, label %11
i32 1800, label %12
i32 2400, label %13
i32 4800, label %14
i32 9600, label %15
i32 19200, label %16
i32 38400, label %17
i32 57600, label %18
i32 115200, label %19
i32 230400, label %20
i32 460800, label %21
i32 500000, label %22
i32 576000, label %23
i32 921600, label %24
i32 1000000, label %25
i32 1152000, label %26
i32 1500000, label %27
i32 2000000, label %28
i32 2500000, label %29
i32 3000000, label %30
]
7: ; preds = %4
br label %31
8: ; preds = %4
br label %31
9: ; preds = %4
br label %31
10: ; preds = %4
br label %31
11: ; preds = %4
br label %31
12: ; preds = %4
br label %31
13: ; preds = %4
br label %31
14: ; preds = %4
br label %31
15: ; preds = %4
br label %31
16: ; preds = %4
br label %31
17: ; preds = %4
br label %31
18: ; preds = %4
br label %31
19: ; preds = %4
br label %31
20: ; preds = %4
br label %31
21: ; preds = %4
br label %31
22: ; preds = %4
br label %31
23: ; preds = %4
br label %31
24: ; preds = %4
br label %31
25: ; preds = %4
br label %31
26: ; preds = %4
br label %31
27: ; preds = %4
br label %31
28: ; preds = %4
br label %31
29: ; preds = %4
br label %31
30: ; preds = %4
br label %31
31: ; preds = %4, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7
%32 = phi i32 [ 0, %4 ], [ 4109, %30 ], [ 4108, %29 ], [ 4107, %28 ], [ 4106, %27 ], [ 4105, %26 ], [ 4104, %25 ], [ 4103, %24 ], [ 4102, %23 ], [ 4101, %22 ], [ 4100, %21 ], [ 4099, %20 ], [ 4098, %19 ], [ 4097, %18 ], [ 15, %17 ], [ 14, %16 ], [ 13, %15 ], [ 12, %14 ], [ 11, %13 ], [ 10, %12 ], [ 9, %11 ], [ 8, %10 ], [ 7, %9 ], [ 6, %8 ], [ 5, %7 ]
%33 = call i32 @memset(%struct.termios* %5, i32 0, i32 40)
%34 = load i32, i32* @CS8
%35 = or i32 %34, %32
%36 = load i32, i32* @CLOCAL
%37 = or i32 %35, %36
%38 = load i32, i32* @CREAD
%39 = or i32 %37, %38
%40 = getelementptr inbounds %struct.termios, %struct.termios* %5, i64 0, i32 0
store i32 %39, i32* %40
%41 = getelementptr inbounds %struct.termios, %struct.termios* %5, i64 0, i32 2
%42 = getelementptr inbounds %struct.termios, %struct.termios* %5, i64 0, i32 1
%43 = bitcast i64* %41 to i8*
%44 = load double*, double** %42
%45 = load i64, i64* @VTIME
%46 = getelementptr inbounds double, double* %44, i64 %45
store double %2, double* %46
%47 = sitofp i32 %3 to double
%48 = load i64, i64* @VMIN
%49 = getelementptr inbounds double, double* %44, i64 %48
store double %47, double* %49
%50 = load i32, i32* @TCIFLUSH
%51 = call i32 @tcflush(i32 %0, i32 %50)
%52 = load i32, i32* @TCSANOW
%53 = call i32 @tcsetattr(i32 %0, i32 %52, %struct.termios* %5)
%54 = load i32, i32* @F_SETFL
%55 = load i32, i32* @FNDELAY
%56 = call i32 @fcntl(i32 %0, i32 %54, i32 %55)
ret i32 undef
}