#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*/ free2DArray(int **, int);
int /*<<< orphan*/ fulfil2DArray(int **, int, int);
int **make2DArray(int, int);
int /*<<< orphan*/ print2DArray(int **, int, int);
int /*<<< orphan*/ puts(char *);
int main(int argc, const char *argv[]) {
  int **testArr1;
  testArr1 = make2DArray(1, 1);
  fulfil2DArray(testArr1, 1, 1);
  print2DArray(testArr1, 1, 1);
  puts("--------");
  int **testArr2;
  testArr2 = make2DArray(1, 2);
  fulfil2DArray(testArr2, 1, 2);
  print2DArray(testArr2, 1, 2);
  puts("--------");
  int **testArr3;
  testArr3 = make2DArray(2, 1);
  fulfil2DArray(testArr3, 2, 1);
  print2DArray(testArr3, 2, 1);
  puts("--------");
  int **testArr4;
  testArr4 = make2DArray(5, 5);
  fulfil2DArray(testArr4, 5, 5);
  print2DArray(testArr4, 5, 5);
  puts("--------");
  int **testArr5;
  testArr5 = make2DArray(6, 10);
  fulfil2DArray(testArr5, 6, 10);
  print2DArray(testArr5, 6, 10);
  free2DArray(testArr1, 1);
  free2DArray(testArr2, 1);
  free2DArray(testArr3, 2);
  free2DArray(testArr4, 5);
  free2DArray(testArr5, 6);
  puts("--------");
  puts("--------");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1070 <make2DArray@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fulfil2DArray@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1060 <print2DArray@plt>
lea    0xe63(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1070 <make2DArray@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fulfil2DArray@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1060 <print2DArray@plt>
lea    0xe1e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1070 <make2DArray@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fulfil2DArray@plt>
mov    -0x28(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1060 <print2DArray@plt>
lea    0xdd9(%rip),%rdi
call   1040 <puts@plt>
mov    $0x5,%esi
mov    %esi,%edi
call   1070 <make2DArray@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    $0x5,%edx
mov    %edx,%esi
call   1030 <fulfil2DArray@plt>
mov    -0x30(%rbp),%rdi
mov    $0x5,%edx
mov    %edx,%esi
call   1060 <print2DArray@plt>
lea    0xd9d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x6,%edi
mov    $0xa,%esi
call   1070 <make2DArray@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    $0x6,%esi
mov    $0xa,%edx
call   1030 <fulfil2DArray@plt>
mov    -0x38(%rbp),%rdi
mov    $0x6,%esi
mov    $0xa,%edx
call   1060 <print2DArray@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1050 <free2DArray@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1050 <free2DArray@plt>
mov    -0x28(%rbp),%rdi
mov    $0x2,%esi
call   1050 <free2DArray@plt>
mov    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1050 <free2DArray@plt>
mov    -0x38(%rbp),%rdi
mov    $0x6,%esi
call   1050 <free2DArray@plt>
lea    0xd12(%rip),%rdi
call   1040 <puts@plt>
lea    0xd06(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1070 <make2DArray@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fulfil2DArray@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1060 <print2DArray@plt>
lea    0xe68(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1070 <make2DArray@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fulfil2DArray@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1060 <print2DArray@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1070 <make2DArray@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fulfil2DArray@plt>
mov    %r13,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1060 <print2DArray@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x5,%edi
mov    $0x5,%esi
call   1070 <make2DArray@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1030 <fulfil2DArray@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1060 <print2DArray@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x6,%edi
mov    $0xa,%esi
call   1070 <make2DArray@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    $0x6,%esi
mov    $0xa,%edx
call   1030 <fulfil2DArray@plt>
mov    %rbp,%rdi
mov    $0x6,%esi
mov    $0xa,%edx
call   1060 <print2DArray@plt>
mov    %r15,%rdi
mov    $0x1,%esi
call   1050 <free2DArray@plt>
mov    %r12,%rdi
mov    $0x1,%esi
call   1050 <free2DArray@plt>
mov    %r13,%rdi
mov    $0x2,%esi
call   1050 <free2DArray@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <free2DArray@plt>
mov    %rbp,%rdi
mov    $0x6,%esi
call   1050 <free2DArray@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"--------\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32**
%7 = alloca i32**
%8 = alloca i32**
%9 = alloca i32**
%10 = alloca i32**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32** @make2DArray(i32 1, i32 1)
store i32** %11, i32*** %6
%12 = load i32**, i32*** %6
%13 = call i32 @fulfil2DArray(i32** %12, i32 1, i32 1)
%14 = load i32**, i32*** %6
%15 = call i32 @print2DArray(i32** %14, i32 1, i32 1)
%16 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%17 = call i32** @make2DArray(i32 1, i32 2)
store i32** %17, i32*** %7
%18 = load i32**, i32*** %7
%19 = call i32 @fulfil2DArray(i32** %18, i32 1, i32 2)
%20 = load i32**, i32*** %7
%21 = call i32 @print2DArray(i32** %20, i32 1, i32 2)
%22 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%23 = call i32** @make2DArray(i32 2, i32 1)
store i32** %23, i32*** %8
%24 = load i32**, i32*** %8
%25 = call i32 @fulfil2DArray(i32** %24, i32 2, i32 1)
%26 = load i32**, i32*** %8
%27 = call i32 @print2DArray(i32** %26, i32 2, i32 1)
%28 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%29 = call i32** @make2DArray(i32 5, i32 5)
store i32** %29, i32*** %9
%30 = load i32**, i32*** %9
%31 = call i32 @fulfil2DArray(i32** %30, i32 5, i32 5)
%32 = load i32**, i32*** %9
%33 = call i32 @print2DArray(i32** %32, i32 5, i32 5)
%34 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%35 = call i32** @make2DArray(i32 6, i32 10)
store i32** %35, i32*** %10
%36 = load i32**, i32*** %10
%37 = call i32 @fulfil2DArray(i32** %36, i32 6, i32 10)
%38 = load i32**, i32*** %10
%39 = call i32 @print2DArray(i32** %38, i32 6, i32 10)
%40 = load i32**, i32*** %6
%41 = call i32 @free2DArray(i32** %40, i32 1)
%42 = load i32**, i32*** %7
%43 = call i32 @free2DArray(i32** %42, i32 1)
%44 = load i32**, i32*** %8
%45 = call i32 @free2DArray(i32** %44, i32 2)
%46 = load i32**, i32*** %9
%47 = call i32 @free2DArray(i32** %46, i32 5)
%48 = load i32**, i32*** %10
%49 = call i32 @free2DArray(i32** %48, i32 6)
%50 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%51 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"--------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32** @make2DArray(i32 1, i32 1)
%4 = tail call i32 @fulfil2DArray(i32** %3, i32 1, i32 1)
%5 = tail call i32 @print2DArray(i32** %3, i32 1, i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32** @make2DArray(i32 1, i32 2)
%8 = tail call i32 @fulfil2DArray(i32** %7, i32 1, i32 2)
%9 = tail call i32 @print2DArray(i32** %7, i32 1, i32 2)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32** @make2DArray(i32 2, i32 1)
%12 = tail call i32 @fulfil2DArray(i32** %11, i32 2, i32 1)
%13 = tail call i32 @print2DArray(i32** %11, i32 2, i32 1)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32** @make2DArray(i32 5, i32 5)
%16 = tail call i32 @fulfil2DArray(i32** %15, i32 5, i32 5)
%17 = tail call i32 @print2DArray(i32** %15, i32 5, i32 5)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32** @make2DArray(i32 6, i32 10)
%20 = tail call i32 @fulfil2DArray(i32** %19, i32 6, i32 10)
%21 = tail call i32 @print2DArray(i32** %19, i32 6, i32 10)
%22 = tail call i32 @free2DArray(i32** %3, i32 1)
%23 = tail call i32 @free2DArray(i32** %7, i32 1)
%24 = tail call i32 @free2DArray(i32** %11, i32 2)
%25 = tail call i32 @free2DArray(i32** %15, i32 5)
%26 = tail call i32 @free2DArray(i32** %19, i32 6)
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}