int main() {
  unsigned mls_size;
  unsigned n = 5, N = 1 << n;
  unsigned i, j;
  int **m = preferd(n, &mls_size);
  printf("size:%d\n", mls_size);
  for (j = 0; j < N - 1; j++)
    printf("%d,", m[0][j]);
  printf("\n");
  printf("\n");
  for (j = 0; j < N - 1; j++)
    printf("%d,", innerPro(m[0], m[1], N - 1, j));
  free(*m);
  free(m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <preferd@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    11c9 <main+0x89>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118f <main+0x4f>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    123a <main+0xfa>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%ecx
mov    $0x0,%al
call   1060 <innerPro@plt>
mov    %eax,%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ec <main+0xac>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1060 <preferd@plt>
movslq %eax,%rbx
mov    0xc(%rsp),%esi
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe84(%rip),%r14
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rax
mov    (%rax,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0x1f,%rbp
jne    1190 <main+0x40>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xe44(%rip),%r14
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    $0x1f,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1070 <innerPro@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    $0x1f,%ebp
jne    11d0 <main+0x80>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"size:%d\0A\00"
@.str.1 = [4 x i8] c"%d,\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32**
store i32 0, i32* %1
store i32 5, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 1, %8
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @preferd to i32 (i32, i32*, ...)*)(i32 %10, i32* %2)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32**
store i32** %13, i32*** %7
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 0, i32* %6
br label %16
16: ; preds = %30, %0
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = sub i32 %18, 1
%20 = icmp ult i32 %17, %19
br i1 %20, label %21, label %33
21: ; preds = %16
%22 = load i32**, i32*** %7
%23 = getelementptr inbounds i32*, i32** %22, i64 0
%24 = load i32*, i32** %23
%25 = load i32, i32* %6
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %21
%31 = load i32, i32* %6
%32 = add i32 %31, 1
store i32 %32, i32* %6
br label %16
33: ; preds = %16
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %36
36: ; preds = %53, %33
%37 = load i32, i32* %6
%38 = load i32, i32* %4
%39 = sub i32 %38, 1
%40 = icmp ult i32 %37, %39
br i1 %40, label %41, label %56
41: ; preds = %36
%42 = load i32**, i32*** %7
%43 = getelementptr inbounds i32*, i32** %42, i64 0
%44 = load i32*, i32** %43
%45 = load i32**, i32*** %7
%46 = getelementptr inbounds i32*, i32** %45, i64 1
%47 = load i32*, i32** %46
%48 = load i32, i32* %4
%49 = sub i32 %48, 1
%50 = load i32, i32* %6
%51 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @innerPro to i32 (i32*, i32*, i32, i32, ...)*)(i32* %44, i32* %47, i32 %49, i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %41
%54 = load i32, i32* %6
%55 = add i32 %54, 1
store i32 %55, i32* %6
br label %36
56: ; preds = %36
%57 = load i32**, i32*** %7
%58 = load i32*, i32** %57
%59 = bitcast i32* %58 to i8*
%60 = load i32**, i32*** %7
%61 = bitcast i32** %60 to i8*
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"size:%d\0A\00"
@.str.1 = [4 x i8] c"%d,\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @preferd to i32 (i32, i32*, ...)*)(i32 5, i32* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32**
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %0, %8
%9 = phi i64 [ 0, %0 ], [ %14, %8 ]
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 %9
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, 31
br i1 %15, label %16, label %8
16: ; preds = %8
%17 = call i32 @putchar(i32 10)
%18 = call i32 @putchar(i32 10)
%19 = getelementptr inbounds i32*, i32** %5, i64 1
br label %20
20: ; preds = %16, %20
%21 = phi i32 [ 0, %16 ], [ %26, %20 ]
%22 = load i32*, i32** %5
%23 = load i32*, i32** %19
%24 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @innerPro to i32 (i32*, i32*, i32, i32, ...)*)(i32* %22, i32* %23, i32 31, i32 %21)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = add nuw nsw i32 %21, 1
%27 = icmp eq i32 %26, 31
br i1 %27, label %28, label %20
28: ; preds = %20
%29 = inttoptr i64 %4 to i8**
%30 = load i8*, i8** %29
%31 = inttoptr i64 %4 to i8*
ret i32 0
}