#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 */

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int **jerasure_dumb_bitmatrix_to_schedule(int, int, int, int *);
int /*<<< orphan*/ jerasure_get_stats(double *);
int /*<<< orphan*/ jerasure_print_bitmatrix(int *, int, int, int);
int /*<<< orphan*/ jerasure_schedule_decode_lazy(int, int, int, int *, int *,
                                                 char **, char **, int, int,
                                                 int);
int /*<<< orphan*/ jerasure_schedule_encode(int, int, int, int **, char **,
                                            char **, int, int);
int *liberation_coding_bitmatrix(int, int);
int lrand48();
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, long *, int);
int /*<<< orphan*/ print_data_and_coding(int, int, int, int, char **, char **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand48(int /*<<< orphan*/);
scalar_t__ sscanf(char *, char *, int *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  long l;
  int k, w, i, j, m;
  int *bitmatrix;
  char **data, **coding;
  int **dumb;
  int *erasures, *erased;
  double stats[3];
  if (argc != 3)
    usage(NULL);
  if (sscanf(argv[1], "%d", &k) == 0 || k <= 0)
    usage("Bad k");
  if (sscanf(argv[2], "%d", &w) == 0 || w <= 0 || w > 32)
    usage("Bad w");
  m = 2;
  if (w < k)
    usage("k is too big");
  bitmatrix = liberation_coding_bitmatrix(k, w);
  if (bitmatrix == NULL) {
    usage("couldn't make coding matrix");
  }
  printf("Coding Bit-Matrix:\n\n");
  jerasure_print_bitmatrix(bitmatrix, w * m, w * k, w);
  printf("\n");
  dumb = jerasure_dumb_bitmatrix_to_schedule(k, m, w, bitmatrix);
  srand48(0);
  data = (char **)malloc(sizeof(char *) * (k));
  for (i = 0; i < k; i++) {
    data[i] = (char *)malloc(sizeof(char) * (sizeof(long) * w));
    for (j = 0; j < w; j++) {
      l = lrand48();
      memcpy(data[i] + j * sizeof(long), &l, sizeof(long));
    }
  }
  coding = (char **)malloc(sizeof(char *) * (m));
  for (i = 0; i < m; i++) {
    coding[i] = (char *)malloc(sizeof(char) * (sizeof(long) * w));
  }
  jerasure_schedule_encode(k, m, w, dumb, data, coding, w * sizeof(long),
                           sizeof(long));
  jerasure_get_stats(stats);
  printf("Smart Encoding Complete: - %.0lf XOR'd bytes\n\n", stats[0]);
  print_data_and_coding(k, m, w, sizeof(long), data, coding);
  erasures = (int *)malloc(sizeof(int) * ((m + 1)));
  erased = (int *)malloc(sizeof(int) * ((k + m)));
  for (i = 0; i < m + k; i++)
    erased[i] = 0;
  for (i = 0; i < m;) {
    erasures[i] = lrand48() % (k + m);
    if (erased[erasures[i]] == 0) {
      erased[erasures[i]] = 1;
      bzero((erasures[i] < k) ? data[erasures[i]] : coding[erasures[i] - k],
            sizeof(long) * w);
      i++;
    }
  }
  erasures[i] = -1;
  printf("Erased %d random devices:\n\n", m);
  print_data_and_coding(k, m, w, sizeof(long), data, coding);
  jerasure_schedule_decode_lazy(k, m, w, bitmatrix, erasures, data, coding,
                                w * sizeof(long), sizeof(long), 1);
  jerasure_get_stats(stats);
  printf("State of the system after decoding: %.0lf XOR'd bytes\n\n", stats[0]);
  print_data_and_coding(k, m, w, sizeof(long), data, coding);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     121c <main+0x2c>
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd5(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   10a0 <sscanf@plt>
cmp    $0x0,%rax
je     1248 <main+0x58>
cmpl   $0x0,-0x1c(%rbp)
jg     1254 <main+0x64>
lea    0xdb4(%rip),%rdi
call   10e0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd9d(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   10a0 <sscanf@plt>
cmp    $0x0,%rax
je     128a <main+0x9a>
cmpl   $0x0,-0x20(%rbp)
jle    128a <main+0x9a>
cmpl   $0x20,-0x20(%rbp)
jle    1296 <main+0xa6>
lea    0xd78(%rip),%rdi
call   10e0 <usage@plt>
movl   $0x2,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12b5 <main+0xc5>
lea    0xd5f(%rip),%rdi
call   10e0 <usage@plt>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1060 <liberation_coding_bitmatrix@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12db <main+0xeb>
lea    0xd46(%rip),%rdi
call   10e0 <usage@plt>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%esi
imul   -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
imul   -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1110 <jerasure_print_bitmatrix@plt>
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%rcx
call   1100 <jerasure_dumb_bitmatrix_to_schedule@plt>
mov    %rax,-0x50(%rbp)
xor    %edi,%edi
call   10d0 <srand48@plt>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13dc <main+0x1ec>
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rdx
mov    -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13c9 <main+0x1d9>
mov    $0x0,%al
call   10b0 <lrand48@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1070 <memcpy@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    137d <main+0x18d>
jmp    13ce <main+0x1de>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1348 <main+0x158>
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1432 <main+0x242>
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rdx
mov    -0x48(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13f6 <main+0x206>
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x50(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,(%rsp)
movl   $0x8,0x8(%rsp)
call   1080 <jerasure_schedule_encode@plt>
lea    -0x80(%rbp),%rdi
call   10c0 <jerasure_get_stats@plt>
movsd  -0x80(%rbp),%xmm0
lea    0xbd9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    $0x8,%ecx
call   1030 <print_data_and_coding@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x2c(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    14f9 <main+0x309>
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    14cb <main+0x2db>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    15d0 <main+0x3e0>
mov    $0x0,%al
call   10b0 <lrand48@plt>
mov    -0x1c(%rbp),%ecx
add    -0x2c(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    15cb <main+0x3db>
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jge    158c <main+0x39c>
mov    -0x40(%rbp),%rax
mov    -0x58(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x88(%rbp)
jmp    15ac <main+0x3bc>
mov    -0x48(%rbp),%rax
mov    -0x58(%rbp),%rcx
movslq -0x24(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   10f0 <bzero@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1500 <main+0x310>
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x2c(%rbp),%esi
lea    0xa93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    $0x8,%ecx
call   1030 <print_data_and_coding@plt>
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x58(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    -0x48(%rbp),%r10
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x1,0x18(%rsp)
call   1050 <jerasure_schedule_decode_lazy@plt>
lea    -0x80(%rbp),%rdi
call   10c0 <jerasure_get_stats@plt>
movsd  -0x80(%rbp),%xmm0
lea    0xa3a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    $0x8,%ecx
call   1030 <print_data_and_coding@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     122d <main+0x1d>
xor    %edi,%edi
call   1100 <usage@plt>
mov    0x8(%rbx),%rdi
lea    0xdc8(%rip),%rsi
lea    0x8(%rsp),%rdx
call   10c0 <sscanf@plt>
test   %rax,%rax
je     124e <main+0x3e>
cmpl   $0x0,0x8(%rsp)
jg     125a <main+0x4a>
lea    0xdae(%rip),%rdi
call   1100 <usage@plt>
mov    0x10(%rbx),%rdi
lea    0xd9b(%rip),%rsi
lea    0xc(%rsp),%rdx
call   10c0 <sscanf@plt>
test   %rax,%rax
je     1281 <main+0x71>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    1281 <main+0x71>
cmp    $0x21,%esi
jl     1291 <main+0x81>
lea    0xd81(%rip),%rdi
call   1100 <usage@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edi
cmp    %edi,%esi
jge    12ad <main+0x9d>
lea    0xd6f(%rip),%rdi
call   1100 <usage@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
call   1080 <liberation_coding_bitmatrix@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    12c6 <main+0xb6>
lea    0xd5b(%rip),%rdi
call   1100 <usage@plt>
lea    0xdee(%rip),%rdi
call   1050 <puts@plt>
mov    0xc(%rsp),%ecx
lea    (%rcx,%rcx,1),%esi
mov    0x8(%rsp),%edx
imul   %ecx,%edx
mov    %rbx,%rdi
call   1130 <jerasure_print_bitmatrix@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%edx
mov    $0x2,%esi
mov    %rbx,0x10(%rsp)
mov    %rbx,%rcx
call   1120 <jerasure_dumb_bitmatrix_to_schedule@plt>
mov    %rax,%r12
xor    %edi,%edi
call   10f0 <srand48@plt>
mov    0x8(%rsp),%edi
shl    $0x3,%edi
call   10b0 <malloc@plt>
mov    %rax,%r14
cmpl   $0x0,0x8(%rsp)
jle    13a6 <main+0x196>
mov    0xc(%rsp),%edi
lea    0x18(%rsp),%r15
xor    %r13d,%r13d
jmp    134e <main+0x13e>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r13
movslq 0x8(%rsp),%rax
cmp    %rax,%r13
jge    13a6 <main+0x196>
shl    $0x3,%edi
call   10b0 <malloc@plt>
mov    %rax,(%r14,%r13,8)
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    1340 <main+0x130>
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   10d0 <lrand48@plt>
cltq
mov    %rax,0x18(%rsp)
mov    (%r14,%r13,8),%rdi
add    %rbx,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
call   1090 <memcpy@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rdi
add    $0x8,%rbx
cmp    %rdi,%rbp
jl     1370 <main+0x160>
jmp    1340 <main+0x130>
mov    $0x10,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
mov    0xc(%rsp),%edi
shl    $0x3,%edi
call   10b0 <malloc@plt>
mov    %rax,(%r15)
mov    0xc(%rsp),%edi
shl    $0x3,%edi
call   10b0 <malloc@plt>
mov    %rax,0x8(%r15)
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%edx
lea    0x0(,%rdx,8),%eax
mov    $0x2,%esi
mov    %r12,%rcx
mov    %r14,%r8
mov    %r15,%r9
push   $0x8
push   %rax
call   10a0 <jerasure_schedule_encode@plt>
add    $0x10,%rsp
lea    0x20(%rsp),%rdi
call   10e0 <jerasure_get_stats@plt>
movsd  0x20(%rsp),%xmm0
lea    0xc26(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%edx
mov    $0x2,%esi
mov    $0x8,%ecx
mov    %r14,%r8
mov    %r15,%r9
call   1030 <print_data_and_coding@plt>
mov    $0xc,%edi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    0x8(%rsp),%eax
lea    0x8(,%rax,4),%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
cmpl   $0xffffffff,0x8(%rsp)
jl     1487 <main+0x277>
mov    $0xffffffffffffffff,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x0,0x4(%r13,%rax,4)
movslq 0x8(%rsp),%rcx
add    $0x1,%rax
cmp    %rcx,%rax
jle    1470 <main+0x260>
xor    %ebp,%ebp
jmp    1495 <main+0x285>
nopl   0x0(%rax,%rax,1)
cmp    $0x2,%ebp
jge    14ef <main+0x2df>
xor    %eax,%eax
call   10d0 <lrand48@plt>
mov    0x8(%rsp),%ecx
add    $0x2,%ecx
cltd
idiv   %ecx
movslq %ebp,%rbx
mov    %edx,(%r12,%rbx,4)
movslq %edx,%rax
cmpl   $0x0,0x0(%r13,%rax,4)
jne    1490 <main+0x280>
movl   $0x1,0x0(%r13,%rax,4)
movslq (%r12,%rbx,4),%rax
mov    0x8(%rsp),%ecx
lea    (%r14,%rax,8),%rdx
sub    %ecx,%eax
cltq
lea    (%r15,%rax,8),%rax
cmovl  %rdx,%rax
mov    (%rax),%rdi
mov    0xc(%rsp),%esi
shl    $0x3,%esi
call   1110 <bzero@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
jmp    1490 <main+0x280>
mov    %ebp,%eax
movl   $0xffffffff,(%r12,%rax,4)
ff
lea    0xb67(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%edx
mov    $0x2,%esi
mov    $0x8,%ecx
mov    %r14,%r8
mov    %r15,%r9
call   1030 <print_data_and_coding@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%edx
lea    0x0(,%rdx,8),%eax
mov    $0x2,%esi
mov    0x10(%rsp),%rcx
mov    %r12,%r8
mov    %r14,%r9
push   $0x1
push   $0x8
push   %rax
push   %r15
call   1070 <jerasure_schedule_decode_lazy@plt>
add    $0x20,%rsp
lea    0x20(%rsp),%rdi
call   10e0 <jerasure_get_stats@plt>
movsd  0x20(%rsp),%xmm0
lea    0xb14(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%edx
mov    $0x2,%esi
mov    $0x8,%ecx
mov    %r14,%r8
mov    %r15,%r9
call   1030 <print_data_and_coding@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"Bad k\00"
@.str.2 = [6 x i8] c"Bad w\00"
@.str.3 = [13 x i8] c"k is too big\00"
@.str.4 = [28 x i8] c"couldn't make coding matrix\00"
@.str.5 = [21 x i8] c"Coding Bit-Matrix:\0A\0A\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [47 x i8] c"Smart Encoding Complete: - %.0lf XOR'd bytes\0A\0A\00"
@.str.8 = [28 x i8] c"Erased %d random devices:\0A\0A\00"
@.str.9 = [56 x i8] c"State of the system after decoding: %.0lf XOR'd bytes\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i8**
%14 = alloca i8**
%15 = alloca i32**
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca [3 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 3
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 @usage(i8* null)
br label %23
23: ; preds = %21, %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @sscanf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %23
%30 = load i32, i32* %7
%31 = icmp sle i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29, %23
%33 = call i32 @usage(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i64 @sscanf(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%39 = icmp eq i64 %38, 0
br i1 %39, label %46, label %40
40: ; preds = %34
%41 = load i32, i32* %8
%42 = icmp sle i32 %41, 0
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i32, i32* %8
%45 = icmp sgt i32 %44, 32
br i1 %45, label %46, label %48
46: ; preds = %43, %40, %34
%47 = call i32 @usage(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46, %43
store i32 2, i32* %11
%49 = load i32, i32* %8
%50 = load i32, i32* %7
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 @usage(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %54
54: ; preds = %52, %48
%55 = load i32, i32* %7
%56 = load i32, i32* %8
%57 = call i32* @liberation_coding_bitmatrix(i32 %55, i32 %56)
store i32* %57, i32** %12
%58 = load i32*, i32** %12
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %62
60: ; preds = %54
%61 = call i32 @usage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %62
62: ; preds = %60, %54
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%64 = load i32*, i32** %12
%65 = load i32, i32* %8
%66 = load i32, i32* %11
%67 = mul nsw i32 %65, %66
%68 = load i32, i32* %8
%69 = load i32, i32* %7
%70 = mul nsw i32 %68, %69
%71 = load i32, i32* %8
%72 = call i32 @jerasure_print_bitmatrix(i32* %64, i32 %67, i32 %70, i32 %71)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%74 = load i32, i32* %7
%75 = load i32, i32* %11
%76 = load i32, i32* %8
%77 = load i32*, i32** %12
%78 = call i32** @jerasure_dumb_bitmatrix_to_schedule(i32 %74, i32 %75, i32 %76, i32* %77)
store i32** %78, i32*** %15
%79 = call i32 @srand48(i32 0)
%80 = load i32, i32* %7
%81 = sext i32 %80 to i64
%82 = mul i64 8, %81
%83 = trunc i64 %82 to i32
%84 = call i64 @malloc(i32 %83)
%85 = inttoptr i64 %84 to i8**
store i8** %85, i8*** %13
store i32 0, i32* %9
br label %86
86: ; preds = %123, %62
%87 = load i32, i32* %9
%88 = load i32, i32* %7
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %126
90: ; preds = %86
%91 = load i32, i32* %8
%92 = sext i32 %91 to i64
%93 = mul i64 8, %92
%94 = mul i64 1, %93
%95 = trunc i64 %94 to i32
%96 = call i64 @malloc(i32 %95)
%97 = inttoptr i64 %96 to i8*
%98 = load i8**, i8*** %13
%99 = load i32, i32* %9
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8*, i8** %98, i64 %100
store i8* %97, i8** %101
store i32 0, i32* %10
br label %102
102: ; preds = %119, %90
%103 = load i32, i32* %10
%104 = load i32, i32* %8
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %122
106: ; preds = %102
%107 = call i32 (...) @lrand48()
%108 = sext i32 %107 to i64
store i64 %108, i64* %6
%109 = load i8**, i8*** %13
%110 = load i32, i32* %9
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8*, i8** %109, i64 %111
%113 = load i8*, i8** %112
%114 = load i32, i32* %10
%115 = sext i32 %114 to i64
%116 = mul i64 %115, 8
%117 = getelementptr inbounds i8, i8* %113, i64 %116
%118 = call i32 @memcpy(i8* %117, i64* %6, i32 8)
br label %119
119: ; preds = %106
%120 = load i32, i32* %10
%121 = add nsw i32 %120, 1
store i32 %121, i32* %10
br label %102
122: ; preds = %102
br label %123
123: ; preds = %122
%124 = load i32, i32* %9
%125 = add nsw i32 %124, 1
store i32 %125, i32* %9
br label %86
126: ; preds = %86
%127 = load i32, i32* %11
%128 = sext i32 %127 to i64
%129 = mul i64 8, %128
%130 = trunc i64 %129 to i32
%131 = call i64 @malloc(i32 %130)
%132 = inttoptr i64 %131 to i8**
store i8** %132, i8*** %14
store i32 0, i32* %9
br label %133
133: ; preds = %149, %126
%134 = load i32, i32* %9
%135 = load i32, i32* %11
%136 = icmp slt i32 %134, %135
br i1 %136, label %137, label %152
137: ; preds = %133
%138 = load i32, i32* %8
%139 = sext i32 %138 to i64
%140 = mul i64 8, %139
%141 = mul i64 1, %140
%142 = trunc i64 %141 to i32
%143 = call i64 @malloc(i32 %142)
%144 = inttoptr i64 %143 to i8*
%145 = load i8**, i8*** %14
%146 = load i32, i32* %9
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8*, i8** %145, i64 %147
store i8* %144, i8** %148
br label %149
149: ; preds = %137
%150 = load i32, i32* %9
%151 = add nsw i32 %150, 1
store i32 %151, i32* %9
br label %133
152: ; preds = %133
%153 = load i32, i32* %7
%154 = load i32, i32* %11
%155 = load i32, i32* %8
%156 = load i32**, i32*** %15
%157 = load i8**, i8*** %13
%158 = load i8**, i8*** %14
%159 = load i32, i32* %8
%160 = sext i32 %159 to i64
%161 = mul i64 %160, 8
%162 = trunc i64 %161 to i32
%163 = call i32 @jerasure_schedule_encode(i32 %153, i32 %154, i32 %155, i32** %156, i8** %157, i8** %158, i32 %162, i32 8)
%164 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%165 = call i32 @jerasure_get_stats(double* %164)
%166 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%167 = load double, double* %166
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), double %167)
%169 = load i32, i32* %7
%170 = load i32, i32* %11
%171 = load i32, i32* %8
%172 = load i8**, i8*** %13
%173 = load i8**, i8*** %14
%174 = call i32 @print_data_and_coding(i32 %169, i32 %170, i32 %171, i32 8, i8** %172, i8** %173)
%175 = load i32, i32* %11
%176 = add nsw i32 %175, 1
%177 = sext i32 %176 to i64
%178 = mul i64 4, %177
%179 = trunc i64 %178 to i32
%180 = call i64 @malloc(i32 %179)
%181 = inttoptr i64 %180 to i32*
store i32* %181, i32** %16
%182 = load i32, i32* %7
%183 = load i32, i32* %11
%184 = add nsw i32 %182, %183
%185 = sext i32 %184 to i64
%186 = mul i64 4, %185
%187 = trunc i64 %186 to i32
%188 = call i64 @malloc(i32 %187)
%189 = inttoptr i64 %188 to i32*
store i32* %189, i32** %17
store i32 0, i32* %9
br label %190
190: ; preds = %201, %152
%191 = load i32, i32* %9
%192 = load i32, i32* %11
%193 = load i32, i32* %7
%194 = add nsw i32 %192, %193
%195 = icmp slt i32 %191, %194
br i1 %195, label %196, label %204
196: ; preds = %190
%197 = load i32*, i32** %17
%198 = load i32, i32* %9
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i32, i32* %197, i64 %199
store i32 0, i32* %200
br label %201
201: ; preds = %196
%202 = load i32, i32* %9
%203 = add nsw i32 %202, 1
store i32 %203, i32* %9
br label %190
204: ; preds = %190
store i32 0, i32* %9
br label %205
205: ; preds = %276, %204
%206 = load i32, i32* %9
%207 = load i32, i32* %11
%208 = icmp slt i32 %206, %207
br i1 %208, label %209, label %277
209: ; preds = %205
%210 = call i32 (...) @lrand48()
%211 = load i32, i32* %7
%212 = load i32, i32* %11
%213 = add nsw i32 %211, %212
%214 = srem i32 %210, %213
%215 = load i32*, i32** %16
%216 = load i32, i32* %9
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds i32, i32* %215, i64 %217
store i32 %214, i32* %218
%219 = load i32*, i32** %17
%220 = load i32*, i32** %16
%221 = load i32, i32* %9
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i32, i32* %220, i64 %222
%224 = load i32, i32* %223
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds i32, i32* %219, i64 %225
%227 = load i32, i32* %226
%228 = icmp eq i32 %227, 0
br i1 %228, label %229, label %276
229: ; preds = %209
%230 = load i32*, i32** %17
%231 = load i32*, i32** %16
%232 = load i32, i32* %9
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds i32, i32* %231, i64 %233
%235 = load i32, i32* %234
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds i32, i32* %230, i64 %236
store i32 1, i32* %237
%238 = load i32*, i32** %16
%239 = load i32, i32* %9
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds i32, i32* %238, i64 %240
%242 = load i32, i32* %241
%243 = load i32, i32* %7
%244 = icmp slt i32 %242, %243
br i1 %244, label %245, label %255
245: ; preds = %229
%246 = load i8**, i8*** %13
%247 = load i32*, i32** %16
%248 = load i32, i32* %9
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds i32, i32* %247, i64 %249
%251 = load i32, i32* %250
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i8*, i8** %246, i64 %252
%254 = load i8*, i8** %253
br label %267
255: ; preds = %229
%256 = load i8**, i8*** %14
%257 = load i32*, i32** %16
%258 = load i32, i32* %9
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds i32, i32* %257, i64 %259
%261 = load i32, i32* %260
%262 = load i32, i32* %7
%263 = sub nsw i32 %261, %262
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds i8*, i8** %256, i64 %264
%266 = load i8*, i8** %265
br label %267
267: ; preds = %255, %245
%268 = phi i8* [ %254, %245 ], [ %266, %255 ]
%269 = load i32, i32* %8
%270 = sext i32 %269 to i64
%271 = mul i64 8, %270
%272 = trunc i64 %271 to i32
%273 = call i32 @bzero(i8* %268, i32 %272)
%274 = load i32, i32* %9
%275 = add nsw i32 %274, 1
store i32 %275, i32* %9
br label %276
276: ; preds = %267, %209
br label %205
277: ; preds = %205
%278 = load i32*, i32** %16
%279 = load i32, i32* %9
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds i32, i32* %278, i64 %280
store i32 -1, i32* %281
%282 = load i32, i32* %11
%283 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %282)
%284 = load i32, i32* %7
%285 = load i32, i32* %11
%286 = load i32, i32* %8
%287 = load i8**, i8*** %13
%288 = load i8**, i8*** %14
%289 = call i32 @print_data_and_coding(i32 %284, i32 %285, i32 %286, i32 8, i8** %287, i8** %288)
%290 = load i32, i32* %7
%291 = load i32, i32* %11
%292 = load i32, i32* %8
%293 = load i32*, i32** %12
%294 = load i32*, i32** %16
%295 = load i8**, i8*** %13
%296 = load i8**, i8*** %14
%297 = load i32, i32* %8
%298 = sext i32 %297 to i64
%299 = mul i64 %298, 8
%300 = trunc i64 %299 to i32
%301 = call i32 @jerasure_schedule_decode_lazy(i32 %290, i32 %291, i32 %292, i32* %293, i32* %294, i8** %295, i8** %296, i32 %300, i32 8, i32 1)
%302 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%303 = call i32 @jerasure_get_stats(double* %302)
%304 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%305 = load double, double* %304
%306 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0), double %305)
%307 = load i32, i32* %7
%308 = load i32, i32* %11
%309 = load i32, i32* %8
%310 = load i8**, i8*** %13
%311 = load i8**, i8*** %14
%312 = call i32 @print_data_and_coding(i32 %307, i32 %308, i32 %309, i32 8, i8** %310, i8** %311)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"Bad k\00"
@.str.2 = [6 x i8] c"Bad w\00"
@.str.3 = [13 x i8] c"k is too big\00"
@.str.4 = [28 x i8] c"couldn't make coding matrix\00"
@.str.7 = [47 x i8] c"Smart Encoding Complete: - %.0lf XOR'd bytes\0A\0A\00"
@.str.8 = [28 x i8] c"Erased %d random devices:\0A\0A\00"
@.str.9 = [56 x i8] c"State of the system after decoding: %.0lf XOR'd bytes\0A\0A\00"
@str = [20 x i8] c"Coding Bit-Matrix:\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3 x double]
%7 = bitcast i64* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast [3 x double]* %6 to i8*
%11 = icmp eq i32 %0, 3
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = tail call i32 @usage(i8* null)
br label %14
14: ; preds = %12, %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @sscanf(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%18 = icmp eq i64 %17, 0
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 1
%21 = select i1 %18, i1 true, i1 %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = call i32 @usage(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %14, %22
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = call i64 @sscanf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%28 = icmp eq i64 %27, 0
%29 = load i32, i32* %5
%30 = icmp slt i32 %29, 1
%31 = select i1 %28, i1 true, i1 %30
%32 = icmp sgt i32 %29, 32
%33 = select i1 %31, i1 true, i1 %32
br i1 %33, label %34, label %37
34: ; preds = %24
%35 = call i32 @usage(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* %5
br label %37
37: ; preds = %24, %34
%38 = phi i32 [ %29, %24 ], [ %36, %34 ]
%39 = load i32, i32* %4
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = call i32 @usage(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%43 = load i32, i32* %4
%44 = load i32, i32* %5
br label %45
45: ; preds = %41, %37
%46 = phi i32 [ %44, %41 ], [ %38, %37 ]
%47 = phi i32 [ %43, %41 ], [ %39, %37 ]
%48 = call i32* @liberation_coding_bitmatrix(i32 %47, i32 %46)
%49 = icmp eq i32* %48, null
br i1 %49, label %50, label %52
50: ; preds = %45
%51 = call i32 @usage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %52
52: ; preds = %50, %45
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%54 = load i32, i32* %5
%55 = shl nsw i32 %54, 1
%56 = load i32, i32* %4
%57 = mul nsw i32 %56, %54
%58 = call i32 @jerasure_print_bitmatrix(i32* %48, i32 %55, i32 %57, i32 %54)
%59 = call i32 @putchar(i32 10)
%60 = load i32, i32* %4
%61 = load i32, i32* %5
%62 = call i32** @jerasure_dumb_bitmatrix_to_schedule(i32 %60, i32 2, i32 %61, i32* %48)
%63 = call i32 @srand48(i32 0)
%64 = load i32, i32* %4
%65 = shl i32 %64, 3
%66 = call i64 @malloc(i32 %65)
%67 = inttoptr i64 %66 to i8**
%68 = load i32, i32* %4
%69 = icmp sgt i32 %68, 0
br i1 %69, label %70, label %99
70: ; preds = %52
%71 = load i32, i32* %5
br label %72
72: ; preds = %70, %93
%73 = phi i32 [ %71, %70 ], [ %94, %93 ]
%74 = phi i64 [ 0, %70 ], [ %95, %93 ]
%75 = shl i32 %73, 3
%76 = call i64 @malloc(i32 %75)
%77 = inttoptr i64 %76 to i8*
%78 = getelementptr inbounds i8*, i8** %67, i64 %74
store i8* %77, i8** %78
%79 = load i32, i32* %5
%80 = icmp sgt i32 %79, 0
br i1 %80, label %81, label %93
81: ; preds = %72, %81
%82 = phi i64 [ %89, %81 ], [ 0, %72 ]
%83 = call i32 (...) @lrand48()
%84 = sext i32 %83 to i64
store i64 %84, i64* %3
%85 = load i8*, i8** %78
%86 = shl nuw nsw i64 %82, 3
%87 = getelementptr inbounds i8, i8* %85, i64 %86
%88 = call i32 @memcpy(i8* %87, i64* %3, i32 8)
%89 = add nuw nsw i64 %82, 1
%90 = load i32, i32* %5
%91 = sext i32 %90 to i64
%92 = icmp slt i64 %89, %91
br i1 %92, label %81, label %93
93: ; preds = %81, %72
%94 = phi i32 [ %79, %72 ], [ %90, %81 ]
%95 = add nuw nsw i64 %74, 1
%96 = load i32, i32* %4
%97 = sext i32 %96 to i64
%98 = icmp slt i64 %95, %97
br i1 %98, label %72, label %99
99: ; preds = %93, %52
%100 = call i64 @malloc(i32 16)
%101 = inttoptr i64 %100 to i8**
%102 = load i32, i32* %5
%103 = shl i32 %102, 3
%104 = call i64 @malloc(i32 %103)
%105 = inttoptr i64 %104 to i8*
store i8* %105, i8** %101
%106 = load i32, i32* %5
%107 = shl i32 %106, 3
%108 = call i64 @malloc(i32 %107)
%109 = inttoptr i64 %108 to i8*
%110 = getelementptr inbounds i8*, i8** %101, i64 1
store i8* %109, i8** %110
%111 = load i32, i32* %4
%112 = load i32, i32* %5
%113 = shl i32 %112, 3
%114 = call i32 @jerasure_schedule_encode(i32 %111, i32 2, i32 %112, i32** %62, i8** %67, i8** %101, i32 %113, i32 8)
%115 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%116 = call i32 @jerasure_get_stats(double* %115)
%117 = load double, double* %115
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), double %117)
%119 = load i32, i32* %4
%120 = load i32, i32* %5
%121 = call i32 @print_data_and_coding(i32 %119, i32 2, i32 %120, i32 8, i8** %67, i8** %101)
%122 = call i64 @malloc(i32 12)
%123 = inttoptr i64 %122 to i32*
%124 = load i32, i32* %4
%125 = shl i32 %124, 2
%126 = add i32 %125, 8
%127 = call i64 @malloc(i32 %126)
%128 = inttoptr i64 %127 to i32*
%129 = load i32, i32* %4
%130 = icmp sgt i32 %129, -2
br i1 %130, label %131, label %138
131: ; preds = %99, %131
%132 = phi i64 [ %134, %131 ], [ 0, %99 ]
%133 = getelementptr inbounds i32, i32* %128, i64 %132
store i32 0, i32* %133
%134 = add nuw nsw i64 %132, 1
%135 = load i32, i32* %4
%136 = sext i32 %135 to i64
%137 = icmp sgt i64 %132, %136
br i1 %137, label %138, label %131
138: ; preds = %131, %99
br label %139
139: ; preds = %138, %166
%140 = phi i32 [ %167, %166 ], [ 0, %138 ]
%141 = call i32 (...) @lrand48()
%142 = load i32, i32* %4
%143 = add nsw i32 %142, 2
%144 = srem i32 %141, %143
%145 = sext i32 %140 to i64
%146 = getelementptr inbounds i32, i32* %123, i64 %145
store i32 %144, i32* %146
%147 = sext i32 %144 to i64
%148 = getelementptr inbounds i32, i32* %128, i64 %147
%149 = load i32, i32* %148
%150 = icmp eq i32 %149, 0
br i1 %150, label %151, label %166
151: ; preds = %139
store i32 1, i32* %148
%152 = load i32, i32* %146
%153 = load i32, i32* %4
%154 = icmp slt i32 %152, %153
%155 = sext i32 %152 to i64
%156 = getelementptr inbounds i8*, i8** %67, i64 %155
%157 = sub nsw i32 %152, %153
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8*, i8** %101, i64 %158
%160 = select i1 %154, i8** %156, i8** %159
%161 = load i8*, i8** %160
%162 = load i32, i32* %5
%163 = shl i32 %162, 3
%164 = call i32 @bzero(i8* %161, i32 %163)
%165 = add nsw i32 %140, 1
br label %166
166: ; preds = %151, %139
%167 = phi i32 [ %165, %151 ], [ %140, %139 ]
%168 = icmp slt i32 %167, 2
br i1 %168, label %139, label %169
169: ; preds = %166
%170 = zext i32 %167 to i64
%171 = getelementptr inbounds i32, i32* %123, i64 %170
store i32 -1, i32* %171
%172 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 2)
%173 = load i32, i32* %4
%174 = load i32, i32* %5
%175 = call i32 @print_data_and_coding(i32 %173, i32 2, i32 %174, i32 8, i8** %67, i8** %101)
%176 = load i32, i32* %4
%177 = load i32, i32* %5
%178 = shl i32 %177, 3
%179 = call i32 @jerasure_schedule_decode_lazy(i32 %176, i32 2, i32 %177, i32* %48, i32* %123, i8** %67, i8** %101, i32 %178, i32 8, i32 1)
%180 = call i32 @jerasure_get_stats(double* %115)
%181 = load double, double* %115
%182 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0), double %181)
%183 = load i32, i32* %4
%184 = load i32, i32* %5
%185 = call i32 @print_data_and_coding(i32 %183, i32 2, i32 %184, i32 8, i8** %67, i8** %101)
ret i32 0
}