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

/* Variables and functions */
int /*<<< orphan*/ B110;
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ B1200;
int /*<<< orphan*/ B134;
int /*<<< orphan*/ B150;
int /*<<< orphan*/ B1800;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B200;
int /*<<< orphan*/ B230400;
int /*<<< orphan*/ B2400;
int /*<<< orphan*/ B300;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ B50;
int /*<<< orphan*/ B57600;
int /*<<< orphan*/ B600;
int /*<<< orphan*/ B75;
int /*<<< orphan*/ B9600;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
speed_t convertspeed(int speed) {
  switch (speed) {
  case 50:
    return B50;
  case 75:
    return B75;
  case 110:
    return B110;
  case 134:
    return B134;
  case 150:
    return B150;
  case 200:
    return B200;
  case 300:
    return B300;
  case 600:
    return B600;
  case 1200:
    return B1200;
  case 1800:
    return B1800;
  case 2400:
    return B2400;
  case 4800:
    return B4800;
  case 9600:
    return B9600;
  case 19200:
    return B19200;
  case 38400:
    return B38400;
  case 57600:
    return B57600;
  case 115200:
    return B115200;
  case 230400:
    return B230400;
  }
  fprintf(stderr, "warning: unknow speed value %d, default 9600 used\n", speed);
  return B9600;
}


