#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*/ test_erasure_code_recovery(size_t, char *, unsigned int,
                                              int);
int /*<<< orphan*/ test_erasure_code_sizes(size_t, char *, unsigned int, int);
int main(int argc, char **argv) {
  (void)argc, (void)argv;
  for (size_t length = 64 * 1024; length <= 8 * (1024 * 1024); length *= 2) {
    for (unsigned int k = 2; k < 8; ++k)
      test_erasure_code_recovery(length, "liber8tion", k, 2);
    for (unsigned int k = 4; k < 11; ++k)
      test_erasure_code_recovery(length, "crs", k, 4);
  }
  for (size_t length = 1 * (1024 * 1024); length <= 256 * (1024 * 1024);
       length *= 2) {
    for (unsigned int k = 2; k < 8; ++k)
      test_erasure_code_sizes(length, "liber8tion", k, 2);
    for (unsigned int k = 4; k < 11; ++k)
      test_erasure_code_sizes(length, "crs", k, 4);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x10000,-0x18(%rbp)
cmpq   $0x800000,-0x18(%rbp)
ja     11d0 <main+0xb0>
movl   $0x2,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jae    1183 <main+0x63>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xe95(%rip),%rsi
mov    $0x2,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1153 <main+0x33>
movl   $0x4,-0x20(%rbp)
cmpl   $0xb,-0x20(%rbp)
jae    11ba <main+0x9a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%edx
lea    0xe69(%rip),%rsi
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    118a <main+0x6a>
jmp    11bf <main+0x9f>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x1e>
movq   $0x100000,-0x28(%rbp)
cmpq   $0x10000000,-0x28(%rbp)
10
ja     126a <main+0x14a>
movl   $0x2,-0x2c(%rbp)
cmpl   $0x8,-0x2c(%rbp)
jae    121d <main+0xfd>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xdfb(%rip),%rsi
mov    $0x2,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ed <main+0xcd>
movl   $0x4,-0x30(%rbp)
cmpl   $0xb,-0x30(%rbp)
jae    1254 <main+0x134>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%edx
lea    0xdcf(%rip),%rsi
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1224 <main+0x104>
jmp    1259 <main+0x139>
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11d8 <main+0xb8>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x10000,%ebx
lea    0xecf(%rip),%r14
lea    0xed3(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x2,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
mov    $0x2,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
mov    $0x2,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x6,%edx
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x7,%edx
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x9,%edx
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xa,%edx
mov    $0x4,%ecx
call   1040 <test_erasure_code_recovery@plt>
lea    (%rbx,%rbx,1),%rax
cmp    $0x400001,%rbx
mov    %rax,%rbx
jb     1140 <main+0x20>
mov    $0x100000,%ebx
lea    0xd8f(%rip),%r14
lea    0xd93(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x2,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
mov    $0x2,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
mov    $0x2,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x6,%edx
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x7,%edx
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x9,%edx
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xa,%edx
mov    $0x4,%ecx
call   1030 <test_erasure_code_sizes@plt>
lea    (%rbx,%rbx,1),%rax
cmp    $0x8000001,%rbx
mov    %rax,%rbx
jb     1280 <main+0x160>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"liber8tion\00"
@.str.1 = [4 x i8] c"crs\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 i64
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
store i64 65536, i64* %6
br label %14
14: ; preds = %40, %2
%15 = load i64, i64* %6
%16 = icmp ule i64 %15, 8388608
br i1 %16, label %17, label %43
17: ; preds = %14
store i32 2, i32* %7
br label %18
18: ; preds = %25, %17
%19 = load i32, i32* %7
%20 = icmp ult i32 %19, 8
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i64, i64* %6
%23 = load i32, i32* %7
%24 = call i32 @test_erasure_code_recovery(i64 %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %23, i32 2)
br label %25
25: ; preds = %21
%26 = load i32, i32* %7
%27 = add i32 %26, 1
store i32 %27, i32* %7
br label %18
28: ; preds = %18
store i32 4, i32* %8
br label %29
29: ; preds = %36, %28
%30 = load i32, i32* %8
%31 = icmp ult i32 %30, 11
br i1 %31, label %32, label %39
32: ; preds = %29
%33 = load i64, i64* %6
%34 = load i32, i32* %8
%35 = call i32 @test_erasure_code_recovery(i64 %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 4)
br label %36
36: ; preds = %32
%37 = load i32, i32* %8
%38 = add i32 %37, 1
store i32 %38, i32* %8
br label %29
39: ; preds = %29
br label %40
40: ; preds = %39
%41 = load i64, i64* %6
%42 = mul i64 %41, 2
store i64 %42, i64* %6
br label %14
43: ; preds = %14
store i64 1048576, i64* %9
br label %44
44: ; preds = %70, %43
%45 = load i64, i64* %9
%46 = icmp ule i64 %45, 268435456
br i1 %46, label %47, label %73
47: ; preds = %44
store i32 2, i32* %10
br label %48
48: ; preds = %55, %47
%49 = load i32, i32* %10
%50 = icmp ult i32 %49, 8
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = load i64, i64* %9
%53 = load i32, i32* %10
%54 = call i32 @test_erasure_code_sizes(i64 %52, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %53, i32 2)
br label %55
55: ; preds = %51
%56 = load i32, i32* %10
%57 = add i32 %56, 1
store i32 %57, i32* %10
br label %48
58: ; preds = %48
store i32 4, i32* %11
br label %59
59: ; preds = %66, %58
%60 = load i32, i32* %11
%61 = icmp ult i32 %60, 11
br i1 %61, label %62, label %69
62: ; preds = %59
%63 = load i64, i64* %9
%64 = load i32, i32* %11
%65 = call i32 @test_erasure_code_sizes(i64 %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %64, i32 4)
br label %66
66: ; preds = %62
%67 = load i32, i32* %11
%68 = add i32 %67, 1
store i32 %68, i32* %11
br label %59
69: ; preds = %59
br label %70
70: ; preds = %69
%71 = load i64, i64* %9
%72 = mul i64 %71, 2
store i64 %72, i64* %9
br label %44
73: ; preds = %44
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"liber8tion\00"
@.str.1 = [4 x i8] c"crs\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 65536, %2 ], [ %18, %3 ]
%5 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
%6 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 2)
%7 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 2)
%8 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5, i32 2)
%9 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6, i32 2)
%10 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 7, i32 2)
%11 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 4)
%12 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 4)
%13 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 4)
%14 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 4)
%15 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 4)
%16 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 4)
%17 = tail call i32 @test_erasure_code_recovery(i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 4)
%18 = shl nuw nsw i64 %4, 1
%19 = icmp ult i64 %4, 4194305
br i1 %19, label %3, label %20
20: ; preds = %3, %20
%21 = phi i64 [ %35, %20 ], [ 1048576, %3 ]
%22 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
%23 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 2)
%24 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 2)
%25 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5, i32 2)
%26 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6, i32 2)
%27 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 7, i32 2)
%28 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 4)
%29 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 4)
%30 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 4)
%31 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 4)
%32 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 4)
%33 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 4)
%34 = tail call i32 @test_erasure_code_sizes(i64 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 4)
%35 = shl nuw nsw i64 %21, 1
%36 = icmp ult i64 %21, 134217729
br i1 %36, label %20, label %37
37: ; preds = %20
ret i32 0
}