#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*/ uint8_t;
struct termios {
  int c_iflag;
  int c_lflag;
  int /*<<< orphan*/ c_cflag;
};
typedef int /*<<< orphan*/ rcv_buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ CRTSCTS;
int /*<<< orphan*/ CS8;
int /*<<< orphan*/ CSIZE;
int /*<<< orphan*/ CSTOPB;
int ECHO;
int ECHOE;
int /*<<< orphan*/ F_SETFL;
int ICANON;
int ISIG;
int IXANY;
int IXOFF;
int IXON;
int O_NDELAY;
int O_NOCTTY;
int O_RDWR;
int /*<<< orphan*/ PARENB;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ cfsetispeed(struct termios *, int /*<<< orphan*/);
int /*<<< orphan*/ cfsetospeed(struct termios *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int open(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, int /*<<< orphan*/ **, int);
int /*<<< orphan*/ tcgetattr(int, struct termios *);
int /*<<< orphan*/ tcsetattr(int, int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ usage(char *);
int xmodem_send(int, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int fd;
  FILE *file_to_send;
  struct termios attr;
  int retval;
  uint8_t rcv_buf[128];
  if (argc != 3) {
    usage(argv[0]);
    return 0;
  }
  file_to_send = fopen(argv[2], "r");
  if (file_to_send == 0) {
    printf("Couldn't open file %s\n", argv[2]);
    return 1;
  }
  fd = open(argv[1], O_RDWR | O_NOCTTY | O_NDELAY);
  if (fd == -1) {
    printf("Couldn't open serial device %s\n", argv[1]);
    return 1;
  }
  tcgetattr(fd, &attr);
  cfsetispeed(&attr, B115200);
  cfsetospeed(&attr, B115200);
  attr.c_cflag &= ~PARENB;
  attr.c_cflag &= ~CSTOPB;
  attr.c_cflag &= ~CSIZE;
  attr.c_cflag |= CS8;
  attr.c_cflag &= ~CRTSCTS;
  attr.c_iflag &= ~(IXON | IXOFF | IXANY);
  attr.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
  tcsetattr(fd, TCSANOW, &attr);
  fcntl(fd, F_SETFL, 0);
  printf("Initializing file transfer...\n");
  read(fd, &rcv_buf, sizeof(rcv_buf));
  retval = xmodem_send(fd, file_to_send);
  if (retval == -1)
    printf("File transfer failed.\n");
  else
    printf("File transfer finished successfully.\n");
  fclose(file_to_send);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     120b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    141b <main+0x24b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xde6(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1250 <main+0x80>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    141b <main+0x24b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
mov    0x2d20(%rip),%rax
or     (%rax),%esi
mov    0x2d07(%rip),%rax
or     (%rax),%esi
call   10d0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    12a7 <main+0xd7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    141b <main+0x24b>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
call   10b0 <tcgetattr@plt>
mov    0x2cb6(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdi
call   10f0 <cfsetispeed@plt>
mov    0x2ca4(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdi
call   1050 <cfsetospeed@plt>
mov    0x2cf2(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2c60(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2c9e(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2c94(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2c35(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2ca3(%rip),%rax
mov    (%rax),%eax
mov    0x2ca2(%rip),%rcx
or     (%rcx),%eax
mov    0x2c49(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2c0f(%rip),%rax
mov    (%rax),%eax
mov    0x2c5e(%rip),%rcx
or     (%rcx),%eax
mov    0x2c4d(%rip),%rcx
or     (%rcx),%eax
mov    0x2c3c(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2c3f(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   10c0 <tcsetattr@plt>
mov    -0x14(%rbp),%edi
mov    0x2be2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x240(%rbp),%rsi
mov    $0x200,%edx
call   1080 <read@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1090 <xmodem_send@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    13f5 <main+0x225>
lea    0xc6f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1403 <main+0x233>
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x218,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    136a <main+0x18a>
mov    0x10(%rbx),%rdi
lea    0xdfc(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1376 <main+0x196>
mov    %rax,%r15
mov    0x2dcc(%rip),%rax
mov    0x2d65(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x8(%rbx),%rdi
mov    0x2d46(%rip),%rax
or     (%rax),%esi
call   10e0 <open@plt>
cmp    $0xffffffff,%eax
je     1383 <main+0x1a3>
mov    %eax,%ebp
mov    %rsp,%r14
mov    %eax,%edi
mov    %r14,%rsi
call   10c0 <tcgetattr@plt>
mov    0x2d18(%rip),%rbx
mov    (%rbx),%esi
mov    %r14,%rdi
call   1100 <cfsetispeed@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1060 <cfsetospeed@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%eax
mov    0x2cd4(%rip),%rcx
or     (%rcx),%eax
mov    0x2d1b(%rip),%rcx
or     (%rcx),%eax
not    %eax
and    0x8(%rsp),%eax
mov    0x2d14(%rip),%rcx
or     (%rcx),%eax
mov    0x2cbb(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %eax,%ecx
mov    %ecx,0x8(%rsp)
mov    0x2d2a(%rip),%rax
mov    0x2d2b(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2cd0(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,(%rsp)
mov    0x2c9a(%rip),%rax
mov    0x2ceb(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2cd8(%rip),%rax
or     (%rax),%ecx
mov    0x2cc7(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,0x4(%rsp)
mov    0x2cd0(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
mov    %r14,%rdx
call   10d0 <tcsetattr@plt>
mov    0x2c75(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
mov    %ebp,%edi
xor    %edx,%edx
call   1040 <fcntl@plt>
lea    0xd1a(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
mov    $0x200,%edx
call   1090 <read@plt>
mov    %ebp,%edi
mov    %r15,%rsi
call   10a0 <xmodem_send@plt>
cmp    $0xffffffff,%eax
lea    0xd33(%rip),%rax
lea    0xd07(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %ebp,%edi
call   1080 <close@plt>
jmp    139a <main+0x1ba>
mov    (%rbx),%rdi
call   10b0 <usage@plt>
xor    %ebx,%ebx
jmp    139a <main+0x1ba>
mov    0x10(%rbx),%rsi
lea    0xc81(%rip),%rdi
jmp    138e <main+0x1ae>
mov    0x8(%rbx),%rsi
lea    0xc8b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x218,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32, i32 }
@.str = [2 x i8] c"r\00"
@.str.1 = [23 x i8] c"Couldn't open file %s\0A\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@.str.2 = [32 x i8] c"Couldn't open serial device %s\0A\00"
@B115200 = global i32 0
@PARENB = global i32 0
@CSTOPB = global i32 0
@CSIZE = global i32 0
@CS8 = global i32 0
@CRTSCTS = 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
@TCSANOW = global i32 0
@F_SETFL = global i32 0
@.str.3 = [31 x i8] c"Initializing file transfer...\0A\00"
@.str.4 = [23 x i8] c"File transfer failed.\0A\00"
@.str.5 = [38 x i8] c"File transfer finished successfully.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca %struct.termios
%9 = alloca i32
%10 = alloca [128 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @usage(i8* %16)
store i32 0, i32* %3
br label %122
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %22, i32** %7
%23 = load i32*, i32** %7
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %30
25: ; preds = %18
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %28)
store i32 1, i32* %3
br label %122
30: ; preds = %18
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = load i32, i32* @O_RDWR
%35 = load i32, i32* @O_NOCTTY
%36 = or i32 %34, %35
%37 = load i32, i32* @O_NDELAY
%38 = or i32 %36, %37
%39 = call i32 @open(i8* %33, i32 %38)
store i32 %39, i32* %6
%40 = load i32, i32* %6
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %47
42: ; preds = %30
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %45)
store i32 1, i32* %3
br label %122
47: ; preds = %30
%48 = load i32, i32* %6
%49 = call i32 @tcgetattr(i32 %48, %struct.termios* %8)
%50 = load i32, i32* @B115200
%51 = call i32 @cfsetispeed(%struct.termios* %8, i32 %50)
%52 = load i32, i32* @B115200
%53 = call i32 @cfsetospeed(%struct.termios* %8, i32 %52)
%54 = load i32, i32* @PARENB
%55 = xor i32 %54, -1
%56 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%57 = load i32, i32* %56
%58 = and i32 %57, %55
store i32 %58, i32* %56
%59 = load i32, i32* @CSTOPB
%60 = xor i32 %59, -1
%61 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%62 = load i32, i32* %61
%63 = and i32 %62, %60
store i32 %63, i32* %61
%64 = load i32, i32* @CSIZE
%65 = xor i32 %64, -1
%66 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%67 = load i32, i32* %66
%68 = and i32 %67, %65
store i32 %68, i32* %66
%69 = load i32, i32* @CS8
%70 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%71 = load i32, i32* %70
%72 = or i32 %71, %69
store i32 %72, i32* %70
%73 = load i32, i32* @CRTSCTS
%74 = xor i32 %73, -1
%75 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 2
%76 = load i32, i32* %75
%77 = and i32 %76, %74
store i32 %77, i32* %75
%78 = load i32, i32* @IXON
%79 = load i32, i32* @IXOFF
%80 = or i32 %78, %79
%81 = load i32, i32* @IXANY
%82 = or i32 %80, %81
%83 = xor i32 %82, -1
%84 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 0
%85 = load i32, i32* %84
%86 = and i32 %85, %83
store i32 %86, i32* %84
%87 = load i32, i32* @ICANON
%88 = load i32, i32* @ECHO
%89 = or i32 %87, %88
%90 = load i32, i32* @ECHOE
%91 = or i32 %89, %90
%92 = load i32, i32* @ISIG
%93 = or i32 %91, %92
%94 = xor i32 %93, -1
%95 = getelementptr inbounds %struct.termios, %struct.termios* %8, i32 0, i32 1
%96 = load i32, i32* %95
%97 = and i32 %96, %94
store i32 %97, i32* %95
%98 = load i32, i32* %6
%99 = load i32, i32* @TCSANOW
%100 = call i32 @tcsetattr(i32 %98, i32 %99, %struct.termios* %8)
%101 = load i32, i32* %6
%102 = load i32, i32* @F_SETFL
%103 = call i32 @fcntl(i32 %101, i32 %102, i32 0)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%105 = load i32, i32* %6
%106 = bitcast [128 x i32]* %10 to i32**
%107 = call i32 @read(i32 %105, i32** %106, i32 512)
%108 = load i32, i32* %6
%109 = load i32*, i32** %7
%110 = call i32 @xmodem_send(i32 %108, i32* %109)
store i32 %110, i32* %9
%111 = load i32, i32* %9
%112 = icmp eq i32 %111, -1
br i1 %112, label %113, label %115
113: ; preds = %47
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %117
115: ; preds = %47
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
br label %117
117: ; preds = %115, %113
%118 = load i32*, i32** %7
%119 = call i32 @fclose(i32* %118)
%120 = load i32, i32* %6
%121 = call i32 @close(i32 %120)
store i32 0, i32* %3
br label %122
122: ; preds = %117, %42, %25, %13
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
%struct.termios = type { i32, i32, i32 }
@.str = [2 x i8] c"r\00"
@.str.1 = [23 x i8] c"Couldn't open file %s\0A\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@.str.2 = [32 x i8] c"Couldn't open serial device %s\0A\00"
@B115200 = global i32 0
@PARENB = global i32 0
@CSTOPB = global i32 0
@CSIZE = global i32 0
@CS8 = global i32 0
@CRTSCTS = 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
@TCSANOW = global i32 0
@F_SETFL = global i32 0
@str = [30 x i8] c"Initializing file transfer...\00"
@str.6 = [37 x i8] c"File transfer finished successfully.\00"
@str.7 = [22 x i8] c"File transfer failed.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.termios
%4 = alloca [128 x i32]
%5 = bitcast %struct.termios* %3 to i8*
%6 = bitcast [128 x i32]* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @usage(i8* %9)
br label %85
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i8*, i8** %12
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %85
19: ; preds = %11
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = load i32, i32* @O_RDWR
%23 = load i32, i32* @O_NOCTTY
%24 = or i32 %23, %22
%25 = load i32, i32* @O_NDELAY
%26 = or i32 %24, %25
%27 = tail call i32 @open(i8* %21, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %32
29: ; preds = %19
%30 = load i8*, i8** %20
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %30)
br label %85
32: ; preds = %19
%33 = call i32 @tcgetattr(i32 %27, %struct.termios* %3)
%34 = load i32, i32* @B115200
%35 = call i32 @cfsetispeed(%struct.termios* %3, i32 %34)
%36 = load i32, i32* @B115200
%37 = call i32 @cfsetospeed(%struct.termios* %3, i32 %36)
%38 = load i32, i32* @PARENB
%39 = getelementptr inbounds %struct.termios, %struct.termios* %3, i64 0, i32 2
%40 = load i32, i32* %39
%41 = load i32, i32* @CSTOPB
%42 = or i32 %38, %41
%43 = load i32, i32* @CSIZE
%44 = or i32 %42, %43
%45 = xor i32 %44, -1
%46 = and i32 %40, %45
%47 = load i32, i32* @CS8
%48 = or i32 %47, %46
%49 = load i32, i32* @CRTSCTS
%50 = xor i32 %49, -1
%51 = and i32 %48, %50
store i32 %51, i32* %39
%52 = load i32, i32* @IXON
%53 = load i32, i32* @IXOFF
%54 = or i32 %53, %52
%55 = load i32, i32* @IXANY
%56 = or i32 %54, %55
%57 = xor i32 %56, -1
%58 = getelementptr inbounds %struct.termios, %struct.termios* %3, i64 0, i32 0
%59 = load i32, i32* %58
%60 = and i32 %59, %57
store i32 %60, i32* %58
%61 = load i32, i32* @ICANON
%62 = load i32, i32* @ECHO
%63 = or i32 %62, %61
%64 = load i32, i32* @ECHOE
%65 = or i32 %63, %64
%66 = load i32, i32* @ISIG
%67 = or i32 %65, %66
%68 = xor i32 %67, -1
%69 = getelementptr inbounds %struct.termios, %struct.termios* %3, i64 0, i32 1
%70 = load i32, i32* %69
%71 = and i32 %70, %68
store i32 %71, i32* %69
%72 = load i32, i32* @TCSANOW
%73 = call i32 @tcsetattr(i32 %27, i32 %72, %struct.termios* %3)
%74 = load i32, i32* @F_SETFL
%75 = call i32 @fcntl(i32 %27, i32 %74, i32 0)
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%77 = bitcast [128 x i32]* %4 to i32**
%78 = call i32 @read(i32 %27, i32** %77, i32 512)
%79 = call i32 @xmodem_send(i32 %27, i32* %14)
%80 = icmp eq i32 %79, -1
%81 = select i1 %80, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0)
%82 = call i32 @puts(i8* dereferenceable(1) %81)
%83 = call i32 @fclose(i32* %14)
%84 = call i32 @close(i32 %27)
br label %85
85: ; preds = %32, %29, %16, %8
%86 = phi i32 [ 0, %8 ], [ 1, %16 ], [ 1, %29 ], [ 0, %32 ]
ret i32 %86
}