#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rs_erasure(unsigned char *, unsigned char *, unsigned short,
                              unsigned char);
int main(void) {
  int k, i;
  char test_pass;
  FILE *fp = NULL;
  fp = fopen("tv_rs_erasure_in.txt", "rt");
  if (NULL == fp) {
    printf("Error Opening Input Test Vector!\n");
    return (1);
  }
  FILE *fp_gold = NULL;
  fp_gold = fopen("tv_rs_erasure_mout.txt", "rt");
  if (NULL == fp_gold) {
    printf("Error Opening Golden Output Test Vector!\n");
    return (1);
  }
  int a[12 + 2];
  int fileend = 0;
  unsigned char c[4];
  unsigned char d[12];
  unsigned short survival_pattern;
  unsigned char codeid;
  int errcnt = 0;
  int linecnt = 0;
  int suberrcnt[4];
  int sublincnt[4];
  for (i = 0; i < 4; i++)
    suberrcnt[i] = 0;
  for (i = 0; i < 4; i++)
    sublincnt[i] = 0;
  while (1) {
    for (k = 0; k < (12 + 2); k++) {
      int tmp;
      int scnt = fscanf(fp, "%d", &tmp);
      a[k] = tmp;
      if (scnt < 0) {
        fileend = 1;
        break;
      }
    }
    if (fileend)
      break;
    linecnt++;
    codeid = a[0] & 3;
    survival_pattern = a[1] & ((1 << (12 + 4)) - 1);
    for (k = 0; k < 12; k++)
      d[k] = a[2 + k] & ((1 << 8) - 1);
    rs_erasure(c, d, survival_pattern, codeid);
    sublincnt[codeid]++;
    unsigned char this_is_err = 0;
    for (k = 0; k < 4; k++) {
      int tmp;
      fscanf(fp_gold, "%d", &tmp);
      if (c[k] != tmp) {
        this_is_err = 1;
        if (suberrcnt[codeid] <= 5)
          printf("[Err %3d] line %d\n", errcnt, linecnt);
      }
    }
    if (this_is_err) {
      suberrcnt[codeid]++;
      errcnt++;
    }
  }
  fclose(fp);
  fclose(fp_gold);
  for (i = 0; i < 4; i++) {
    printf("\t[%d] %3d out of %3d test vectors failed.\n", i, suberrcnt[i],
           sublincnt[i]);
  }
  printf("Total %d Test Vectors, Err Count = %d.\n", linecnt, errcnt);
  if (errcnt)
    printf("Test Failed!\n");
  else
    printf("Test Passed!\n");
  return (errcnt);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xe8f(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    11a7 <main+0x57>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14b4 <main+0x364>
movq   $0x0,-0x20(%rbp)
lea    0xe84(%rip),%rdi
lea    0xe58(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    11ec <main+0x9c>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14b4 <main+0x364>
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    122f <main+0xdf>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x90(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1208 <main+0xb8>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    125d <main+0x10d>
movslq -0xc(%rbp),%rax
movl   $0x0,-0xa0(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1236 <main+0xe6>
jmp    1262 <main+0x112>
movl   $0x0,-0x8(%rbp)
cmpl   $0xe,-0x8(%rbp)
jge    12ca <main+0x17a>
mov    -0x18(%rbp),%rdi
lea    0xdfd(%rip),%rsi
lea    -0xa4(%rbp),%rdx
call   1050 <fscanf@plt>
mov    %eax,-0xa8(%rbp)
mov    -0xa4(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
cmpl   $0x0,-0xa8(%rbp)
jge    12b7 <main+0x167>
movl   $0x1,-0x64(%rbp)
jmp    12ca <main+0x17a>
jmp    12bc <main+0x16c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1269 <main+0x119>
cmpl   $0x0,-0x64(%rbp)
je     12d9 <main+0x189>
jmp    1417 <main+0x2c7>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
mov    -0x60(%rbp),%eax
and    $0x3,%eax
mov    %al,-0x77(%rbp)
mov    -0x5c(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x76(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    1331 <main+0x1e1>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
cltq
mov    -0x60(%rbp,%rax,4),%eax
and    $0xff,%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x74(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12fe <main+0x1ae>
lea    -0x68(%rbp),%rdi
lea    -0x74(%rbp),%rsi
mov    -0x76(%rbp),%ax
movzwl %ax,%edx
movzbl -0x77(%rbp),%ecx
call   1070 <rs_erasure@plt>
movzbl -0x77(%rbp),%eax
mov    -0xa0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0xa0(%rbp,%rax,4)
movb   $0x0,-0xa9(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    13e7 <main+0x297>
mov    -0x20(%rbp),%rdi
lea    0xcfa(%rip),%rsi
lea    -0xb0(%rbp),%rdx
call   1050 <fscanf@plt>
movslq -0x8(%rbp),%rax
movzbl -0x68(%rbp,%rax,1),%eax
cmp    -0xb0(%rbp),%eax
je     13d4 <main+0x284>
movb   $0x1,-0xa9(%rbp)
movzbl -0x77(%rbp),%eax
cmpl   $0x5,-0x90(%rbp,%rax,4)
05
jg     13cf <main+0x27f>
mov    -0x7c(%rbp),%esi
mov    -0x80(%rbp),%edx
lea    0xcb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13d4 <main+0x284>
jmp    13d9 <main+0x289>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    136c <main+0x21c>
cmpb   $0x0,-0xa9(%rbp)
je     1412 <main+0x2c2>
movzbl -0x77(%rbp),%eax
mov    -0x90(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1262 <main+0x112>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    146f <main+0x31f>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%edx
movslq -0xc(%rbp),%rax
mov    -0xa0(%rbp,%rax,4),%ecx
lea    0xc37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1430 <main+0x2e0>
mov    -0x80(%rbp),%esi
mov    -0x7c(%rbp),%edx
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x7c(%rbp)
je     14a0 <main+0x350>
lea    0xc50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14ae <main+0x35e>
lea    0xc4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%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    $0x98,%rsp
lea    0xe98(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     161c <main+0x4bc>
mov    %rax,%rbx
lea    0xe91(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     1625 <main+0x4c5>
pxor   %xmm0,%xmm0
movdqa %xmm0,0x20(%rsp)
movdqa %xmm0,0x70(%rsp)
lea    0xe77(%rip),%r13
lea    0x4(%rsp),%rbp
movl   $0x0,0x8(%rsp)
xor    %r12d,%r12d
mov    0x34(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%r15d
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x10(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x38(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x3c(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x40(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x44(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x48(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x4c(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x50(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x54(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x58(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x5c(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x60(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,0x64(%rsp)
test   %eax,%eax
js     156b <main+0x40b>
movdqu 0x38(%rsp),%xmm0
movdqu 0x48(%rsp),%xmm1
movdqu 0x58(%rsp),%xmm2
movdqa 0xc65(%rip),%xmm3
pand   %xmm3,%xmm0
packuswb %xmm0,%xmm0
packuswb %xmm0,%xmm0
movd   %xmm0,0x84(%rsp)
pand   %xmm3,%xmm1
packuswb %xmm1,%xmm1
packuswb %xmm1,%xmm1
movd   %xmm1,0x88(%rsp)
pand   %xmm3,%xmm2
packuswb %xmm2,%xmm2
packuswb %xmm2,%xmm2
movd   %xmm2,0x8c(%rsp)
mov    %r12,0x90(%rsp)
lea    0x1(%r12),%eax
mov    %eax,0xc(%rsp)
mov    %r15d,%ecx
and    $0x3,%ecx
movzwl 0x10(%rsp),%edx
lea    0x14(%rsp),%rdi
lea    0x84(%rsp),%rsi
call   1080 <rs_erasure@plt>
mov    %r15d,%r14d
and    $0x3,%r14d
addl   $0x1,0x70(%rsp,%r14,4)
mov    0x18(%rsp),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
movzbl 0x14(%rsp),%eax
cmp    %eax,0x4(%rsp)
jne    1440 <main+0x2e0>
xor    %r12d,%r12d
jmp    1461 <main+0x301>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%r12b
cmpl   $0x5,0x20(%rsp,%r14,4)
jg     1461 <main+0x301>
lea    0xbf0(%rip),%rdi
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
movzbl 0x15(%rsp),%eax
cmp    %eax,0x4(%rsp)
je     149d <main+0x33d>
mov    $0x1,%r12b
cmpl   $0x5,0x20(%rsp,%r14,4)
jg     149d <main+0x33d>
lea    0xbb4(%rip),%rdi
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
movzbl 0x16(%rsp),%eax
cmp    %eax,0x4(%rsp)
je     14d9 <main+0x379>
mov    $0x1,%r12b
cmpl   $0x5,0x20(%rsp,%r14,4)
jg     14d9 <main+0x379>
lea    0xb78(%rip),%rdi
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
movzbl 0x17(%rsp),%eax
cmp    %eax,0x4(%rsp)
jne    1524 <main+0x3c4>
mov    0x90(%rsp),%rax
add    $0x1,%eax
test   %r12b,%r12b
mov    %rax,%r12
je     11e0 <main+0x80>
mov    %r15d,0x30(%rsp)
mov    0x10(%rsp),%eax
mov    %eax,0x34(%rsp)
mov    0x8(%rsp),%r15d
mov    0xc(%rsp),%r12d
jmp    1557 <main+0x3f7>
mov    %r15d,0x30(%rsp)
mov    0x10(%rsp),%eax
mov    %eax,0x34(%rsp)
cmpl   $0x5,0x20(%rsp,%r14,4)
mov    0x8(%rsp),%r15d
mov    0xc(%rsp),%r12d
jg     1557 <main+0x3f7>
lea    0xaf8(%rip),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
addl   $0x1,0x20(%rsp,%r14,4)
add    $0x1,%r15d
mov    %r15d,0x8(%rsp)
jmp    11d8 <main+0x78>
mov    %r15d,0x30(%rsp)
mov    0x10(%rsp),%eax
mov    %eax,0x34(%rsp)
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x20(%rsp),%edx
mov    0x70(%rsp),%ecx
lea    0xabc(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x24(%rsp),%edx
mov    0x74(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rsp),%edx
mov    0x78(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c(%rsp),%edx
mov    0x7c(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xa8f(%rip),%rdi
mov    %r12d,%esi
mov    0x8(%rsp),%ebx
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
lea    0xa9e(%rip),%rax
lea    0xaa4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
jmp    1636 <main+0x4d6>
lea    0xac8(%rip),%rdi
jmp    162c <main+0x4cc>
lea    0xa96(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"tv_rs_erasure_in.txt\00"
@.str.1 = [3 x i8] c"rt\00"
@.str.2 = [34 x i8] c"Error Opening Input Test Vector!\0A\00"
@.str.3 = [23 x i8] c"tv_rs_erasure_mout.txt\00"
@.str.4 = [42 x i8] c"Error Opening Golden Output Test Vector!\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [19 x i8] c"[Err %3d] line %d\0A\00"
@.str.7 = [43 x i8] c"\09[%d] %3d out of %3d test vectors failed.\0A\00"
@.str.8 = [40 x i8] c"Total %d Test Vectors, Err Count = %d.\0A\00"
@.str.9 = [14 x i8] c"Test Failed!\0A\00"
@.str.10 = [14 x i8] c"Test Passed!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [14 x i32]
%8 = alloca i32
%9 = alloca [4 x i8]
%10 = alloca [12 x i8]
%11 = alloca i16
%12 = alloca i8
%13 = alloca i32
%14 = alloca i32
%15 = alloca [4 x i32]
%16 = alloca [4 x i32]
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8
%20 = alloca i32
store i32 0, i32* %1
store i32* null, i32** %5
%21 = call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %5
%22 = load i32*, i32** %5
%23 = icmp eq i32* null, %22
br i1 %23, label %24, label %26
24: ; preds = %0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %190
26: ; preds = %0
store i32* null, i32** %6
%27 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %27, i32** %6
%28 = load i32*, i32** %6
%29 = icmp eq i32* null, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %190
32: ; preds = %26
store i32 0, i32* %8
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %3
br label %33
33: ; preds = %40, %32
%34 = load i32, i32* %3
%35 = icmp slt i32 %34, 4
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %38
store i32 0, i32* %39
br label %40
40: ; preds = %36
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %33
43: ; preds = %33
store i32 0, i32* %3
br label %44
44: ; preds = %51, %43
%45 = load i32, i32* %3
%46 = icmp slt i32 %45, 4
br i1 %46, label %47, label %54
47: ; preds = %44
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [4 x i32], [4 x i32]* %16, i64 0, i64 %49
store i32 0, i32* %50
br label %51
51: ; preds = %47
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %44
54: ; preds = %44
br label %55
55: ; preds = %54, %155
store i32 0, i32* %2
br label %56
56: ; preds = %70, %55
%57 = load i32, i32* %2
%58 = icmp slt i32 %57, 14
br i1 %58, label %59, label %73
59: ; preds = %56
%60 = load i32*, i32** %5
%61 = call i32 @fscanf(i32* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %17)
store i32 %61, i32* %18
%62 = load i32, i32* %17
%63 = load i32, i32* %2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [14 x i32], [14 x i32]* %7, i64 0, i64 %64
store i32 %62, i32* %65
%66 = load i32, i32* %18
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %59
store i32 1, i32* %8
br label %73
69: ; preds = %59
br label %70
70: ; preds = %69
%71 = load i32, i32* %2
%72 = add nsw i32 %71, 1
store i32 %72, i32* %2
br label %56
73: ; preds = %68, %56
%74 = load i32, i32* %8
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %73
br label %156
77: ; preds = %73
%78 = load i32, i32* %14
%79 = add nsw i32 %78, 1
store i32 %79, i32* %14
%80 = getelementptr inbounds [14 x i32], [14 x i32]* %7, i64 0, i64 0
%81 = load i32, i32* %80
%82 = and i32 %81, 3
%83 = trunc i32 %82 to i8
store i8 %83, i8* %12
%84 = getelementptr inbounds [14 x i32], [14 x i32]* %7, i64 0, i64 1
%85 = load i32, i32* %84
%86 = and i32 %85, 65535
%87 = trunc i32 %86 to i16
store i16 %87, i16* %11
store i32 0, i32* %2
br label %88
88: ; preds = %102, %77
%89 = load i32, i32* %2
%90 = icmp slt i32 %89, 12
br i1 %90, label %91, label %105
91: ; preds = %88
%92 = load i32, i32* %2
%93 = add nsw i32 2, %92
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [14 x i32], [14 x i32]* %7, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = and i32 %96, 255
%98 = trunc i32 %97 to i8
%99 = load i32, i32* %2
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [12 x i8], [12 x i8]* %10, i64 0, i64 %100
store i8 %98, i8* %101
br label %102
102: ; preds = %91
%103 = load i32, i32* %2
%104 = add nsw i32 %103, 1
store i32 %104, i32* %2
br label %88
105: ; preds = %88
%106 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%107 = getelementptr inbounds [12 x i8], [12 x i8]* %10, i64 0, i64 0
%108 = load i16, i16* %11
%109 = load i8, i8* %12
%110 = call i32 @rs_erasure(i8* %106, i8* %107, i16 zeroext %108, i8 zeroext %109)
%111 = load i8, i8* %12
%112 = zext i8 %111 to i64
%113 = getelementptr inbounds [4 x i32], [4 x i32]* %16, i64 0, i64 %112
%114 = load i32, i32* %113
%115 = add nsw i32 %114, 1
store i32 %115, i32* %113
store i8 0, i8* %19
store i32 0, i32* %2
br label %116
116: ; preds = %141, %105
%117 = load i32, i32* %2
%118 = icmp slt i32 %117, 4
br i1 %118, label %119, label %144
119: ; preds = %116
%120 = load i32*, i32** %6
%121 = call i32 @fscanf(i32* %120, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %20)
%122 = load i32, i32* %2
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 %123
%125 = load i8, i8* %124
%126 = zext i8 %125 to i32
%127 = load i32, i32* %20
%128 = icmp ne i32 %126, %127
br i1 %128, label %129, label %140
129: ; preds = %119
store i8 1, i8* %19
%130 = load i8, i8* %12
%131 = zext i8 %130 to i64
%132 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %131
%133 = load i32, i32* %132
%134 = icmp sle i32 %133, 5
br i1 %134, label %135, label %139
135: ; preds = %129
%136 = load i32, i32* %13
%137 = load i32, i32* %14
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %136, i32 %137)
br label %139
139: ; preds = %135, %129
br label %140
140: ; preds = %139, %119
br label %141
141: ; preds = %140
%142 = load i32, i32* %2
%143 = add nsw i32 %142, 1
store i32 %143, i32* %2
br label %116
144: ; preds = %116
%145 = load i8, i8* %19
%146 = icmp ne i8 %145, 0
br i1 %146, label %147, label %155
147: ; preds = %144
%148 = load i8, i8* %12
%149 = zext i8 %148 to i64
%150 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %149
%151 = load i32, i32* %150
%152 = add nsw i32 %151, 1
store i32 %152, i32* %150
%153 = load i32, i32* %13
%154 = add nsw i32 %153, 1
store i32 %154, i32* %13
br label %155
155: ; preds = %147, %144
br label %55
156: ; preds = %76
%157 = load i32*, i32** %5
%158 = call i32 @fclose(i32* %157)
%159 = load i32*, i32** %6
%160 = call i32 @fclose(i32* %159)
store i32 0, i32* %3
br label %161
161: ; preds = %175, %156
%162 = load i32, i32* %3
%163 = icmp slt i32 %162, 4
br i1 %163, label %164, label %178
164: ; preds = %161
%165 = load i32, i32* %3
%166 = load i32, i32* %3
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %167
%169 = load i32, i32* %168
%170 = load i32, i32* %3
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [4 x i32], [4 x i32]* %16, i64 0, i64 %171
%173 = load i32, i32* %172
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 %165, i32 %169, i32 %173)
br label %175
175: ; preds = %164
%176 = load i32, i32* %3
%177 = add nsw i32 %176, 1
store i32 %177, i32* %3
br label %161
178: ; preds = %161
%179 = load i32, i32* %14
%180 = load i32, i32* %13
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %179, i32 %180)
%182 = load i32, i32* %13
%183 = icmp ne i32 %182, 0
br i1 %183, label %184, label %186
184: ; preds = %178
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %188
186: ; preds = %178
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
br label %188
188: ; preds = %186, %184
%189 = load i32, i32* %13
store i32 %189, i32* %1
br label %190
190: ; preds = %188, %30, %24
%191 = load i32, i32* %1
ret i32 %191
}

LLVM IR (-O2):
@.str = [21 x i8] c"tv_rs_erasure_in.txt\00"
@.str.1 = [3 x i8] c"rt\00"
@.str.3 = [23 x i8] c"tv_rs_erasure_mout.txt\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [19 x i8] c"[Err %3d] line %d\0A\00"
@.str.7 = [43 x i8] c"\09[%d] %3d out of %3d test vectors failed.\0A\00"
@.str.8 = [40 x i8] c"Total %d Test Vectors, Err Count = %d.\0A\00"
@str = [13 x i8] c"Test Passed!\00"
@str.11 = [13 x i8] c"Test Failed!\00"
@str.12 = [41 x i8] c"Error Opening Golden Output Test Vector!\00"
@str.13 = [33 x i8] c"Error Opening Input Test Vector!\00"
define i32 @main() {
%1 = alloca [14 x i32]
%2 = alloca [4 x i8]
%3 = alloca [12 x i8]
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = alloca [4 x i32]
%7 = bitcast [4 x i32]* %6 to i8*
%8 = alloca i32
%9 = alloca i32
%10 = tail call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.13, i64 0, i64 0))
br label %214
14: ; preds = %0
%15 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.12, i64 0, i64 0))
br label %214
19: ; preds = %14
%20 = bitcast [14 x i32]* %1 to i8*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%23 = bitcast i32* %8 to i8*
%24 = bitcast i32* %9 to i8*
%25 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 2
%26 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 6
%27 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 4
%28 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 10
%29 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 8
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%31 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%33 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%34 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 1
%35 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 2
%36 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 3
%37 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 4
%38 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 5
%39 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 6
%40 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 7
%41 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 8
%42 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 9
%43 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 10
%44 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 11
%45 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 12
%46 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 13
%47 = bitcast i32* %25 to <4 x i32>*
%48 = bitcast [12 x i8]* %3 to <4 x i8>*
%49 = bitcast i32* %26 to <4 x i32>*
%50 = bitcast i8* %27 to <4 x i8>*
%51 = bitcast i32* %28 to <4 x i32>*
%52 = bitcast i8* %29 to <4 x i8>*
br label %53
53: ; preds = %182, %19
%54 = phi i32 [ %185, %182 ], [ 0, %19 ]
%55 = phi i32 [ %123, %182 ], [ 0, %19 ]
%56 = load i32, i32* %34
br label %57
57: ; preds = %53, %179
%58 = phi i32 [ %65, %179 ], [ %56, %53 ]
%59 = phi i32 [ %123, %179 ], [ %55, %53 ]
%60 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%61 = load i32, i32* %8
%62 = icmp slt i32 %60, 0
br i1 %62, label %186, label %63
63: ; preds = %57
%64 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%65 = load i32, i32* %8
%66 = icmp slt i32 %64, 0
br i1 %66, label %186, label %67
67: ; preds = %63
%68 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%69 = load i32, i32* %8
store i32 %69, i32* %35
%70 = icmp slt i32 %68, 0
br i1 %70, label %186, label %71
71: ; preds = %67
%72 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%73 = load i32, i32* %8
store i32 %73, i32* %36
%74 = icmp slt i32 %72, 0
br i1 %74, label %186, label %75
75: ; preds = %71
%76 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%77 = load i32, i32* %8
store i32 %77, i32* %37
%78 = icmp slt i32 %76, 0
br i1 %78, label %186, label %79
79: ; preds = %75
%80 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%81 = load i32, i32* %8
store i32 %81, i32* %38
%82 = icmp slt i32 %80, 0
br i1 %82, label %186, label %83
83: ; preds = %79
%84 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%85 = load i32, i32* %8
store i32 %85, i32* %39
%86 = icmp slt i32 %84, 0
br i1 %86, label %186, label %87
87: ; preds = %83
%88 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%89 = load i32, i32* %8
store i32 %89, i32* %40
%90 = icmp slt i32 %88, 0
br i1 %90, label %186, label %91
91: ; preds = %87
%92 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%93 = load i32, i32* %8
store i32 %93, i32* %41
%94 = icmp slt i32 %92, 0
br i1 %94, label %186, label %95
95: ; preds = %91
%96 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%97 = load i32, i32* %8
store i32 %97, i32* %42
%98 = icmp slt i32 %96, 0
br i1 %98, label %186, label %99
99: ; preds = %95
%100 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%101 = load i32, i32* %8
store i32 %101, i32* %43
%102 = icmp slt i32 %100, 0
br i1 %102, label %186, label %103
103: ; preds = %99
%104 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%105 = load i32, i32* %8
store i32 %105, i32* %44
%106 = icmp slt i32 %104, 0
br i1 %106, label %186, label %107
107: ; preds = %103
%108 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%109 = load i32, i32* %8
store i32 %109, i32* %45
%110 = icmp slt i32 %108, 0
br i1 %110, label %186, label %111
111: ; preds = %107
%112 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%113 = load i32, i32* %8
store i32 %113, i32* %46
%114 = icmp slt i32 %112, 0
br i1 %114, label %186, label %115
115: ; preds = %111
%116 = trunc i32 %61 to i8
%117 = load <4 x i32>, <4 x i32>* %47
%118 = trunc <4 x i32> %117 to <4 x i8>
store <4 x i8> %118, <4 x i8>* %48
%119 = load <4 x i32>, <4 x i32>* %49
%120 = trunc <4 x i32> %119 to <4 x i8>
store <4 x i8> %120, <4 x i8>* %50
%121 = load <4 x i32>, <4 x i32>* %51
%122 = trunc <4 x i32> %121 to <4 x i8>
store <4 x i8> %122, <4 x i8>* %52
%123 = add nuw nsw i32 %59, 1
%124 = and i8 %116, 3
%125 = trunc i32 %65 to i16
%126 = call i32 @rs_erasure(i8* %21, i8* %22, i16 zeroext %125, i8 zeroext %124)
%127 = zext i8 %124 to i64
%128 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 %127
%129 = load i32, i32* %128
%130 = add nsw i32 %129, 1
store i32 %130, i32* %128
%131 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 %127
%132 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%133 = load i8, i8* %21
%134 = zext i8 %133 to i32
%135 = load i32, i32* %9
%136 = icmp eq i32 %135, %134
br i1 %136, label %142, label %137
137: ; preds = %115
%138 = load i32, i32* %131
%139 = icmp slt i32 %138, 6
br i1 %139, label %140, label %142
140: ; preds = %137
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %54, i32 %123)
br label %142
142: ; preds = %137, %140, %115
%143 = phi i8 [ 1, %140 ], [ 1, %137 ], [ 0, %115 ]
%144 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%145 = load i8, i8* %30
%146 = zext i8 %145 to i32
%147 = load i32, i32* %9
%148 = icmp eq i32 %147, %146
br i1 %148, label %154, label %149
149: ; preds = %142
%150 = load i32, i32* %131
%151 = icmp slt i32 %150, 6
br i1 %151, label %152, label %154
152: ; preds = %149
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %54, i32 %123)
br label %154
154: ; preds = %152, %149, %142
%155 = phi i8 [ 1, %152 ], [ 1, %149 ], [ %143, %142 ]
%156 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%157 = load i8, i8* %31
%158 = zext i8 %157 to i32
%159 = load i32, i32* %9
%160 = icmp eq i32 %159, %158
br i1 %160, label %166, label %161
161: ; preds = %154
%162 = load i32, i32* %131
%163 = icmp slt i32 %162, 6
br i1 %163, label %164, label %166
164: ; preds = %161
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %54, i32 %123)
br label %166
166: ; preds = %164, %161, %154
%167 = phi i8 [ 1, %164 ], [ 1, %161 ], [ %155, %154 ]
%168 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%169 = load i8, i8* %32
%170 = zext i8 %169 to i32
%171 = load i32, i32* %9
%172 = icmp eq i32 %171, %170
br i1 %172, label %179, label %173
173: ; preds = %166
store i32 %61, i32* %33
store i32 %65, i32* %34
%174 = load i32, i32* %131
%175 = icmp slt i32 %174, 6
br i1 %175, label %176, label %178
176: ; preds = %173
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %54, i32 %123)
br label %178
178: ; preds = %176, %173
br label %182
179: ; preds = %166
%180 = icmp eq i8 %167, 0
br i1 %180, label %57, label %181
181: ; preds = %179
store i32 %61, i32* %33
store i32 %65, i32* %34
br label %182
182: ; preds = %181, %178
%183 = load i32, i32* %131
%184 = add nsw i32 %183, 1
store i32 %184, i32* %131
%185 = add nuw nsw i32 %54, 1
br label %53
186: ; preds = %63, %67, %71, %75, %79, %83, %87, %91, %95, %99, %103, %107, %111, %57
%187 = phi i32 [ %58, %57 ], [ %65, %111 ], [ %65, %107 ], [ %65, %103 ], [ %65, %99 ], [ %65, %95 ], [ %65, %91 ], [ %65, %87 ], [ %65, %83 ], [ %65, %79 ], [ %65, %75 ], [ %65, %71 ], [ %65, %67 ], [ %65, %63 ]
store i32 %61, i32* %33
store i32 %187, i32* %34
%188 = call i32 @fclose(i32* %10)
%189 = call i32 @fclose(i32* %15)
%190 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%191 = load i32, i32* %190
%192 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%193 = load i32, i32* %192
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 0, i32 %191, i32 %193)
%195 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%196 = load i32, i32* %195
%197 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
%198 = load i32, i32* %197
%199 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 1, i32 %196, i32 %198)
%200 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%201 = load i32, i32* %200
%202 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
%203 = load i32, i32* %202
%204 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 2, i32 %201, i32 %203)
%205 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
%206 = load i32, i32* %205
%207 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
%208 = load i32, i32* %207
%209 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 3, i32 %206, i32 %208)
%210 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %59, i32 %54)
%211 = icmp eq i32 %54, 0
%212 = select i1 %211, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0)
%213 = call i32 @puts(i8* dereferenceable(1) %212)
br label %214
214: ; preds = %17, %186, %12
%215 = phi i32 [ 1, %12 ], [ 1, %17 ], [ %54, %186 ]
ret i32 %215
}