#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 dummy;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int /*<<< orphan*/ B0;
int /*<<< orphan*/ B110;
int /*<<< orphan*/ B1200;
int /*<<< orphan*/ B134;
int /*<<< orphan*/ B150;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B2400;
int /*<<< orphan*/ B300;
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ B50;
int /*<<< orphan*/ B600;
int /*<<< orphan*/ B75;
int /*<<< orphan*/ B9600;
int /*<<< orphan*/ TCSANOW;
scalar_t__ cfsetispeed(struct termios *, int /*<<< orphan*/);
scalar_t__ cfsetospeed(struct termios *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
scalar_t__ guessbaudrate(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
scalar_t__ tcgetattr(int, struct termios *);
scalar_t__ tcsetattr(int, int /*<<< orphan*/, struct termios *);
int modifybaud(int fd, long baudrate) {
  if (baudrate == -1)
    return 0;
  if (baudrate == 0) {
    return guessbaudrate(fd) > 0 ? 0 : 1;
  }
  struct termios options;
  if (0 != tcgetattr(fd, &options)) {
    perror("tcgetattr");
    return -1;
  }
  speed_t speedreq = B38400;
  switch (baudrate) {
  case 38400:
    speedreq = B38400;
    break;
  case 19200:
    speedreq = B19200;
    break;
  case 9600:
    speedreq = B9600;
    break;
  case 4800:
    speedreq = B4800;
    break;
  case 2400:
    speedreq = B2400;
    break;
  case 1200:
    speedreq = B1200;
    break;
  case 600:
    speedreq = B600;
    break;
  case 300:
    speedreq = B300;
    break;
  case 150:
    speedreq = B150;
    break;
  case 134:
    speedreq = B134;
    break;
  case 110:
    speedreq = B110;
    break;
  case 75:
    speedreq = B75;
    break;
  case 50:
    speedreq = B50;
    break;
  case 0:
    speedreq = B0;
    break;
  default:
    fprintf(stderr, "Uknown baudrate: %li\n", baudrate);
    return -1;
    break;
  }
  if (0 != cfsetispeed(&options, speedreq)) {
    perror("cfsetispeed");
    return -1;
  }
  if (0 != cfsetospeed(&options, speedreq)) {
    perror("cfsetospeed");
    return -1;
  }
  if (0 != tcsetattr(fd, TCSANOW, &options)) {
    perror("tcsetattr");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<modifybaud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1196 <modifybaud+0x26>
movl   $0x0,-0x4(%rbp)
jmp    14da <modifybaud+0x36a>
cmpq   $0x0,-0x10(%rbp)
jne    11c2 <modifybaud+0x52>
mov    -0x8(%rbp),%edi
call   1030 <guessbaudrate@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    14da <modifybaud+0x36a>
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1060 <tcgetattr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     11f4 <modifybaud+0x84>
lea    0xe1d(%rip),%rdi
call   1090 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14da <modifybaud+0x36a>
mov    0x2d65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
test   %rax,%rax
je     13fe <modifybaud+0x28e>
jmp    1216 <modifybaud+0xa6>
mov    -0x28(%rbp),%rax
sub    $0x32,%rax
je     13ed <modifybaud+0x27d>
jmp    1229 <modifybaud+0xb9>
mov    -0x28(%rbp),%rax
sub    $0x4b,%rax
je     13dc <modifybaud+0x26c>
jmp    123c <modifybaud+0xcc>
mov    -0x28(%rbp),%rax
sub    $0x6e,%rax
je     13cb <modifybaud+0x25b>
jmp    124f <modifybaud+0xdf>
mov    -0x28(%rbp),%rax
sub    $0x86,%rax
je     13ba <modifybaud+0x24a>
jmp    1264 <modifybaud+0xf4>
mov    -0x28(%rbp),%rax
sub    $0x96,%rax
je     13a9 <modifybaud+0x239>
jmp    1279 <modifybaud+0x109>
mov    -0x28(%rbp),%rax
sub    $0x12c,%rax
je     1398 <modifybaud+0x228>
jmp    128e <modifybaud+0x11e>
mov    -0x28(%rbp),%rax
sub    $0x258,%rax
je     1387 <modifybaud+0x217>
jmp    12a3 <modifybaud+0x133>
mov    -0x28(%rbp),%rax
sub    $0x4b0,%rax
je     1376 <modifybaud+0x206>
jmp    12b8 <modifybaud+0x148>
mov    -0x28(%rbp),%rax
sub    $0x960,%rax
je     1365 <modifybaud+0x1f5>
jmp    12cd <modifybaud+0x15d>
mov    -0x28(%rbp),%rax
sub    $0x12c0,%rax
je     1354 <modifybaud+0x1e4>
jmp    12e2 <modifybaud+0x172>
mov    -0x28(%rbp),%rax
sub    $0x2580,%rax
je     1343 <modifybaud+0x1d3>
jmp    12f7 <modifybaud+0x187>
mov    -0x28(%rbp),%rax
sub    $0x4b00,%rax
je     1332 <modifybaud+0x1c2>
jmp    130c <modifybaud+0x19c>
mov    -0x28(%rbp),%rax
sub    $0x9600,%rax
jne    140f <modifybaud+0x29f>
jmp    1321 <modifybaud+0x1b1>
mov    0x2c38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2cb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2c66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2c5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2c14(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2bf3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2c3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2c09(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2bc8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2bff(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2c0e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2bf5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2bac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2b8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <modifybaud+0x2c4>
mov    0x2b72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xbe7(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14da <modifybaud+0x36a>
mov    -0x1c(%rbp),%esi
lea    -0x18(%rbp),%rdi
call   1080 <cfsetispeed@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1466 <modifybaud+0x2f6>
lea    0xbcb(%rip),%rdi
call   1090 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14da <modifybaud+0x36a>
mov    -0x1c(%rbp),%esi
lea    -0x18(%rbp),%rdi
call   1040 <cfsetospeed@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1498 <modifybaud+0x328>
lea    0xba5(%rip),%rdi
call   1090 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14da <modifybaud+0x36a>
mov    -0x8(%rbp),%edi
mov    0x2b2e(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1070 <tcsetattr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     14d3 <modifybaud+0x363>
lea    0xb76(%rip),%rdi
call   1090 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14da <modifybaud+0x36a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modifybaud>:
push   %rbp
push   %rbx
push   %rax
cmp    $0xffffffffffffffff,%rsi
je     119a <modifybaud+0x2a>
mov    %rsi,%rbx
mov    %edi,%ebp
test   %rsi,%rsi
jne    11a1 <modifybaud+0x31>
mov    %ebp,%edi
call   1030 <guessbaudrate@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setle  %al
jmp    136f <modifybaud+0x1ff>
xor    %eax,%eax
jmp    136f <modifybaud+0x1ff>
mov    %rsp,%rsi
mov    %ebp,%edi
call   1060 <tcgetattr@plt>
test   %rax,%rax
jne    134c <modifybaud+0x1dc>
cmp    $0x257,%rbx
jle    11f9 <modifybaud+0x89>
cmp    $0x12bf,%rbx
jle    122c <modifybaud+0xbc>
cmp    $0x4aff,%rbx
jg     1287 <modifybaud+0x117>
cmp    $0x12c0,%rbx
je     12a6 <modifybaud+0x136>
cmp    $0x2580,%rbx
jne    1332 <modifybaud+0x1c2>
mov    0x2dbc(%rip),%rax
jmp    12ec <modifybaud+0x17c>
cmp    $0x85,%rbx
jg     125f <modifybaud+0xef>
cmp    $0x32,%rbx
je     12af <modifybaud+0x13f>
cmp    $0x4b,%rbx
je     12b8 <modifybaud+0x148>
cmp    $0x6e,%rbx
jne    1332 <modifybaud+0x1c2>
mov    0x2db9(%rip),%rax
jmp    12ec <modifybaud+0x17c>
cmp    $0x258,%rbx
je     12c1 <modifybaud+0x151>
cmp    $0x4b0,%rbx
je     12ca <modifybaud+0x15a>
cmp    $0x960,%rbx
jne    1332 <modifybaud+0x1c2>
mov    0x2d2e(%rip),%rax
jmp    12ec <modifybaud+0x17c>
cmp    $0x86,%rbx
je     12d3 <modifybaud+0x163>
cmp    $0x96,%rbx
je     12dc <modifybaud+0x16c>
cmp    $0x12c,%rbx
jne    1332 <modifybaud+0x1c2>
mov    0x2d23(%rip),%rax
jmp    12ec <modifybaud+0x17c>
cmp    $0x9600,%rbx
je     12e5 <modifybaud+0x175>
cmp    $0x4b00,%rbx
jne    1332 <modifybaud+0x1c2>
mov    0x2d4c(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2d0b(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2cea(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2d19(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2d00(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2ca7(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2ce6(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2c9d(%rip),%rax
jmp    12ec <modifybaud+0x17c>
mov    0x2c7c(%rip),%rax
mov    (%rax),%ebx
mov    %rsp,%rdi
mov    %ebx,%esi
call   1080 <cfsetispeed@plt>
test   %rax,%rax
jne    1355 <modifybaud+0x1e5>
mov    %rsp,%rdi
mov    %ebx,%esi
call   1040 <cfsetospeed@plt>
test   %rax,%rax
jne    135e <modifybaud+0x1ee>
mov    0x2cbd(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    %ebp,%edi
call   1070 <tcsetattr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     136f <modifybaud+0x1ff>
lea    0xd08(%rip),%rdi
jmp    1365 <modifybaud+0x1f5>
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
lea    0xcc8(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
jmp    136a <modifybaud+0x1fa>
lea    0xcad(%rip),%rdi
jmp    1365 <modifybaud+0x1f5>
lea    0xcc4(%rip),%rdi
jmp    1365 <modifybaud+0x1f5>
lea    0xcc7(%rip),%rdi
call   1090 <perror@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@.str = [10 x i8] c"tcgetattr\00"
@B38400 = global i32 0
@B19200 = global i32 0
@B9600 = global i32 0
@B4800 = global i32 0
@B2400 = global i32 0
@B1200 = global i32 0
@B600 = global i32 0
@B300 = global i32 0
@B150 = global i32 0
@B134 = global i32 0
@B110 = global i32 0
@B75 = global i32 0
@B50 = global i32 0
@B0 = global i32 0
@stderr = global i32 0
@.str.1 = [22 x i8] c"Uknown baudrate: %li\0A\00"
@.str.2 = [12 x i8] c"cfsetispeed\00"
@.str.3 = [12 x i8] c"cfsetospeed\00"
@TCSANOW = global i32 0
@.str.4 = [10 x i8] c"tcsetattr\00"
define i32 @modifybaud(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca %struct.termios
%7 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
%8 = load i64, i64* %5
%9 = icmp eq i64 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %81
11: ; preds = %2
%12 = load i64, i64* %5
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %4
%16 = call i64 @guessbaudrate(i32 %15)
%17 = icmp sgt i64 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 0, i32 1
store i32 %19, i32* %3
br label %81
20: ; preds = %11
%21 = load i32, i32* %4
%22 = call i64 @tcgetattr(i32 %21, %struct.termios* %6)
%23 = icmp ne i64 0, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %81
26: ; preds = %20
%27 = load i32, i32* @B38400
store i32 %27, i32* %7
%28 = load i64, i64* %5
switch i64 %28, label %57 [
i64 38400, label %29
i64 19200, label %31
i64 9600, label %33
i64 4800, label %35
i64 2400, label %37
i64 1200, label %39
i64 600, label %41
i64 300, label %43
i64 150, label %45
i64 134, label %47
i64 110, label %49
i64 75, label %51
i64 50, label %53
i64 0, label %55
]
29: ; preds = %26
%30 = load i32, i32* @B38400
store i32 %30, i32* %7
br label %61
31: ; preds = %26
%32 = load i32, i32* @B19200
store i32 %32, i32* %7
br label %61
33: ; preds = %26
%34 = load i32, i32* @B9600
store i32 %34, i32* %7
br label %61
35: ; preds = %26
%36 = load i32, i32* @B4800
store i32 %36, i32* %7
br label %61
37: ; preds = %26
%38 = load i32, i32* @B2400
store i32 %38, i32* %7
br label %61
39: ; preds = %26
%40 = load i32, i32* @B1200
store i32 %40, i32* %7
br label %61
41: ; preds = %26
%42 = load i32, i32* @B600
store i32 %42, i32* %7
br label %61
43: ; preds = %26
%44 = load i32, i32* @B300
store i32 %44, i32* %7
br label %61
45: ; preds = %26
%46 = load i32, i32* @B150
store i32 %46, i32* %7
br label %61
47: ; preds = %26
%48 = load i32, i32* @B134
store i32 %48, i32* %7
br label %61
49: ; preds = %26
%50 = load i32, i32* @B110
store i32 %50, i32* %7
br label %61
51: ; preds = %26
%52 = load i32, i32* @B75
store i32 %52, i32* %7
br label %61
53: ; preds = %26
%54 = load i32, i32* @B50
store i32 %54, i32* %7
br label %61
55: ; preds = %26
%56 = load i32, i32* @B0
store i32 %56, i32* %7
br label %61
57: ; preds = %26
%58 = load i32, i32* @stderr
%59 = load i64, i64* %5
%60 = call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 %59)
store i32 -1, i32* %3
br label %81
61: ; preds = %55, %53, %51, %49, %47, %45, %43, %41, %39, %37, %35, %33, %31, %29
%62 = load i32, i32* %7
%63 = call i64 @cfsetispeed(%struct.termios* %6, i32 %62)
%64 = icmp ne i64 0, %63
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %81
67: ; preds = %61
%68 = load i32, i32* %7
%69 = call i64 @cfsetospeed(%struct.termios* %6, i32 %68)
%70 = icmp ne i64 0, %69
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %81
73: ; preds = %67
%74 = load i32, i32* %4
%75 = load i32, i32* @TCSANOW
%76 = call i64 @tcsetattr(i32 %74, i32 %75, %struct.termios* %6)
%77 = icmp ne i64 0, %76
br i1 %77, label %78, label %80
78: ; preds = %73
%79 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %81
80: ; preds = %73
store i32 0, i32* %3
br label %81
81: ; preds = %80, %78, %71, %65, %57, %24, %14, %10
%82 = load i32, i32* %3
ret i32 %82
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@.str = [10 x i8] c"tcgetattr\00"
@B38400 = global i32 0
@B19200 = global i32 0
@B9600 = global i32 0
@B4800 = global i32 0
@B2400 = global i32 0
@B1200 = global i32 0
@B600 = global i32 0
@B300 = global i32 0
@B150 = global i32 0
@B134 = global i32 0
@B110 = global i32 0
@B75 = global i32 0
@B50 = global i32 0
@B0 = global i32 0
@stderr = global i32 0
@.str.1 = [22 x i8] c"Uknown baudrate: %li\0A\00"
@.str.2 = [12 x i8] c"cfsetispeed\00"
@.str.3 = [12 x i8] c"cfsetospeed\00"
@TCSANOW = global i32 0
@.str.4 = [10 x i8] c"tcsetattr\00"
define i32 @modifybaud(i32 %0, i64 %1) {
%3 = alloca %struct.termios
switch i64 %1, label %8 [
i64 -1, label %50
i64 0, label %4
]
4: ; preds = %2
%5 = tail call i64 @guessbaudrate(i32 %0)
%6 = icmp slt i64 %5, 1
%7 = zext i1 %6 to i32
br label %50
8: ; preds = %2
%9 = bitcast %struct.termios* %3 to i8*
%10 = call i64 @tcgetattr(i32 %0, %struct.termios* %3)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %48
14: ; preds = %8
switch i64 %1, label %27 [
i64 38400, label %30
i64 19200, label %15
i64 9600, label %16
i64 4800, label %17
i64 2400, label %18
i64 1200, label %19
i64 600, label %20
i64 300, label %21
i64 150, label %22
i64 134, label %23
i64 110, label %24
i64 75, label %25
i64 50, label %26
]
15: ; preds = %14
br label %30
16: ; preds = %14
br label %30
17: ; preds = %14
br label %30
18: ; preds = %14
br label %30
19: ; preds = %14
br label %30
20: ; preds = %14
br label %30
21: ; preds = %14
br label %30
22: ; preds = %14
br label %30
23: ; preds = %14
br label %30
24: ; preds = %14
br label %30
25: ; preds = %14
br label %30
26: ; preds = %14
br label %30
27: ; preds = %14
%28 = load i32, i32* @stderr
%29 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 %1)
br label %48
30: ; preds = %14, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15
%31 = phi i32* [ @B50, %26 ], [ @B75, %25 ], [ @B110, %24 ], [ @B134, %23 ], [ @B150, %22 ], [ @B300, %21 ], [ @B600, %20 ], [ @B1200, %19 ], [ @B2400, %18 ], [ @B4800, %17 ], [ @B9600, %16 ], [ @B19200, %15 ], [ @B38400, %14 ]
%32 = load i32, i32* %31
%33 = call i64 @cfsetispeed(%struct.termios* %3, i32 %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %30
%36 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %48
37: ; preds = %30
%38 = call i64 @cfsetospeed(%struct.termios* %3, i32 %32)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %48
42: ; preds = %37
%43 = load i32, i32* @TCSANOW
%44 = call i64 @tcsetattr(i32 %0, i32 %43, %struct.termios* %3)
%45 = icmp eq i64 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %42
%47 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %48
48: ; preds = %27, %35, %40, %46, %42, %12
%49 = phi i32 [ -1, %12 ], [ -1, %27 ], [ -1, %35 ], [ -1, %40 ], [ -1, %46 ], [ 0, %42 ]
br label %50
50: ; preds = %2, %48, %4
%51 = phi i32 [ %7, %4 ], [ %49, %48 ], [ 0, %2 ]
ret i32 %51
}