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

/* Variables and functions */
int /*<<< orphan*/ B0;
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ B1200;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B230400;
int /*<<< orphan*/ B2400;
int /*<<< orphan*/ B300;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ B57600;
int /*<<< orphan*/ B9600;
scalar_t__ strcmp(char const *, char *);
tcflag_t baud_name_to_flags(const char *baud_name) {
  if (strcmp(baud_name, "230400") == 0)
    return B230400;
  if (strcmp(baud_name, "115200") == 0)
    return B115200;
  if (strcmp(baud_name, "57600") == 0)
    return B57600;
  if (strcmp(baud_name, "38400") == 0)
    return B38400;
  if (strcmp(baud_name, "19200") == 0)
    return B19200;
  if (strcmp(baud_name, "9600") == 0)
    return B9600;
  if (strcmp(baud_name, "4800") == 0)
    return B4800;
  if (strcmp(baud_name, "2400") == 0)
    return B2400;
  if (strcmp(baud_name, "1200") == 0)
    return B1200;
  if (strcmp(baud_name, "300") == 0)
    return B300;
  return B0;
}


x86 assembly (clang, -O0):
<baud_name_to_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1147 <baud_name_to_flags+0x37>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1172 <baud_name_to_flags+0x62>
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    119d <baud_name_to_flags+0x8d>
mov    0x2e35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11c8 <baud_name_to_flags+0xb8>
mov    0x2dca(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11f3 <baud_name_to_flags+0xe3>
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    121e <baud_name_to_flags+0x10e>
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xdfc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1249 <baud_name_to_flags+0x139>
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xdd6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1274 <baud_name_to_flags+0x164>
mov    0x2d46(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xdb0(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    129f <baud_name_to_flags+0x18f>
mov    0x2d13(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12ca <baud_name_to_flags+0x1ba>
mov    0x2d10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12d6 <baud_name_to_flags+0x1c6>
mov    0x2ce7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baud_name_to_flags>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11fa <baud_name_to_flags+0xea>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1203 <baud_name_to_flags+0xf3>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     120c <baud_name_to_flags+0xfc>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1215 <baud_name_to_flags+0x105>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     121e <baud_name_to_flags+0x10e>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1227 <baud_name_to_flags+0x117>
lea    0xe7d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1230 <baud_name_to_flags+0x120>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1239 <baud_name_to_flags+0x129>
lea    0xe5f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1242 <baud_name_to_flags+0x132>
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    124b <baud_name_to_flags+0x13b>
mov    0x2dd8(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2d8f(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2d96(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2db5(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2d6c(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2dcb(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2daa(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2da9(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2d70(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2d5f(%rip),%rax
jmp    1252 <baud_name_to_flags+0x142>
mov    0x2d66(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"230400\00"
@B230400 = global i32 0
@.str.1 = [7 x i8] c"115200\00"
@B115200 = global i32 0
@.str.2 = [6 x i8] c"57600\00"
@B57600 = global i32 0
@.str.3 = [6 x i8] c"38400\00"
@B38400 = global i32 0
@.str.4 = [6 x i8] c"19200\00"
@B19200 = global i32 0
@.str.5 = [5 x i8] c"9600\00"
@B9600 = global i32 0
@.str.6 = [5 x i8] c"4800\00"
@B4800 = global i32 0
@.str.7 = [5 x i8] c"2400\00"
@B2400 = global i32 0
@.str.8 = [5 x i8] c"1200\00"
@B1200 = global i32 0
@.str.9 = [4 x i8] c"300\00"
@B300 = global i32 0
@B0 = global i32 0
define i32 @baud_name_to_flags(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @B230400
store i32 %8, i32* %2
br label %65
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* @B115200
store i32 %14, i32* %2
br label %65
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* @B57600
store i32 %20, i32* %2
br label %65
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* @B38400
store i32 %26, i32* %2
br label %65
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load i32, i32* @B19200
store i32 %32, i32* %2
br label %65
33: ; preds = %27
%34 = load i8*, i8** %3
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = load i32, i32* @B9600
store i32 %38, i32* %2
br label %65
39: ; preds = %33
%40 = load i8*, i8** %3
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load i32, i32* @B4800
store i32 %44, i32* %2
br label %65
45: ; preds = %39
%46 = load i8*, i8** %3
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = load i32, i32* @B2400
store i32 %50, i32* %2
br label %65
51: ; preds = %45
%52 = load i8*, i8** %3
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = load i32, i32* @B1200
store i32 %56, i32* %2
br label %65
57: ; preds = %51
%58 = load i8*, i8** %3
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = load i32, i32* @B300
store i32 %62, i32* %2
br label %65
63: ; preds = %57
%64 = load i32, i32* @B0
store i32 %64, i32* %2
br label %65
65: ; preds = %63, %61, %55, %49, %43, %37, %31, %25, %19, %13, %7
%66 = load i32, i32* %2
ret i32 %66
}

LLVM IR (-O2):
@.str = [7 x i8] c"230400\00"
@B230400 = global i32 0
@.str.1 = [7 x i8] c"115200\00"
@B115200 = global i32 0
@.str.2 = [6 x i8] c"57600\00"
@B57600 = global i32 0
@.str.3 = [6 x i8] c"38400\00"
@B38400 = global i32 0
@.str.4 = [6 x i8] c"19200\00"
@B19200 = global i32 0
@.str.5 = [5 x i8] c"9600\00"
@B9600 = global i32 0
@.str.6 = [5 x i8] c"4800\00"
@B4800 = global i32 0
@.str.7 = [5 x i8] c"2400\00"
@B2400 = global i32 0
@.str.8 = [5 x i8] c"1200\00"
@B1200 = global i32 0
@.str.9 = [4 x i8] c"300\00"
@B300 = global i32 0
@B0 = global i32 0
define i32 @baud_name_to_flags(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %32, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %32, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %32, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %32, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %32, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %32, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %32, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %25
%29 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
%31 = select i1 %30, i32* @B300, i32* @B0
br label %32
32: ; preds = %28, %25, %22, %19, %16, %13, %10, %7, %4, %1
%33 = phi i32* [ @B230400, %1 ], [ @B115200, %4 ], [ @B57600, %7 ], [ @B38400, %10 ], [ @B19200, %13 ], [ @B9600, %16 ], [ @B4800, %19 ], [ @B2400, %22 ], [ @B1200, %25 ], [ %31, %28 ]
%34 = load i32, i32* %33
ret i32 %34
}