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