x86 assembly (clang, -O0):
<convertspeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x32,%eax
je     126e <convertspeed+0x15e>
jmp    112f <convertspeed+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x4b,%eax
je     127f <convertspeed+0x16f>
jmp    1140 <convertspeed+0x30>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     1290 <convertspeed+0x180>
jmp    1151 <convertspeed+0x41>
mov    -0xc(%rbp),%eax
sub    $0x86,%eax
je     12a1 <convertspeed+0x191>
jmp    1164 <convertspeed+0x54>
mov    -0xc(%rbp),%eax
sub    $0x96,%eax
je     12b2 <convertspeed+0x1a2>
jmp    1177 <convertspeed+0x67>
mov    -0xc(%rbp),%eax
sub    $0xc8,%eax
je     12c3 <convertspeed+0x1b3>
jmp    118a <convertspeed+0x7a>
mov    -0xc(%rbp),%eax
sub    $0x12c,%eax
je     12d4 <convertspeed+0x1c4>
jmp    119d <convertspeed+0x8d>
mov    -0xc(%rbp),%eax
sub    $0x258,%eax
je     12e5 <convertspeed+0x1d5>
jmp    11b0 <convertspeed+0xa0>
mov    -0xc(%rbp),%eax
sub    $0x4b0,%eax
je     12f6 <convertspeed+0x1e6>
jmp    11c3 <convertspeed+0xb3>
mov    -0xc(%rbp),%eax
sub    $0x708,%eax
je     1307 <convertspeed+0x1f7>
jmp    11d6 <convertspeed+0xc6>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     1318 <convertspeed+0x208>
jmp    11e9 <convertspeed+0xd9>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     1329 <convertspeed+0x219>
jmp    11fc <convertspeed+0xec>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     133a <convertspeed+0x22a>
jmp    120f <convertspeed+0xff>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     134b <convertspeed+0x23b>
jmp    1222 <convertspeed+0x112>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     135c <convertspeed+0x24c>
jmp    1235 <convertspeed+0x125>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     136d <convertspeed+0x25d>
jmp    1248 <convertspeed+0x138>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
je     137e <convertspeed+0x26e>
jmp    125b <convertspeed+0x14b>
mov    -0xc(%rbp),%eax
sub    $0x38400,%eax
je     138f <convertspeed+0x27f>
jmp    13a0 <convertspeed+0x290>
mov    0x2d33(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2d52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2d49(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2d20(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2cb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2cd6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2cd5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2ce4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2c6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2c7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2c59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2c90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2c77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2c9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2be5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2c24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2bdb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2bba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c4 <convertspeed+0x2b4>
mov    0x2bd9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xc4d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2bf9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertspeed>:
push   %rax
mov    %edi,%edx
cmp    $0x707,%edi
jg     1163 <convertspeed+0x53>
cmp    $0x95,%edx
jle    11a7 <convertspeed+0x97>
cmp    $0x12b,%edx
jle    11f6 <convertspeed+0xe6>
cmp    $0x12c,%edx
je     1281 <convertspeed+0x171>
cmp    $0x258,%edx
je     128a <convertspeed+0x17a>
cmp    $0x4b0,%edx
jne    1263 <convertspeed+0x153>
mov    0x2e0a(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
cmp    $0x4aff,%edx
jle    11ce <convertspeed+0xbe>
cmp    $0xe0ff,%edx
jle    1216 <convertspeed+0x106>
cmp    $0xe100,%edx
je     1293 <convertspeed+0x183>
cmp    $0x1c200,%edx
je     129c <convertspeed+0x18c>
cmp    $0x38400,%edx
jne    1263 <convertspeed+0x153>
mov    0x2dae(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
cmp    $0x6d,%edx
jg     1236 <convertspeed+0x126>
cmp    $0x32,%edx
je     12a5 <convertspeed+0x195>
cmp    $0x4b,%edx
jne    1263 <convertspeed+0x153>
mov    0x2e0f(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
cmp    $0x12bf,%edx
jg     1253 <convertspeed+0x143>
cmp    $0x708,%edx
je     12ae <convertspeed+0x19e>
cmp    $0x960,%edx
jne    1263 <convertspeed+0x153>
mov    0x2d87(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
cmp    $0x96,%edx
je     12b7 <convertspeed+0x1a7>
cmp    $0xc8,%edx
jne    1263 <convertspeed+0x153>
mov    0x2d8f(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
cmp    $0x4b00,%edx
je     12c0 <convertspeed+0x1b0>
cmp    $0x9600,%edx
jne    1263 <convertspeed+0x153>
mov    0x2d17(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
cmp    $0x6e,%edx
je     12c9 <convertspeed+0x1b9>
cmp    $0x86,%edx
jne    1263 <convertspeed+0x153>
mov    0x2d7a(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
cmp    $0x12c0,%edx
je     12d2 <convertspeed+0x1c2>
cmp    $0x2580,%edx
je     1278 <convertspeed+0x168>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
lea    0xd8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2d39(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2d28(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2d3f(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2cfe(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2cbd(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2cfc(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2cd3(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2cb2(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2d29(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2d10(%rip),%rax
jmp    12d9 <convertspeed+0x1c9>
mov    0x2ce7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@B50 = global i32 0
@B75 = global i32 0
@B110 = global i32 0
@B134 = global i32 0
@B150 = global i32 0
@B200 = global i32 0
@B300 = global i32 0
@B600 = global i32 0
@B1200 = global i32 0
@B1800 = global i32 0
@B2400 = global i32 0
@B4800 = global i32 0
@B9600 = global i32 0
@B19200 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
@B230400 = global i32 0
@stderr = global i32 0
@.str = [51 x i8] c"warning: unknow speed value %d, default 9600 used\0A\00"
define i32 @convertspeed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %41 [
i32 50, label %5
i32 75, label %7
i32 110, label %9
i32 134, label %11
i32 150, label %13
i32 200, label %15
i32 300, label %17
i32 600, label %19
i32 1200, label %21
i32 1800, label %23
i32 2400, label %25
i32 4800, label %27
i32 9600, label %29
i32 19200, label %31
i32 38400, label %33
i32 57600, label %35
i32 115200, label %37
i32 230400, label %39
]
5: ; preds = %1
%6 = load i32, i32* @B50
store i32 %6, i32* %2
br label %46
7: ; preds = %1
%8 = load i32, i32* @B75
store i32 %8, i32* %2
br label %46
9: ; preds = %1
%10 = load i32, i32* @B110
store i32 %10, i32* %2
br label %46
11: ; preds = %1
%12 = load i32, i32* @B134
store i32 %12, i32* %2
br label %46
13: ; preds = %1
%14 = load i32, i32* @B150
store i32 %14, i32* %2
br label %46
15: ; preds = %1
%16 = load i32, i32* @B200
store i32 %16, i32* %2
br label %46
17: ; preds = %1
%18 = load i32, i32* @B300
store i32 %18, i32* %2
br label %46
19: ; preds = %1
%20 = load i32, i32* @B600
store i32 %20, i32* %2
br label %46
21: ; preds = %1
%22 = load i32, i32* @B1200
store i32 %22, i32* %2
br label %46
23: ; preds = %1
%24 = load i32, i32* @B1800
store i32 %24, i32* %2
br label %46
25: ; preds = %1
%26 = load i32, i32* @B2400
store i32 %26, i32* %2
br label %46
27: ; preds = %1
%28 = load i32, i32* @B4800
store i32 %28, i32* %2
br label %46
29: ; preds = %1
%30 = load i32, i32* @B9600
store i32 %30, i32* %2
br label %46
31: ; preds = %1
%32 = load i32, i32* @B19200
store i32 %32, i32* %2
br label %46
33: ; preds = %1
%34 = load i32, i32* @B38400
store i32 %34, i32* %2
br label %46
35: ; preds = %1
%36 = load i32, i32* @B57600
store i32 %36, i32* %2
br label %46
37: ; preds = %1
%38 = load i32, i32* @B115200
store i32 %38, i32* %2
br label %46
39: ; preds = %1
%40 = load i32, i32* @B230400
store i32 %40, i32* %2
br label %46
41: ; preds = %1
%42 = load i32, i32* @stderr
%43 = load i32, i32* %3
%44 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = load i32, i32* @B9600
store i32 %45, i32* %2
br label %46
46: ; preds = %41, %39, %37, %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%47 = load i32, i32* %2
ret i32 %47
}

LLVM IR (-O2):
@B50 = global i32 0
@B75 = global i32 0
@B110 = global i32 0
@B134 = global i32 0
@B150 = global i32 0
@B200 = global i32 0
@B300 = global i32 0
@B600 = global i32 0
@B1200 = global i32 0
@B1800 = global i32 0
@B2400 = global i32 0
@B4800 = global i32 0
@B9600 = global i32 0
@B19200 = global i32 0
@B38400 = global i32 0
@B57600 = global i32 0
@B115200 = global i32 0
@B230400 = global i32 0
@stderr = global i32 0
@.str = [51 x i8] c"warning: unknow speed value %d, default 9600 used\0A\00"
define i32 @convertspeed(i32 %0) {
switch i32 %0, label %19 [
i32 50, label %22
i32 75, label %2
i32 110, label %3
i32 134, label %4
i32 150, label %5
i32 200, label %6
i32 300, label %7
i32 600, label %8
i32 1200, label %9
i32 1800, label %10
i32 2400, label %11
i32 4800, label %12
i32 9600, label %13
i32 19200, label %14
i32 38400, label %15
i32 57600, label %16
i32 115200, label %17
i32 230400, label %18
]
2: ; preds = %1
br label %22
3: ; preds = %1
br label %22
4: ; preds = %1
br label %22
5: ; preds = %1
br label %22
6: ; preds = %1
br label %22
7: ; preds = %1
br label %22
8: ; preds = %1
br label %22
9: ; preds = %1
br label %22
10: ; preds = %1
br label %22
11: ; preds = %1
br label %22
12: ; preds = %1
br label %22
13: ; preds = %1
br label %22
14: ; preds = %1
br label %22
15: ; preds = %1
br label %22
16: ; preds = %1
br label %22
17: ; preds = %1
br label %22
18: ; preds = %1
br label %22
19: ; preds = %1
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %22
22: ; preds = %1, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%23 = phi i32* [ @B9600, %19 ], [ @B230400, %18 ], [ @B115200, %17 ], [ @B57600, %16 ], [ @B38400, %15 ], [ @B19200, %14 ], [ @B9600, %13 ], [ @B4800, %12 ], [ @B2400, %11 ], [ @B1800, %10 ], [ @B1200, %9 ], [ @B600, %8 ], [ @B300, %7 ], [ @B200, %6 ], [ @B150, %5 ], [ @B134, %4 ], [ @B110, %3 ], [ @B75, %2 ], [ @B50, %1 ]
%24 = load i32, i32* %23
ret i32 %24
}