#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 {
  scalar_t__ c_iflag;
  scalar_t__ c_oflag;
  int c_cflag;
  scalar_t__ c_lflag;
  int *c_cc;
};

/* Variables and functions */
int B9600;
int CLOCAL;
int CREAD;
int CS8;
int HUPCL;
scalar_t__ IGNPAR;
int O_NOCTTY;
int O_RDWR;
int /*<<< orphan*/ TCIFLUSH;
int /*<<< orphan*/ TCSANOW;
size_t VMIN;
size_t VTIME;
int cfgetospeed(struct termios *);
int cfsetospeed(struct termios *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int open(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int tcflush(int, int /*<<< orphan*/);
int tcgetattr(int, struct termios *);
int tcsetattr(int, int /*<<< orphan*/, struct termios *);
int open_tty(void) {
  struct termios tio;
  int fd;
  fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY);
  if (fd == -1) {
    perror("open: /dev/ttyS0");
    exit(149);
  }
  if (tcgetattr(fd, &tio) == -1) {
    perror("tcgetattr: /dev/ttyS0");
    exit(154);
  }
  if (tcflush(fd, TCIFLUSH) == -1) {
    perror("tcflush: /dev/ttyS0");
    exit(165);
  }
  tio.c_iflag = IGNPAR;
  tio.c_oflag = 0;
  tio.c_cflag = CLOCAL | HUPCL | CREAD | CS8 | B9600;
  tio.c_lflag = 0;
  tio.c_cc[VTIME] = 0;
  tio.c_cc[VMIN] = 1;
  if (cfsetospeed(&tio, B9600) == -1) {
    perror("cfsetospeed");
    exit(177);
  }
  if (tcsetattr(fd, TCSANOW, &tio) == -1) {
    perror("tcsetattr: /dev/ttyS0");
    exit(182);
  }
  if (tcgetattr(fd, &tio) == -1) {
    perror("tcgetattr: /dev/ttyS0");
    exit(188);
  }
  if (tio.c_iflag != IGNPAR || tio.c_oflag != 0 ||
      tio.c_cflag != (CLOCAL | HUPCL | CREAD | CS8 | B9600) ||
      tio.c_lflag != 0 || tio.c_cc[VTIME] != 0 || tio.c_cc[VMIN] != 1 ||
      cfgetospeed(&tio) != B9600) {
    fputs("tcsetattr: /dev/ttyS0: Incomplete\n", stderr);
    exit(199);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2e49(%rip),%rax
mov    (%rax),%esi
mov    0x2e00(%rip),%rax
or     (%rax),%esi
lea    0xe7f(%rip),%rdi
call   1090 <open@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    11d9 <open_tty+0x49>
lea    0xe36(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x95,%edi
call   10b0 <exit@plt>
mov    -0x2c(%rbp),%edi
lea    -0x28(%rbp),%rsi
call   1070 <tcgetattr@plt>
cmp    $0xffffffff,%eax
jne    1204 <open_tty+0x74>
lea    0xe1c(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x9a,%edi
call   10b0 <exit@plt>
mov    -0x2c(%rbp),%edi
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
call   1040 <tcflush@plt>
cmp    $0xffffffff,%eax
jne    1234 <open_tty+0xa4>
lea    0xe02(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xa5,%edi
call   10b0 <exit@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2d27(%rip),%rax
mov    (%rax),%eax
mov    0x2d36(%rip),%rcx
or     (%rcx),%eax
mov    0x2d6d(%rip),%rcx
or     (%rcx),%eax
mov    0x2d5c(%rip),%rcx
or     (%rcx),%eax
mov    0x2d63(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2d0b(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x2d1e(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    0x2d25(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdi
call   1030 <cfsetospeed@plt>
cmp    $0xffffffff,%eax
jne    12dd <open_tty+0x14d>
lea    0xd6d(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xb1,%edi
call   10b0 <exit@plt>
mov    -0x2c(%rbp),%edi
mov    0x2cf9(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1080 <tcsetattr@plt>
cmp    $0xffffffff,%eax
jne    1311 <open_tty+0x181>
lea    0xd45(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xb6,%edi
call   10b0 <exit@plt>
mov    -0x2c(%rbp),%edi
lea    -0x28(%rbp),%rsi
call   1070 <tcgetattr@plt>
cmp    $0xffffffff,%eax
jne    133c <open_tty+0x1ac>
lea    0xce4(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xbc,%edi
call   10b0 <exit@plt>
mov    -0x28(%rbp),%rax
mov    0x2c41(%rip),%rcx
cmp    (%rcx),%rax
jne    13e6 <open_tty+0x256>
cmpq   $0x0,-0x20(%rbp)
jne    13e6 <open_tty+0x256>
mov    -0x18(%rbp),%eax
mov    0x2c13(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2c22(%rip),%rdx
or     (%rdx),%ecx
mov    0x2c59(%rip),%rdx
or     (%rdx),%ecx
mov    0x2c48(%rip),%rdx
or     (%rdx),%ecx
mov    0x2c4f(%rip),%rdx
or     (%rdx),%ecx
cmp    %ecx,%eax
jne    13e6 <open_tty+0x256>
cmpq   $0x0,-0x10(%rbp)
jne    13e6 <open_tty+0x256>
mov    -0x8(%rbp),%rax
mov    0x2bef(%rip),%rcx
mov    (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    13e6 <open_tty+0x256>
mov    -0x8(%rbp),%rax
mov    0x2bff(%rip),%rcx
mov    (%rcx),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    13e6 <open_tty+0x256>
lea    -0x28(%rbp),%rdi
call   1060 <cfgetospeed@plt>
mov    0x2bfa(%rip),%rcx
cmp    (%rcx),%eax
je     1405 <open_tty+0x275>
mov    0x2bb3(%rip),%rax
mov    (%rax),%esi
lea    0xc67(%rip),%rdi
call   1050 <fputs@plt>
mov    $0xc7,%edi
call   10b0 <exit@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_tty>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2e43(%rip),%rax
mov    0x2dfc(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe79(%rip),%rdi
call   1090 <open@plt>
cmp    $0xffffffff,%eax
je     134c <open_tty+0x1bc>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
call   1070 <tcgetattr@plt>
cmp    $0xffffffff,%eax
je     1362 <open_tty+0x1d2>
mov    0x2dcf(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <tcflush@plt>
cmp    $0xffffffff,%eax
je     1378 <open_tty+0x1e8>
mov    0x2d8e(%rip),%r13
mov    0x0(%r13),%rax
mov    %rax,(%rsp)
mov    0x2d6f(%rip),%rcx
mov    0x2d80(%rip),%rbp
mov    0x0(%rbp),%eax
or     (%rcx),%eax
movq   $0x0,0x8(%rsp)
mov    0x2dab(%rip),%r15
or     (%r15),%eax
mov    0x2d99(%rip),%r12
or     (%r12),%eax
mov    0x2d9e(%rip),%r14
or     (%r14),%eax
mov    %eax,0x10(%rsp)
movq   $0x0,0x18(%rsp)
mov    0x20(%rsp),%rax
mov    0x2d42(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d59(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    (%r14),%esi
mov    %rsp,%rdi
call   1030 <cfsetospeed@plt>
cmp    $0xffffffff,%eax
je     138e <open_tty+0x1fe>
mov    0x2d54(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    %ebx,%edi
call   1080 <tcsetattr@plt>
cmp    $0xffffffff,%eax
je     13a4 <open_tty+0x214>
mov    %rsp,%rsi
mov    %ebx,%edi
call   1070 <tcgetattr@plt>
cmp    $0xffffffff,%eax
je     13ba <open_tty+0x22a>
mov    (%rsp),%rax
cmp    0x0(%r13),%rax
jne    132d <open_tty+0x19d>
cmpq   $0x0,0x8(%rsp)
jne    132d <open_tty+0x19d>
mov    0x0(%rbp),%eax
mov    0x2ca8(%rip),%rcx
or     (%rcx),%eax
or     (%r15),%eax
or     (%r12),%eax
or     (%r14),%eax
cmp    %eax,0x10(%rsp)
jne    132d <open_tty+0x19d>
cmpq   $0x0,0x18(%rsp)
jne    132d <open_tty+0x19d>
mov    0x20(%rsp),%rax
mov    0x2ca2(%rip),%rcx
mov    (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    132d <open_tty+0x19d>
mov    0x2cba(%rip),%rcx
mov    (%rcx),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    132d <open_tty+0x19d>
mov    %rsp,%rdi
call   1060 <cfgetospeed@plt>
cmp    (%r14),%eax
jne    132d <open_tty+0x19d>
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c6c(%rip),%rax
mov    (%rax),%esi
lea    0xd20(%rip),%rdi
call   1050 <fputs@plt>
mov    $0xc7,%edi
call   10b0 <exit@plt>
lea    0xcad(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x95,%edi
call   10b0 <exit@plt>
lea    0xca8(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x9a,%edi
call   10b0 <exit@plt>
lea    0xca8(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xa5,%edi
call   10b0 <exit@plt>
lea    0xca6(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xb1,%edi
call   10b0 <exit@plt>
lea    0xc9c(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xb6,%edi
call   10b0 <exit@plt>
lea    0xc50(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xbc,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.termios = type { i64, i64, i32, i64, i32* }
@.str = [11 x i8] c"/dev/ttyS0\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str.1 = [17 x i8] c"open: /dev/ttyS0\00"
@.str.2 = [22 x i8] c"tcgetattr: /dev/ttyS0\00"
@TCIFLUSH = global i32 0
@.str.3 = [20 x i8] c"tcflush: /dev/ttyS0\00"
@IGNPAR = global i64 0
@CLOCAL = global i32 0
@HUPCL = global i32 0
@CREAD = global i32 0
@CS8 = global i32 0
@B9600 = global i32 0
@VTIME = global i64 0
@VMIN = global i64 0
@.str.4 = [12 x i8] c"cfsetospeed\00"
@TCSANOW = global i32 0
@.str.5 = [22 x i8] c"tcsetattr: /dev/ttyS0\00"
@.str.6 = [35 x i8] c"tcsetattr: /dev/ttyS0: Incomplete\0A\00"
@stderr = global i32 0
define i32 @open_tty() {
%1 = alloca %struct.termios
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_NOCTTY
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 149)
unreachable
12: ; preds = %0
%13 = load i32, i32* %2
%14 = call i32 @tcgetattr(i32 %13, %struct.termios* %1)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @exit(i32 154)
unreachable
19: ; preds = %12
%20 = load i32, i32* %2
%21 = load i32, i32* @TCIFLUSH
%22 = call i32 @tcflush(i32 %20, i32 %21)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @exit(i32 165)
unreachable
27: ; preds = %19
%28 = load i64, i64* @IGNPAR
%29 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 0
store i64 %28, i64* %29
%30 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 1
store i64 0, i64* %30
%31 = load i32, i32* @CLOCAL
%32 = load i32, i32* @HUPCL
%33 = or i32 %31, %32
%34 = load i32, i32* @CREAD
%35 = or i32 %33, %34
%36 = load i32, i32* @CS8
%37 = or i32 %35, %36
%38 = load i32, i32* @B9600
%39 = or i32 %37, %38
%40 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 2
store i32 %39, i32* %40
%41 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 3
store i64 0, i64* %41
%42 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 4
%43 = load i32*, i32** %42
%44 = load i64, i64* @VTIME
%45 = getelementptr inbounds i32, i32* %43, i64 %44
store i32 0, i32* %45
%46 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 4
%47 = load i32*, i32** %46
%48 = load i64, i64* @VMIN
%49 = getelementptr inbounds i32, i32* %47, i64 %48
store i32 1, i32* %49
%50 = load i32, i32* @B9600
%51 = call i32 @cfsetospeed(%struct.termios* %1, i32 %50)
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %56
53: ; preds = %27
%54 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%55 = call i32 @exit(i32 177)
unreachable
56: ; preds = %27
%57 = load i32, i32* %2
%58 = load i32, i32* @TCSANOW
%59 = call i32 @tcsetattr(i32 %57, i32 %58, %struct.termios* %1)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %56
%62 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%63 = call i32 @exit(i32 182)
unreachable
64: ; preds = %56
%65 = load i32, i32* %2
%66 = call i32 @tcgetattr(i32 %65, %struct.termios* %1)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %71
68: ; preds = %64
%69 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%70 = call i32 @exit(i32 188)
unreachable
71: ; preds = %64
%72 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 0
%73 = load i64, i64* %72
%74 = load i64, i64* @IGNPAR
%75 = icmp ne i64 %73, %74
br i1 %75, label %115, label %76
76: ; preds = %71
%77 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 1
%78 = load i64, i64* %77
%79 = icmp ne i64 %78, 0
br i1 %79, label %115, label %80
80: ; preds = %76
%81 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 2
%82 = load i32, i32* %81
%83 = load i32, i32* @CLOCAL
%84 = load i32, i32* @HUPCL
%85 = or i32 %83, %84
%86 = load i32, i32* @CREAD
%87 = or i32 %85, %86
%88 = load i32, i32* @CS8
%89 = or i32 %87, %88
%90 = load i32, i32* @B9600
%91 = or i32 %89, %90
%92 = icmp ne i32 %82, %91
br i1 %92, label %115, label %93
93: ; preds = %80
%94 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 3
%95 = load i64, i64* %94
%96 = icmp ne i64 %95, 0
br i1 %96, label %115, label %97
97: ; preds = %93
%98 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 4
%99 = load i32*, i32** %98
%100 = load i64, i64* @VTIME
%101 = getelementptr inbounds i32, i32* %99, i64 %100
%102 = load i32, i32* %101
%103 = icmp ne i32 %102, 0
br i1 %103, label %115, label %104
104: ; preds = %97
%105 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 4
%106 = load i32*, i32** %105
%107 = load i64, i64* @VMIN
%108 = getelementptr inbounds i32, i32* %106, i64 %107
%109 = load i32, i32* %108
%110 = icmp ne i32 %109, 1
br i1 %110, label %115, label %111
111: ; preds = %104
%112 = call i32 @cfgetospeed(%struct.termios* %1)
%113 = load i32, i32* @B9600
%114 = icmp ne i32 %112, %113
br i1 %114, label %115, label %119
115: ; preds = %111, %104, %97, %93, %80, %76, %71
%116 = load i32, i32* @stderr
%117 = call i32 @fputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %116)
%118 = call i32 @exit(i32 199)
unreachable
119: ; preds = %111
%120 = load i32, i32* %2
ret i32 %120
}

LLVM IR (-O2):
%struct.termios = type { i64, i64, i32, i64, i32* }
@.str = [11 x i8] c"/dev/ttyS0\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str.1 = [17 x i8] c"open: /dev/ttyS0\00"
@.str.2 = [22 x i8] c"tcgetattr: /dev/ttyS0\00"
@TCIFLUSH = global i32 0
@.str.3 = [20 x i8] c"tcflush: /dev/ttyS0\00"
@IGNPAR = global i64 0
@CLOCAL = global i32 0
@HUPCL = global i32 0
@CREAD = global i32 0
@CS8 = global i32 0
@B9600 = global i32 0
@VTIME = global i64 0
@VMIN = global i64 0
@.str.4 = [12 x i8] c"cfsetospeed\00"
@TCSANOW = global i32 0
@.str.5 = [22 x i8] c"tcsetattr: /dev/ttyS0\00"
@.str.6 = [35 x i8] c"tcsetattr: /dev/ttyS0: Incomplete\0A\00"
@stderr = global i32 0
define i32 @open_tty() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_NOCTTY
%5 = or i32 %4, %3
%6 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @exit(i32 149)
unreachable
11: ; preds = %0
%12 = call i32 @tcgetattr(i32 %6, %struct.termios* %1)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @exit(i32 154)
unreachable
17: ; preds = %11
%18 = load i32, i32* @TCIFLUSH
%19 = call i32 @tcflush(i32 %6, i32 %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @exit(i32 165)
unreachable
24: ; preds = %17
%25 = load i64, i64* @IGNPAR
%26 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
store i64 %25, i64* %26
%27 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 1
store i64 0, i64* %27
%28 = load i32, i32* @CLOCAL
%29 = load i32, i32* @HUPCL
%30 = or i32 %29, %28
%31 = load i32, i32* @CREAD
%32 = or i32 %30, %31
%33 = load i32, i32* @CS8
%34 = or i32 %32, %33
%35 = load i32, i32* @B9600
%36 = or i32 %34, %35
%37 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 2
store i32 %36, i32* %37
%38 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 3
store i64 0, i64* %38
%39 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 4
%40 = load i32*, i32** %39
%41 = load i64, i64* @VTIME
%42 = getelementptr inbounds i32, i32* %40, i64 %41
store i32 0, i32* %42
%43 = load i64, i64* @VMIN
%44 = getelementptr inbounds i32, i32* %40, i64 %43
store i32 1, i32* %44
%45 = load i32, i32* @B9600
%46 = call i32 @cfsetospeed(%struct.termios* %1, i32 %45)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %51
48: ; preds = %24
%49 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 @exit(i32 177)
unreachable
51: ; preds = %24
%52 = load i32, i32* @TCSANOW
%53 = call i32 @tcsetattr(i32 %6, i32 %52, %struct.termios* %1)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%57 = call i32 @exit(i32 182)
unreachable
58: ; preds = %51
%59 = call i32 @tcgetattr(i32 %6, %struct.termios* %1)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%63 = call i32 @exit(i32 188)
unreachable
64: ; preds = %58
%65 = load i64, i64* %26
%66 = load i64, i64* @IGNPAR
%67 = icmp ne i64 %65, %66
%68 = load i64, i64* %27
%69 = icmp ne i64 %68, 0
%70 = select i1 %67, i1 true, i1 %69
br i1 %70, label %101, label %71
71: ; preds = %64
%72 = load i32, i32* %37
%73 = load i32, i32* @CLOCAL
%74 = load i32, i32* @HUPCL
%75 = or i32 %74, %73
%76 = load i32, i32* @CREAD
%77 = or i32 %75, %76
%78 = load i32, i32* @CS8
%79 = or i32 %77, %78
%80 = load i32, i32* @B9600
%81 = or i32 %79, %80
%82 = icmp ne i32 %72, %81
%83 = load i64, i64* %38
%84 = icmp ne i64 %83, 0
%85 = select i1 %82, i1 true, i1 %84
br i1 %85, label %101, label %86
86: ; preds = %71
%87 = load i32*, i32** %39
%88 = load i64, i64* @VTIME
%89 = getelementptr inbounds i32, i32* %87, i64 %88
%90 = load i32, i32* %89
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %101
92: ; preds = %86
%93 = load i64, i64* @VMIN
%94 = getelementptr inbounds i32, i32* %87, i64 %93
%95 = load i32, i32* %94
%96 = icmp eq i32 %95, 1
br i1 %96, label %97, label %101
97: ; preds = %92
%98 = call i32 @cfgetospeed(%struct.termios* %1)
%99 = load i32, i32* @B9600
%100 = icmp eq i32 %98, %99
br i1 %100, label %105, label %101
101: ; preds = %97, %92, %86, %71, %64
%102 = load i32, i32* @stderr
%103 = call i32 @fputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %102)
%104 = call i32 @exit(i32 199)
unreachable
105: ; preds = %97
ret i32 %6
}