#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*/ free(int *);
int /*<<< orphan*/ jerasure_bitmatrix_dotprod(int, int, int *, int *, int,
                                              char **, char **, int, int);
int *jerasure_erasures_to_erased(int, int, int *);
scalar_t__ jerasure_make_decoding_bitmatrix(int, int, int, int *, int *, int *,
                                            int *);
scalar_t__ malloc(int);
int jerasure_bitmatrix_decode(int k, int m, int w, int *bitmatrix,
                              int row_k_ones, int *erasures, char **data_ptrs,
                              char **coding_ptrs, int size, int packetsize) {
  int i;
  int *erased;
  int *decoding_matrix;
  int *dm_ids;
  int edd, *tmpids, lastdrive;
  erased = jerasure_erasures_to_erased(k, m, erasures);
  if (erased == NULL)
    return -1;
  lastdrive = k;
  edd = 0;
  for (i = 0; i < k; i++) {
    if (erased[i]) {
      edd++;
      lastdrive = i;
    }
  }
  if (row_k_ones != 1 || erased[k])
    lastdrive = k;
  dm_ids = NULL;
  decoding_matrix = NULL;
  if (edd > 1 || (edd > 0 && (row_k_ones != 1 || erased[k]))) {
    dm_ids = (int *)malloc(sizeof(int) * (k));
    if (dm_ids == NULL) {
      free(erased);
      return -1;
    }
    decoding_matrix = (int *)malloc(sizeof(int) * (k * k * w * w));
    if (decoding_matrix == NULL) {
      free(erased);
      free(dm_ids);
      return -1;
    }
    if (jerasure_make_decoding_bitmatrix(k, m, w, bitmatrix, erased,
                                         decoding_matrix, dm_ids) < 0) {
      free(erased);
      free(dm_ids);
      free(decoding_matrix);
      return -1;
    }
  }
  for (i = 0; edd > 0 && i < lastdrive; i++) {
    if (erased[i]) {
      jerasure_bitmatrix_dotprod(k, w, decoding_matrix + i * k * w * w, dm_ids,
                                 i, data_ptrs, coding_ptrs, size, packetsize);
      edd--;
    }
  }
  if (edd > 0) {
    tmpids = (int *)malloc(sizeof(int) * (k));
    for (i = 0; i < k; i++) {
      tmpids[i] = (i < lastdrive) ? i : i + 1;
    }
    jerasure_bitmatrix_dotprod(k, w, bitmatrix, tmpids, lastdrive, data_ptrs,
                               coding_ptrs, size, packetsize);
    free(tmpids);
  }
  for (i = 0; i < m; i++) {
    if (erased[k + i]) {
      jerasure_bitmatrix_dotprod(k, w, bitmatrix + i * k * w * w, NULL, k + i,
                                 data_ptrs, coding_ptrs, size, packetsize);
    }
  }
  free(erased);
  if (dm_ids != NULL)
    free(dm_ids);
  if (decoding_matrix != NULL)
    free(decoding_matrix);
  return 0;
}


