#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 ssize_t;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ memset(char *, char, int);
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int /*<<< orphan*/);
scalar_t__ strstr(char *, char *);
int write(int, char *, int);
int main(int argc, char **argv) {
  int i, percent = -1;
  int newline = 0;
  char prefix[512];
  unsigned cnt = 0, blk_size = 1024 * 1024, blk_cnt = 0, size = 0;
  ssize_t r, w, p;
  char buf[1024 * 1024];
  argv++;
  argc--;
  memset(prefix, '\0', 512);
  if (argc > 1 && strstr(*argv, "-s")) {
    i = atoi(argv[1]);
    if (i) {
      size = i;
    }
    argv += 2;
    argc -= 2;
  }
  if (argc == 2 && strstr(*argv, "-l")) {
    newline = 1;
    strncpy(prefix, *(argv + 1), strlen(*(argv + 1)));
    argv += 2;
    argc -= 2;
  }
  if (!size) {
    fprintf(stderr, "no size in MB set\n");
    return 1;
  }
  fprintf(stderr, "      ");
  while ((r = read(0, buf, sizeof buf)) > 0) {
    p = 0;
    while ((w = write(1, buf + p, r - p)) >= 0) {
      p += w;
      if (p >= r) {
        break;
      }
    }
    if (p < r) {
      fprintf(stderr, "write error\n");
      return 1;
    }
    cnt += r;
    if (cnt >= blk_size) {
      blk_cnt += cnt / blk_size;
      cnt %= blk_size;
      i = percent;
      percent = (blk_cnt * 100) / size;
      if (percent != i) {
        if (newline) {
          fprintf(stderr, "%s(%3d%%)\n", prefix, percent);
        } else {
          fprintf(stderr, "\x08\x08\x08\x08\x08\x08(%3d%%)", percent);
        }
      }
    }
  }
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100250,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x224(%rbp)
movl   $0x100000,-0x228(%rbp)
movl   $0x0,-0x22c(%rbp)
movl   $0x0,-0x230(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    -0x220(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1060 <memset@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1266 <main+0xd6>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xde1(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     1266 <main+0xd6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1251 <main+0xc1>
mov    -0x14(%rbp),%eax
mov    %eax,-0x230(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    12e8 <main+0x158>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd85(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     12e8 <main+0x158>
movl   $0x1,-0x1c(%rbp)
lea    -0x220(%rbp),%rax
mov    %rax,-0x100250(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x100248(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <strlen@plt>
mov    -0x100250(%rbp),%rdi
mov    -0x100248(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x230(%rbp)
jne    1318 <main+0x188>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
lea    0xd01(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14da <main+0x34a>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    -0x100240(%rbp),%rsi
xor    %edi,%edi
mov    $0x100000,%edx
call   1070 <read@plt>
mov    %eax,-0x234(%rbp)
cmp    $0x0,%eax
jle    14c5 <main+0x335>
movl   $0x0,-0x23c(%rbp)
lea    -0x100240(%rbp),%rsi
movslq -0x23c(%rbp),%rax
add    %rax,%rsi
mov    -0x234(%rbp),%edx
sub    -0x23c(%rbp),%edx
mov    $0x1,%edi
call   1040 <write@plt>
mov    %eax,-0x238(%rbp)
cmp    $0x0,%eax
jl     13bf <main+0x22f>
mov    -0x238(%rbp),%eax
add    -0x23c(%rbp),%eax
mov    %eax,-0x23c(%rbp)
mov    -0x23c(%rbp),%eax
cmp    -0x234(%rbp),%eax
jl     13ba <main+0x22a>
jmp    13bf <main+0x22f>
jmp    135b <main+0x1cb>
mov    -0x23c(%rbp),%eax
cmp    -0x234(%rbp),%eax
jge    13f4 <main+0x264>
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
lea    0xc3f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14da <main+0x34a>
mov    -0x234(%rbp),%eax
add    -0x224(%rbp),%eax
mov    %eax,-0x224(%rbp)
mov    -0x224(%rbp),%eax
cmp    -0x228(%rbp),%eax
jb     14c0 <main+0x330>
mov    -0x224(%rbp),%eax
xor    %edx,%edx
divl   -0x228(%rbp)
add    -0x22c(%rbp),%eax
mov    %eax,-0x22c(%rbp)
mov    -0x228(%rbp),%ecx
mov    -0x224(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,-0x224(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x64,-0x22c(%rbp),%eax
xor    %edx,%edx
divl   -0x230(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     14bb <main+0x32b>
cmpl   $0x0,-0x1c(%rbp)
je     149c <main+0x30c>
mov    0x2b63(%rip),%rax
mov    (%rax),%edi
lea    -0x220(%rbp),%rdx
mov    -0x18(%rbp),%ecx
lea    0xb9d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    14b6 <main+0x326>
mov    0x2b3d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xb89(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    14bb <main+0x32b>
jmp    14c0 <main+0x330>
jmp    132f <main+0x19f>
mov    0x2b0c(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x100218,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x10(%rsp),%rdi
movl   $0x0,0x8(%rsp)
xor    %esi,%esi
mov    $0x200,%edx
call   1060 <memset@plt>
cmp    $0x3,%ebp
jl     1361 <main+0x1d1>
lea    0x8(%rbx),%r14
mov    (%r14),%rdi
lea    0xe2a(%rip),%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     11f9 <main+0x69>
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,0x8(%rsp)
add    $0x18,%rbx
add    $0xfffffffd,%ebp
mov    %rbx,%r14
jmp    11fc <main+0x6c>
add    $0xffffffff,%ebp
mov    $0x1,%al
mov    %eax,0xc(%rsp)
cmp    $0x2,%ebp
jne    123e <main+0xae>
mov    (%r14),%rdi
lea    0xdf2(%rip),%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     123e <main+0xae>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
movl   $0x0,0xc(%rsp)
cmpl   $0x0,0x8(%rsp)
je     1361 <main+0x1d1>
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
lea    0xdc0(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x210(%rsp),%rsi
xor    %edi,%edi
mov    $0x100000,%edx
call   1070 <read@plt>
test   %eax,%eax
jle    137f <main+0x1ef>
mov    %eax,%ebp
mov    $0xffffffff,%r12d
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    12bd <main+0x12d>
nopl   0x0(%rax)
mov    %r12d,%ebx
mov    %r13d,%r14d
mov    %ebp,%r15d
xor    %edi,%edi
lea    0x210(%rsp),%rsi
mov    $0x100000,%edx
call   1070 <read@plt>
mov    %eax,%ebp
mov    %r14d,%r13d
mov    %ebx,%r12d
test   %eax,%eax
jle    137f <main+0x1ef>
xor    %ebx,%ebx
nop
movslq %ebx,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x210,%rsi
mov    %ebp,%edx
sub    %eax,%edx
mov    $0x1,%edi
call   1040 <write@plt>
test   %eax,%eax
js     12e6 <main+0x156>
add    %eax,%ebx
cmp    %ebp,%ebx
jl     12c0 <main+0x130>
cmp    %ebp,%ebx
jl     13a1 <main+0x211>
add    %r15d,%ebp
cmp    $0x100000,%ebp
jb     1290 <main+0x100>
mov    %ebp,%r14d
shr    $0x14,%r14d
add    %r13d,%r14d
and    $0xfffff,%ebp
imul   $0x64,%r14d,%eax
xor    %edx,%edx
divl   0x8(%rsp)
cmp    %r12d,%eax
jne    1320 <main+0x190>
mov    %r12d,%ebx
jmp    1296 <main+0x106>
mov    %eax,%ebx
mov    0x2cb7(%rip),%rax
mov    (%rax),%edi
cmpb   $0x0,0xc(%rsp)
je     1347 <main+0x1b7>
lea    0xcff(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1296 <main+0x106>
lea    0xcdf(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1296 <main+0x106>
mov    0x2c78(%rip),%rax
mov    (%rax),%edi
lea    0xc95(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%eax
jmp    138f <main+0x1ff>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
xor    %eax,%eax
add    $0x100218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
lea    0xc6f(%rip),%rsi
jmp    1371 <main+0x1e1>

LLVM IR (-O0):
@.str = [3 x i8] c"-s\00"
@.str.1 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.2 = [19 x i8] c"no size in MB set\0A\00"
@.str.3 = [7 x i8] c" \00"
@.str.4 = [13 x i8] c"write error\0A\00"
@.str.5 = [11 x i8] c"%s(%3d%%)\0A\00"
@.str.6 = [14 x i8] c"\08\08\08\08\08\08(%3d%%)\00"
@stdout = 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 [512 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [1048576 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %7
store i32 0, i32* %8
store i32 0, i32* %10
store i32 1048576, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %5
%20 = load i32, i32* %4
%21 = add nsw i32 %20, -1
store i32 %21, i32* %4
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%23 = call i32 @memset(i8* %22, i8 signext 0, i32 512)
%24 = load i32, i32* %4
%25 = icmp sgt i32 %24, 1
br i1 %25, label %26, label %45
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = load i8*, i8** %27
%29 = call i64 @strstr(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %45
31: ; preds = %26
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %31
%39 = load i32, i32* %6
store i32 %39, i32* %13
br label %40
40: ; preds = %38, %31
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 2
store i8** %42, i8*** %5
%43 = load i32, i32* %4
%44 = sub nsw i32 %43, 2
store i32 %44, i32* %4
br label %45
45: ; preds = %40, %26, %2
%46 = load i32, i32* %4
%47 = icmp eq i32 %46, 2
br i1 %47, label %48, label %67
48: ; preds = %45
%49 = load i8**, i8*** %5
%50 = load i8*, i8** %49
%51 = call i64 @strstr(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %67
53: ; preds = %48
store i32 1, i32* %8
%54 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 1
%60 = load i8*, i8** %59
%61 = call i32 @strlen(i8* %60)
%62 = call i32 @strncpy(i8* %54, i8* %57, i32 %61)
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
store i8** %64, i8*** %5
%65 = load i32, i32* %4
%66 = sub nsw i32 %65, 2
store i32 %66, i32* %4
br label %67
67: ; preds = %53, %48, %45
%68 = load i32, i32* %13
%69 = icmp ne i32 %68, 0
br i1 %69, label %73, label %70
70: ; preds = %67
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %149
73: ; preds = %67
%74 = load i32, i32* @stderr
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %76
76: ; preds = %145, %73
%77 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %17, i64 0, i64 0
%78 = call i32 @read(i32 0, i8* %77, i32 1048576)
store i32 %78, i32* %14
%79 = icmp sgt i32 %78, 0
br i1 %79, label %80, label %146
80: ; preds = %76
store i32 0, i32* %16
br label %81
81: ; preds = %99, %80
%82 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %17, i64 0, i64 0
%83 = load i32, i32* %16
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = load i32, i32* %14
%87 = load i32, i32* %16
%88 = sub nsw i32 %86, %87
%89 = call i32 @write(i32 1, i8* %85, i32 %88)
store i32 %89, i32* %15
%90 = icmp sge i32 %89, 0
br i1 %90, label %91, label %100
91: ; preds = %81
%92 = load i32, i32* %15
%93 = load i32, i32* %16
%94 = add nsw i32 %93, %92
store i32 %94, i32* %16
%95 = load i32, i32* %16
%96 = load i32, i32* %14
%97 = icmp sge i32 %95, %96
br i1 %97, label %98, label %99
98: ; preds = %91
br label %100
99: ; preds = %91
br label %81
100: ; preds = %98, %81
%101 = load i32, i32* %16
%102 = load i32, i32* %14
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %107
104: ; preds = %100
%105 = load i32, i32* @stderr
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %149
107: ; preds = %100
%108 = load i32, i32* %14
%109 = load i32, i32* %10
%110 = add i32 %109, %108
store i32 %110, i32* %10
%111 = load i32, i32* %10
%112 = load i32, i32* %11
%113 = icmp uge i32 %111, %112
br i1 %113, label %114, label %145
114: ; preds = %107
%115 = load i32, i32* %10
%116 = load i32, i32* %11
%117 = udiv i32 %115, %116
%118 = load i32, i32* %12
%119 = add i32 %118, %117
store i32 %119, i32* %12
%120 = load i32, i32* %11
%121 = load i32, i32* %10
%122 = urem i32 %121, %120
store i32 %122, i32* %10
%123 = load i32, i32* %7
store i32 %123, i32* %6
%124 = load i32, i32* %12
%125 = mul i32 %124, 100
%126 = load i32, i32* %13
%127 = udiv i32 %125, %126
store i32 %127, i32* %7
%128 = load i32, i32* %7
%129 = load i32, i32* %6
%130 = icmp ne i32 %128, %129
br i1 %130, label %131, label %144
131: ; preds = %114
%132 = load i32, i32* %8
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %139
134: ; preds = %131
%135 = load i32, i32* @stderr
%136 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%137 = load i32, i32* %7
%138 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %136, i32 %137)
br label %143
139: ; preds = %131
%140 = load i32, i32* @stderr
%141 = load i32, i32* %7
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %140, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %141)
br label %143
143: ; preds = %139, %134
br label %144
144: ; preds = %143, %114
br label %145
145: ; preds = %144, %107
br label %76
146: ; preds = %76
%147 = load i32, i32* @stdout
%148 = call i32 @fflush(i32 %147)
store i32 0, i32* %3
br label %149
149: ; preds = %146, %104, %70
%150 = load i32, i32* %3
ret i32 %150
}

LLVM IR (-O2):
@.str = [3 x i8] c"-s\00"
@.str.1 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.2 = [19 x i8] c"no size in MB set\0A\00"
@.str.3 = [7 x i8] c" \00"
@.str.4 = [13 x i8] c"write error\0A\00"
@.str.5 = [11 x i8] c"%s(%3d%%)\0A\00"
@.str.6 = [14 x i8] c"\08\08\08\08\08\08(%3d%%)\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [1048576 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = call i32 @memset(i8* %5, i8 signext 0, i32 512)
%9 = icmp sgt i32 %0, 2
br i1 %9, label %10, label %38
10: ; preds = %2
%11 = add nsw i32 %0, -1
%12 = load i8*, i8** %7
%13 = call i64 @strstr(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %10
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = add nsw i32 %0, -3
br label %21
21: ; preds = %15, %10
%22 = phi i8** [ %19, %15 ], [ %7, %10 ]
%23 = phi i32 [ %18, %15 ], [ 0, %10 ]
%24 = phi i32 [ %20, %15 ], [ %11, %10 ]
%25 = icmp eq i32 %24, 2
br i1 %25, label %26, label %35
26: ; preds = %21
%27 = load i8*, i8** %22
%28 = call i64 @strstr(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %35, label %30
30: ; preds = %26
%31 = getelementptr inbounds i8*, i8** %22, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @strlen(i8* %32)
%34 = call i32 @strncpy(i8* %5, i8* %32, i32 %33)
br label %35
35: ; preds = %30, %26, %21
%36 = phi i1 [ false, %30 ], [ true, %26 ], [ true, %21 ]
%37 = icmp eq i32 %23, 0
br i1 %37, label %38, label %41
38: ; preds = %2, %35
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %92
41: ; preds = %35
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%44 = call i32 @read(i32 0, i8* %6, i32 1048576)
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %89
46: ; preds = %41, %83
%47 = phi i32 [ %87, %83 ], [ %44, %41 ]
%48 = phi i32 [ %86, %83 ], [ 0, %41 ]
%49 = phi i32 [ %85, %83 ], [ 0, %41 ]
%50 = phi i32 [ %84, %83 ], [ -1, %41 ]
br label %51
51: ; preds = %46, %58
%52 = phi i32 [ %59, %58 ], [ 0, %46 ]
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %4, i64 0, i64 %53
%55 = sub nsw i32 %47, %52
%56 = call i32 @write(i32 1, i8* %54, i32 %55)
%57 = icmp sgt i32 %56, -1
br i1 %57, label %58, label %61
58: ; preds = %51
%59 = add nsw i32 %56, %52
%60 = icmp slt i32 %59, %47
br i1 %60, label %51, label %61
61: ; preds = %58, %51
%62 = phi i32 [ %59, %58 ], [ %52, %51 ]
%63 = icmp slt i32 %62, %47
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %92
67: ; preds = %61
%68 = add i32 %47, %49
%69 = icmp ugt i32 %68, 1048575
br i1 %69, label %70, label %83
70: ; preds = %67
%71 = lshr i32 %68, 20
%72 = add i32 %71, %48
%73 = and i32 %68, 1048575
%74 = mul i32 %72, 100
%75 = udiv i32 %74, %23
%76 = icmp eq i32 %75, %50
br i1 %76, label %83, label %77
77: ; preds = %70
%78 = load i32, i32* @stderr
br i1 %36, label %81, label %79
79: ; preds = %77
%80 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %5, i32 %75)
br label %83
81: ; preds = %77
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %75)
br label %83
83: ; preds = %70, %81, %79, %67
%84 = phi i32 [ %75, %79 ], [ %75, %81 ], [ %50, %70 ], [ %50, %67 ]
%85 = phi i32 [ %73, %79 ], [ %73, %81 ], [ %73, %70 ], [ %68, %67 ]
%86 = phi i32 [ %72, %79 ], [ %72, %81 ], [ %72, %70 ], [ %48, %67 ]
%87 = call i32 @read(i32 0, i8* %6, i32 1048576)
%88 = icmp sgt i32 %87, 0
br i1 %88, label %46, label %89
89: ; preds = %83, %41
%90 = load i32, i32* @stdout
%91 = call i32 @fflush(i32 %90)
br label %92
92: ; preds = %89, %64, %38
%93 = phi i32 [ 1, %64 ], [ 0, %89 ], [ 1, %38 ]
ret i32 %93
}