#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 uint32_t;
struct termios {
  int c_cflag;
  int c_iflag;
  int *c_cc;
  int /*<<< orphan*/ c_oflag;
};

/* Variables and functions */
int /*<<< orphan*/ B9600;
int CLOCAL;
int CREAD;
int CRTSCTS;
int CS8;
int CSIZE;
int CSTOPB;
int ECHO;
int ECHOE;
int ICANON;
int ISIG;
int IXANY;
int IXOFF;
int IXON;
int /*<<< orphan*/ OPOST;
int O_NOCTTY;
int O_RDWR;
int PARENB;
int /*<<< orphan*/ TCIFLUSH;
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 open(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char **, int);
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
int /*<<< orphan*/ tcgetattr(int, struct termios *);
scalar_t__ tcsetattr(int, int /*<<< orphan*/, struct termios *);
int main(void) {
  int file_descriptor;
  char *serial_port_path = "/dev/ttyACM0";
  file_descriptor = open(serial_port_path, O_RDWR | O_NOCTTY);
  char *status_message = (file_descriptor < 0) ? "Error opening the port!!!"
                                               : "port opened succesfully";
  printf("%s\n", status_message);
  struct termios serial_port_settings;
  tcgetattr(file_descriptor, &serial_port_settings);
  cfsetispeed(&serial_port_settings, B9600);
  cfsetospeed(&serial_port_settings, B9600);
  serial_port_settings.c_cflag &= ~PARENB;
  serial_port_settings.c_cflag &= ~CSTOPB;
  serial_port_settings.c_cflag &= ~CSIZE;
  serial_port_settings.c_cflag |= CS8;
  serial_port_settings.c_cflag &= ~CRTSCTS;
  serial_port_settings.c_cflag |= CREAD | CLOCAL;
  serial_port_settings.c_iflag &= ~(IXON | IXOFF | IXANY);
  serial_port_settings.c_iflag &= ~(ICANON | ECHO | ECHOE | ISIG);
  serial_port_settings.c_oflag &= ~OPOST;
  serial_port_settings.c_cc[VMIN] = 10;
  serial_port_settings.c_cc[VTIME] = 0;
  if ((tcsetattr(file_descriptor, TCSANOW, &serial_port_settings)) != 0) {
    printf("ERROR ! in Setting attributes");
  } else {
    printf("Stop bits: %b", ~CSTOPB);
  }
  tcflush(file_descriptor, TCIFLUSH);
  char read_buffer[32];
  uint32_t bytes_read;
  uint32_t i;
  bytes_read = read(file_descriptor, &read_buffer, 32);
  printf("Bytes received: %d\n", bytes_read);
  for (i = 0; i < bytes_read; i++) {
    printf("%c", read_buffer[i]);
  }
  printf("\n-------------------------------------------------------------------"
         "------\n");
  close(file_descriptor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e33(%rip),%rax
mov    (%rax),%esi
mov    0x2da2(%rip),%rax
or     (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xe55(%rip),%rax
lea    0xe34(%rip),%rcx
cmp    $0x0,%edx
cmovl  %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
call   1080 <tcgetattr@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdi
call   10b0 <cfsetispeed@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdi
call   1030 <cfsetospeed@plt>
mov    0x2d9b(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2cf9(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d2f(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d2d(%rip),%rax
mov    (%rax),%eax
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2cce(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d14(%rip),%rax
mov    (%rax),%eax
mov    0x2ca3(%rip),%rcx
or     (%rcx),%eax
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d34(%rip),%rax
mov    (%rax),%eax
mov    0x2d3b(%rip),%rcx
or     (%rcx),%eax
mov    0x2cc2(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2c90(%rip),%rax
mov    (%rax),%eax
mov    0x2cef(%rip),%rcx
or     (%rcx),%eax
mov    0x2cde(%rip),%rcx
or     (%rcx),%eax
mov    0x2ccd(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2ceb(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2c85(%rip),%rcx
mov    (%rcx),%rcx
movl   $0xa,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
mov    0x2c40(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%edi
mov    0x2c94(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   1090 <tcsetattr@plt>
cmp    $0x0,%rax
je     1354 <main+0x1c4>
lea    0xcfb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    136e <main+0x1de>
mov    0x2bdd(%rip),%rax
mov    (%rax),%esi
xor    $0xffffffff,%esi
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
mov    0x2bf0(%rip),%rax
mov    (%rax),%esi
call   1040 <tcflush@plt>
mov    -0x8(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
call   1070 <read@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%esi
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    13dc <main+0x24c>
movslq -0x58(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%esi
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    13ab <main+0x21b>
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0x2e27(%rip),%rax
mov    0x2d98(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe2d(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,%r15d
test   %eax,%eax
lea    0xe29(%rip),%rax
lea    0xe3c(%rip),%rdi
cmovs  %rax,%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%r14
mov    %r15d,%edi
mov    %r14,%rsi
call   10a0 <tcgetattr@plt>
mov    0x2d95(%rip),%rbx
mov    (%rbx),%esi
mov    %r14,%rdi
call   10d0 <cfsetispeed@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1050 <cfsetospeed@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%eax
mov    0x2d09(%rip),%rbp
or     0x0(%rbp),%eax
mov    0x2d47(%rip),%rcx
or     (%rcx),%eax
not    %eax
and    0x8(%rsp),%eax
mov    0x2d48(%rip),%rcx
or     (%rcx),%eax
mov    0x2cef(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %eax,%ecx
mov    0x2d3a(%rip),%rax
or     (%rax),%ecx
mov    0x2cc9(%rip),%rax
or     (%rax),%ecx
mov    0x2d60(%rip),%rax
mov    0x2d69(%rip),%rdx
mov    (%rdx),%edx
or     (%rax),%edx
mov    0x2cee(%rip),%rax
or     (%rax),%edx
mov    0x2cc5(%rip),%rax
mov    0x2d26(%rip),%rsi
mov    (%rsi),%esi
or     (%rax),%esi
mov    %ecx,0x8(%rsp)
mov    0x2d0f(%rip),%rax
or     (%rax),%esi
mov    0x2cfe(%rip),%rax
or     (%rax),%esi
or     %edx,%esi
not    %esi
and    %esi,0xc(%rsp)
mov    0x2d1d(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %eax,0x18(%rsp)
mov    0x10(%rsp),%rax
mov    0x2cb9(%rip),%rcx
mov    (%rcx),%rcx
movl   $0xa,(%rax,%rcx,4)
mov    0x2c78(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2ccf(%rip),%rax
mov    (%rax),%esi
mov    %r15d,%edi
mov    %r14,%rdx
call   10b0 <tcsetattr@plt>
test   %rax,%rax
je     1313 <main+0x163>
lea    0xd35(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1326 <main+0x176>
mov    0x0(%rbp),%esi
not    %esi
lea    0xd3e(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2c3b(%rip),%rax
mov    (%rax),%esi
mov    %r15d,%edi
call   1060 <tcflush@plt>
lea    0x20(%rsp),%rsi
mov    %r15d,%edi
mov    $0x20,%edx
call   1090 <read@plt>
mov    %eax,%ebp
lea    0xd19(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebp,%ebp
jle    1383 <main+0x1d3>
mov    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x20(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1370 <main+0x1c0>
lea    0xcf5(%rip),%rdi
call   1040 <puts@plt>
mov    %r15d,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32, i32*, i32 }
@.str = [13 x i8] c"/dev/ttyACM0\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str.1 = [26 x i8] c"Error opening the port!!!\00"
@.str.2 = [24 x i8] c"port opened succesfully\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@B9600 = global i32 0
@PARENB = global i32 0
@CSTOPB = global i32 0
@CSIZE = global i32 0
@CS8 = global i32 0
@CRTSCTS = global i32 0
@CREAD = global i32 0
@CLOCAL = global i32 0
@IXON = global i32 0
@IXOFF = global i32 0
@IXANY = global i32 0
@ICANON = global i32 0
@ECHO = global i32 0
@ECHOE = global i32 0
@ISIG = global i32 0
@OPOST = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
@TCSANOW = global i32 0
@.str.4 = [30 x i8] c"ERROR ! in Setting attributes\00"
@.str.5 = [14 x i8] c"Stop bits: %b\00"
@TCIFLUSH = global i32 0
@.str.6 = [20 x i8] c"Bytes received: %d\0A\00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [76 x i8] c"\0A-------------------------------------------------------------------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.termios
%6 = alloca [32 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %3
%9 = load i8*, i8** %3
%10 = load i32, i32* @O_RDWR
%11 = load i32, i32* @O_NOCTTY
%12 = or i32 %10, %11
%13 = call i32 @open(i8* %9, i32 %12)
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0)
store i8* %17, i8** %4
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = load i32, i32* %2
%21 = call i32 @tcgetattr(i32 %20, %struct.termios* %5)
%22 = load i32, i32* @B9600
%23 = call i32 @cfsetispeed(%struct.termios* %5, i32 %22)
%24 = load i32, i32* @B9600
%25 = call i32 @cfsetospeed(%struct.termios* %5, i32 %24)
%26 = load i32, i32* @PARENB
%27 = xor i32 %26, -1
%28 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%29 = load i32, i32* %28
%30 = and i32 %29, %27
store i32 %30, i32* %28
%31 = load i32, i32* @CSTOPB
%32 = xor i32 %31, -1
%33 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%34 = load i32, i32* %33
%35 = and i32 %34, %32
store i32 %35, i32* %33
%36 = load i32, i32* @CSIZE
%37 = xor i32 %36, -1
%38 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%39 = load i32, i32* %38
%40 = and i32 %39, %37
store i32 %40, i32* %38
%41 = load i32, i32* @CS8
%42 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%43 = load i32, i32* %42
%44 = or i32 %43, %41
store i32 %44, i32* %42
%45 = load i32, i32* @CRTSCTS
%46 = xor i32 %45, -1
%47 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%48 = load i32, i32* %47
%49 = and i32 %48, %46
store i32 %49, i32* %47
%50 = load i32, i32* @CREAD
%51 = load i32, i32* @CLOCAL
%52 = or i32 %50, %51
%53 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%54 = load i32, i32* %53
%55 = or i32 %54, %52
store i32 %55, i32* %53
%56 = load i32, i32* @IXON
%57 = load i32, i32* @IXOFF
%58 = or i32 %56, %57
%59 = load i32, i32* @IXANY
%60 = or i32 %58, %59
%61 = xor i32 %60, -1
%62 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 1
%63 = load i32, i32* %62
%64 = and i32 %63, %61
store i32 %64, i32* %62
%65 = load i32, i32* @ICANON
%66 = load i32, i32* @ECHO
%67 = or i32 %65, %66
%68 = load i32, i32* @ECHOE
%69 = or i32 %67, %68
%70 = load i32, i32* @ISIG
%71 = or i32 %69, %70
%72 = xor i32 %71, -1
%73 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 1
%74 = load i32, i32* %73
%75 = and i32 %74, %72
store i32 %75, i32* %73
%76 = load i32, i32* @OPOST
%77 = xor i32 %76, -1
%78 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 3
%79 = load i32, i32* %78
%80 = and i32 %79, %77
store i32 %80, i32* %78
%81 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 2
%82 = load i32*, i32** %81
%83 = load i64, i64* @VMIN
%84 = getelementptr inbounds i32, i32* %82, i64 %83
store i32 10, i32* %84
%85 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 2
%86 = load i32*, i32** %85
%87 = load i64, i64* @VTIME
%88 = getelementptr inbounds i32, i32* %86, i64 %87
store i32 0, i32* %88
%89 = load i32, i32* %2
%90 = load i32, i32* @TCSANOW
%91 = call i64 @tcsetattr(i32 %89, i32 %90, %struct.termios* %5)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %0
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %99
95: ; preds = %0
%96 = load i32, i32* @CSTOPB
%97 = xor i32 %96, -1
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %97)
br label %99
99: ; preds = %95, %93
%100 = load i32, i32* %2
%101 = load i32, i32* @TCIFLUSH
%102 = call i32 @tcflush(i32 %100, i32 %101)
%103 = load i32, i32* %2
%104 = bitcast [32 x i8]* %6 to i8**
%105 = call i32 @read(i32 %103, i8** %104, i32 32)
store i32 %105, i32* %7
%106 = load i32, i32* %7
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %106)
store i32 0, i32* %8
br label %108
108: ; preds = %119, %99
%109 = load i32, i32* %8
%110 = load i32, i32* %7
%111 = icmp slt i32 %109, %110
br i1 %111, label %112, label %122
112: ; preds = %108
%113 = load i32, i32* %8
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %117)
br label %119
119: ; preds = %112
%120 = load i32, i32* %8
%121 = add nsw i32 %120, 1
store i32 %121, i32* %8
br label %108
122: ; preds = %108
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.8, i64 0, i64 0))
%124 = load i32, i32* %2
%125 = call i32 @close(i32 %124)
ret i32 0
}

LLVM IR (-O2):
%struct.termios = type { i32, i32, i32*, i32 }
@.str = [13 x i8] c"/dev/ttyACM0\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str.1 = [26 x i8] c"Error opening the port!!!\00"
@.str.2 = [24 x i8] c"port opened succesfully\00"
@B9600 = global i32 0
@PARENB = global i32 0
@CSTOPB = global i32 0
@CSIZE = global i32 0
@CS8 = global i32 0
@CRTSCTS = global i32 0
@CREAD = global i32 0
@CLOCAL = global i32 0
@IXON = global i32 0
@IXOFF = global i32 0
@IXANY = global i32 0
@ICANON = global i32 0
@ECHO = global i32 0
@ECHOE = global i32 0
@ISIG = global i32 0
@OPOST = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
@TCSANOW = global i32 0
@.str.4 = [30 x i8] c"ERROR ! in Setting attributes\00"
@.str.5 = [14 x i8] c"Stop bits: %b\00"
@TCIFLUSH = global i32 0
@.str.6 = [20 x i8] c"Bytes received: %d\0A\00"
@str = [75 x i8] c"\0A-------------------------------------------------------------------------\00"
define i32 @main() {
%1 = alloca %struct.termios
%2 = alloca [32 x 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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp slt i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0)
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
%10 = bitcast %struct.termios* %1 to i8*
%11 = call i32 @tcgetattr(i32 %6, %struct.termios* %1)
%12 = load i32, i32* @B9600
%13 = call i32 @cfsetispeed(%struct.termios* %1, i32 %12)
%14 = load i32, i32* @B9600
%15 = call i32 @cfsetospeed(%struct.termios* %1, i32 %14)
%16 = load i32, i32* @PARENB
%17 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%18 = load i32, i32* %17
%19 = load i32, i32* @CSTOPB
%20 = or i32 %16, %19
%21 = load i32, i32* @CSIZE
%22 = or i32 %20, %21
%23 = xor i32 %22, -1
%24 = and i32 %18, %23
%25 = load i32, i32* @CS8
%26 = or i32 %25, %24
%27 = load i32, i32* @CRTSCTS
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* @CREAD
%31 = load i32, i32* @CLOCAL
%32 = or i32 %30, %29
%33 = or i32 %32, %31
store i32 %33, i32* %17
%34 = load i32, i32* @IXON
%35 = load i32, i32* @IXOFF
%36 = or i32 %35, %34
%37 = load i32, i32* @IXANY
%38 = or i32 %36, %37
%39 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 1
%40 = load i32, i32* %39
%41 = load i32, i32* @ICANON
%42 = load i32, i32* @ECHO
%43 = or i32 %42, %41
%44 = load i32, i32* @ECHOE
%45 = or i32 %43, %44
%46 = load i32, i32* @ISIG
%47 = or i32 %45, %46
%48 = or i32 %38, %47
%49 = xor i32 %48, -1
%50 = and i32 %40, %49
store i32 %50, i32* %39
%51 = load i32, i32* @OPOST
%52 = xor i32 %51, -1
%53 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 3
%54 = load i32, i32* %53
%55 = and i32 %54, %52
store i32 %55, i32* %53
%56 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 2
%57 = load i32*, i32** %56
%58 = load i64, i64* @VMIN
%59 = getelementptr inbounds i32, i32* %57, i64 %58
store i32 10, i32* %59
%60 = load i64, i64* @VTIME
%61 = getelementptr inbounds i32, i32* %57, i64 %60
store i32 0, i32* %61
%62 = load i32, i32* @TCSANOW
%63 = call i64 @tcsetattr(i32 %6, i32 %62, %struct.termios* %1)
%64 = icmp eq i64 %63, 0
br i1 %64, label %67, label %65
65: ; preds = %0
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %71
67: ; preds = %0
%68 = load i32, i32* @CSTOPB
%69 = xor i32 %68, -1
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %67, %65
%72 = load i32, i32* @TCIFLUSH
%73 = call i32 @tcflush(i32 %6, i32 %72)
%74 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%75 = bitcast [32 x i8]* %2 to i8**
%76 = call i32 @read(i32 %6, i8** %75, i32 32)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %76)
%78 = icmp sgt i32 %76, 0
br i1 %78, label %79, label %89
79: ; preds = %71
%80 = zext i32 %76 to i64
br label %81
81: ; preds = %79, %81
%82 = phi i64 [ 0, %79 ], [ %87, %81 ]
%83 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 %82
%84 = load i8, i8* %83
%85 = sext i8 %84 to i32
%86 = call i32 @putchar(i32 %85)
%87 = add nuw nsw i64 %82, 1
%88 = icmp eq i64 %87, %80
br i1 %88, label %89, label %81
89: ; preds = %81, %71
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%91 = call i32 @close(i32 %6)
ret i32 0
}