#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 const);
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strncpy(char *, char *, int const);
scalar_t__ strstr(char *, char *);
int write(int, char *, int);
int main(int argc, char **argv) {
  int i, percent = -1;
  int newline = 0;
  const int max_prefix_len = 512;
  char prefix[max_prefix_len];
  unsigned cnt = 0, blk_size = 1024 * 1024, blk_cnt = 0, size = 0;
  ssize_t r;
  char buf[1024 * 1024];
  argv++;
  argc--;
  memset(prefix, '\0', max_prefix_len);
  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), max_prefix_len - 1);
  }
  if (!size) {
    fprintf(stderr, "no size in MB set\n");
    return 1;
  }
  fprintf(stderr, "      ");
  while ((r = read(0, buf, sizeof buf)) > 0) {
    ssize_t p = 0;
    ssize_t w = 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   $0x200,-0x20(%rbp)
mov    %rsp,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x100000,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    -0x100250(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1255 <main+0xd5>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdef(%rip),%rsi
call   10a0 <strstr@plt>
cmp    $0x0,%rax
je     1255 <main+0xd5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1240 <main+0xc0>
mov    -0x14(%rbp),%eax
mov    %eax,-0x38(%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    129c <main+0x11c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd96(%rip),%rsi
call   10a0 <strstr@plt>
cmp    $0x0,%rax
je     129c <main+0x11c>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x100250(%rbp),%rdi
mov    $0x1ff,%edx
call   1030 <strncpy@plt>
cmpl   $0x0,-0x38(%rbp)
jne    12d3 <main+0x153>
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
lea    0xd50(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x100044(%rbp)
jmp    147d <main+0x2fd>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
lea    0xd36(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x100040(%rbp),%rsi
xor    %edi,%edi
mov    $0x100000,%edx
call   1060 <read@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
jle    145e <main+0x2de>
movl   $0x0,-0x100048(%rbp)
movl   $0x0,-0x10004c(%rbp)
lea    -0x100040(%rbp),%rsi
movslq -0x100048(%rbp),%rax
add    %rax,%rsi
mov    -0x3c(%rbp),%edx
sub    -0x100048(%rbp),%edx
mov    $0x1,%edi
call   1040 <write@plt>
mov    %eax,-0x10004c(%rbp)
cmp    $0x0,%eax
jl     137b <main+0x1fb>
mov    -0x10004c(%rbp),%eax
add    -0x100048(%rbp),%eax
mov    %eax,-0x100048(%rbp)
mov    -0x100048(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jl     1376 <main+0x1f6>
jmp    137b <main+0x1fb>
jmp    131d <main+0x19d>
mov    -0x100048(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    13b7 <main+0x237>
mov    0x2c4f(%rip),%rax
mov    (%rax),%edi
lea    0xc86(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x100044(%rbp)
jmp    147d <main+0x2fd>
mov    -0x3c(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jb     1459 <main+0x2d9>
mov    -0x2c(%rbp),%eax
xor    %edx,%edx
divl   -0x30(%rbp)
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x2c(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x64,-0x34(%rbp),%eax
xor    %edx,%edx
divl   -0x38(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1454 <main+0x2d4>
cmpl   $0x0,-0x1c(%rbp)
je     1435 <main+0x2b5>
mov    0x2bca(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%ecx
lea    0xc0b(%rip),%rsi
lea    -0x100250(%rbp),%rdx
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    144f <main+0x2cf>
mov    0x2ba4(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xbf0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1454 <main+0x2d4>
jmp    1459 <main+0x2d9>
jmp    12ea <main+0x16a>
mov    0x2b73(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x100044(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
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   1050 <memset@plt>
cmp    $0x3,%ebp
jl     1351 <main+0x1d1>
lea    0x8(%rbx),%r14
mov    (%r14),%rdi
lea    0xe3a(%rip),%rsi
call   10a0 <strstr@plt>
test   %rax,%rax
je     11e9 <main+0x69>
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,0x8(%rsp)
add    $0x18,%rbx
add    $0xfffffffd,%ebp
mov    %rbx,%r14
jmp    11ec <main+0x6c>
add    $0xffffffff,%ebp
mov    $0x1,%al
mov    %eax,0xc(%rsp)
cmp    $0x2,%ebp
jne    1226 <main+0xa6>
mov    (%r14),%rdi
lea    0xe02(%rip),%rsi
call   10a0 <strstr@plt>
test   %rax,%rax
je     1226 <main+0xa6>
mov    0x8(%r14),%rsi
lea    0x10(%rsp),%rdi
mov    $0x1ff,%edx
call   1030 <strncpy@plt>
movl   $0x0,0xc(%rsp)
cmpl   $0x0,0x8(%rsp)
je     1351 <main+0x1d1>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
lea    0xdd8(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x210(%rsp),%rsi
xor    %edi,%edi
mov    $0x100000,%edx
call   1060 <read@plt>
test   %eax,%eax
jle    136f <main+0x1ef>
mov    %eax,%ebp
mov    $0xffffffff,%r12d
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    12ad <main+0x12d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12d,%ebx
mov    %r13d,%r14d
mov    %ebp,%r15d
xor    %edi,%edi
lea    0x210(%rsp),%rsi
mov    $0x100000,%edx
call   1060 <read@plt>
mov    %eax,%ebp
mov    %r14d,%r13d
mov    %ebx,%r12d
test   %eax,%eax
jle    136f <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     12d6 <main+0x156>
add    %eax,%ebx
cmp    %ebp,%ebx
jl     12b0 <main+0x130>
cmp    %ebp,%ebx
jl     1391 <main+0x211>
add    %r15d,%ebp
cmp    $0x100000,%ebp
jb     1280 <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    1310 <main+0x190>
mov    %r12d,%ebx
jmp    1286 <main+0x106>
mov    %eax,%ebx
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
cmpb   $0x0,0xc(%rsp)
je     1337 <main+0x1b7>
lea    0xd0f(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1286 <main+0x106>
lea    0xcef(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1286 <main+0x106>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
lea    0xca5(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%eax
jmp    137f <main+0x1ff>
mov    0x2c62(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
xor    %eax,%eax
add    $0x100218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c48(%rip),%rax
mov    (%rax),%edi
lea    0xc7f(%rip),%rsi
jmp    1361 <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 i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca [1048576 x i8]
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
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 512, i32* %9
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %10
%21 = alloca i8, i64 512
store i32 0, i32* %11
store i32 1048576, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i32 1
store i8** %23, i8*** %5
%24 = load i32, i32* %4
%25 = add nsw i32 %24, -1
store i32 %25, i32* %4
%26 = call i32 @memset(i8* %21, i8 signext 0, i32 512)
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 1
br i1 %28, label %29, label %48
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = load i8*, i8** %30
%32 = call i64 @strstr(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %48
34: ; preds = %29
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %34
%42 = load i32, i32* %6
store i32 %42, i32* %14
br label %43
43: ; preds = %41, %34
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
store i8** %45, i8*** %5
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, 2
store i32 %47, i32* %4
br label %48
48: ; preds = %43, %29, %2
%49 = load i32, i32* %4
%50 = icmp eq i32 %49, 2
br i1 %50, label %51, label %61
51: ; preds = %48
%52 = load i8**, i8*** %5
%53 = load i8*, i8** %52
%54 = call i64 @strstr(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %61
56: ; preds = %51
store i32 1, i32* %8
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 1
%59 = load i8*, i8** %58
%60 = call i32 @strncpy(i8* %21, i8* %59, i32 511)
br label %61
61: ; preds = %56, %51, %48
%62 = load i32, i32* %14
%63 = icmp ne i32 %62, 0
br i1 %63, label %67, label %64
64: ; preds = %61
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %17
br label %142
67: ; preds = %61
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %70
70: ; preds = %138, %67
%71 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %16, i64 0, i64 0
%72 = call i32 @read(i32 0, i8* %71, i32 1048576)
store i32 %72, i32* %15
%73 = icmp sgt i32 %72, 0
br i1 %73, label %74, label %139
74: ; preds = %70
store i32 0, i32* %18
store i32 0, i32* %19
br label %75
75: ; preds = %93, %74
%76 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %16, i64 0, i64 0
%77 = load i32, i32* %18
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %76, i64 %78
%80 = load i32, i32* %15
%81 = load i32, i32* %18
%82 = sub nsw i32 %80, %81
%83 = call i32 @write(i32 1, i8* %79, i32 %82)
store i32 %83, i32* %19
%84 = icmp sge i32 %83, 0
br i1 %84, label %85, label %94
85: ; preds = %75
%86 = load i32, i32* %19
%87 = load i32, i32* %18
%88 = add nsw i32 %87, %86
store i32 %88, i32* %18
%89 = load i32, i32* %18
%90 = load i32, i32* %15
%91 = icmp sge i32 %89, %90
br i1 %91, label %92, label %93
92: ; preds = %85
br label %94
93: ; preds = %85
br label %75
94: ; preds = %92, %75
%95 = load i32, i32* %18
%96 = load i32, i32* %15
%97 = icmp slt i32 %95, %96
br i1 %97, label %98, label %101
98: ; preds = %94
%99 = load i32, i32* @stderr
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %17
br label %142
101: ; preds = %94
%102 = load i32, i32* %15
%103 = load i32, i32* %11
%104 = add i32 %103, %102
store i32 %104, i32* %11
%105 = load i32, i32* %11
%106 = load i32, i32* %12
%107 = icmp uge i32 %105, %106
br i1 %107, label %108, label %138
108: ; preds = %101
%109 = load i32, i32* %11
%110 = load i32, i32* %12
%111 = udiv i32 %109, %110
%112 = load i32, i32* %13
%113 = add i32 %112, %111
store i32 %113, i32* %13
%114 = load i32, i32* %12
%115 = load i32, i32* %11
%116 = urem i32 %115, %114
store i32 %116, i32* %11
%117 = load i32, i32* %7
store i32 %117, i32* %6
%118 = load i32, i32* %13
%119 = mul i32 %118, 100
%120 = load i32, i32* %14
%121 = udiv i32 %119, %120
store i32 %121, i32* %7
%122 = load i32, i32* %7
%123 = load i32, i32* %6
%124 = icmp ne i32 %122, %123
br i1 %124, label %125, label %137
125: ; preds = %108
%126 = load i32, i32* %8
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %132
128: ; preds = %125
%129 = load i32, i32* @stderr
%130 = load i32, i32* %7
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %129, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %21, i32 %130)
br label %136
132: ; preds = %125
%133 = load i32, i32* @stderr
%134 = load i32, i32* %7
%135 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %134)
br label %136
136: ; preds = %132, %128
br label %137
137: ; preds = %136, %108
br label %138
138: ; preds = %137, %101
br label %70
139: ; preds = %70
%140 = load i32, i32* @stdout
%141 = call i32 @fflush(i32 %140)
store i32 0, i32* %3
store i32 1, i32* %17
br label %142
142: ; preds = %139, %98, %64
%143 = load i8*, i8** %10
%144 = load i32, i32* %3
ret i32 %144
}

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 [1048576 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, 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 %37
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 [ %20, %15 ], [ %11, %10 ]
%24 = phi i32 [ %18, %15 ], [ 0, %10 ]
%25 = icmp eq i32 %23, 2
br i1 %25, label %26, label %34
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 %34, label %30
30: ; preds = %26
%31 = getelementptr inbounds i8*, i8** %22, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @strncpy(i8* %5, i8* %32, i32 511)
br label %34
34: ; preds = %30, %26, %21
%35 = phi i1 [ false, %30 ], [ true, %26 ], [ true, %21 ]
%36 = icmp eq i32 %24, 0
br i1 %36, label %37, label %40
37: ; preds = %2, %34
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %91
40: ; preds = %34
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%43 = call i32 @read(i32 0, i8* %6, i32 1048576)
%44 = icmp sgt i32 %43, 0
br i1 %44, label %45, label %88
45: ; preds = %40, %82
%46 = phi i32 [ %86, %82 ], [ %43, %40 ]
%47 = phi i32 [ %85, %82 ], [ 0, %40 ]
%48 = phi i32 [ %84, %82 ], [ 0, %40 ]
%49 = phi i32 [ %83, %82 ], [ -1, %40 ]
br label %50
50: ; preds = %45, %57
%51 = phi i32 [ %58, %57 ], [ 0, %45 ]
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %52
%54 = sub nsw i32 %46, %51
%55 = call i32 @write(i32 1, i8* %53, i32 %54)
%56 = icmp sgt i32 %55, -1
br i1 %56, label %57, label %60
57: ; preds = %50
%58 = add nsw i32 %55, %51
%59 = icmp slt i32 %58, %46
br i1 %59, label %50, label %60
60: ; preds = %57, %50
%61 = phi i32 [ %58, %57 ], [ %51, %50 ]
%62 = icmp slt i32 %61, %46
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i32, i32* @stderr
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %91
66: ; preds = %60
%67 = add i32 %46, %48
%68 = icmp ugt i32 %67, 1048575
br i1 %68, label %69, label %82
69: ; preds = %66
%70 = lshr i32 %67, 20
%71 = add i32 %70, %47
%72 = and i32 %67, 1048575
%73 = mul i32 %71, 100
%74 = udiv i32 %73, %24
%75 = icmp eq i32 %74, %49
br i1 %75, label %82, label %76
76: ; preds = %69
%77 = load i32, i32* @stderr
br i1 %35, label %80, label %78
78: ; preds = %76
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %5, i32 %74)
br label %82
80: ; preds = %76
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %74)
br label %82
82: ; preds = %66, %78, %80, %69
%83 = phi i32 [ %74, %78 ], [ %74, %80 ], [ %49, %69 ], [ %49, %66 ]
%84 = phi i32 [ %72, %78 ], [ %72, %80 ], [ %72, %69 ], [ %67, %66 ]
%85 = phi i32 [ %71, %78 ], [ %71, %80 ], [ %71, %69 ], [ %47, %66 ]
%86 = call i32 @read(i32 0, i8* %6, i32 1048576)
%87 = icmp sgt i32 %86, 0
br i1 %87, label %45, label %88
88: ; preds = %82, %40
%89 = load i32, i32* @stdout
%90 = call i32 @fflush(i32 %89)
br label %91
91: ; preds = %63, %88, %37
%92 = phi i32 [ 0, %88 ], [ 1, %37 ], [ 1, %63 ]
ret i32 %92
}