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

/* Variables and functions */
int BRKINT;
int CS7;
int CS8;
int CSIZE;
int CSTOPB;
int ECHO;
int ECHONL;
int ICANON;
int ICRNL;
int IEXTEN;
int IGNBRK;
int INLCR;
int INPCK;
int ISIG;
int ISTRIP;
int IXON;
int /*<<< orphan*/ O_RDWR;
int PARENB;
int PARMRK;
int PARODD;
int /*<<< orphan*/ TCSAFLUSH;
size_t VMIN;
size_t VTIME;
scalar_t__ cfsetispeed(struct termios *, int);
scalar_t__ cfsetospeed(struct termios *, int);
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ isatty(int);
int open(char const *, int /*<<< orphan*/);
scalar_t__ tcgetattr(int, struct termios *);
scalar_t__ tcsetattr(int, int /*<<< orphan*/, struct termios *);
int setup_optical_eye(char const *optical_eye_device, int optical_eye_baudrate,
                      int is_7e1) {
  int optical_eye_fd = open(optical_eye_device, O_RDWR);
  struct termios config;
  if (optical_eye_fd < 0)
    fail("Could not open the optical eye device");
  if (!isatty(optical_eye_fd))
    fail("Optical eye device is not a TTY");
  if (tcgetattr(optical_eye_fd, &config) < 0)
    fail("Error getting current configuration of optical eye device");
  config.c_iflag &=
      ~(IGNBRK | BRKINT | ICRNL | INLCR | PARMRK | INPCK | ISTRIP | IXON);
  config.c_oflag &= 0;
  config.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG);
  if (is_7e1) {
    config.c_cflag &= ~(CSIZE | PARODD);
    config.c_cflag |= CS7 | PARENB;
  } else {
    config.c_cflag &= ~(CSIZE | PARENB);
    config.c_cflag |= CS8 | CSTOPB;
  }
  config.c_cc[VMIN] = 1;
  config.c_cc[VTIME] = 0;
  if (cfsetispeed(&config, optical_eye_baudrate) < 0 ||
      cfsetospeed(&config, optical_eye_baudrate) < 0) {
    fail("Could not set the desired baud rate");
  }
  if (tcsetattr(optical_eye_fd, TCSAFLUSH, &config) < 0) {
    fail("Could not apply configuration to optical eye device");
  }
  return optical_eye_fd;
}