x86 assembly (clang, -O0):
<jerasure_bitmatrix_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1050 <jerasure_erasures_to_erased@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11a8 <jerasure_bitmatrix_decode+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    1547 <jerasure_bitmatrix_decode+0x3f7>
mov    -0x8(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11fc <jerasure_bitmatrix_decode+0xac>
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11e9 <jerasure_bitmatrix_decode+0x99>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    11ee <jerasure_bitmatrix_decode+0x9e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11bc <jerasure_bitmatrix_decode+0x6c>
cmpl   $0x1,-0x1c(%rbp)
jne    1218 <jerasure_bitmatrix_decode+0xc8>
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     121e <jerasure_bitmatrix_decode+0xce>
mov    -0x8(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
cmpl   $0x1,-0x4c(%rbp)
jg     125e <jerasure_bitmatrix_decode+0x10e>
cmpl   $0x0,-0x4c(%rbp)
jle    1332 <jerasure_bitmatrix_decode+0x1e2>
cmpl   $0x1,-0x1c(%rbp)
jne    125e <jerasure_bitmatrix_decode+0x10e>
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1332 <jerasure_bitmatrix_decode+0x1e2>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1291 <jerasure_bitmatrix_decode+0x141>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1547 <jerasure_bitmatrix_decode+0x3f7>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    12da <jerasure_bitmatrix_decode+0x18a>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1547 <jerasure_bitmatrix_decode+0x3f7>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    -0x48(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <jerasure_make_decoding_bitmatrix@plt>
cmp    $0x0,%rax
jge    132d <jerasure_bitmatrix_decode+0x1dd>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1547 <jerasure_bitmatrix_decode+0x3f7>
jmp    1332 <jerasure_bitmatrix_decode+0x1e2>
movl   $0x0,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4c(%rbp)
mov    %al,-0x5d(%rbp)
jle    1354 <jerasure_bitmatrix_decode+0x204>
mov    -0x2c(%rbp),%eax
cmp    -0x5c(%rbp),%eax
setl   %al
mov    %al,-0x5d(%rbp)
mov    -0x5d(%rbp),%al
test   $0x1,%al
jne    1364 <jerasure_bitmatrix_decode+0x214>
jmp    13dd <jerasure_bitmatrix_decode+0x28d>
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     13ca <jerasure_bitmatrix_decode+0x27a>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x2c(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10d
mov    0x28(%rbp),%eax
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1070 <jerasure_bitmatrix_dotprod@plt>
mov    -0x4c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4c(%rbp)
jmp    13cf <jerasure_bitmatrix_decode+0x27f>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1339 <jerasure_bitmatrix_decode+0x1e9>
cmpl   $0x0,-0x4c(%rbp)
jle    1485 <jerasure_bitmatrix_decode+0x335>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1449 <jerasure_bitmatrix_decode+0x2f9>
mov    -0x2c(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    1424 <jerasure_bitmatrix_decode+0x2d4>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x64(%rbp)
jmp    142d <jerasure_bitmatrix_decode+0x2dd>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%edx
mov    -0x58(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1401 <jerasure_bitmatrix_decode+0x2b1>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x5c(%rbp),%r8d
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10d
mov    0x28(%rbp),%eax
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1070 <jerasure_bitmatrix_dotprod@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    150f <jerasure_bitmatrix_decode+0x3bf>
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     14fc <jerasure_bitmatrix_decode+0x3ac>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x2c(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x8(%rbp),%r8d
add    -0x2c(%rbp),%r8d
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10d
mov    0x28(%rbp),%eax
xor    %ecx,%ecx
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1070 <jerasure_bitmatrix_dotprod@plt>
jmp    1501 <jerasure_bitmatrix_decode+0x3b1>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    148c <jerasure_bitmatrix_decode+0x33c>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x48(%rbp)
je     152c <jerasure_bitmatrix_decode+0x3dc>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x40(%rbp)
je     1540 <jerasure_bitmatrix_decode+0x3f0>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jerasure_bitmatrix_decode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8d,%r15d
mov    %rcx,0x30(%rsp)
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %r9,%rdx
call   1050 <jerasure_erasures_to_erased@plt>
test   %rax,%rax
je     119d <jerasure_bitmatrix_decode+0x4d>
mov    %rax,%r13
mov    %ebx,%edi
test   %ebx,%ebx
mov    %r14d,0xc(%rsp)
jle    11a7 <jerasure_bitmatrix_decode+0x57>
cmp    $0x1,%ebx
jne    11af <jerasure_bitmatrix_decode+0x5f>
xor    %eax,%eax
mov    %ebx,%r14d
xor    %r12d,%r12d
test   $0x1,%dil
jne    11fe <jerasure_bitmatrix_decode+0xae>
jmp    1213 <jerasure_bitmatrix_decode+0xc3>
mov    $0xffffffff,%ebp
jmp    15a7 <jerasure_bitmatrix_decode+0x457>
xor    %r12d,%r12d
mov    %ebx,%r14d
jmp    1213 <jerasure_bitmatrix_decode+0xc3>
mov    %edi,%ecx
and    $0xfffffffe,%ecx
xor    %eax,%eax
mov    %rbx,%r8
mov    %ebx,%r14d
xor    %r12d,%r12d
nop
xor    %edx,%edx
cmpl   $0x0,0x0(%r13,%rax,4)
mov    %r14d,%esi
cmovne %eax,%esi
setne  %dl
add    %r12d,%edx
lea    0x1(%rax),%r14d
xor    %r12d,%r12d
cmpl   $0x0,0x4(%r13,%rax,4)
cmove  %esi,%r14d
setne  %r12b
add    %edx,%r12d
add    $0x2,%rax
cmp    %rcx,%rax
jne    11c0 <jerasure_bitmatrix_decode+0x70>
mov    %r8,%rbx
test   $0x1,%dil
je     1213 <jerasure_bitmatrix_decode+0xc3>
xor    %ecx,%ecx
cmpl   $0x0,0x0(%r13,%rax,4)
setne  %cl
cmove  %r14d,%eax
add    %ecx,%r12d
mov    %eax,%r14d
cmp    $0x1,%r15d
jne    1224 <jerasure_bitmatrix_decode+0xd4>
movslq %ebx,%rax
cmpl   $0x0,0x0(%r13,%rax,4)
je     1227 <jerasure_bitmatrix_decode+0xd7>
mov    %ebx,%r14d
cmp    $0x1,%r12d
mov    %rdi,0x38(%rsp)
mov    %ebp,0x24(%rsp)
ja     1251 <jerasure_bitmatrix_decode+0x101>
jne    13cb <jerasure_bitmatrix_decode+0x27b>
cmp    $0x1,%r15d
jne    1251 <jerasure_bitmatrix_decode+0x101>
movslq %ebx,%rax
cmpl   $0x0,0x0(%r13,%rax,4)
je     141b <jerasure_bitmatrix_decode+0x2cb>
lea    0x0(,%rbx,4),%edi
call   1060 <malloc@plt>
mov    $0xffffffff,%ebp
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     13c3 <jerasure_bitmatrix_decode+0x273>
mov    0xc(%rsp),%r15d
mov    %r15d,%edi
imul   %ebx,%edi
imul   %edi,%edi
shl    $0x2,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     13eb <jerasure_bitmatrix_decode+0x29b>
sub    $0x8,%rsp
mov    %rbx,0x18(%rsp)
mov    %ebx,%edi
mov    0x2c(%rsp),%esi
mov    %r15d,%edx
mov    0x38(%rsp),%rcx
mov    %r13,%r8
mov    %rax,%rbx
mov    %rax,%r9
mov    0x20(%rsp),%r15
push   %r15
call   1040 <jerasure_make_decoding_bitmatrix@plt>
add    $0x10,%rsp
test   %rax,%rax
js     1403 <jerasure_bitmatrix_decode+0x2b3>
mov    %r15,0x28(%rsp)
mov    %rbx,0x18(%rsp)
mov    0x10(%rsp),%rbx
test   %r12d,%r12d
setg   %al
mov    %rbx,0x10(%rsp)
jle    137b <jerasure_bitmatrix_decode+0x22b>
test   %r14d,%r14d
jle    137b <jerasure_bitmatrix_decode+0x22b>
mov    0xc(%rsp),%ebx
imul   %ebx,%ebx
imul   0x10(%rsp),%ebx
mov    %r14d,%eax
mov    %rax,0x40(%rsp)
xor    %r15d,%r15d
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x0(%r13,%rbp,4)
je     1365 <jerasure_bitmatrix_decode+0x215>
movslq %r15d,%rax
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%rdx
sub    $0x8,%rsp
mov    0x18(%rsp),%rdi
mov    0x14(%rsp),%esi
mov    0x30(%rsp),%rcx
mov    %ebp,%r8d
mov    0x88(%rsp),%r9
mov    0xa0(%rsp),%eax
push   %rax
mov    0xa0(%rsp),%eax
push   %rax
push   0xa0(%rsp)
call   1070 <jerasure_bitmatrix_dotprod@plt>
add    $0x20,%rsp
add    $0xffffffff,%r12d
test   %r12d,%r12d
setg   %al
jle    137b <jerasure_bitmatrix_decode+0x22b>
add    $0x1,%rbp
add    %ebx,%r15d
cmp    0x40(%rsp),%rbp
jb     1310 <jerasure_bitmatrix_decode+0x1c0>
test   %al,%al
je     13f2 <jerasure_bitmatrix_decode+0x2a2>
mov    0x10(%rsp),%rbx
lea    0x0(,%rbx,4),%edi
call   1060 <malloc@plt>
mov    %rax,%r12
test   %ebx,%ebx
mov    0xc(%rsp),%esi
mov    0x24(%rsp),%r15d
jle    14a9 <jerasure_bitmatrix_decode+0x359>
movslq %r14d,%r9
mov    0x38(%rsp),%r8
lea    -0x1(%r8),%rdx
mov    %r8d,%ecx
and    $0x3,%ecx
cmp    $0x3,%rdx
jae    142e <jerasure_bitmatrix_decode+0x2de>
xor    %edx,%edx
jmp    148b <jerasure_bitmatrix_decode+0x33b>
mov    %r13,%rbx
jmp    159f <jerasure_bitmatrix_decode+0x44f>
mov    %rbx,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
test   %ebp,%ebp
jg     14f8 <jerasure_bitmatrix_decode+0x3a8>
jmp    157c <jerasure_bitmatrix_decode+0x42c>
mov    0x18(%rsp),%rbx
jmp    140e <jerasure_bitmatrix_decode+0x2be>
mov    0x24(%rsp),%ebp
test   %ebp,%ebp
jg     14f8 <jerasure_bitmatrix_decode+0x3a8>
jmp    157c <jerasure_bitmatrix_decode+0x42c>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%r13
mov    %r13,%rdi
call   1030 <free@plt>
jmp    159f <jerasure_bitmatrix_decode+0x44f>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
jmp    12d7 <jerasure_bitmatrix_decode+0x187>
and    $0xfffffffc,%r8d
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdx,%rdi
add    $0x1,%rdx
cmp    %r9,%rdi
mov    %edx,%ebp
cmovl  %edi,%ebp
mov    %ebp,(%r12,%rdi,4)
lea    0x2(%rdi),%rbp
cmp    %r9,%rdx
mov    %ebp,%ebx
cmovl  %edx,%ebx
lea    0x3(%rdi),%rax
cmp    %r9,%rbp
mov    %eax,%edx
cmovl  %ebp,%edx
mov    %ebx,0x4(%r12,%rdi,4)
mov    %edx,0x8(%r12,%rdi,4)
lea    0x4(%rdi),%rdx
cmp    %r9,%rax
mov    %edx,%ebp
cmovl  %eax,%ebp
mov    %ebp,0xc(%r12,%rdi,4)
cmp    %r8,%rdx
jne    1440 <jerasure_bitmatrix_decode+0x2f0>
test   %rcx,%rcx
je     14a9 <jerasure_bitmatrix_decode+0x359>
lea    0x1(%rdx),%rbp
cmp    %r9,%rdx
mov    %ebp,%edi
cmovl  %edx,%edi
mov    %edi,(%r12,%rdx,4)
mov    %rbp,%rdx
add    $0xffffffffffffffff,%rcx
jne    1490 <jerasure_bitmatrix_decode+0x340>
sub    $0x8,%rsp
mov    0x18(%rsp),%rdi
mov    0x38(%rsp),%rdx
mov    %r12,%rcx
mov    %r14d,%r8d
mov    0x88(%rsp),%r9
mov    0xa0(%rsp),%eax
push   %rax
mov    0xa0(%rsp),%eax
push   %rax
push   0xa0(%rsp)
call   1070 <jerasure_bitmatrix_dotprod@plt>
add    $0x20,%rsp
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15d,%ebp
test   %ebp,%ebp
jle    157c <jerasure_bitmatrix_decode+0x42c>
mov    0xc(%rsp),%r12d
imul   %r12d,%r12d
mov    0x10(%rsp),%rax
imul   %eax,%r12d
cltq
mov    %ebp,%r14d
lea    0x0(,%rax,4),%r15
add    %r13,%r15
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    152c <jerasure_bitmatrix_decode+0x3dc>
add    $0x1,%rbp
add    %r12d,%ebx
cmp    %rbp,%r14
je     157c <jerasure_bitmatrix_decode+0x42c>
cmpl   $0x0,(%r15,%rbp,4)
je     1520 <jerasure_bitmatrix_decode+0x3d0>
movslq %ebx,%rax
mov    0x30(%rsp),%rcx
lea    (%rcx,%rax,4),%rdx
mov    0x38(%rsp),%rdi
lea    (%rdi,%rbp,1),%r8d
sub    $0x8,%rsp
mov    0x14(%rsp),%esi
xor    %ecx,%ecx
mov    0x88(%rsp),%r9
mov    0xa0(%rsp),%eax
push   %rax
mov    0xa0(%rsp),%eax
push   %rax
push   0xa0(%rsp)
call   1070 <jerasure_bitmatrix_dotprod@plt>
add    $0x20,%rsp
jmp    1520 <jerasure_bitmatrix_decode+0x3d0>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
test   %rdi,%rdi
je     1593 <jerasure_bitmatrix_decode+0x443>
call   1030 <free@plt>
xor    %ebp,%ebp
mov    0x18(%rsp),%rbx
test   %rbx,%rbx
je     15a7 <jerasure_bitmatrix_decode+0x457>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @jerasure_bitmatrix_decode(i32 %0, i32 %1, i32 %2, i32* %3, i32 %4, i32* %5, i8** %6, i8** %7, i32 %8, i32 %9) {
%11 = tail call i32* @jerasure_erasures_to_erased(i32 %0, i32 %1, i32* %5)
%12 = icmp eq i32* %11, null
br i1 %12, label %224, label %13
13: ; preds = %10
%14 = icmp sgt i32 %0, 0
br i1 %14, label %15, label %62
15: ; preds = %13
%16 = zext i32 %0 to i64
%17 = and i64 %16, 1
%18 = icmp eq i32 %0, 1
br i1 %18, label %46, label %19
19: ; preds = %15
%20 = and i64 %16, 4294967294
br label %21
21: ; preds = %21, %19
%22 = phi i64 [ 0, %19 ], [ %43, %21 ]
%23 = phi i32 [ %0, %19 ], [ %42, %21 ]
%24 = phi i32 [ 0, %19 ], [ %40, %21 ]
%25 = phi i64 [ 0, %19 ], [ %44, %21 ]
%26 = getelementptr inbounds i32, i32* %11, i64 %22
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 0
%29 = xor i1 %28, true
%30 = zext i1 %29 to i32
%31 = add nuw nsw i32 %24, %30
%32 = trunc i64 %22 to i32
%33 = select i1 %28, i32 %23, i32 %32
%34 = or i64 %22, 1
%35 = getelementptr inbounds i32, i32* %11, i64 %34
%36 = load i32, i32* %35
%37 = icmp eq i32 %36, 0
%38 = xor i1 %37, true
%39 = zext i1 %38 to i32
%40 = add nuw nsw i32 %31, %39
%41 = trunc i64 %34 to i32
%42 = select i1 %37, i32 %33, i32 %41
%43 = add nuw nsw i64 %22, 2
%44 = add i64 %25, 2
%45 = icmp eq i64 %44, %20
br i1 %45, label %46, label %21
46: ; preds = %21, %15
%47 = phi i32 [ undef, %15 ], [ %40, %21 ]
%48 = phi i32 [ undef, %15 ], [ %42, %21 ]
%49 = phi i64 [ 0, %15 ], [ %43, %21 ]
%50 = phi i32 [ %0, %15 ], [ %42, %21 ]
%51 = phi i32 [ 0, %15 ], [ %40, %21 ]
%52 = icmp eq i64 %17, 0
br i1 %52, label %62, label %53
53: ; preds = %46
%54 = getelementptr inbounds i32, i32* %11, i64 %49
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 0
%57 = xor i1 %56, true
%58 = zext i1 %57 to i32
%59 = add nuw nsw i32 %51, %58
%60 = trunc i64 %49 to i32
%61 = select i1 %56, i32 %50, i32 %60
br label %62
62: ; preds = %53, %46, %13
%63 = phi i32 [ 0, %13 ], [ %47, %46 ], [ %59, %53 ]
%64 = phi i32 [ %0, %13 ], [ %48, %46 ], [ %61, %53 ]
%65 = icmp eq i32 %4, 1
br i1 %65, label %66, label %71
66: ; preds = %62
%67 = sext i32 %0 to i64
%68 = getelementptr inbounds i32, i32* %11, i64 %67
%69 = load i32, i32* %68
%70 = icmp eq i32 %69, 0
br i1 %70, label %72, label %71
71: ; preds = %66, %62
br label %72
72: ; preds = %71, %66
%73 = phi i32 [ %0, %71 ], [ %64, %66 ]
%74 = icmp ugt i32 %63, 1
br i1 %74, label %83, label %75
75: ; preds = %72
%76 = icmp eq i32 %63, 1
br i1 %76, label %77, label %184
77: ; preds = %75
br i1 %65, label %78, label %83
78: ; preds = %77
%79 = sext i32 %0 to i64
%80 = getelementptr inbounds i32, i32* %11, i64 %79
%81 = load i32, i32* %80
%82 = icmp eq i32 %81, 0
br i1 %82, label %100, label %83
83: ; preds = %78, %77, %72
%84 = shl i32 %0, 2
%85 = tail call i64 @malloc(i32 %84)
%86 = inttoptr i64 %85 to i32*
%87 = icmp eq i64 %85, 0
br i1 %87, label %220, label %88
88: ; preds = %83
%89 = mul i32 %2, %0
%90 = shl i32 %89, 2
%91 = mul i32 %90, %89
%92 = tail call i64 @malloc(i32 %91)
%93 = inttoptr i64 %92 to i32*
%94 = icmp eq i64 %92, 0
br i1 %94, label %216, label %95
95: ; preds = %88
%96 = tail call i64 @jerasure_make_decoding_bitmatrix(i32 %0, i32 %1, i32 %2, i32* %3, i32* %11, i32* %93, i32* %86)
%97 = icmp slt i64 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %95
%99 = tail call i32 @free(i32* %11)
br label %216
100: ; preds = %95, %78
%101 = phi i32* [ %93, %95 ], [ null, %78 ]
%102 = phi i32* [ %86, %95 ], [ null, %78 ]
%103 = icmp sgt i32 %63, 0
%104 = icmp sgt i32 %73, 0
%105 = select i1 %103, i1 %104, i1 false
br i1 %105, label %106, label %129
106: ; preds = %100
%107 = mul i32 %2, %2
%108 = mul i32 %107, %0
%109 = zext i32 %73 to i64
br label %110
110: ; preds = %106, %123
%111 = phi i64 [ 0, %106 ], [ %125, %123 ]
%112 = phi i32 [ %63, %106 ], [ %124, %123 ]
%113 = getelementptr inbounds i32, i32* %11, i64 %111
%114 = load i32, i32* %113
%115 = icmp eq i32 %114, 0
br i1 %115, label %123, label %116
116: ; preds = %110
%117 = trunc i64 %111 to i32
%118 = mul i32 %108, %117
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i32, i32* %101, i64 %119
%121 = tail call i32 @jerasure_bitmatrix_dotprod(i32 %0, i32 %2, i32* %120, i32* %102, i32 %117, i8** %6, i8** %7, i32 %8, i32 %9)
%122 = add nsw i32 %112, -1
br label %123
123: ; preds = %110, %116
%124 = phi i32 [ %122, %116 ], [ %112, %110 ]
%125 = add nuw nsw i64 %111, 1
%126 = icmp sgt i32 %124, 0
%127 = icmp ult i64 %125, %109
%128 = select i1 %126, i1 %127, i1 false
br i1 %128, label %110, label %129
129: ; preds = %123, %100
%130 = phi i1 [ %103, %100 ], [ %126, %123 ]
br i1 %130, label %131, label %184
131: ; preds = %129
%132 = shl i32 %0, 2
%133 = tail call i64 @malloc(i32 %132)
%134 = inttoptr i64 %133 to i32*
br i1 %14, label %135, label %181
135: ; preds = %131
%136 = sext i32 %73 to i64
%137 = zext i32 %0 to i64
%138 = add nsw i64 %137, -1
%139 = and i64 %137, 3
%140 = icmp ult i64 %138, 3
br i1 %140, label %168, label %141
141: ; preds = %135
%142 = and i64 %137, 4294967292
br label %143
143: ; preds = %143, %141
%144 = phi i64 [ 0, %141 ], [ %162, %143 ]
%145 = phi i64 [ 0, %141 ], [ %166, %143 ]
%146 = icmp slt i64 %144, %136
%147 = or i64 %144, 1
%148 = select i1 %146, i64 %144, i64 %147
%149 = trunc i64 %148 to i32
%150 = getelementptr inbounds i32, i32* %134, i64 %144
store i32 %149, i32* %150
%151 = icmp slt i64 %147, %136
%152 = or i64 %144, 2
%153 = select i1 %151, i64 %147, i64 %152
%154 = trunc i64 %153 to i32
%155 = getelementptr inbounds i32, i32* %134, i64 %147
store i32 %154, i32* %155
%156 = icmp slt i64 %152, %136
%157 = or i64 %144, 3
%158 = select i1 %156, i64 %152, i64 %157
%159 = trunc i64 %158 to i32
%160 = getelementptr inbounds i32, i32* %134, i64 %152
store i32 %159, i32* %160
%161 = icmp slt i64 %157, %136
%162 = add nuw nsw i64 %144, 4
%163 = select i1 %161, i64 %157, i64 %162
%164 = trunc i64 %163 to i32
%165 = getelementptr inbounds i32, i32* %134, i64 %157
store i32 %164, i32* %165
%166 = add i64 %145, 4
%167 = icmp eq i64 %166, %142
br i1 %167, label %168, label %143
168: ; preds = %143, %135
%169 = phi i64 [ 0, %135 ], [ %162, %143 ]
%170 = icmp eq i64 %139, 0
br i1 %170, label %181, label %171
171: ; preds = %168, %171
%172 = phi i64 [ %175, %171 ], [ %169, %168 ]
%173 = phi i64 [ %179, %171 ], [ 0, %168 ]
%174 = icmp slt i64 %172, %136
%175 = add nuw nsw i64 %172, 1
%176 = select i1 %174, i64 %172, i64 %175
%177 = trunc i64 %176 to i32
%178 = getelementptr inbounds i32, i32* %134, i64 %172
store i32 %177, i32* %178
%179 = add i64 %173, 1
%180 = icmp eq i64 %179, %139
br i1 %180, label %181, label %171
181: ; preds = %168, %171, %131
%182 = tail call i32 @jerasure_bitmatrix_dotprod(i32 %0, i32 %2, i32* %3, i32* %134, i32 %73, i8** %6, i8** %7, i32 %8, i32 %9)
%183 = tail call i32 @free(i32* %134)
br label %184
184: ; preds = %75, %181, %129
%185 = phi i32* [ %101, %181 ], [ %101, %129 ], [ null, %75 ]
%186 = phi i32* [ %102, %181 ], [ %102, %129 ], [ null, %75 ]
%187 = icmp sgt i32 %1, 0
br i1 %187, label %188, label %209
188: ; preds = %184
%189 = mul i32 %2, %2
%190 = mul i32 %189, %0
%191 = sext i32 %0 to i64
%192 = zext i32 %1 to i64
br label %193
193: ; preds = %188, %206
%194 = phi i64 [ 0, %188 ], [ %207, %206 ]
%195 = add nsw i64 %194, %191
%196 = getelementptr inbounds i32, i32* %11, i64 %195
%197 = load i32, i32* %196
%198 = icmp eq i32 %197, 0
br i1 %198, label %206, label %199
199: ; preds = %193
%200 = trunc i64 %194 to i32
%201 = mul i32 %190, %200
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds i32, i32* %3, i64 %202
%204 = trunc i64 %195 to i32
%205 = tail call i32 @jerasure_bitmatrix_dotprod(i32 %0, i32 %2, i32* %203, i32* null, i32 %204, i8** %6, i8** %7, i32 %8, i32 %9)
br label %206
206: ; preds = %193, %199
%207 = add nuw nsw i64 %194, 1
%208 = icmp eq i64 %207, %192
br i1 %208, label %209, label %193
209: ; preds = %206, %184
%210 = tail call i32 @free(i32* %11)
%211 = icmp eq i32* %186, null
br i1 %211, label %214, label %212
212: ; preds = %209
%213 = tail call i32 @free(i32* %186)
br label %214
214: ; preds = %212, %209
%215 = icmp eq i32* %185, null
br i1 %215, label %224, label %220
216: ; preds = %88, %98
%217 = phi i32* [ %86, %98 ], [ %11, %88 ]
%218 = phi i32* [ %93, %98 ], [ %86, %88 ]
%219 = tail call i32 @free(i32* %217)
br label %220
220: ; preds = %216, %214, %83
%221 = phi i32* [ %11, %83 ], [ %185, %214 ], [ %218, %216 ]
%222 = phi i32 [ -1, %83 ], [ 0, %214 ], [ -1, %216 ]
%223 = tail call i32 @free(i32* %221)
br label %224
224: ; preds = %220, %214, %10
%225 = phi i32 [ -1, %10 ], [ 0, %214 ], [ %222, %220 ]
ret i32 %225
}