#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;

/* Variables and functions */
uint32_t librpip_uart_frag_wait_calc(uint32_t baud) {
  switch (baud) {
  case 1200:
    return 1600;
    break;
  case 2400:
    return 800;
    break;
  case 4800:
    return 400;
    break;
  case 9600:
    return 180;
    break;
  case 19200:
    return 100;
    break;
  case 38400:
    return 50;
    break;
  case 57600:
    return 33;
    break;
  case 115200:
    return 17;
    break;
  case 230400:
    return 8;
    break;
  case 460800:
  case 500000:
  case 576000:
    return 4;
    break;
  case 921600:
  case 1000000:
  case 1152000:
  case 1500000:
  case 2000000:
    return 2;
    break;
  case 2500000:
  case 3000000:
  case 3500000:
  case 4000000:
    return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<librpip_uart_frag_wait_calc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4b0,%eax
je     1299 <librpip_uart_frag_wait_calc+0x199>
jmp    111d <librpip_uart_frag_wait_calc+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     12a5 <librpip_uart_frag_wait_calc+0x1a5>
jmp    1130 <librpip_uart_frag_wait_calc+0x30>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     12b1 <librpip_uart_frag_wait_calc+0x1b1>
jmp    1143 <librpip_uart_frag_wait_calc+0x43>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     12bd <librpip_uart_frag_wait_calc+0x1bd>
jmp    1156 <librpip_uart_frag_wait_calc+0x56>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     12c9 <librpip_uart_frag_wait_calc+0x1c9>
jmp    1169 <librpip_uart_frag_wait_calc+0x69>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     12d5 <librpip_uart_frag_wait_calc+0x1d5>
jmp    117c <librpip_uart_frag_wait_calc+0x7c>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     12e1 <librpip_uart_frag_wait_calc+0x1e1>
jmp    118f <librpip_uart_frag_wait_calc+0x8f>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     12ed <librpip_uart_frag_wait_calc+0x1ed>
jmp    11a2 <librpip_uart_frag_wait_calc+0xa2>
mov    -0xc(%rbp),%eax
sub    $0x38400,%eax
je     12f9 <librpip_uart_frag_wait_calc+0x1f9>
jmp    11b5 <librpip_uart_frag_wait_calc+0xb5>
mov    -0xc(%rbp),%eax
sub    $0x70800,%eax
je     1305 <librpip_uart_frag_wait_calc+0x205>
jmp    11c8 <librpip_uart_frag_wait_calc+0xc8>
mov    -0xc(%rbp),%eax
sub    $0x7a120,%eax
je     1305 <librpip_uart_frag_wait_calc+0x205>
jmp    11db <librpip_uart_frag_wait_calc+0xdb>
mov    -0xc(%rbp),%eax
sub    $0x8ca00,%eax
je     1305 <librpip_uart_frag_wait_calc+0x205>
jmp    11ee <librpip_uart_frag_wait_calc+0xee>
mov    -0xc(%rbp),%eax
sub    $0xe1000,%eax
je     1311 <librpip_uart_frag_wait_calc+0x211>
jmp    1201 <librpip_uart_frag_wait_calc+0x101>
mov    -0xc(%rbp),%eax
sub    $0xf4240,%eax
je     1311 <librpip_uart_frag_wait_calc+0x211>
jmp    1214 <librpip_uart_frag_wait_calc+0x114>
mov    -0xc(%rbp),%eax
sub    $0x119400,%eax
je     1311 <librpip_uart_frag_wait_calc+0x211>
jmp    1227 <librpip_uart_frag_wait_calc+0x127>
mov    -0xc(%rbp),%eax
sub    $0x16e360,%eax
je     1311 <librpip_uart_frag_wait_calc+0x211>
jmp    123a <librpip_uart_frag_wait_calc+0x13a>
mov    -0xc(%rbp),%eax
sub    $0x1e8480,%eax
je     1311 <librpip_uart_frag_wait_calc+0x211>
jmp    124d <librpip_uart_frag_wait_calc+0x14d>
mov    -0xc(%rbp),%eax
sub    $0x2625a0,%eax
je     131d <librpip_uart_frag_wait_calc+0x21d>
jmp    1260 <librpip_uart_frag_wait_calc+0x160>
mov    -0xc(%rbp),%eax
sub    $0x2dc6c0,%eax
je     131d <librpip_uart_frag_wait_calc+0x21d>
jmp    1273 <librpip_uart_frag_wait_calc+0x173>
mov    -0xc(%rbp),%eax
sub    $0x3567e0,%eax
je     131d <librpip_uart_frag_wait_calc+0x21d>
jmp    1286 <librpip_uart_frag_wait_calc+0x186>
mov    -0xc(%rbp),%eax
sub    $0x3d0900,%eax
je     131d <librpip_uart_frag_wait_calc+0x21d>
jmp    1329 <librpip_uart_frag_wait_calc+0x229>
movl   $0x640,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x320,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x190,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0xb4,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x64,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x32,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x21,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x11,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x8,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x4,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x2,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x1,-0x4(%rbp)
jmp    1330 <librpip_uart_frag_wait_calc+0x230>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<librpip_uart_frag_wait_calc>:
cmp    $0x7a11f,%edi
jle    113d <librpip_uart_frag_wait_calc+0x3d>
cmp    $0x16e35f,%edi
jle    117b <librpip_uart_frag_wait_calc+0x7b>
cmp    $0x2dc6bf,%edi
jg     11d6 <librpip_uart_frag_wait_calc+0xd6>
cmp    $0x16e360,%edi
je     11a3 <librpip_uart_frag_wait_calc+0xa3>
cmp    $0x1e8480,%edi
je     11a3 <librpip_uart_frag_wait_calc+0xa3>
cmp    $0x2625a0,%edi
je     11ee <librpip_uart_frag_wait_calc+0xee>
jmp    1259 <librpip_uart_frag_wait_calc+0x159>
cmp    $0x95ff,%edi
jg     11a9 <librpip_uart_frag_wait_calc+0xa9>
cmp    $0x12bf,%edi
jle    11f4 <librpip_uart_frag_wait_calc+0xf4>
cmp    $0x12c0,%edi
je     123b <librpip_uart_frag_wait_calc+0x13b>
cmp    $0x2580,%edi
je     1241 <librpip_uart_frag_wait_calc+0x141>
cmp    $0x4b00,%edi
jne    1259 <librpip_uart_frag_wait_calc+0x159>
mov    $0x64,%eax
ret
cmp    $0xe0fff,%edi
jle    120f <librpip_uart_frag_wait_calc+0x10f>
cmp    $0xe1000,%edi
je     11a3 <librpip_uart_frag_wait_calc+0xa3>
cmp    $0xf4240,%edi
je     11a3 <librpip_uart_frag_wait_calc+0xa3>
cmp    $0x119400,%edi
jne    1259 <librpip_uart_frag_wait_calc+0x159>
mov    $0x2,%eax
ret
cmp    $0x1c1ff,%edi
jle    1225 <librpip_uart_frag_wait_calc+0x125>
cmp    $0x1c200,%edi
je     1247 <librpip_uart_frag_wait_calc+0x147>
cmp    $0x38400,%edi
je     124d <librpip_uart_frag_wait_calc+0x14d>
cmp    $0x70800,%edi
je     121f <librpip_uart_frag_wait_calc+0x11f>
jmp    1259 <librpip_uart_frag_wait_calc+0x159>
cmp    $0x2dc6c0,%edi
je     11ee <librpip_uart_frag_wait_calc+0xee>
cmp    $0x3567e0,%edi
je     11ee <librpip_uart_frag_wait_calc+0xee>
cmp    $0x3d0900,%edi
jne    1259 <librpip_uart_frag_wait_calc+0x159>
mov    $0x1,%eax
ret
mov    $0x640,%eax
cmp    $0x4b0,%edi
je     1252 <librpip_uart_frag_wait_calc+0x152>
cmp    $0x960,%edi
jne    1259 <librpip_uart_frag_wait_calc+0x159>
mov    $0x320,%eax
ret
cmp    $0x7a120,%edi
je     121f <librpip_uart_frag_wait_calc+0x11f>
cmp    $0x8ca00,%edi
jne    1259 <librpip_uart_frag_wait_calc+0x159>
mov    $0x4,%eax
ret
cmp    $0x9600,%edi
je     1253 <librpip_uart_frag_wait_calc+0x153>
cmp    $0xe100,%edi
jne    1259 <librpip_uart_frag_wait_calc+0x159>
mov    $0x21,%eax
ret
mov    $0x190,%eax
ret
mov    $0xb4,%eax
ret
mov    $0x11,%eax
ret
mov    $0x8,%eax
ret
mov    $0x32,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @librpip_uart_frag_wait_calc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %17 [
i32 1200, label %5
i32 2400, label %6
i32 4800, label %7
i32 9600, label %8
i32 19200, label %9
i32 38400, label %10
i32 57600, label %11
i32 115200, label %12
i32 230400, label %13
i32 460800, label %14
i32 500000, label %14
i32 576000, label %14
i32 921600, label %15
i32 1000000, label %15
i32 1152000, label %15
i32 1500000, label %15
i32 2000000, label %15
i32 2500000, label %16
i32 3000000, label %16
i32 3500000, label %16
i32 4000000, label %16
]
5: ; preds = %1
store i32 1600, i32* %2
br label %18
6: ; preds = %1
store i32 800, i32* %2
br label %18
7: ; preds = %1
store i32 400, i32* %2
br label %18
8: ; preds = %1
store i32 180, i32* %2
br label %18
9: ; preds = %1
store i32 100, i32* %2
br label %18
10: ; preds = %1
store i32 50, i32* %2
br label %18
11: ; preds = %1
store i32 33, i32* %2
br label %18
12: ; preds = %1
store i32 17, i32* %2
br label %18
13: ; preds = %1
store i32 8, i32* %2
br label %18
14: ; preds = %1, %1, %1
store i32 4, i32* %2
br label %18
15: ; preds = %1, %1, %1, %1, %1
store i32 2, i32* %2
br label %18
16: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @librpip_uart_frag_wait_calc(i32 %0) {
switch i32 %0, label %13 [
i32 1200, label %14
i32 2400, label %2
i32 4800, label %3
i32 9600, label %4
i32 19200, label %5
i32 38400, label %6
i32 57600, label %7
i32 115200, label %8
i32 230400, label %9
i32 460800, label %10
i32 500000, label %10
i32 576000, label %10
i32 921600, label %11
i32 1000000, label %11
i32 1152000, label %11
i32 1500000, label %11
i32 2000000, label %11
i32 2500000, label %12
i32 3000000, label %12
i32 3500000, label %12
i32 4000000, label %12
]
2: ; preds = %1
br label %14
3: ; preds = %1
br label %14
4: ; preds = %1
br label %14
5: ; preds = %1
br label %14
6: ; preds = %1
br label %14
7: ; preds = %1
br label %14
8: ; preds = %1
br label %14
9: ; preds = %1
br label %14
10: ; preds = %1, %1, %1
br label %14
11: ; preds = %1, %1, %1, %1, %1
br label %14
12: ; preds = %1, %1, %1, %1
br label %14
13: ; preds = %1
br label %14
14: ; preds = %1, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%15 = phi i32 [ 0, %13 ], [ 1, %12 ], [ 2, %11 ], [ 4, %10 ], [ 8, %9 ], [ 17, %8 ], [ 33, %7 ], [ 50, %6 ], [ 100, %5 ], [ 180, %4 ], [ 400, %3 ], [ 800, %2 ], [ 1600, %1 ]
ret i32 %15
}