x86 assembly (clang, -O0):
<setup_optical_eye>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    11ad <setup_optical_eye+0x3d>
lea    0xe58(%rip),%rdi
call   1040 <fail@plt>
mov    -0x14(%rbp),%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
jne    11ca <setup_optical_eye+0x5a>
lea    0xe61(%rip),%rdi
call   1040 <fail@plt>
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
call   1060 <tcgetattr@plt>
cmp    $0x0,%rax
jge    11ec <setup_optical_eye+0x7c>
lea    0xe5f(%rip),%rdi
call   1040 <fail@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%eax
mov    0x2d9c(%rip),%rcx
or     (%rcx),%eax
mov    0x2dd3(%rip),%rcx
or     (%rcx),%eax
mov    0x2dc2(%rip),%rcx
or     (%rcx),%eax
mov    0x2dd9(%rip),%rcx
or     (%rcx),%eax
mov    0x2d48(%rip),%rcx
or     (%rcx),%eax
mov    0x2d37(%rip),%rcx
or     (%rcx),%eax
mov    0x2d8e(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
and    $0x0,%eax
mov    %eax,-0x20(%rbp)
mov    0x2d63(%rip),%rax
mov    (%rax),%eax
mov    0x2d02(%rip),%rcx
or     (%rcx),%eax
mov    0x2ce1(%rip),%rcx
or     (%rcx),%eax
mov    0x2d10(%rip),%rcx
or     (%rcx),%eax
mov    0x2d2f(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     12be <setup_optical_eye+0x14e>
mov    0x2cf3(%rip),%rax
mov    (%rax),%eax
mov    0x2d12(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2c80(%rip),%rax
mov    (%rax),%eax
mov    0x2d07(%rip),%rcx
or     (%rcx),%eax
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    12f1 <setup_optical_eye+0x181>
mov    0x2cbb(%rip),%rax
mov    (%rax),%eax
mov    0x2cea(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2cb0(%rip),%rax
mov    (%rax),%eax
mov    0x2c47(%rip),%rcx
or     (%rcx),%eax
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2c8c(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
mov    0x2c37(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%esi
lea    -0x38(%rbp),%rdi
call   1090 <cfsetispeed@plt>
cmp    $0x0,%rax
jl     1347 <setup_optical_eye+0x1d7>
mov    -0xc(%rbp),%esi
lea    -0x38(%rbp),%rdi
call   1050 <cfsetospeed@plt>
cmp    $0x0,%rax
jge    1353 <setup_optical_eye+0x1e3>
lea    0xd32(%rip),%rdi
call   1040 <fail@plt>
mov    -0x14(%rbp),%edi
mov    0x2c6b(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
call   1070 <tcsetattr@plt>
cmp    $0x0,%rax
jge    137e <setup_optical_eye+0x20e>
lea    0xd2b(%rip),%rdi
call   1040 <fail@plt>
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_optical_eye>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebp
mov    %esi,%r14d
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    119d <setup_optical_eye+0x2d>
lea    0xe68(%rip),%rdi
call   1040 <fail@plt>
mov    %ebx,%edi
call   1030 <isatty@plt>
test   %eax,%eax
jne    11b4 <setup_optical_eye+0x44>
lea    0xe77(%rip),%rdi
call   1040 <fail@plt>
mov    %rsp,%rsi
mov    %ebx,%edi
call   1060 <tcgetattr@plt>
test   %rax,%rax
jns    11cf <setup_optical_eye+0x5f>
lea    0xe7c(%rip),%rdi
call   1040 <fail@plt>
mov    0x2d7a(%rip),%rax
mov    0x2dbb(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2df0(%rip),%rax
or     (%rax),%ecx
mov    0x2ddf(%rip),%rax
or     (%rax),%ecx
mov    0x2df6(%rip),%rax
or     (%rax),%ecx
mov    0x2d65(%rip),%rax
or     (%rax),%ecx
mov    0x2d54(%rip),%rax
or     (%rax),%ecx
mov    0x2dab(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,(%rsp)
mov    0x2d8d(%rip),%rax
mov    0x2d2e(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2d0b(%rip),%rax
or     (%rax),%ecx
mov    0x2d3a(%rip),%rax
or     (%rax),%ecx
movl   $0x0,0x18(%rsp)
mov    0x2d51(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,0x4(%rsp)
test   %ebp,%ebp
mov    0x2d58(%rip),%rax
mov    (%rax),%eax
mov    0x2d3f(%rip),%rcx
mov    (%rcx),%ecx
cmove  %eax,%ecx
mov    0x2cb3(%rip),%rdx
cmove  0x2d13(%rip),%rdx
mov    0x2cac(%rip),%rsi
cmove  (%rsi),%eax
mov    0x2cf2(%rip),%rsi
or     (%rsi),%ecx
not    %ecx
and    0x8(%rsp),%ecx
or     (%rdx),%ecx
or     %eax,%ecx
mov    %ecx,0x8(%rsp)
mov    0x10(%rsp),%rax
mov    0x2cde(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    0x2c8d(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    %rsp,%rdi
mov    %r14d,%esi
call   1090 <cfsetispeed@plt>
test   %rax,%rax
js     12e5 <setup_optical_eye+0x175>
mov    %rsp,%rdi
mov    %r14d,%esi
call   1050 <cfsetospeed@plt>
test   %rax,%rax
jns    12f1 <setup_optical_eye+0x181>
lea    0xd94(%rip),%rdi
call   1040 <fail@plt>
mov    0x2cd0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    %ebx,%edi
call   1070 <tcsetattr@plt>
test   %rax,%rax
jns    1315 <setup_optical_eye+0x1a5>
lea    0xd94(%rip),%rdi
call   1040 <fail@plt>
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32, i32, i32*, i32 }
@O_RDWR = global i32 0
@.str = [38 x i8] c"Could not open the optical eye device\00"
@.str.1 = [32 x i8] c"Optical eye device is not a TTY\00"
@.str.2 = [58 x i8] c"Error getting current configuration of optical eye device\00"
@IGNBRK = global i32 0
@BRKINT = global i32 0
@ICRNL = global i32 0
@INLCR = global i32 0
@PARMRK = global i32 0
@INPCK = global i32 0
@ISTRIP = global i32 0
@IXON = global i32 0
@ECHO = global i32 0
@ECHONL = global i32 0
@ICANON = global i32 0
@IEXTEN = global i32 0
@ISIG = global i32 0
@CSIZE = global i32 0
@PARODD = global i32 0
@CS7 = global i32 0
@PARENB = global i32 0
@CS8 = global i32 0
@CSTOPB = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
@.str.3 = [36 x i8] c"Could not set the desired baud rate\00"
@TCSAFLUSH = global i32 0
@.str.4 = [52 x i8] c"Could not apply configuration to optical eye device\00"
define i32 @setup_optical_eye(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.termios
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* @O_RDWR
%11 = call i32 @open(i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
%18 = call i32 @isatty(i32 %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = call i32 @fail(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %7
%24 = call i64 @tcgetattr(i32 %23, %struct.termios* %8)
%25 = icmp slt i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @fail(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* @IGNBRK
%30 = load i32, i32* @BRKINT
%31 = or i32 %29, %30
%32 = load i32, i32* @ICRNL
%33 = or i32 %31, %32
%34 = load i32, i32* @INLCR
%35 = or i32 %33, %34
%36 = load i32, i32* @PARMRK
%37 = or i32 %35, %36
%38 = load i32, i32* @INPCK
%39 = or i32 %37, %38
%40 = load i32, i32* @ISTRIP
%41 = or i32 %39, %40
%42 = load i32, i32* @IXON
%43 = or i32 %41, %42
%44 = xor i32 %43, -1
%45 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 0
%46 = load i32, i32* %45
%47 = and i32 %46, %44
store i32 %47, i32* %45
%48 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 4
%49 = load i32, i32* %48
%50 = and i32 %49, 0
store i32 %50, i32* %48
%51 = load i32, i32* @ECHO
%52 = load i32, i32* @ECHONL
%53 = or i32 %51, %52
%54 = load i32, i32* @ICANON
%55 = or i32 %53, %54
%56 = load i32, i32* @IEXTEN
%57 = or i32 %55, %56
%58 = load i32, i32* @ISIG
%59 = or i32 %57, %58
%60 = xor i32 %59, -1
%61 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 1
%62 = load i32, i32* %61
%63 = and i32 %62, %60
store i32 %63, i32* %61
%64 = load i32, i32* %6
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %80
66: ; preds = %28
%67 = load i32, i32* @CSIZE
%68 = load i32, i32* @PARODD
%69 = or i32 %67, %68
%70 = xor i32 %69, -1
%71 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%72 = load i32, i32* %71
%73 = and i32 %72, %70
store i32 %73, i32* %71
%74 = load i32, i32* @CS7
%75 = load i32, i32* @PARENB
%76 = or i32 %74, %75
%77 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%78 = load i32, i32* %77
%79 = or i32 %78, %76
store i32 %79, i32* %77
br label %94
80: ; preds = %28
%81 = load i32, i32* @CSIZE
%82 = load i32, i32* @PARENB
%83 = or i32 %81, %82
%84 = xor i32 %83, -1
%85 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%86 = load i32, i32* %85
%87 = and i32 %86, %84
store i32 %87, i32* %85
%88 = load i32, i32* @CS8
%89 = load i32, i32* @CSTOPB
%90 = or i32 %88, %89
%91 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%92 = load i32, i32* %91
%93 = or i32 %92, %90
store i32 %93, i32* %91
br label %94
94: ; preds = %80, %66
%95 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 3
%96 = load i32*, i32** %95
%97 = load i64, i64* @VMIN
%98 = getelementptr inbounds i32, i32* %96, i64 %97
store i32 1, i32* %98
%99 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 3
%100 = load i32*, i32** %99
%101 = load i64, i64* @VTIME
%102 = getelementptr inbounds i32, i32* %100, i64 %101
store i32 0, i32* %102
%103 = load i32, i32* %5
%104 = call i64 @cfsetispeed(%struct.termios* %8, i32 %103)
%105 = icmp slt i64 %104, 0
br i1 %105, label %110, label %106
106: ; preds = %94
%107 = load i32, i32* %5
%108 = call i64 @cfsetospeed(%struct.termios* %8, i32 %107)
%109 = icmp slt i64 %108, 0
br i1 %109, label %110, label %112
110: ; preds = %106, %94
%111 = call i32 @fail(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %112
112: ; preds = %110, %106
%113 = load i32, i32* %7
%114 = load i32, i32* @TCSAFLUSH
%115 = call i64 @tcsetattr(i32 %113, i32 %114, %struct.termios* %8)
%116 = icmp slt i64 %115, 0
br i1 %116, label %117, label %119
117: ; preds = %112
%118 = call i32 @fail(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
br label %119
119: ; preds = %117, %112
%120 = load i32, i32* %7
ret i32 %120
}

LLVM IR (-O2):
%struct.termios = type { i32, i32, i32, i32*, i32 }
@O_RDWR = global i32 0
@.str = [38 x i8] c"Could not open the optical eye device\00"
@.str.1 = [32 x i8] c"Optical eye device is not a TTY\00"
@.str.2 = [58 x i8] c"Error getting current configuration of optical eye device\00"
@IGNBRK = global i32 0
@BRKINT = global i32 0
@ICRNL = global i32 0
@INLCR = global i32 0
@PARMRK = global i32 0
@INPCK = global i32 0
@ISTRIP = global i32 0
@IXON = global i32 0
@ECHO = global i32 0
@ECHONL = global i32 0
@ICANON = global i32 0
@IEXTEN = global i32 0
@ISIG = global i32 0
@CSIZE = global i32 0
@PARODD = global i32 0
@CS7 = global i32 0
@PARENB = global i32 0
@CS8 = global i32 0
@CSTOPB = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
@.str.3 = [36 x i8] c"Could not set the desired baud rate\00"
@TCSAFLUSH = global i32 0
@.str.4 = [52 x i8] c"Could not apply configuration to optical eye device\00"
define i32 @setup_optical_eye(i8* nocapture %0, i32 %1, i32 %2) {
%4 = alloca %struct.termios
%5 = load i32, i32* @O_RDWR
%6 = tail call i32 @open(i8* %0, i32 %5)
%7 = bitcast %struct.termios* %4 to i8*
%8 = icmp slt i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
%12 = tail call i32 @isatty(i32 %6)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @fail(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
%17 = call i64 @tcgetattr(i32 %6, %struct.termios* %4)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @fail(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* @IGNBRK
%23 = load i32, i32* @BRKINT
%24 = or i32 %23, %22
%25 = load i32, i32* @ICRNL
%26 = or i32 %24, %25
%27 = load i32, i32* @INLCR
%28 = or i32 %26, %27
%29 = load i32, i32* @PARMRK
%30 = or i32 %28, %29
%31 = load i32, i32* @INPCK
%32 = or i32 %30, %31
%33 = load i32, i32* @ISTRIP
%34 = or i32 %32, %33
%35 = load i32, i32* @IXON
%36 = or i32 %34, %35
%37 = xor i32 %36, -1
%38 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 0
%39 = load i32, i32* %38
%40 = and i32 %39, %37
store i32 %40, i32* %38
%41 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 4
store i32 0, i32* %41
%42 = load i32, i32* @ECHO
%43 = load i32, i32* @ECHONL
%44 = or i32 %43, %42
%45 = load i32, i32* @ICANON
%46 = or i32 %44, %45
%47 = load i32, i32* @IEXTEN
%48 = or i32 %46, %47
%49 = load i32, i32* @ISIG
%50 = or i32 %48, %49
%51 = xor i32 %50, -1
%52 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 1
%53 = load i32, i32* %52
%54 = and i32 %53, %51
store i32 %54, i32* %52
%55 = icmp eq i32 %2, 0
%56 = load i32, i32* @CSIZE
%57 = load i32, i32* @PARENB
%58 = load i32, i32* @PARODD
%59 = select i1 %55, i32 %57, i32 %58
%60 = or i32 %59, %56
%61 = xor i32 %60, -1
%62 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 2
%63 = load i32, i32* %62
%64 = and i32 %63, %61
%65 = load i32, i32* @CS8
%66 = load i32, i32* @CS7
%67 = select i1 %55, i32 %65, i32 %66
%68 = load i32, i32* @CSTOPB
%69 = load i32, i32* @PARENB
%70 = select i1 %55, i32 %68, i32 %69
%71 = or i32 %67, %64
%72 = or i32 %71, %70
store i32 %72, i32* %62
%73 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 3
%74 = load i32*, i32** %73
%75 = load i64, i64* @VMIN
%76 = getelementptr inbounds i32, i32* %74, i64 %75
store i32 1, i32* %76
%77 = load i64, i64* @VTIME
%78 = getelementptr inbounds i32, i32* %74, i64 %77
store i32 0, i32* %78
%79 = call i64 @cfsetispeed(%struct.termios* %4, i32 %1)
%80 = icmp slt i64 %79, 0
br i1 %80, label %84, label %81
81: ; preds = %21
%82 = call i64 @cfsetospeed(%struct.termios* %4, i32 %1)
%83 = icmp slt i64 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %81, %21
%85 = call i32 @fail(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %86
86: ; preds = %84, %81
%87 = load i32, i32* @TCSAFLUSH
%88 = call i64 @tcsetattr(i32 %6, i32 %87, %struct.termios* %4)
%89 = icmp slt i64 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %86
%91 = call i32 @fail(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
br label %92
92: ; preds = %90, %86
ret i32 %6
}