#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 int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoll(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int random();
int main(int argc, char **argv) {
  char buf[1024 * 1024];
  FILE *fd;
  int64_t count = 0;
  int64_t tsize = 0;
  int64_t rsize = 0;
  int64_t i = 0, j = 0;
  int64_t wsize = 0;
  int64_t k = 0;
  int64_t t1 = 0;
  int64_t t2 = 0;
  int flag = 0;
  char g[10];
  int64_t gg = 0;
  int64_t n = 0;
  if (argc != 3) {
    printf("usage: ./pd filename filesize\n");
    return -1;
  }
  memset(buf, 0, 1024 * 1024);
  fd = fopen(argv[1], "wb");
  if (fd == NULL) {
    printf("open %s failed\n", argv[1]);
  }
  int ii = 0;
  for (; argv[2][ii] != 0; ii++) {
    printf("argv[2][%d] = %c\n", ii, argv[2][ii]);
  }
  printf("ii %d\n", ii);
  if (ii >= 10) {
    flag = 1;
    ii -= 9;
    for (n = 0; n < ii; n++) {
      g[n] = argv[2][n];
    }
    g[n] = 0;
    for (n = 0; n < 9; n++) {
      argv[2][n] = argv[2][n + ii];
    }
    argv[2][n] = 0;
  }
  printf("g %s\n", g);
  printf("argv[2] %s\n", argv[2]);
  gg = atoll(g);
  tsize = atoll(argv[2]);
  printf("gg %llu\n", gg);
  printf("tsize %llu\n", tsize);
  count = tsize / (1024 * 1024);
  rsize = tsize - count * 1024 * 1024;
  printf("tsize %llu  %llu gb %llu mb rsize %llu\n", tsize, gg, count, rsize);
  for (; gg > 0 && flag; gg--) {
    for (i = 0; i < 1024; i++) {
      memset(buf, 0, 1024 * 1024);
      for (j = 0; j < 1024 * 1024; j++) {
        buf[j] = (random() % 256);
      }
      k = 0;
      wsize = 0;
      while (wsize < 1024 * 1024) {
        k = fwrite(buf + wsize, 1, 1024 * 1024 - wsize, fd);
        wsize += k;
      }
    }
  }
  for (i = 0; i < count; i++) {
    memset(buf, 0, 1024 * 1024);
    for (j = 0; j < 1024 * 1024; j++) {
      buf[j] = (random() % 256);
    }
    k = 0;
    wsize = 0;
    while (wsize < 1024 * 1024) {
      k = fwrite(buf + wsize, 1, 1024 * 1024 - wsize, fd);
      wsize += k;
    }
  }
  memset(buf, 0, 1024 * 1024);
  for (j = 0; j < rsize; j++) {
    buf[j] = (random() % 256);
  }
  k = 0;
  wsize = 0;
  while (wsize < rsize) {
    k = fwrite(buf + wsize, 1, rsize - wsize, fd);
    wsize += k;
  }
  fclose(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100060,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x10001c(%rbp)
movl   $0x0,-0x100020(%rbp)
movl   $0x0,-0x100024(%rbp)
movl   $0x0,-0x100028(%rbp)
movl   $0x0,-0x10002c(%rbp)
movl   $0x0,-0x100030(%rbp)
movl   $0x0,-0x100034(%rbp)
movl   $0x0,-0x100038(%rbp)
movl   $0x0,-0x10003c(%rbp)
movl   $0x0,-0x100040(%rbp)
movl   $0x0,-0x100050(%rbp)
movl   $0x0,-0x100054(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1225 <main+0xb5>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    17e3 <main+0x673>
lea    -0x100010(%rbp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd8(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x100018(%rbp)
cmpq   $0x0,-0x100018(%rbp)
jne    1277 <main+0x107>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x100058(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x100058(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     12d8 <main+0x168>
mov    -0x100058(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x100058(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x100058(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100058(%rbp)
jmp    1281 <main+0x111>
mov    -0x100058(%rbp),%esi
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0xa,-0x100058(%rbp)
jl     13db <main+0x26b>
movl   $0x1,-0x100040(%rbp)
mov    -0x100058(%rbp),%eax
sub    $0x9,%eax
mov    %eax,-0x100058(%rbp)
movl   $0x0,-0x100054(%rbp)
mov    -0x100054(%rbp),%eax
cmp    -0x100058(%rbp),%eax
jge    1362 <main+0x1f2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x100054(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x100054(%rbp),%rax
mov    %cl,-0x10004a(%rbp,%rax,1)
mov    -0x100054(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100054(%rbp)
jmp    131c <main+0x1ac>
movslq -0x100054(%rbp),%rax
movb   $0x0,-0x10004a(%rbp,%rax,1)
movl   $0x0,-0x100054(%rbp)
cmpl   $0x9,-0x100054(%rbp)
jge    13c8 <main+0x258>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x100054(%rbp),%ecx
add    -0x100058(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x100054(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x100054(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100054(%rbp)
jmp    137b <main+0x20b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x100054(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
lea    -0x10004a(%rbp),%rsi
lea    0xc62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10004a(%rbp),%rdi
call   1060 <atoll@plt>
mov    %eax,-0x100050(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoll@plt>
mov    %eax,-0x100020(%rbp)
mov    -0x100050(%rbp),%esi
lea    0xc25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x100020(%rbp),%esi
lea    0xc1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x100020(%rbp),%eax
mov    $0x100000,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10001c(%rbp)
mov    -0x100020(%rbp),%eax
mov    -0x10001c(%rbp),%ecx
shl    $0xa,%ecx
shl    $0xa,%ecx
sub    %ecx,%eax
mov    %eax,-0x100024(%rbp)
mov    -0x100020(%rbp),%esi
mov    -0x100050(%rbp),%edx
mov    -0x10001c(%rbp),%ecx
mov    -0x100024(%rbp),%r8d
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x100050(%rbp)
mov    %al,-0x100059(%rbp)
jle    14cd <main+0x35d>
cmpl   $0x0,-0x100040(%rbp)
setne  %al
mov    %al,-0x100059(%rbp)
mov    -0x100059(%rbp),%al
test   $0x1,%al
jne    14e0 <main+0x370>
jmp    15fa <main+0x48a>
movl   $0x0,-0x100028(%rbp)
cmpl   $0x400,-0x100028(%rbp)
jge    15e1 <main+0x471>
lea    -0x100010(%rbp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1050 <memset@plt>
movl   $0x0,-0x10002c(%rbp)
cmpl   $0x100000,-0x10002c(%rbp)
jge    155a <main+0x3ea>
mov    $0x0,%al
call   1070 <random@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
movslq -0x10002c(%rbp),%rax
mov    %cl,-0x100010(%rbp,%rax,1)
mov    -0x10002c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10002c(%rbp)
jmp    1517 <main+0x3a7>
movl   $0x0,-0x100034(%rbp)
movl   $0x0,-0x100030(%rbp)
cmpl   $0x100000,-0x100030(%rbp)
jge    15c8 <main+0x458>
lea    -0x100010(%rbp),%rdi
movslq -0x100030(%rbp),%rax
add    %rax,%rdi
mov    $0x100000,%edx
sub    -0x100030(%rbp),%edx
mov    -0x100018(%rbp),%rcx
mov    $0x1,%esi
call   1090 <fwrite@plt>
mov    %eax,-0x100034(%rbp)
mov    -0x100034(%rbp),%eax
add    -0x100030(%rbp),%eax
mov    %eax,-0x100030(%rbp)
jmp    156e <main+0x3fe>
jmp    15cd <main+0x45d>
mov    -0x100028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100028(%rbp)
jmp    14ea <main+0x37a>
jmp    15e6 <main+0x476>
mov    -0x100050(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x100050(%rbp)
jmp    14a8 <main+0x338>
movl   $0x0,-0x100028(%rbp)
mov    -0x100028(%rbp),%eax
cmp    -0x10001c(%rbp),%eax
jge    16fd <main+0x58d>
lea    -0x100010(%rbp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1050 <memset@plt>
movl   $0x0,-0x10002c(%rbp)
cmpl   $0x100000,-0x10002c(%rbp)
jge    1676 <main+0x506>
mov    $0x0,%al
call   1070 <random@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
movslq -0x10002c(%rbp),%rax
mov    %cl,-0x100010(%rbp,%rax,1)
mov    -0x10002c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10002c(%rbp)
jmp    1633 <main+0x4c3>
movl   $0x0,-0x100034(%rbp)
movl   $0x0,-0x100030(%rbp)
cmpl   $0x100000,-0x100030(%rbp)
jge    16e4 <main+0x574>
lea    -0x100010(%rbp),%rdi
movslq -0x100030(%rbp),%rax
add    %rax,%rdi
mov    $0x100000,%edx
sub    -0x100030(%rbp),%edx
mov    -0x100018(%rbp),%rcx
mov    $0x1,%esi
call   1090 <fwrite@plt>
mov    %eax,-0x100034(%rbp)
mov    -0x100034(%rbp),%eax
add    -0x100030(%rbp),%eax
mov    %eax,-0x100030(%rbp)
jmp    168a <main+0x51a>
jmp    16e9 <main+0x579>
mov    -0x100028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100028(%rbp)
jmp    1604 <main+0x494>
lea    -0x100010(%rbp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1050 <memset@plt>
movl   $0x0,-0x10002c(%rbp)
mov    -0x10002c(%rbp),%eax
cmp    -0x100024(%rbp),%eax
jge    175f <main+0x5ef>
mov    $0x0,%al
call   1070 <random@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
movslq -0x10002c(%rbp),%rax
mov    %cl,-0x100010(%rbp,%rax,1)
mov    -0x10002c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10002c(%rbp)
jmp    171a <main+0x5aa>
movl   $0x0,-0x100034(%rbp)
movl   $0x0,-0x100030(%rbp)
mov    -0x100030(%rbp),%eax
cmp    -0x100024(%rbp),%eax
jge    17d0 <main+0x660>
lea    -0x100010(%rbp),%rdi
movslq -0x100030(%rbp),%rax
add    %rax,%rdi
mov    -0x100024(%rbp),%edx
sub    -0x100030(%rbp),%edx
mov    -0x100018(%rbp),%rcx
mov    $0x1,%esi
call   1090 <fwrite@plt>
mov    %eax,-0x100034(%rbp)
mov    -0x100034(%rbp),%eax
add    -0x100030(%rbp),%eax
mov    %eax,-0x100030(%rbp)
jmp    1773 <main+0x603>
mov    -0x100018(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x100028,%rsp
cmp    $0x3,%edi
jne    12e1 <main+0x161>
mov    %rsi,%r14
lea    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1060 <memset@plt>
mov    0x8(%r14),%rdi
lea    0xe47(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11d8 <main+0x58>
mov    0x8(%r14),%rsi
lea    0xe32(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%r14),%rax
mov    (%rax),%al
test   %al,%al
je     12f8 <main+0x178>
lea    0xe26(%rip),%r15
xor    %ebp,%ebp
nop
movsbl %al,%edx
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movzbl 0x1(%rax,%rbp,1),%eax
add    $0x1,%rbp
test   %al,%al
jne    11f0 <main+0x70>
lea    0xe0e(%rip),%rdi
xor    %r15d,%r15d
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xa,%ebp
setae  %r10b
jb     137f <main+0x1ff>
lea    -0x9(%rbp),%r15
mov    0x10(%r14),%rdx
cmp    $0xa,%ebp
jl     130d <main+0x18d>
mov    %r15d,%r11d
cmp    $0x8,%r15d
jb     126d <main+0xed>
lea    (%rdx,%r11,1),%rax
lea    0x6(%rsp),%r8
cmp    %rax,%r8
jae    15f1 <main+0x471>
lea    (%rsp,%r11,1),%rax
add    $0x6,%rax
cmp    %rax,%rdx
jae    15f1 <main+0x471>
xor    %esi,%esi
mov    %rsi,%rcx
not    %rcx
add    %r11,%rcx
test   $0x3,%r11b
je     12a2 <main+0x122>
mov    %r15d,%edi
and    $0x3,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdx,%rsi,1),%eax
mov    %al,0x6(%rsp,%rsi,1)
add    $0x1,%rsi
add    $0xffffffffffffffff,%rdi
jne    1290 <main+0x110>
cmp    $0x3,%rcx
jb     12dc <main+0x15c>
mov    %r15d,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rdx,%rsi,1),%eax
mov    %al,0x6(%rsp,%rsi,1)
movzbl 0x1(%rdx,%rsi,1),%eax
mov    %al,0x7(%rsp,%rsi,1)
movzbl 0x2(%rdx,%rsi,1),%eax
mov    %al,0x8(%rsp,%rsi,1)
movzbl 0x3(%rdx,%rsi,1),%eax
mov    %al,0x9(%rsp,%rsi,1)
add    $0x4,%rsi
cmp    %rsi,%rcx
jne    12b0 <main+0x130>
mov    %r15d,%eax
jmp    130f <main+0x18f>
lea    0xd93(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%r14d
jmp    15dc <main+0x45c>
lea    0xd26(%rip),%rdi
xor    %r15d,%r15d
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    137f <main+0x1ff>
xor    %eax,%eax
movb   $0x0,0x6(%rsp,%rax,1)
movslq %r15d,%rax
mov    (%rdx,%rax,1),%cl
mov    %cl,(%rdx)
mov    0x10(%r14),%rcx
mov    0x1(%rax,%rcx,1),%dl
mov    %dl,0x1(%rcx)
mov    0x10(%r14),%rcx
mov    0x2(%rax,%rcx,1),%dl
mov    %dl,0x2(%rcx)
mov    0x10(%r14),%rcx
mov    0x3(%rax,%rcx,1),%dl
mov    %dl,0x3(%rcx)
mov    0x10(%r14),%rcx
mov    0x4(%rax,%rcx,1),%dl
mov    %dl,0x4(%rcx)
mov    0x10(%r14),%rcx
mov    0x5(%rax,%rcx,1),%dl
mov    %dl,0x5(%rcx)
mov    0x10(%r14),%rcx
mov    0x6(%rax,%rcx,1),%dl
mov    %dl,0x6(%rcx)
mov    0x10(%r14),%rcx
mov    0x7(%rax,%rcx,1),%dl
mov    %dl,0x7(%rcx)
mov    0x10(%r14),%rcx
mov    0x8(%rax,%rcx,1),%al
mov    %al,0x8(%rcx)
mov    0x10(%r14),%rax
movb   $0x0,0x9(%rax)
mov    %r10d,%r15d
lea    0xca6(%rip),%rdi
lea    0x6(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%r14),%rsi
lea    0xc92(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1070 <atoll@plt>
mov    %eax,%r13d
mov    0x10(%r14),%rdi
call   1070 <atoll@plt>
mov    %eax,%ebp
lea    0xc7a(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc72(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfffff(%rbp),%eax
test   %ebp,%ebp
cmovns %ebp,%eax
mov    %eax,%ecx
sar    $0x14,%ecx
and    $0xfff00000,%eax
mov    %ebp,%r8d
sub    %eax,%r8d
lea    0xc53(%rip),%rdi
mov    %rbp,0x18(%rsp)
mov    %ebp,%esi
mov    %r13d,%edx
mov    %ecx,0x10(%rsp)
mov    %r8d,0x14(%rsp)
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
jle    14d6 <main+0x356>
test   %r15b,%r15b
je     14d6 <main+0x356>
lea    0x20(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1060 <memset@plt>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <random@plt>
mov    %al,0x20(%rsp,%r14,1)
add    $0x1,%r14
cmp    $0x100000,%r14
jne    1470 <main+0x2f0>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movslq %eax,%rbp
lea    (%rsp,%rbp,1),%rdi
add    $0x20,%rdi
mov    $0x100000,%edx
sub    %ebp,%edx
mov    $0x1,%esi
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
add    %ebp,%eax
cmp    $0x100000,%eax
jl     1490 <main+0x310>
add    $0x1,%r12d
cmp    $0x400,%r12d
jne    1450 <main+0x2d0>
lea    -0x1(%r13),%eax
cmp    $0x1,%r13d
mov    %eax,%r13d
jg     1440 <main+0x2c0>
cmpl   $0x100000,0x18(%rsp)
mov    0x14(%rsp),%r15d
mov    0x10(%rsp),%r13d
jl     1571 <main+0x3f1>
lea    0x20(%rsp),%r12
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1060 <memset@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <random@plt>
mov    %al,0x20(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x100000,%rbp
jne    1520 <main+0x3a0>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movslq %eax,%rbp
lea    (%rsp,%rbp,1),%rdi
add    $0x20,%rdi
mov    $0x100000,%edx
sub    %ebp,%edx
mov    $0x1,%esi
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
add    %ebp,%eax
cmp    $0x100000,%eax
jl     1540 <main+0x3c0>
add    $0x1,%r14d
cmp    %r13d,%r14d
jne    1500 <main+0x380>
lea    0x20(%rsp),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0x100000,%edx
call   1060 <memset@plt>
test   %r15d,%r15d
jle    15d4 <main+0x454>
mov    %r15d,%r12d
xor    %ebp,%ebp
nop
xor    %eax,%eax
call   1080 <random@plt>
mov    %al,0x20(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1590 <main+0x410>
test   %r15d,%r15d
jle    15d4 <main+0x454>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movslq %eax,%rbp
lea    (%rsp,%rbp,1),%rdi
add    $0x20,%rdi
mov    %r15d,%edx
sub    %ebp,%edx
mov    $0x1,%esi
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
add    %ebp,%eax
cmp    %eax,%r15d
jg     15b0 <main+0x430>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14d,%eax
add    $0x100028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x20,%r15d
jae    15fe <main+0x47e>
xor    %esi,%esi
jmp    16ea <main+0x56a>
mov    %r11d,%esi
and    $0xffffffe0,%esi
lea    -0x20(%rsi),%rax
mov    %rax,%r9
shr    $0x5,%r9
add    $0x1,%r9
cmp    $0x60,%rax
jae    161d <main+0x49d>
xor    %ebp,%ebp
jmp    168e <main+0x50e>
mov    %r15d,%ecx
and    $0xffffffe0,%ecx
add    $0xffffffffffffffe0,%rcx
shr    $0x5,%rcx
add    $0x1,%rcx
and    $0xfffffffffffffffc,%rcx
xor    %ebp,%ebp
movups (%rdx,%rbp,1),%xmm0
movups 0x10(%rdx,%rbp,1),%xmm1
movups %xmm0,0x6(%rsp,%rbp,1)
movups %xmm1,0x16(%rsp,%rbp,1)
movups 0x20(%rdx,%rbp,1),%xmm0
movups 0x30(%rdx,%rbp,1),%xmm1
movups %xmm0,0x26(%rsp,%rbp,1)
movups %xmm1,0x36(%rsp,%rbp,1)
movups 0x40(%rdx,%rbp,1),%xmm0
movups 0x50(%rdx,%rbp,1),%xmm1
movups %xmm0,0x46(%rsp,%rbp,1)
movups %xmm1,0x56(%rsp,%rbp,1)
movups 0x60(%rdx,%rbp,1),%xmm0
movups 0x70(%rdx,%rbp,1),%xmm1
movups %xmm0,0x66(%rsp,%rbp,1)
movups %xmm1,0x76(%rsp,%rbp,1)
sub    $0xffffffffffffff80,%rbp
add    $0xfffffffffffffffc,%rcx
jne    1635 <main+0x4b5>
test   $0x3,%r9b
je     16d7 <main+0x557>
lea    (%r8,%rbp,1),%rcx
add    $0x10,%rcx
add    %rdx,%rbp
add    $0x10,%rbp
mov    %r15d,%eax
and    $0x60,%al
add    $0xe0,%al
shr    $0x5,%al
add    $0x1,%al
movzbl %al,%edi
and    $0x3,%edi
shl    $0x5,%rdi
xor    %eax,%eax
movups -0x10(%rbp,%rax,1),%xmm0
movups 0x0(%rbp,%rax,1),%xmm1
movups %xmm0,-0x10(%rcx,%rax,1)
movups %xmm1,(%rcx,%rax,1)
add    $0x20,%rax
cmp    %rax,%rdi
jne    16bb <main+0x53b>
cmp    %r11,%rsi
je     12dc <main+0x15c>
test   $0x18,%r11b
je     126f <main+0xef>
mov    %rsi,%rcx
mov    %r11d,%esi
and    $0xfffffff8,%esi
mov    %r15d,%eax
and    $0xfffffff8,%eax
nopl   0x0(%rax)
mov    (%rdx,%rcx,1),%rdi
mov    %rdi,0x6(%rsp,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rax
jne    1700 <main+0x580>
cmp    %r11,%rsi
je     12dc <main+0x15c>
jmp    126f <main+0xef>

LLVM IR (-O0):
@.str = [31 x i8] c"usage: ./pd filename filesize\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [16 x i8] c"open %s failed\0A\00"
@.str.3 = [18 x i8] c"argv[2][%d] = %c\0A\00"
@.str.4 = [7 x i8] c"ii %d\0A\00"
@.str.5 = [6 x i8] c"g %s\0A\00"
@.str.6 = [12 x i8] c"argv[2] %s\0A\00"
@.str.7 = [9 x i8] c"gg %llu\0A\00"
@.str.8 = [12 x i8] c"tsize %llu\0A\00"
@.str.9 = [40 x i8] c"tsize %llu %llu gb %llu mb rsize %llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1048576 x i8]
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [10 x i8]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
store i32 0, i32* %19
store i32 0, i32* %20
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %284
26: ; preds = %2
%27 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%28 = call i32 @memset(i8* %27, i32 0, i32 1048576)
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %32, i32** %7
%33 = load i32*, i32** %7
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %40
35: ; preds = %26
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %38)
br label %40
40: ; preds = %35, %26
store i32 0, i32* %21
br label %41
41: ; preds = %62, %40
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = load i32, i32* %21
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %65
51: ; preds = %41
%52 = load i32, i32* %21
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = load i32, i32* %21
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %52, i32 %60)
br label %62
62: ; preds = %51
%63 = load i32, i32* %21
%64 = add nsw i32 %63, 1
store i32 %64, i32* %21
br label %41
65: ; preds = %41
%66 = load i32, i32* %21
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %21
%69 = icmp sge i32 %68, 10
br i1 %69, label %70, label %124
70: ; preds = %65
store i32 1, i32* %17
%71 = load i32, i32* %21
%72 = sub nsw i32 %71, 9
store i32 %72, i32* %21
store i32 0, i32* %20
br label %73
73: ; preds = %88, %70
%74 = load i32, i32* %20
%75 = load i32, i32* %21
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %91
77: ; preds = %73
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 2
%80 = load i8*, i8** %79
%81 = load i32, i32* %20
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %80, i64 %82
%84 = load i8, i8* %83
%85 = load i32, i32* %20
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [10 x i8], [10 x i8]* %18, i64 0, i64 %86
store i8 %84, i8* %87
br label %88
88: ; preds = %77
%89 = load i32, i32* %20
%90 = add nsw i32 %89, 1
store i32 %90, i32* %20
br label %73
91: ; preds = %73
%92 = load i32, i32* %20
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [10 x i8], [10 x i8]* %18, i64 0, i64 %93
store i8 0, i8* %94
store i32 0, i32* %20
br label %95
95: ; preds = %114, %91
%96 = load i32, i32* %20
%97 = icmp slt i32 %96, 9
br i1 %97, label %98, label %117
98: ; preds = %95
%99 = load i8**, i8*** %5
%100 = getelementptr inbounds i8*, i8** %99, i64 2
%101 = load i8*, i8** %100
%102 = load i32, i32* %20
%103 = load i32, i32* %21
%104 = add nsw i32 %102, %103
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %101, i64 %105
%107 = load i8, i8* %106
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 2
%110 = load i8*, i8** %109
%111 = load i32, i32* %20
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8, i8* %110, i64 %112
store i8 %107, i8* %113
br label %114
114: ; preds = %98
%115 = load i32, i32* %20
%116 = add nsw i32 %115, 1
store i32 %116, i32* %20
br label %95
117: ; preds = %95
%118 = load i8**, i8*** %5
%119 = getelementptr inbounds i8*, i8** %118, i64 2
%120 = load i8*, i8** %119
%121 = load i32, i32* %20
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %120, i64 %122
store i8 0, i8* %123
br label %124
124: ; preds = %117, %65
%125 = getelementptr inbounds [10 x i8], [10 x i8]* %18, i64 0, i64 0
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %125)
%127 = load i8**, i8*** %5
%128 = getelementptr inbounds i8*, i8** %127, i64 2
%129 = load i8*, i8** %128
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %129)
%131 = getelementptr inbounds [10 x i8], [10 x i8]* %18, i64 0, i64 0
%132 = call i32 @atoll(i8* %131)
store i32 %132, i32* %19
%133 = load i8**, i8*** %5
%134 = getelementptr inbounds i8*, i8** %133, i64 2
%135 = load i8*, i8** %134
%136 = call i32 @atoll(i8* %135)
store i32 %136, i32* %9
%137 = load i32, i32* %19
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %137)
%139 = load i32, i32* %9
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %139)
%141 = load i32, i32* %9
%142 = sdiv i32 %141, 1048576
store i32 %142, i32* %8
%143 = load i32, i32* %9
%144 = load i32, i32* %8
%145 = mul nsw i32 %144, 1024
%146 = mul nsw i32 %145, 1024
%147 = sub nsw i32 %143, %146
store i32 %147, i32* %10
%148 = load i32, i32* %9
%149 = load i32, i32* %19
%150 = load i32, i32* %8
%151 = load i32, i32* %10
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %148, i32 %149, i32 %150, i32 %151)
br label %153
153: ; preds = %202, %124
%154 = load i32, i32* %19
%155 = icmp sgt i32 %154, 0
br i1 %155, label %156, label %159
156: ; preds = %153
%157 = load i32, i32* %17
%158 = icmp ne i32 %157, 0
br label %159
159: ; preds = %156, %153
%160 = phi i1 [ false, %153 ], [ %158, %156 ]
br i1 %160, label %161, label %205
161: ; preds = %159
store i32 0, i32* %11
br label %162
162: ; preds = %198, %161
%163 = load i32, i32* %11
%164 = icmp slt i32 %163, 1024
br i1 %164, label %165, label %201
165: ; preds = %162
%166 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%167 = call i32 @memset(i8* %166, i32 0, i32 1048576)
store i32 0, i32* %12
br label %168
168: ; preds = %178, %165
%169 = load i32, i32* %12
%170 = icmp slt i32 %169, 1048576
br i1 %170, label %171, label %181
171: ; preds = %168
%172 = call i32 (...) @random()
%173 = srem i32 %172, 256
%174 = trunc i32 %173 to i8
%175 = load i32, i32* %12
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 %176
store i8 %174, i8* %177
br label %178
178: ; preds = %171
%179 = load i32, i32* %12
%180 = add nsw i32 %179, 1
store i32 %180, i32* %12
br label %168
181: ; preds = %168
store i32 0, i32* %14
store i32 0, i32* %13
br label %182
182: ; preds = %185, %181
%183 = load i32, i32* %13
%184 = icmp slt i32 %183, 1048576
br i1 %184, label %185, label %197
185: ; preds = %182
%186 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%187 = load i32, i32* %13
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds i8, i8* %186, i64 %188
%190 = load i32, i32* %13
%191 = sub nsw i32 1048576, %190
%192 = load i32*, i32** %7
%193 = call i32 @fwrite(i8* %189, i32 1, i32 %191, i32* %192)
store i32 %193, i32* %14
%194 = load i32, i32* %14
%195 = load i32, i32* %13
%196 = add nsw i32 %195, %194
store i32 %196, i32* %13
br label %182
197: ; preds = %182
br label %198
198: ; preds = %197
%199 = load i32, i32* %11
%200 = add nsw i32 %199, 1
store i32 %200, i32* %11
br label %162
201: ; preds = %162
br label %202
202: ; preds = %201
%203 = load i32, i32* %19
%204 = add nsw i32 %203, -1
store i32 %204, i32* %19
br label %153
205: ; preds = %159
store i32 0, i32* %11
br label %206
206: ; preds = %243, %205
%207 = load i32, i32* %11
%208 = load i32, i32* %8
%209 = icmp slt i32 %207, %208
br i1 %209, label %210, label %246
210: ; preds = %206
%211 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%212 = call i32 @memset(i8* %211, i32 0, i32 1048576)
store i32 0, i32* %12
br label %213
213: ; preds = %223, %210
%214 = load i32, i32* %12
%215 = icmp slt i32 %214, 1048576
br i1 %215, label %216, label %226
216: ; preds = %213
%217 = call i32 (...) @random()
%218 = srem i32 %217, 256
%219 = trunc i32 %218 to i8
%220 = load i32, i32* %12
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 %221
store i8 %219, i8* %222
br label %223
223: ; preds = %216
%224 = load i32, i32* %12
%225 = add nsw i32 %224, 1
store i32 %225, i32* %12
br label %213
226: ; preds = %213
store i32 0, i32* %14
store i32 0, i32* %13
br label %227
227: ; preds = %230, %226
%228 = load i32, i32* %13
%229 = icmp slt i32 %228, 1048576
br i1 %229, label %230, label %242
230: ; preds = %227
%231 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%232 = load i32, i32* %13
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds i8, i8* %231, i64 %233
%235 = load i32, i32* %13
%236 = sub nsw i32 1048576, %235
%237 = load i32*, i32** %7
%238 = call i32 @fwrite(i8* %234, i32 1, i32 %236, i32* %237)
store i32 %238, i32* %14
%239 = load i32, i32* %14
%240 = load i32, i32* %13
%241 = add nsw i32 %240, %239
store i32 %241, i32* %13
br label %227
242: ; preds = %227
br label %243
243: ; preds = %242
%244 = load i32, i32* %11
%245 = add nsw i32 %244, 1
store i32 %245, i32* %11
br label %206
246: ; preds = %206
%247 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%248 = call i32 @memset(i8* %247, i32 0, i32 1048576)
store i32 0, i32* %12
br label %249
249: ; preds = %260, %246
%250 = load i32, i32* %12
%251 = load i32, i32* %10
%252 = icmp slt i32 %250, %251
br i1 %252, label %253, label %263
253: ; preds = %249
%254 = call i32 (...) @random()
%255 = srem i32 %254, 256
%256 = trunc i32 %255 to i8
%257 = load i32, i32* %12
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 %258
store i8 %256, i8* %259
br label %260
260: ; preds = %253
%261 = load i32, i32* %12
%262 = add nsw i32 %261, 1
store i32 %262, i32* %12
br label %249
263: ; preds = %249
store i32 0, i32* %14
store i32 0, i32* %13
br label %264
264: ; preds = %268, %263
%265 = load i32, i32* %13
%266 = load i32, i32* %10
%267 = icmp slt i32 %265, %266
br i1 %267, label %268, label %281
268: ; preds = %264
%269 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%270 = load i32, i32* %13
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds i8, i8* %269, i64 %271
%273 = load i32, i32* %10
%274 = load i32, i32* %13
%275 = sub nsw i32 %273, %274
%276 = load i32*, i32** %7
%277 = call i32 @fwrite(i8* %272, i32 1, i32 %275, i32* %276)
store i32 %277, i32* %14
%278 = load i32, i32* %14
%279 = load i32, i32* %13
%280 = add nsw i32 %279, %278
store i32 %280, i32* %13
br label %264
281: ; preds = %264
%282 = load i32*, i32** %7
%283 = call i32 @fclose(i32* %282)
store i32 0, i32* %3
br label %284
284: ; preds = %281, %24
%285 = load i32, i32* %3
ret i32 %285
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [16 x i8] c"open %s failed\0A\00"
@.str.3 = [18 x i8] c"argv[2][%d] = %c\0A\00"
@.str.4 = [7 x i8] c"ii %d\0A\00"
@.str.5 = [6 x i8] c"g %s\0A\00"
@.str.6 = [12 x i8] c"argv[2] %s\0A\00"
@.str.7 = [9 x i8] c"gg %llu\0A\00"
@.str.8 = [12 x i8] c"tsize %llu\0A\00"
@.str.9 = [40 x i8] c"tsize %llu %llu gb %llu mb rsize %llu\0A\00"
@str = [30 x i8] c"usage: ./pd filename filesize\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1048576 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%8 = icmp eq i32 %0, 3
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %328
11: ; preds = %2
%12 = call i32 @memset(i8* %6, i32 0, i32 1048576)
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %11
%18 = load i8*, i8** %13
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %11
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %240
27: ; preds = %20, %27
%28 = phi i64 [ %33, %27 ], [ 0, %20 ]
%29 = phi i8 [ %36, %27 ], [ %23, %20 ]
%30 = sext i8 %29 to i32
%31 = trunc i64 %28 to i32
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %31, i32 %30)
%33 = add nuw i64 %28, 1
%34 = load i8*, i8** %21
%35 = getelementptr inbounds i8, i8* %34, i64 %33
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, 0
br i1 %37, label %38, label %27
38: ; preds = %27
%39 = trunc i64 %33 to i32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %39)
%41 = icmp ugt i32 %39, 9
br i1 %41, label %42, label %240
42: ; preds = %38
%43 = add i32 %39, -9
%44 = icmp sgt i32 %39, 9
%45 = load i8*, i8** %21
br i1 %44, label %46, label %192
46: ; preds = %42
%47 = zext i32 %43 to i64
%48 = icmp ult i32 %43, 8
br i1 %48, label %153, label %49
49: ; preds = %46
%50 = getelementptr [10 x i8], [10 x i8]* %4, i64 0, i64 %47
%51 = getelementptr i8, i8* %45, i64 %47
%52 = icmp ult i8* %5, %51
%53 = icmp ult i8* %45, %50
%54 = and i1 %52, %53
br i1 %54, label %153, label %55
55: ; preds = %49
%56 = icmp ult i32 %43, 32
br i1 %56, label %139, label %57
57: ; preds = %55
%58 = and i64 %47, 4294967264
%59 = add nsw i64 %58, -32
%60 = lshr exact i64 %59, 5
%61 = add nuw nsw i64 %60, 1
%62 = and i64 %61, 3
%63 = icmp ult i64 %59, 96
br i1 %63, label %115, label %64
64: ; preds = %57
%65 = and i64 %61, 1152921504606846972
br label %66
66: ; preds = %66, %64
%67 = phi i64 [ 0, %64 ], [ %112, %66 ]
%68 = phi i64 [ 0, %64 ], [ %113, %66 ]
%69 = getelementptr inbounds i8, i8* %45, i64 %67
%70 = bitcast i8* %69 to <16 x i8>*
%71 = load <16 x i8>, <16 x i8>* %70
%72 = getelementptr inbounds i8, i8* %69, i64 16
%73 = bitcast i8* %72 to <16 x i8>*
%74 = load <16 x i8>, <16 x i8>* %73
%75 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %67
%76 = bitcast i8* %75 to <16 x i8>*
store <16 x i8> %71, <16 x i8>* %76
%77 = getelementptr inbounds i8, i8* %75, i64 16
%78 = bitcast i8* %77 to <16 x i8>*
store <16 x i8> %74, <16 x i8>* %78
%79 = or i64 %67, 32
%80 = getelementptr inbounds i8, i8* %45, i64 %79
%81 = bitcast i8* %80 to <16 x i8>*
%82 = load <16 x i8>, <16 x i8>* %81
%83 = getelementptr inbounds i8, i8* %80, i64 16
%84 = bitcast i8* %83 to <16 x i8>*
%85 = load <16 x i8>, <16 x i8>* %84
%86 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %79
%87 = bitcast i8* %86 to <16 x i8>*
store <16 x i8> %82, <16 x i8>* %87
%88 = getelementptr inbounds i8, i8* %86, i64 16
%89 = bitcast i8* %88 to <16 x i8>*
store <16 x i8> %85, <16 x i8>* %89
%90 = or i64 %67, 64
%91 = getelementptr inbounds i8, i8* %45, i64 %90
%92 = bitcast i8* %91 to <16 x i8>*
%93 = load <16 x i8>, <16 x i8>* %92
%94 = getelementptr inbounds i8, i8* %91, i64 16
%95 = bitcast i8* %94 to <16 x i8>*
%96 = load <16 x i8>, <16 x i8>* %95
%97 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %90
%98 = bitcast i8* %97 to <16 x i8>*
store <16 x i8> %93, <16 x i8>* %98
%99 = getelementptr inbounds i8, i8* %97, i64 16
%100 = bitcast i8* %99 to <16 x i8>*
store <16 x i8> %96, <16 x i8>* %100
%101 = or i64 %67, 96
%102 = getelementptr inbounds i8, i8* %45, i64 %101
%103 = bitcast i8* %102 to <16 x i8>*
%104 = load <16 x i8>, <16 x i8>* %103
%105 = getelementptr inbounds i8, i8* %102, i64 16
%106 = bitcast i8* %105 to <16 x i8>*
%107 = load <16 x i8>, <16 x i8>* %106
%108 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %101
%109 = bitcast i8* %108 to <16 x i8>*
store <16 x i8> %104, <16 x i8>* %109
%110 = getelementptr inbounds i8, i8* %108, i64 16
%111 = bitcast i8* %110 to <16 x i8>*
store <16 x i8> %107, <16 x i8>* %111
%112 = add nuw i64 %67, 128
%113 = add i64 %68, 4
%114 = icmp eq i64 %113, %65
br i1 %114, label %115, label %66
115: ; preds = %66, %57
%116 = phi i64 [ 0, %57 ], [ %112, %66 ]
%117 = icmp eq i64 %62, 0
br i1 %117, label %134, label %118
118: ; preds = %115, %118
%119 = phi i64 [ %131, %118 ], [ %116, %115 ]
%120 = phi i64 [ %132, %118 ], [ 0, %115 ]
%121 = getelementptr inbounds i8, i8* %45, i64 %119
%122 = bitcast i8* %121 to <16 x i8>*
%123 = load <16 x i8>, <16 x i8>* %122
%124 = getelementptr inbounds i8, i8* %121, i64 16
%125 = bitcast i8* %124 to <16 x i8>*
%126 = load <16 x i8>, <16 x i8>* %125
%127 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %119
%128 = bitcast i8* %127 to <16 x i8>*
store <16 x i8> %123, <16 x i8>* %128
%129 = getelementptr inbounds i8, i8* %127, i64 16
%130 = bitcast i8* %129 to <16 x i8>*
store <16 x i8> %126, <16 x i8>* %130
%131 = add nuw i64 %119, 32
%132 = add i64 %120, 1
%133 = icmp eq i64 %132, %62
br i1 %133, label %134, label %118
134: ; preds = %118, %115
%135 = icmp eq i64 %58, %47
br i1 %135, label %190, label %136
136: ; preds = %134
%137 = and i64 %47, 24
%138 = icmp eq i64 %137, 0
br i1 %138, label %153, label %139
139: ; preds = %55, %136
%140 = phi i64 [ %58, %136 ], [ 0, %55 ]
%141 = and i64 %47, 4294967288
br label %142
142: ; preds = %142, %139
%143 = phi i64 [ %140, %139 ], [ %149, %142 ]
%144 = getelementptr inbounds i8, i8* %45, i64 %143
%145 = bitcast i8* %144 to <8 x i8>*
%146 = load <8 x i8>, <8 x i8>* %145
%147 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %143
%148 = bitcast i8* %147 to <8 x i8>*
store <8 x i8> %146, <8 x i8>* %148
%149 = add nuw i64 %143, 8
%150 = icmp eq i64 %149, %141
br i1 %150, label %151, label %142
151: ; preds = %142
%152 = icmp eq i64 %141, %47
br i1 %152, label %190, label %153
153: ; preds = %49, %46, %136, %151
%154 = phi i64 [ 0, %46 ], [ 0, %49 ], [ %58, %136 ], [ %141, %151 ]
%155 = xor i64 %154, -1
%156 = add nsw i64 %155, %47
%157 = and i64 %47, 3
%158 = icmp eq i64 %157, 0
br i1 %158, label %168, label %159
159: ; preds = %153, %159
%160 = phi i64 [ %165, %159 ], [ %154, %153 ]
%161 = phi i64 [ %166, %159 ], [ 0, %153 ]
%162 = getelementptr inbounds i8, i8* %45, i64 %160
%163 = load i8, i8* %162
%164 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %160
store i8 %163, i8* %164
%165 = add nuw nsw i64 %160, 1
%166 = add i64 %161, 1
%167 = icmp eq i64 %166, %157
br i1 %167, label %168, label %159
168: ; preds = %159, %153
%169 = phi i64 [ %154, %153 ], [ %165, %159 ]
%170 = icmp ult i64 %156, 3
br i1 %170, label %190, label %171
171: ; preds = %168, %171
%172 = phi i64 [ %188, %171 ], [ %169, %168 ]
%173 = getelementptr inbounds i8, i8* %45, i64 %172
%174 = load i8, i8* %173
%175 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %172
store i8 %174, i8* %175
%176 = add nuw nsw i64 %172, 1
%177 = getelementptr inbounds i8, i8* %45, i64 %176
%178 = load i8, i8* %177
%179 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %176
store i8 %178, i8* %179
%180 = add nuw nsw i64 %172, 2
%181 = getelementptr inbounds i8, i8* %45, i64 %180
%182 = load i8, i8* %181
%183 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %180
store i8 %182, i8* %183
%184 = add nuw nsw i64 %172, 3
%185 = getelementptr inbounds i8, i8* %45, i64 %184
%186 = load i8, i8* %185
%187 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %184
store i8 %186, i8* %187
%188 = add nuw nsw i64 %172, 4
%189 = icmp eq i64 %188, %47
br i1 %189, label %190, label %171
190: ; preds = %168, %171, %151, %134
%191 = zext i32 %43 to i64
br label %192
192: ; preds = %42, %190
%193 = phi i64 [ %191, %190 ], [ 0, %42 ]
%194 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %193
store i8 0, i8* %194
%195 = sext i32 %43 to i64
%196 = getelementptr inbounds i8, i8* %45, i64 %195
%197 = load i8, i8* %196
store i8 %197, i8* %45
%198 = load i8*, i8** %21
%199 = add nsw i64 %195, 1
%200 = getelementptr inbounds i8, i8* %198, i64 %199
%201 = load i8, i8* %200
%202 = getelementptr inbounds i8, i8* %198, i64 1
store i8 %201, i8* %202
%203 = load i8*, i8** %21
%204 = add nsw i64 %195, 2
%205 = getelementptr inbounds i8, i8* %203, i64 %204
%206 = load i8, i8* %205
%207 = getelementptr inbounds i8, i8* %203, i64 2
store i8 %206, i8* %207
%208 = load i8*, i8** %21
%209 = add nsw i64 %195, 3
%210 = getelementptr inbounds i8, i8* %208, i64 %209
%211 = load i8, i8* %210
%212 = getelementptr inbounds i8, i8* %208, i64 3
store i8 %211, i8* %212
%213 = load i8*, i8** %21
%214 = add nsw i64 %195, 4
%215 = getelementptr inbounds i8, i8* %213, i64 %214
%216 = load i8, i8* %215
%217 = getelementptr inbounds i8, i8* %213, i64 4
store i8 %216, i8* %217
%218 = load i8*, i8** %21
%219 = add nsw i64 %195, 5
%220 = getelementptr inbounds i8, i8* %218, i64 %219
%221 = load i8, i8* %220
%222 = getelementptr inbounds i8, i8* %218, i64 5
store i8 %221, i8* %222
%223 = load i8*, i8** %21
%224 = add nsw i64 %195, 6
%225 = getelementptr inbounds i8, i8* %223, i64 %224
%226 = load i8, i8* %225
%227 = getelementptr inbounds i8, i8* %223, i64 6
store i8 %226, i8* %227
%228 = load i8*, i8** %21
%229 = add nsw i64 %195, 7
%230 = getelementptr inbounds i8, i8* %228, i64 %229
%231 = load i8, i8* %230
%232 = getelementptr inbounds i8, i8* %228, i64 7
store i8 %231, i8* %232
%233 = load i8*, i8** %21
%234 = add nsw i64 %195, 8
%235 = getelementptr inbounds i8, i8* %233, i64 %234
%236 = load i8, i8* %235
%237 = getelementptr inbounds i8, i8* %233, i64 8
store i8 %236, i8* %237
%238 = load i8*, i8** %21
%239 = getelementptr inbounds i8, i8* %238, i64 9
store i8 0, i8* %239
br label %240
240: ; preds = %25, %192, %38
%241 = phi i1 [ false, %25 ], [ %41, %192 ], [ false, %38 ]
%242 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%243 = load i8*, i8** %21
%244 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %243)
%245 = call i32 @atoll(i8* %7)
%246 = load i8*, i8** %21
%247 = call i32 @atoll(i8* %246)
%248 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %245)
%249 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %247)
%250 = sdiv i32 %247, 1048576
%251 = mul i32 %250, -1048576
%252 = add i32 %251, %247
%253 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %247, i32 %245, i32 %250, i32 %252)
%254 = icmp sgt i32 %245, 0
%255 = and i1 %254, %241
br i1 %255, label %256, label %258
256: ; preds = %240, %281
%257 = phi i32 [ %282, %281 ], [ %245, %240 ]
br label %260
258: ; preds = %281, %240
%259 = icmp sgt i32 %247, 1048575
br i1 %259, label %284, label %305
260: ; preds = %256, %278
%261 = phi i32 [ 0, %256 ], [ %279, %278 ]
%262 = call i32 @memset(i8* %6, i32 0, i32 1048576)
br label %263
263: ; preds = %260, %263
%264 = phi i64 [ 0, %260 ], [ %268, %263 ]
%265 = call i32 (...) @random()
%266 = trunc i32 %265 to i8
%267 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %264
store i8 %266, i8* %267
%268 = add nuw nsw i64 %264, 1
%269 = icmp eq i64 %268, 1048576
br i1 %269, label %270, label %263
270: ; preds = %263, %270
%271 = phi i32 [ %276, %270 ], [ 0, %263 ]
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %272
%274 = sub nsw i32 1048576, %271
%275 = call i32 @fwrite(i8* %273, i32 1, i32 %274, i32* %15)
%276 = add nsw i32 %275, %271
%277 = icmp slt i32 %276, 1048576
br i1 %277, label %270, label %278
278: ; preds = %270
%279 = add nuw nsw i32 %261, 1
%280 = icmp eq i32 %279, 1024
br i1 %280, label %281, label %260
281: ; preds = %278
%282 = add nsw i32 %257, -1
%283 = icmp sgt i32 %257, 1
br i1 %283, label %256, label %258
284: ; preds = %258, %302
%285 = phi i32 [ %303, %302 ], [ 0, %258 ]
%286 = call i32 @memset(i8* %6, i32 0, i32 1048576)
br label %287
287: ; preds = %284, %287
%288 = phi i64 [ 0, %284 ], [ %292, %287 ]
%289 = call i32 (...) @random()
%290 = trunc i32 %289 to i8
%291 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %288
store i8 %290, i8* %291
%292 = add nuw nsw i64 %288, 1
%293 = icmp eq i64 %292, 1048576
br i1 %293, label %294, label %287
294: ; preds = %287, %294
%295 = phi i32 [ %300, %294 ], [ 0, %287 ]
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %296
%298 = sub nsw i32 1048576, %295
%299 = call i32 @fwrite(i8* %297, i32 1, i32 %298, i32* %15)
%300 = add nsw i32 %299, %295
%301 = icmp slt i32 %300, 1048576
br i1 %301, label %294, label %302
302: ; preds = %294
%303 = add nuw nsw i32 %285, 1
%304 = icmp eq i32 %303, %250
br i1 %304, label %305, label %284
305: ; preds = %302, %258
%306 = call i32 @memset(i8* %6, i32 0, i32 1048576)
%307 = icmp sgt i32 %252, 0
br i1 %307, label %308, label %326
308: ; preds = %305
%309 = zext i32 %252 to i64
br label %311
310: ; preds = %311
br i1 %307, label %318, label %326
311: ; preds = %308, %311
%312 = phi i64 [ 0, %308 ], [ %316, %311 ]
%313 = call i32 (...) @random()
%314 = trunc i32 %313 to i8
%315 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %312
store i8 %314, i8* %315
%316 = add nuw nsw i64 %312, 1
%317 = icmp eq i64 %316, %309
br i1 %317, label %310, label %311
318: ; preds = %310, %318
%319 = phi i32 [ %324, %318 ], [ 0, %310 ]
%320 = sext i32 %319 to i64
%321 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %320
%322 = sub nsw i32 %252, %319
%323 = call i32 @fwrite(i8* %321, i32 1, i32 %322, i32* %15)
%324 = add nsw i32 %323, %319
%325 = icmp sgt i32 %252, %324
br i1 %325, label %318, label %326
326: ; preds = %318, %305, %310
%327 = call i32 @fclose(i32* %15)
br label %328
328: ; preds = %326, %9
%329 = phi i32 [ -1, %9 ], [ 0, %326 ]
ret i32 %329
}