#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*/ tio;
struct termios {
  int c_cflag;
  int *c_cc;
  scalar_t__ c_lflag;
  scalar_t__ c_oflag;
  scalar_t__ c_iflag;
};
typedef int /*<<< orphan*/ stdio;

/* Variables and functions */
int /*<<< orphan*/ B115200;
int CLOCAL;
int CREAD;
int CS8;
int EXIT_SUCCESS;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int O_RDWR;
int STDIN_FILENO;
int STDOUT_FILENO;
int /*<<< orphan*/ TCSAFLUSH;
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*/ fcntl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ memset(struct termios *, int /*<<< orphan*/, int);
int open(char *, int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ read(int, unsigned char *, int);
int /*<<< orphan*/ tcgetattr(int, struct termios *);
int /*<<< orphan*/ tcsetattr(int, int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ write(int, unsigned char *, int);
int main(int argc, char **argv) {
  struct termios tio;
  struct termios stdio;
  struct termios old_stdio;
  int tty_fd;
  unsigned char c = 'D';
  tcgetattr(STDOUT_FILENO, &old_stdio);
  printf("Please start with %s /dev/ttyS1 (for example)\n", argv[0]);
  memset(&stdio, 0, sizeof(stdio));
  stdio.c_iflag = 0;
  stdio.c_oflag = 0;
  stdio.c_cflag = 0;
  stdio.c_lflag = 0;
  stdio.c_cc[VMIN] = 1;
  stdio.c_cc[VTIME] = 0;
  tcsetattr(STDOUT_FILENO, TCSANOW, &stdio);
  tcsetattr(STDOUT_FILENO, TCSAFLUSH, &stdio);
  fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
  memset(&tio, 0, sizeof(tio));
  tio.c_iflag = 0;
  tio.c_oflag = 0;
  tio.c_cflag = CS8 | CREAD | CLOCAL;
  tio.c_lflag = 0;
  tio.c_cc[VMIN] = 1;
  tio.c_cc[VTIME] = 5;
  tty_fd = open(argv[1], O_RDWR | O_NONBLOCK);
  cfsetospeed(&tio, B115200);
  cfsetispeed(&tio, B115200);
  tcsetattr(tty_fd, TCSANOW, &tio);
  while (c != 'q') {
    if (read(tty_fd, &c, 1) > 0)
      write(STDOUT_FILENO, &c, 1);
    if (read(STDIN_FILENO, &c, 1) > 0)
      write(tty_fd, &c, 1);
  }
  close(tty_fd);
  tcsetattr(STDOUT_FILENO, TCSANOW, &old_stdio);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x44,-0x8d(%rbp)
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
lea    -0x88(%rbp),%rsi
call   10a0 <tcgetattr@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe0d(%rip),%rdi
call   1060 <printf@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x60(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x58(%rbp),%rax
mov    0x2d7e(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x58(%rbp),%rax
mov    0x2d41(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
mov    0x2d67(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   10b0 <tcsetattr@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%edi
mov    0x2d5c(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   10b0 <tcsetattr@plt>
mov    0x2cf2(%rip),%rax
mov    (%rax),%edi
mov    0x2d09(%rip),%rax
mov    (%rax),%esi
mov    0x2d30(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2cea(%rip),%rax
mov    (%rax),%eax
mov    0x2ce9(%rip),%rcx
or     (%rcx),%eax
mov    0x2c90(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x38(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    0x2cb8(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
mov    0x2c7b(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x5,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2cba(%rip),%rax
mov    (%rax),%esi
mov    0x2ca1(%rip),%rax
or     (%rax),%esi
call   10c0 <open@plt>
mov    %eax,-0x8c(%rbp)
mov    0x2c4d(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdi
call   1050 <cfsetospeed@plt>
mov    0x2c3b(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdi
call   10d0 <cfsetispeed@plt>
mov    -0x8c(%rbp),%edi
mov    0x2c5b(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
call   10b0 <tcsetattr@plt>
movzbl -0x8d(%rbp),%eax
cmp    $0x71,%eax
je     1403 <main+0x253>
mov    -0x8c(%rbp),%edi
lea    -0x8d(%rbp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jle    13c3 <main+0x213>
mov    0x2c40(%rip),%rax
mov    (%rax),%edi
lea    -0x8d(%rbp),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
lea    -0x8d(%rbp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jle    13fe <main+0x24e>
mov    -0x8c(%rbp),%edi
lea    -0x8d(%rbp),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
jmp    1378 <main+0x1c8>
mov    -0x8c(%rbp),%edi
call   1080 <close@plt>
mov    0x2bdb(%rip),%rax
mov    (%rax),%edi
mov    0x2baa(%rip),%rax
mov    (%rax),%esi
lea    -0x88(%rbp),%rdx
call   10b0 <tcsetattr@plt>
mov    0x2b65(%rip),%rax
mov    (%rax),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbx
movb   $0x44,0xf(%rsp)
mov    0x2e20(%rip),%r15
mov    (%r15),%edi
lea    0x60(%rsp),%rsi
call   10a0 <tcgetattr@plt>
mov    (%rbx),%rsi
lea    0xe29(%rip),%rdi
call   1060 <printf@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
movl   $0x0,0x10(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
mov    0x18(%rsp),%rax
mov    0x2d8b(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    0x2d52(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    (%r15),%edi
mov    0x2d7e(%rip),%r12
mov    (%r12),%esi
mov    %rbp,%rdx
call   10b0 <tcsetattr@plt>
mov    (%r15),%edi
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
mov    %rbp,%rdx
call   10b0 <tcsetattr@plt>
mov    0x2d0f(%rip),%r13
mov    0x0(%r13),%edi
mov    0x2d24(%rip),%rax
mov    (%rax),%esi
mov    0x2d4b(%rip),%rbp
mov    0x0(%rbp),%edx
call   1030 <fcntl@plt>
lea    0x38(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
mov    0x2d10(%rip),%rax
mov    0x2d11(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xorps  %xmm0,%xmm0
movups %xmm0,0x50(%rsp)
mov    0x2cae(%rip),%rax
or     (%rax),%ecx
mov    %ecx,0x38(%rsp)
movq   $0x0,0x48(%rsp)
mov    0x40(%rsp),%rax
mov    0x2cd3(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    0x2c9a(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x5,(%rax,%rcx,4)
mov    0x8(%rbx),%rdi
mov    0x2cdd(%rip),%rax
mov    0x0(%rbp),%esi
or     (%rax),%esi
call   10c0 <open@plt>
mov    %eax,%ebp
mov    0x2c7a(%rip),%rbx
mov    (%rbx),%esi
mov    %r14,%rdi
call   1050 <cfsetospeed@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   10d0 <cfsetispeed@plt>
mov    (%r12),%esi
mov    %ebp,%edi
mov    %r14,%rdx
call   10b0 <tcsetattr@plt>
lea    0xf(%rsp),%rbx
jmp    1347 <main+0x197>
nop
cmpb   $0x71,0xf(%rsp)
je     1392 <main+0x1e2>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jle    136b <main+0x1bb>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    0x0(%r13),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jle    1340 <main+0x190>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
jmp    1340 <main+0x190>
mov    %ebp,%edi
call   1080 <close@plt>
mov    (%r15),%edi
mov    (%r12),%esi
lea    0x60(%rsp),%rdx
call   10b0 <tcsetattr@plt>
mov    0x2be7(%rip),%rax
mov    (%rax),%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32*, i64, i64, i64 }
@STDOUT_FILENO = global i32 0
@.str = [47 x i8] c"Please start with %s /dev/ttyS1 (for example)\0A\00"
@VMIN = global i64 0
@VTIME = global i64 0
@TCSANOW = global i32 0
@TCSAFLUSH = global i32 0
@STDIN_FILENO = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@CS8 = global i32 0
@CREAD = global i32 0
@CLOCAL = global i32 0
@O_RDWR = global i32 0
@B115200 = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.termios
%7 = alloca %struct.termios
%8 = alloca %struct.termios
%9 = alloca i32
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 68, i8* %10
%11 = load i32, i32* @STDOUT_FILENO
%12 = call i32 @tcgetattr(i32 %11, %struct.termios* %8)
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @memset(%struct.termios* %7, i32 0, i32 40)
%18 = getelementptr inbounds %struct.termios, %struct.termios* %7, i32 0, i32 4
store i64 0, i64* %18
%19 = getelementptr inbounds %struct.termios, %struct.termios* %7, i32 0, i32 3
store i64 0, i64* %19
%20 = getelementptr inbounds %struct.termios, %struct.termios* %7, i32 0, i32 0
store i32 0, i32* %20
%21 = getelementptr inbounds %struct.termios, %struct.termios* %7, i32 0, i32 2
store i64 0, i64* %21
%22 = getelementptr inbounds %struct.termios, %struct.termios* %7, i32 0, i32 1
%23 = load i32*, i32** %22
%24 = load i64, i64* @VMIN
%25 = getelementptr inbounds i32, i32* %23, i64 %24
store i32 1, i32* %25
%26 = getelementptr inbounds %struct.termios, %struct.termios* %7, i32 0, i32 1
%27 = load i32*, i32** %26
%28 = load i64, i64* @VTIME
%29 = getelementptr inbounds i32, i32* %27, i64 %28
store i32 0, i32* %29
%30 = load i32, i32* @STDOUT_FILENO
%31 = load i32, i32* @TCSANOW
%32 = call i32 @tcsetattr(i32 %30, i32 %31, %struct.termios* %7)
%33 = load i32, i32* @STDOUT_FILENO
%34 = load i32, i32* @TCSAFLUSH
%35 = call i32 @tcsetattr(i32 %33, i32 %34, %struct.termios* %7)
%36 = load i32, i32* @STDIN_FILENO
%37 = load i32, i32* @F_SETFL
%38 = load i32, i32* @O_NONBLOCK
%39 = call i32 @fcntl(i32 %36, i32 %37, i32 %38)
%40 = call i32 @memset(%struct.termios* %6, i32 0, i32 40)
%41 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 4
store i64 0, i64* %41
%42 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 3
store i64 0, i64* %42
%43 = load i32, i32* @CS8
%44 = load i32, i32* @CREAD
%45 = or i32 %43, %44
%46 = load i32, i32* @CLOCAL
%47 = or i32 %45, %46
%48 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 0
store i32 %47, i32* %48
%49 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 2
store i64 0, i64* %49
%50 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 1
%51 = load i32*, i32** %50
%52 = load i64, i64* @VMIN
%53 = getelementptr inbounds i32, i32* %51, i64 %52
store i32 1, i32* %53
%54 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 1
%55 = load i32*, i32** %54
%56 = load i64, i64* @VTIME
%57 = getelementptr inbounds i32, i32* %55, i64 %56
store i32 5, i32* %57
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 1
%60 = load i8*, i8** %59
%61 = load i32, i32* @O_RDWR
%62 = load i32, i32* @O_NONBLOCK
%63 = or i32 %61, %62
%64 = call i32 @open(i8* %60, i32 %63)
store i32 %64, i32* %9
%65 = load i32, i32* @B115200
%66 = call i32 @cfsetospeed(%struct.termios* %6, i32 %65)
%67 = load i32, i32* @B115200
%68 = call i32 @cfsetispeed(%struct.termios* %6, i32 %67)
%69 = load i32, i32* %9
%70 = load i32, i32* @TCSANOW
%71 = call i32 @tcsetattr(i32 %69, i32 %70, %struct.termios* %6)
br label %72
72: ; preds = %90, %2
%73 = load i8, i8* %10
%74 = zext i8 %73 to i32
%75 = icmp ne i32 %74, 113
br i1 %75, label %76, label %91
76: ; preds = %72
%77 = load i32, i32* %9
%78 = call i64 @read(i32 %77, i8* %10, i32 1)
%79 = icmp sgt i64 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = load i32, i32* @STDOUT_FILENO
%82 = call i32 @write(i32 %81, i8* %10, i32 1)
br label %83
83: ; preds = %80, %76
%84 = load i32, i32* @STDIN_FILENO
%85 = call i64 @read(i32 %84, i8* %10, i32 1)
%86 = icmp sgt i64 %85, 0
br i1 %86, label %87, label %90
87: ; preds = %83
%88 = load i32, i32* %9
%89 = call i32 @write(i32 %88, i8* %10, i32 1)
br label %90
90: ; preds = %87, %83
br label %72
91: ; preds = %72
%92 = load i32, i32* %9
%93 = call i32 @close(i32 %92)
%94 = load i32, i32* @STDOUT_FILENO
%95 = load i32, i32* @TCSANOW
%96 = call i32 @tcsetattr(i32 %94, i32 %95, %struct.termios* %8)
%97 = load i32, i32* @EXIT_SUCCESS
ret i32 %97
}

LLVM IR (-O2):
%struct.termios = type { i32, i32*, i64, i64, i64 }
@STDOUT_FILENO = global i32 0
@.str = [47 x i8] c"Please start with %s /dev/ttyS1 (for example)\0A\00"
@VMIN = global i64 0
@VTIME = global i64 0
@TCSANOW = global i32 0
@TCSAFLUSH = global i32 0
@STDIN_FILENO = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@CS8 = global i32 0
@CREAD = global i32 0
@CLOCAL = global i32 0
@O_RDWR = global i32 0
@B115200 = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.termios
%4 = alloca %struct.termios
%5 = alloca %struct.termios
%6 = alloca i8
%7 = bitcast %struct.termios* %3 to i8*
%8 = bitcast %struct.termios* %4 to i8*
%9 = bitcast %struct.termios* %5 to i8*
store i8 68, i8* %6
%10 = load i32, i32* @STDOUT_FILENO
%11 = call i32 @tcgetattr(i32 %10, %struct.termios* %5)
%12 = load i8*, i8** %1
%13 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @memset(%struct.termios* %4, i32 0, i32 40)
%15 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 0
store i32 0, i32* %15
%16 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 2
%17 = getelementptr inbounds %struct.termios, %struct.termios* %4, i64 0, i32 1
%18 = bitcast i64* %16 to i8*
%19 = load i32*, i32** %17
%20 = load i64, i64* @VMIN
%21 = getelementptr inbounds i32, i32* %19, i64 %20
store i32 1, i32* %21
%22 = load i64, i64* @VTIME
%23 = getelementptr inbounds i32, i32* %19, i64 %22
store i32 0, i32* %23
%24 = load i32, i32* @STDOUT_FILENO
%25 = load i32, i32* @TCSANOW
%26 = call i32 @tcsetattr(i32 %24, i32 %25, %struct.termios* %4)
%27 = load i32, i32* @STDOUT_FILENO
%28 = load i32, i32* @TCSAFLUSH
%29 = call i32 @tcsetattr(i32 %27, i32 %28, %struct.termios* %4)
%30 = load i32, i32* @STDIN_FILENO
%31 = load i32, i32* @F_SETFL
%32 = load i32, i32* @O_NONBLOCK
%33 = call i32 @fcntl(i32 %30, i32 %31, i32 %32)
%34 = call i32 @memset(%struct.termios* %3, i32 0, i32 40)
%35 = getelementptr inbounds %struct.termios, %struct.termios* %3, i64 0, i32 3
%36 = bitcast i64* %35 to i8*
%37 = load i32, i32* @CS8
%38 = load i32, i32* @CREAD
%39 = or i32 %38, %37
%40 = load i32, i32* @CLOCAL
%41 = or i32 %39, %40
%42 = getelementptr inbounds %struct.termios, %struct.termios* %3, i64 0, i32 0
store i32 %41, i32* %42
%43 = getelementptr inbounds %struct.termios, %struct.termios* %3, i64 0, i32 2
store i64 0, i64* %43
%44 = getelementptr inbounds %struct.termios, %struct.termios* %3, i64 0, i32 1
%45 = load i32*, i32** %44
%46 = load i64, i64* @VMIN
%47 = getelementptr inbounds i32, i32* %45, i64 %46
store i32 1, i32* %47
%48 = load i64, i64* @VTIME
%49 = getelementptr inbounds i32, i32* %45, i64 %48
store i32 5, i32* %49
%50 = getelementptr inbounds i8*, i8** %1, i64 1
%51 = load i8*, i8** %50
%52 = load i32, i32* @O_RDWR
%53 = load i32, i32* @O_NONBLOCK
%54 = or i32 %53, %52
%55 = call i32 @open(i8* %51, i32 %54)
%56 = load i32, i32* @B115200
%57 = call i32 @cfsetospeed(%struct.termios* %3, i32 %56)
%58 = load i32, i32* @B115200
%59 = call i32 @cfsetispeed(%struct.termios* %3, i32 %58)
%60 = load i32, i32* @TCSANOW
%61 = call i32 @tcsetattr(i32 %55, i32 %60, %struct.termios* %3)
br label %62
62: ; preds = %2, %74
%63 = call i64 @read(i32 %55, i8* %6, i32 1)
%64 = icmp sgt i64 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = load i32, i32* @STDOUT_FILENO
%67 = call i32 @write(i32 %66, i8* %6, i32 1)
br label %68
68: ; preds = %65, %62
%69 = load i32, i32* @STDIN_FILENO
%70 = call i64 @read(i32 %69, i8* %6, i32 1)
%71 = icmp sgt i64 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = call i32 @write(i32 %55, i8* %6, i32 1)
br label %74
74: ; preds = %72, %68
%75 = load i8, i8* %6
%76 = icmp eq i8 %75, 113
br i1 %76, label %77, label %62
77: ; preds = %74
%78 = call i32 @close(i32 %55)
%79 = load i32, i32* @STDOUT_FILENO
%80 = load i32, i32* @TCSANOW
%81 = call i32 @tcsetattr(i32 %79, i32 %80, %struct.termios* %5)
%82 = load i32, i32* @EXIT_SUCCESS
ret i32 %82
}