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

/* Variables and functions */
int /*<<< orphan*/ B9600;
int BRKINT;
int CLOCAL;
int CS8;
int CSIZE;
int ECHO;
int ICANON;
int ICRNL;
int IEXTEN;
int INPCK;
int ISIG;
int IXON;
int /*<<< orphan*/ OPOST;
int O_NONBLOCK;
int O_RDWR;
int PARENB;
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ TCSANOW;
size_t VMIN;
size_t VTIME;
int /*<<< orphan*/ cfsetispeed(struct termios *, int /*<<< orphan*/);
int /*<<< orphan*/ cfsetospeed(struct termios *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int open(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ report(char *, int /*<<< orphan*/);
scalar_t__ tcflush(int, int /*<<< orphan*/);
scalar_t__ tcgetattr(int, struct termios *);
scalar_t__ tcsendbreak(int, int /*<<< orphan*/);
scalar_t__ tcsetattr(int, int /*<<< orphan*/, struct termios *);
int open_gizmo(const char *gizmo_tty) {
  int gizmofd;
  struct termios term;
  if ((gizmofd = open(gizmo_tty, (O_RDWR | O_NONBLOCK), 0)) < 0) {
    report("open(GIZMO_TTY): %s", errno);
    close(gizmofd);
    return -1;
  }
  if (tcgetattr(gizmofd, &term) < 0) {
    report("tcgetattr(GIZMO_TTY): %s", errno);
    close(gizmofd);
    return -1;
  }
  cfsetispeed(&term, B9600);
  cfsetospeed(&term, B9600);
  term.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
  term.c_iflag &= ~(BRKINT | ICRNL | INPCK | IXON);
  term.c_oflag &= ~(OPOST);
  term.c_cflag &= ~(CSIZE | PARENB);
  term.c_cflag |= (CS8 | CLOCAL);
  term.c_cc[VMIN] = 1;
  term.c_cc[VTIME] = 0;
  if (tcsetattr(gizmofd, TCSANOW, &term) < 0) {
    report("tcsetattr(GIZMO_TTY): %s", errno);
    close(gizmofd);
    return -1;
  }
  if (tcflush(gizmofd, TCIOFLUSH) < 0) {
    report("tcflush(GIZMO_TTY): %s", errno);
    close(gizmofd);
    return -1;
  }
  if (tcsendbreak(gizmofd, 0) < 0) {
    report("tcsendbreak(GIZMO_TTY): %s", errno);
    close(gizmofd);
    return -1;
  }
  return gizmofd;
}


x86 assembly (clang, -O0):
<open_gizmo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
mov    0x2e28(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    11ee <open_gizmo+0x5e>
mov    0x2d94(%rip),%rax
mov    (%rax),%esi
lea    0xe2b(%rip),%rdi
call   10b0 <report@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e9 <open_gizmo+0x259>
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
call   1070 <tcgetattr@plt>
cmp    $0x0,%rax
jge    122d <open_gizmo+0x9d>
mov    0x2d55(%rip),%rax
mov    (%rax),%esi
lea    0xe00(%rip),%rdi
call   10b0 <report@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e9 <open_gizmo+0x259>
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdi
call   10a0 <cfsetispeed@plt>
mov    0x2d5a(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdi
call   1030 <cfsetospeed@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%eax
mov    0x2ce7(%rip),%rcx
or     (%rcx),%eax
mov    0x2d0e(%rip),%rcx
or     (%rcx),%eax
mov    0x2d35(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    0x2d13(%rip),%rax
mov    (%rax),%eax
mov    0x2d52(%rip),%rcx
or     (%rcx),%eax
mov    0x2cd1(%rip),%rcx
or     (%rcx),%eax
mov    0x2d28(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    0x2d1e(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    0x2cbc(%rip),%rax
mov    (%rax),%eax
mov    0x2cf3(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2cb1(%rip),%rax
mov    (%rax),%eax
mov    0x2c50(%rip),%rcx
or     (%rcx),%eax
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2c8d(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
mov    0x2c40(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%edi
mov    0x2c94(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
call   1080 <tcsetattr@plt>
cmp    $0x0,%rax
jge    1362 <open_gizmo+0x1d2>
mov    0x2c20(%rip),%rax
mov    (%rax),%esi
lea    0xce4(%rip),%rdi
call   10b0 <report@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e9 <open_gizmo+0x259>
mov    -0x14(%rbp),%edi
mov    0x2bec(%rip),%rax
mov    (%rax),%esi
call   1040 <tcflush@plt>
cmp    $0x0,%rax
jge    13a6 <open_gizmo+0x216>
mov    0x2bdc(%rip),%rax
mov    (%rax),%esi
lea    0xcb9(%rip),%rdi
call   10b0 <report@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e9 <open_gizmo+0x259>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <tcsendbreak@plt>
cmp    $0x0,%rax
jge    13e3 <open_gizmo+0x253>
mov    0x2b9f(%rip),%rax
mov    (%rax),%esi
lea    0xc93(%rip),%rdi
call   10b0 <report@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e9 <open_gizmo+0x259>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_gizmo>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    0x2e48(%rip),%rax
mov    0x2e31(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
xor    %edx,%edx
call   1090 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     12f3 <open_gizmo+0x163>
mov    %rsp,%rsi
mov    %ebx,%edi
call   1070 <tcgetattr@plt>
test   %rax,%rax
js     1305 <open_gizmo+0x175>
mov    0x2dca(%rip),%r15
mov    (%r15),%esi
mov    %rsp,%r14
mov    %r14,%rdi
call   10a0 <cfsetispeed@plt>
mov    (%r15),%esi
mov    %r14,%rdi
call   1030 <cfsetospeed@plt>
mov    0x2dba(%rip),%rax
mov    0x2d4b(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2d70(%rip),%rax
or     (%rax),%ecx
mov    0x2d97(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,(%rsp)
mov    0x2d79(%rip),%rax
mov    0x2dba(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2d37(%rip),%rax
or     (%rax),%ecx
mov    0x2d8e(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,0x4(%rsp)
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %eax,0x18(%rsp)
mov    0x2d28(%rip),%rax
mov    0x2d61(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
not    %ecx
and    0x8(%rsp),%ecx
mov    0x2d20(%rip),%rax
mov    0x2cc1(%rip),%rdx
or     (%rax),%ecx
or     (%rdx),%ecx
mov    %ecx,0x8(%rsp)
mov    0x10(%rsp),%rax
mov    0x2cfd(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    0x2cb4(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d0b(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1080 <tcsetattr@plt>
test   %rax,%rax
js     1317 <open_gizmo+0x187>
mov    0x2c93(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <tcflush@plt>
test   %rax,%rax
js     1329 <open_gizmo+0x199>
mov    %ebx,%edi
xor    %esi,%esi
call   1060 <tcsendbreak@plt>
test   %rax,%rax
jns    134a <open_gizmo+0x1ba>
mov    0x2c78(%rip),%rax
mov    (%rax),%esi
lea    0xd6c(%rip),%rdi
jmp    1339 <open_gizmo+0x1a9>
mov    0x2c66(%rip),%rax
mov    (%rax),%esi
lea    0xcfd(%rip),%rdi
jmp    1339 <open_gizmo+0x1a9>
mov    0x2c54(%rip),%rax
mov    (%rax),%esi
lea    0xcff(%rip),%rdi
jmp    1339 <open_gizmo+0x1a9>
mov    0x2c42(%rip),%rax
mov    (%rax),%esi
lea    0xd06(%rip),%rdi
jmp    1339 <open_gizmo+0x1a9>
mov    0x2c30(%rip),%rax
mov    (%rax),%esi
lea    0xd0d(%rip),%rdi
call   10b0 <report@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32, i32, i32*, i32 }
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@.str = [20 x i8] c"open(GIZMO_TTY): %s\00"
@errno = global i32 0
@.str.1 = [25 x i8] c"tcgetattr(GIZMO_TTY): %s\00"
@B9600 = global i32 0
@ECHO = global i32 0
@ICANON = global i32 0
@IEXTEN = global i32 0
@ISIG = global i32 0
@BRKINT = global i32 0
@ICRNL = global i32 0
@INPCK = global i32 0
@IXON = global i32 0
@OPOST = global i32 0
@CSIZE = global i32 0
@PARENB = global i32 0
@CS8 = global i32 0
@CLOCAL = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
@TCSANOW = global i32 0
@.str.2 = [25 x i8] c"tcsetattr(GIZMO_TTY): %s\00"
@TCIOFLUSH = global i32 0
@.str.3 = [23 x i8] c"tcflush(GIZMO_TTY): %s\00"
@.str.4 = [27 x i8] c"tcsendbreak(GIZMO_TTY): %s\00"
define i32 @open_gizmo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.termios
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_RDWR
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %6, i32 %9, i32 0)
store i32 %10, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32, i32* @errno
%14 = call i32 @report(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %4
%16 = call i32 @close(i32 %15)
store i32 -1, i32* %2
br label %109
17: ; preds = %1
%18 = load i32, i32* %4
%19 = call i64 @tcgetattr(i32 %18, %struct.termios* %5)
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i32, i32* @errno
%23 = call i32 @report(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %4
%25 = call i32 @close(i32 %24)
store i32 -1, i32* %2
br label %109
26: ; preds = %17
%27 = load i32, i32* @B9600
%28 = call i32 @cfsetispeed(%struct.termios* %5, i32 %27)
%29 = load i32, i32* @B9600
%30 = call i32 @cfsetospeed(%struct.termios* %5, i32 %29)
%31 = load i32, i32* @ECHO
%32 = load i32, i32* @ICANON
%33 = or i32 %31, %32
%34 = load i32, i32* @IEXTEN
%35 = or i32 %33, %34
%36 = load i32, i32* @ISIG
%37 = or i32 %35, %36
%38 = xor i32 %37, -1
%39 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%40 = load i32, i32* %39
%41 = and i32 %40, %38
store i32 %41, i32* %39
%42 = load i32, i32* @BRKINT
%43 = load i32, i32* @ICRNL
%44 = or i32 %42, %43
%45 = load i32, i32* @INPCK
%46 = or i32 %44, %45
%47 = load i32, i32* @IXON
%48 = or i32 %46, %47
%49 = xor i32 %48, -1
%50 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 1
%51 = load i32, i32* %50
%52 = and i32 %51, %49
store i32 %52, i32* %50
%53 = load i32, i32* @OPOST
%54 = xor i32 %53, -1
%55 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 4
%56 = load i32, i32* %55
%57 = and i32 %56, %54
store i32 %57, i32* %55
%58 = load i32, i32* @CSIZE
%59 = load i32, i32* @PARENB
%60 = or i32 %58, %59
%61 = xor i32 %60, -1
%62 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 2
%63 = load i32, i32* %62
%64 = and i32 %63, %61
store i32 %64, i32* %62
%65 = load i32, i32* @CS8
%66 = load i32, i32* @CLOCAL
%67 = or i32 %65, %66
%68 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 2
%69 = load i32, i32* %68
%70 = or i32 %69, %67
store i32 %70, i32* %68
%71 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 3
%72 = load i32*, i32** %71
%73 = load i64, i64* @VMIN
%74 = getelementptr inbounds i32, i32* %72, i64 %73
store i32 1, i32* %74
%75 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 3
%76 = load i32*, i32** %75
%77 = load i64, i64* @VTIME
%78 = getelementptr inbounds i32, i32* %76, i64 %77
store i32 0, i32* %78
%79 = load i32, i32* %4
%80 = load i32, i32* @TCSANOW
%81 = call i64 @tcsetattr(i32 %79, i32 %80, %struct.termios* %5)
%82 = icmp slt i64 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %26
%84 = load i32, i32* @errno
%85 = call i32 @report(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %84)
%86 = load i32, i32* %4
%87 = call i32 @close(i32 %86)
store i32 -1, i32* %2
br label %109
88: ; preds = %26
%89 = load i32, i32* %4
%90 = load i32, i32* @TCIOFLUSH
%91 = call i64 @tcflush(i32 %89, i32 %90)
%92 = icmp slt i64 %91, 0
br i1 %92, label %93, label %98
93: ; preds = %88
%94 = load i32, i32* @errno
%95 = call i32 @report(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %94)
%96 = load i32, i32* %4
%97 = call i32 @close(i32 %96)
store i32 -1, i32* %2
br label %109
98: ; preds = %88
%99 = load i32, i32* %4
%100 = call i64 @tcsendbreak(i32 %99, i32 0)
%101 = icmp slt i64 %100, 0
br i1 %101, label %102, label %107
102: ; preds = %98
%103 = load i32, i32* @errno
%104 = call i32 @report(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %103)
%105 = load i32, i32* %4
%106 = call i32 @close(i32 %105)
store i32 -1, i32* %2
br label %109
107: ; preds = %98
%108 = load i32, i32* %4
store i32 %108, i32* %2
br label %109
109: ; preds = %107, %102, %93, %83, %21, %12
%110 = load i32, i32* %2
ret i32 %110
}

LLVM IR (-O2):
%struct.termios = type { i32, i32, i32, i32*, i32 }
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@.str = [20 x i8] c"open(GIZMO_TTY): %s\00"
@errno = global i32 0
@.str.1 = [25 x i8] c"tcgetattr(GIZMO_TTY): %s\00"
@B9600 = global i32 0
@ECHO = global i32 0
@ICANON = global i32 0
@IEXTEN = global i32 0
@ISIG = global i32 0
@BRKINT = global i32 0
@ICRNL = global i32 0
@INPCK = global i32 0
@IXON = global i32 0
@OPOST = global i32 0
@CSIZE = global i32 0
@PARENB = global i32 0
@CS8 = global i32 0
@CLOCAL = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
@TCSANOW = global i32 0
@.str.2 = [25 x i8] c"tcsetattr(GIZMO_TTY): %s\00"
@TCIOFLUSH = global i32 0
@.str.3 = [23 x i8] c"tcflush(GIZMO_TTY): %s\00"
@.str.4 = [27 x i8] c"tcsendbreak(GIZMO_TTY): %s\00"
define i32 @open_gizmo(i8* nocapture %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @open(i8* %0, i32 %6, i32 0)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @errno
%11 = tail call i32 @report(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = tail call i32 @close(i32 %7)
br label %91
13: ; preds = %1
%14 = call i64 @tcgetattr(i32 %7, %struct.termios* %2)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32, i32* @errno
%18 = call i32 @report(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = call i32 @close(i32 %7)
br label %91
20: ; preds = %13
%21 = load i32, i32* @B9600
%22 = call i32 @cfsetispeed(%struct.termios* %2, i32 %21)
%23 = load i32, i32* @B9600
%24 = call i32 @cfsetospeed(%struct.termios* %2, i32 %23)
%25 = load i32, i32* @ECHO
%26 = load i32, i32* @ICANON
%27 = or i32 %26, %25
%28 = load i32, i32* @IEXTEN
%29 = or i32 %27, %28
%30 = load i32, i32* @ISIG
%31 = or i32 %29, %30
%32 = xor i32 %31, -1
%33 = getelementptr inbounds %struct.termios, %struct.termios* %2, i64 0, i32 0
%34 = load i32, i32* %33
%35 = and i32 %34, %32
store i32 %35, i32* %33
%36 = load i32, i32* @BRKINT
%37 = load i32, i32* @ICRNL
%38 = or i32 %37, %36
%39 = load i32, i32* @INPCK
%40 = or i32 %38, %39
%41 = load i32, i32* @IXON
%42 = or i32 %40, %41
%43 = xor i32 %42, -1
%44 = getelementptr inbounds %struct.termios, %struct.termios* %2, i64 0, i32 1
%45 = load i32, i32* %44
%46 = and i32 %45, %43
store i32 %46, i32* %44
%47 = load i32, i32* @OPOST
%48 = xor i32 %47, -1
%49 = getelementptr inbounds %struct.termios, %struct.termios* %2, i64 0, i32 4
%50 = load i32, i32* %49
%51 = and i32 %50, %48
store i32 %51, i32* %49
%52 = load i32, i32* @CSIZE
%53 = load i32, i32* @PARENB
%54 = or i32 %53, %52
%55 = xor i32 %54, -1
%56 = getelementptr inbounds %struct.termios, %struct.termios* %2, i64 0, i32 2
%57 = load i32, i32* %56
%58 = and i32 %57, %55
%59 = load i32, i32* @CS8
%60 = load i32, i32* @CLOCAL
%61 = or i32 %59, %58
%62 = or i32 %61, %60
store i32 %62, i32* %56
%63 = getelementptr inbounds %struct.termios, %struct.termios* %2, i64 0, i32 3
%64 = load i32*, i32** %63
%65 = load i64, i64* @VMIN
%66 = getelementptr inbounds i32, i32* %64, i64 %65
store i32 1, i32* %66
%67 = load i64, i64* @VTIME
%68 = getelementptr inbounds i32, i32* %64, i64 %67
store i32 0, i32* %68
%69 = load i32, i32* @TCSANOW
%70 = call i64 @tcsetattr(i32 %7, i32 %69, %struct.termios* %2)
%71 = icmp slt i64 %70, 0
br i1 %71, label %72, label %76
72: ; preds = %20
%73 = load i32, i32* @errno
%74 = call i32 @report(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %73)
%75 = call i32 @close(i32 %7)
br label %91
76: ; preds = %20
%77 = load i32, i32* @TCIOFLUSH
%78 = call i64 @tcflush(i32 %7, i32 %77)
%79 = icmp slt i64 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %76
%81 = load i32, i32* @errno
%82 = call i32 @report(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %81)
%83 = call i32 @close(i32 %7)
br label %91
84: ; preds = %76
%85 = call i64 @tcsendbreak(i32 %7, i32 0)
%86 = icmp slt i64 %85, 0
br i1 %86, label %87, label %91
87: ; preds = %84
%88 = load i32, i32* @errno
%89 = call i32 @report(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %88)
%90 = call i32 @close(i32 %7)
br label %91
91: ; preds = %84, %87, %80, %72, %16, %9
%92 = phi i32 [ -1, %9 ], [ -1, %16 ], [ -1, %72 ], [ -1, %80 ], [ -1, %87 ], [ %7, %84 ]
ret i32 %92
}