#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 dummy;
};

/* Variables and functions */
int BUFSIZ;
int O_APPEND;
int O_CREAT;
int O_NOCTTY;
int O_NONBLOCK;
int O_RDWR;
int /*<<< orphan*/ TCIOFLUSH;
int TCSAFLUSH;
int TCSANOW;
int /*<<< orphan*/ assert(int);
int atoi(char *);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ cfmakeraw(struct termios *);
int /*<<< orphan*/ cfsetispeed(struct termios *, int);
int /*<<< orphan*/ cfsetospeed(struct termios *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int open(char *, int, int);
int read(int, char *, int);
int /*<<< orphan*/ spinner(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
int /*<<< orphan*/ tcgetattr(int, struct termios *);
int tcsetattr(int, int, struct termios *);
int /*<<< orphan*/ usleep(int);
scalar_t__ write(int, char *, int);
int main(int argc, char **argv) {
  int speed, n, l, ifd, ofd;
  struct termios term;
  char buf[BUFSIZ];
  if (argc != 4) {
    fprintf(stderr, "usage: binlog <speed> <port> <logfile>\n");
    return 1;
  }
  speed = atoi(argv[1]);
  switch (speed) {
  case 230400:
  case 115200:
  case 57600:
  case 38400:
  case 28800:
  case 19200:
  case 14400:
  case 9600:
  case 4800:
    break;
  default:
    fprintf(stderr, "invalid speed\n");
    return 1;
  }
  if ((ifd = open(argv[2], O_RDWR | O_NONBLOCK | O_NOCTTY, 0644)) == -1)
    err(1, "open");
  if ((ofd = open(argv[3], O_RDWR | O_CREAT | O_APPEND, 0644)) == -1)
    err(1, "open");
  tcgetattr(ifd, &term);
  cfmakeraw(&term);
  cfsetospeed(&term, speed);
  cfsetispeed(&term, speed);
  if (tcsetattr(ifd, TCSANOW | TCSAFLUSH, &term) == -1)
    err(1, "tcsetattr");
  tcflush(ifd, TCIOFLUSH);
  n = 0;
  while (1) {
    l = read(ifd, buf, BUFSIZ);
    if (l > 0)
      assert(write(ofd, buf, l) > 0);
    usleep(1000);
    bzero(buf, BUFSIZ);
    spinner(n++);
  }
  close(ifd);
  close(ofd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2d8b(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1274 <main+0x74>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
lea    0xda4(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    14e8 <main+0x2e8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4c(%rbp)
sub    $0x12c0,%eax
je     1332 <main+0x132>
jmp    129a <main+0x9a>
mov    -0x4c(%rbp),%eax
sub    $0x2580,%eax
je     1332 <main+0x132>
jmp    12ad <main+0xad>
mov    -0x4c(%rbp),%eax
sub    $0x3840,%eax
je     1332 <main+0x132>
jmp    12c0 <main+0xc0>
mov    -0x4c(%rbp),%eax
sub    $0x4b00,%eax
je     1332 <main+0x132>
jmp    12d3 <main+0xd3>
mov    -0x4c(%rbp),%eax
sub    $0x7080,%eax
je     1332 <main+0x132>
jmp    12e6 <main+0xe6>
mov    -0x4c(%rbp),%eax
sub    $0x9600,%eax
je     1332 <main+0x132>
jmp    12f9 <main+0xf9>
mov    -0x4c(%rbp),%eax
sub    $0xe100,%eax
je     1332 <main+0x132>
jmp    130c <main+0x10c>
mov    -0x4c(%rbp),%eax
sub    $0x1c200,%eax
je     1332 <main+0x132>
jmp    131f <main+0x11f>
mov    -0x4c(%rbp),%eax
sub    $0x38400,%eax
jne    1337 <main+0x137>
jmp    1332 <main+0x132>
jmp    135f <main+0x15f>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
lea    0xce1(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    14e8 <main+0x2e8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2c72(%rip),%rax
mov    (%rax),%esi
mov    0x2c59(%rip),%rax
or     (%rax),%esi
mov    0x2c38(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   10d0 <open@plt>
mov    %eax,-0x20(%rbp)
cmp    $0xffffffff,%eax
jne    13a9 <main+0x1a9>
mov    $0x1,%edi
lea    0xc93(%rip),%rsi
call   1090 <err@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    0x2c28(%rip),%rax
mov    (%rax),%esi
mov    0x2c37(%rip),%rax
or     (%rax),%esi
mov    0x2bc6(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   10d0 <open@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
jne    13f3 <main+0x1f3>
mov    $0x1,%edi
lea    0xc49(%rip),%rsi
call   1090 <err@plt>
mov    -0x20(%rbp),%edi
lea    -0x28(%rbp),%rsi
call   10b0 <tcgetattr@plt>
lea    -0x28(%rbp),%rdi
call   10a0 <cfmakeraw@plt>
mov    -0x14(%rbp),%esi
lea    -0x28(%rbp),%rdi
call   1040 <cfsetospeed@plt>
mov    -0x14(%rbp),%esi
lea    -0x28(%rbp),%rdi
call   10e0 <cfsetispeed@plt>
mov    -0x20(%rbp),%edi
mov    0x2b9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ba5(%rip),%rax
or     (%rax),%esi
lea    -0x28(%rbp),%rdx
call   10c0 <tcsetattr@plt>
cmp    $0xffffffff,%eax
jne    1458 <main+0x258>
mov    $0x1,%edi
lea    0xbe9(%rip),%rsi
call   1090 <err@plt>
mov    -0x20(%rbp),%edi
mov    0x2b3e(%rip),%rax
mov    (%rax),%esi
call   1050 <tcflush@plt>
movl   $0x0,-0x18(%rbp)
jmp    1475 <main+0x275>
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%edi
mov    0x2b25(%rip),%rax
mov    (%rax),%edx
call   1060 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    14b7 <main+0x2b7>
mov    -0x48(%rbp),%rsi
mov    -0x24(%rbp),%edi
mov    -0x1c(%rbp),%edx
call   1030 <write@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    $0x3e8,%edi
call   1120 <usleep@plt>
mov    -0x48(%rbp),%rdi
mov    0x2adc(%rip),%rax
mov    (%rax),%esi
call   10f0 <bzero@plt>
mov    -0x18(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
call   1110 <spinner@plt>
jmp    1470 <main+0x270>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
mov    0x2d8d(%rip),%r15
mov    (%r15),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
cmp    $0x4,%edi
jne    126c <main+0x6c>
mov    %rsi,%r12
mov    0x8(%rsi),%rdi
call   1100 <atoi@plt>
lea    0xde1(%rip),%rsi
cmp    $0x707f,%eax
jle    1298 <main+0x98>
cmp    $0xe0ff,%eax
jle    12af <main+0xaf>
cmp    $0xe100,%eax
je     12cd <main+0xcd>
cmp    $0x38400,%eax
je     12cd <main+0xcd>
cmp    $0x1c200,%eax
je     12cd <main+0xcd>
jmp    1273 <main+0x73>
lea    0xd8d(%rip),%rsi
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
call   1080 <fprintf@plt>
mov    %rbx,%rsp
mov    $0x1,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x383f,%eax
jg     12bf <main+0xbf>
cmp    $0x12c0,%eax
je     12cd <main+0xcd>
cmp    $0x2580,%eax
je     12cd <main+0xcd>
jmp    1273 <main+0x73>
cmp    $0x7080,%eax
je     12cd <main+0xcd>
cmp    $0x9600,%eax
je     12cd <main+0xcd>
jmp    1273 <main+0x73>
cmp    $0x3840,%eax
je     12cd <main+0xcd>
cmp    $0x4b00,%eax
jne    1273 <main+0x73>
mov    %eax,-0x2c(%rbp)
mov    0x2d09(%rip),%rbx
mov    0x2cf2(%rip),%rax
mov    (%rax),%esi
or     (%rbx),%esi
mov    0x10(%r12),%rdi
mov    0x2cca(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   10d0 <open@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
jne    1313 <main+0x113>
lea    0xd2e(%rip),%rsi
mov    $0x1,%edi
call   1090 <err@plt>
mov    0x2cde(%rip),%rax
mov    (%rax),%esi
or     (%rbx),%esi
mov    0x18(%r12),%rdi
mov    0x2c66(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   10d0 <open@plt>
mov    %eax,-0x30(%rbp)
cmp    $0xffffffff,%eax
jne    134f <main+0x14f>
lea    0xcf2(%rip),%rsi
mov    $0x1,%edi
call   1090 <err@plt>
lea    -0x38(%rbp),%r12
mov    %r14d,%edi
mov    %r12,%rsi
call   10b0 <tcgetattr@plt>
mov    %r12,%rdi
call   10a0 <cfmakeraw@plt>
mov    %r12,%rdi
mov    -0x2c(%rbp),%ebx
mov    %ebx,%esi
call   1040 <cfsetospeed@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   10e0 <cfsetispeed@plt>
mov    0x2c44(%rip),%rax
mov    0x2c4d(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %r14d,%edi
mov    %r12,%rdx
call   10c0 <tcsetattr@plt>
cmp    $0xffffffff,%eax
jne    13b0 <main+0x1b0>
lea    0xc96(%rip),%rsi
mov    $0x1,%edi
call   1090 <err@plt>
mov    0x2be9(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   1050 <tcflush@plt>
xor    %ebx,%ebx
jmp    13f9 <main+0x1f9>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x3e8,%edi
call   1120 <usleep@plt>
mov    (%r15),%esi
mov    %r13,%rdi
call   10f0 <bzero@plt>
mov    %r15,%r12
lea    0x1(%rbx),%r15d
mov    %ebx,%edi
call   1110 <spinner@plt>
mov    %r15d,%ebx
mov    %r12,%r15
mov    (%r15),%edx
mov    %r14d,%edi
mov    %r13,%rsi
call   1060 <read@plt>
test   %eax,%eax
jle    13d0 <main+0x1d0>
mov    -0x30(%rbp),%edi
mov    %r13,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1070 <assert@plt>
jmp    13d0 <main+0x1d0>

LLVM IR (-O0):
%struct.termios = type { i32 }
@BUFSIZ = global i32 0
@stderr = global i32 0
@.str = [40 x i8] c"usage: binlog <speed> <port> <logfile>\0A\00"
@.str.1 = [15 x i8] c"invalid speed\0A\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@O_NOCTTY = global i32 0
@.str.2 = [5 x i8] c"open\00"
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@TCSANOW = global i32 0
@TCSAFLUSH = global i32 0
@.str.3 = [10 x i8] c"tcsetattr\00"
@TCIOFLUSH = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.termios
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* @BUFSIZ
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %12
%18 = alloca i8, i64 %16
store i64 %16, i64* %13
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 4
br i1 %20, label %21, label %24
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %14
br label %101
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %6
%29 = load i32, i32* %6
switch i32 %29, label %31 [
i32 230400, label %30
i32 115200, label %30
i32 57600, label %30
i32 38400, label %30
i32 28800, label %30
i32 19200, label %30
i32 14400, label %30
i32 9600, label %30
i32 4800, label %30
]
30: ; preds = %24, %24, %24, %24, %24, %24, %24, %24, %24
br label %34
31: ; preds = %24
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %14
br label %101
34: ; preds = %30
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = load i32, i32* @O_RDWR
%39 = load i32, i32* @O_NONBLOCK
%40 = or i32 %38, %39
%41 = load i32, i32* @O_NOCTTY
%42 = or i32 %40, %41
%43 = call i32 @open(i8* %37, i32 %42, i32 420)
store i32 %43, i32* %9
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %47
45: ; preds = %34
%46 = call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45, %34
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 3
%50 = load i8*, i8** %49
%51 = load i32, i32* @O_RDWR
%52 = load i32, i32* @O_CREAT
%53 = or i32 %51, %52
%54 = load i32, i32* @O_APPEND
%55 = or i32 %53, %54
%56 = call i32 @open(i8* %50, i32 %55, i32 420)
store i32 %56, i32* %10
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %60
58: ; preds = %47
%59 = call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %60
60: ; preds = %58, %47
%61 = load i32, i32* %9
%62 = call i32 @tcgetattr(i32 %61, %struct.termios* %11)
%63 = call i32 @cfmakeraw(%struct.termios* %11)
%64 = load i32, i32* %6
%65 = call i32 @cfsetospeed(%struct.termios* %11, i32 %64)
%66 = load i32, i32* %6
%67 = call i32 @cfsetispeed(%struct.termios* %11, i32 %66)
%68 = load i32, i32* %9
%69 = load i32, i32* @TCSANOW
%70 = load i32, i32* @TCSAFLUSH
%71 = or i32 %69, %70
%72 = call i32 @tcsetattr(i32 %68, i32 %71, %struct.termios* %11)
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %76
74: ; preds = %60
%75 = call i32 @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %76
76: ; preds = %74, %60
%77 = load i32, i32* %9
%78 = load i32, i32* @TCIOFLUSH
%79 = call i32 @tcflush(i32 %77, i32 %78)
store i32 0, i32* %7
br label %80
80: ; preds = %94, %76
br label %81
81: ; preds = %80
%82 = load i32, i32* %9
%83 = load i32, i32* @BUFSIZ
%84 = call i32 @read(i32 %82, i8* %18, i32 %83)
store i32 %84, i32* %8
%85 = load i32, i32* %8
%86 = icmp sgt i32 %85, 0
br i1 %86, label %87, label %94
87: ; preds = %81
%88 = load i32, i32* %10
%89 = load i32, i32* %8
%90 = call i64 @write(i32 %88, i8* %18, i32 %89)
%91 = icmp sgt i64 %90, 0
%92 = zext i1 %91 to i32
%93 = call i32 @assert(i32 %92)
br label %94
94: ; preds = %87, %81
%95 = call i32 @usleep(i32 1000)
%96 = load i32, i32* @BUFSIZ
%97 = call i32 @bzero(i8* %18, i32 %96)
%98 = load i32, i32* %7
%99 = add nsw i32 %98, 1
store i32 %99, i32* %7
%100 = call i32 @spinner(i32 %98)
br label %80
101: ; preds = %31, %21
%102 = load i8*, i8** %12
%103 = load i32, i32* %3
ret i32 %103
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@BUFSIZ = global i32 0
@stderr = global i32 0
@.str = [40 x i8] c"usage: binlog <speed> <port> <logfile>\0A\00"
@.str.1 = [15 x i8] c"invalid speed\0A\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@O_NOCTTY = global i32 0
@.str.2 = [5 x i8] c"open\00"
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@TCSANOW = global i32 0
@TCSAFLUSH = global i32 0
@.str.3 = [10 x i8] c"tcsetattr\00"
@TCIOFLUSH = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.termios
%4 = bitcast %struct.termios* %3 to i8*
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i8, i64 %6
%9 = icmp eq i32 %0, 4
br i1 %9, label %10, label %69
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
switch i32 %13, label %69 [
i32 230400, label %14
i32 115200, label %14
i32 57600, label %14
i32 38400, label %14
i32 28800, label %14
i32 19200, label %14
i32 14400, label %14
i32 9600, label %14
i32 4800, label %14
]
14: ; preds = %10, %10, %10, %10, %10, %10, %10, %10, %10
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = load i32, i32* @O_RDWR
%18 = load i32, i32* @O_NONBLOCK
%19 = or i32 %18, %17
%20 = load i32, i32* @O_NOCTTY
%21 = or i32 %19, %20
%22 = tail call i32 @open(i8* %16, i32 %21, i32 420)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %26
24: ; preds = %14
%25 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %14
%27 = getelementptr inbounds i8*, i8** %1, i64 3
%28 = load i8*, i8** %27
%29 = load i32, i32* @O_RDWR
%30 = load i32, i32* @O_CREAT
%31 = or i32 %30, %29
%32 = load i32, i32* @O_APPEND
%33 = or i32 %31, %32
%34 = tail call i32 @open(i8* %28, i32 %33, i32 420)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %38
36: ; preds = %26
%37 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %36, %26
%39 = call i32 @tcgetattr(i32 %22, %struct.termios* %3)
%40 = call i32 @cfmakeraw(%struct.termios* %3)
%41 = call i32 @cfsetospeed(%struct.termios* %3, i32 %13)
%42 = call i32 @cfsetispeed(%struct.termios* %3, i32 %13)
%43 = load i32, i32* @TCSANOW
%44 = load i32, i32* @TCSAFLUSH
%45 = or i32 %44, %43
%46 = call i32 @tcsetattr(i32 %22, i32 %45, %struct.termios* %3)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %50
48: ; preds = %38
%49 = call i32 @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %48, %38
%51 = load i32, i32* @TCIOFLUSH
%52 = call i32 @tcflush(i32 %22, i32 %51)
br label %53
53: ; preds = %63, %50
%54 = phi i32 [ 0, %50 ], [ %67, %63 ]
%55 = load i32, i32* @BUFSIZ
%56 = call i32 @read(i32 %22, i8* %8, i32 %55)
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %63
58: ; preds = %53
%59 = call i64 @write(i32 %34, i8* %8, i32 %56)
%60 = icmp sgt i64 %59, 0
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
br label %63
63: ; preds = %58, %53
%64 = call i32 @usleep(i32 1000)
%65 = load i32, i32* @BUFSIZ
%66 = call i32 @bzero(i8* %8, i32 %65)
%67 = add nuw nsw i32 %54, 1
%68 = call i32 @spinner(i32 %54)
br label %53
69: ; preds = %10, %2
%70 = phi i8* [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %10 ]
%71 = load i32, i32* @stderr
%72 = tail call i32 @fprintf(i32 %71, i8* %70)
tail call void @llvm.stackrestore(i8* %7)
ret i32 1
}