int main() {
  int array_len = 10;
  int *a = create_int_array(array_len, 10);
  int *b = create_int_array(array_len, 100);
  int *c = create_int_array(array_len, 1000);
  int **array_pointer = malloc(3 * sizeof(int *));
  array_pointer[0] = a;
  array_pointer[1] = b;
  array_pointer[2] = c;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < array_len; j++) {
      printf("array_pointer[%d][%d]: %d\n", i, j, array_pointer[i][j]);
    }
  }
  free(array_pointer);
  free(a);
  free(b);
  free(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
mov    $0x0,%al
call   1060 <create_int_array@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x64,%esi
mov    $0x0,%al
call   1060 <create_int_array@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3e8,%esi
mov    $0x0,%al
call   1060 <create_int_array@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    $0x18,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x10(%rax)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    1232 <main+0xf2>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121f <main+0xdf>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11de <main+0x9e>
jmp    1224 <main+0xe4>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11cd <main+0x8d>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0xa,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <create_int_array@plt>
movslq %eax,%r14
mov    $0xa,%edi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <create_int_array@plt>
movslq %eax,%r15
mov    $0xa,%edi
mov    $0x3e8,%esi
xor    %eax,%eax
call   1050 <create_int_array@plt>
movslq %eax,%r12
mov    (%r14),%ecx
lea    0xe82(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%r14),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%r15),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%r12),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"array_pointer[%d][%d]: %d\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
%8 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @create_int_array to i32 (i32, i32, ...)*)(i32 %9, i32 10)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %3
%13 = load i32, i32* %2
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @create_int_array to i32 (i32, i32, ...)*)(i32 %13, i32 100)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %4
%17 = load i32, i32* %2
%18 = call i32 (i32, i32, ...) bitcast (i32 (...)* @create_int_array to i32 (i32, i32, ...)*)(i32 %17, i32 1000)
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store i32* %20, i32** %5
%21 = call i8* @malloc(i64 24)
%22 = bitcast i8* %21 to i32**
store i32** %22, i32*** %6
%23 = load i32*, i32** %3
%24 = load i32**, i32*** %6
%25 = getelementptr inbounds i32*, i32** %24, i64 0
store i32* %23, i32** %25
%26 = load i32*, i32** %4
%27 = load i32**, i32*** %6
%28 = getelementptr inbounds i32*, i32** %27, i64 1
store i32* %26, i32** %28
%29 = load i32*, i32** %5
%30 = load i32**, i32*** %6
%31 = getelementptr inbounds i32*, i32** %30, i64 2
store i32* %29, i32** %31
store i32 0, i32* %7
br label %32
32: ; preds = %57, %0
%33 = load i32, i32* %7
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %60
35: ; preds = %32
store i32 0, i32* %8
br label %36
36: ; preds = %53, %35
%37 = load i32, i32* %8
%38 = load i32, i32* %2
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %56
40: ; preds = %36
%41 = load i32, i32* %7
%42 = load i32, i32* %8
%43 = load i32**, i32*** %6
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32*, i32** %43, i64 %45
%47 = load i32*, i32** %46
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %47, i64 %49
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %41, i32 %42, i32 %51)
br label %53
53: ; preds = %40
%54 = load i32, i32* %8
%55 = add nsw i32 %54, 1
store i32 %55, i32* %8
br label %36
56: ; preds = %36
br label %57
57: ; preds = %56
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %32
60: ; preds = %32
%61 = load i32**, i32*** %6
%62 = bitcast i32** %61 to i8*
%63 = load i32*, i32** %3
%64 = bitcast i32* %63 to i8*
%65 = load i32*, i32** %4
%66 = bitcast i32* %65 to i8*
%67 = load i32*, i32** %5
%68 = bitcast i32* %67 to i8*
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"array_pointer[%d][%d]: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @create_int_array to i32 (i32, i32, ...)*)(i32 10, i32 10)
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @create_int_array to i32 (i32, i32, ...)*)(i32 10, i32 100)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @create_int_array to i32 (i32, i32, ...)*)(i32 10, i32 1000)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load i32, i32* %3
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 %10)
%12 = getelementptr inbounds i32, i32* %3, i64 1
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 %13)
%15 = getelementptr inbounds i32, i32* %3, i64 2
%16 = load i32, i32* %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32 %16)
%18 = getelementptr inbounds i32, i32* %3, i64 3
%19 = load i32, i32* %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i32 %19)
%21 = getelementptr inbounds i32, i32* %3, i64 4
%22 = load i32, i32* %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 4, i32 %22)
%24 = getelementptr inbounds i32, i32* %3, i64 5
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 5, i32 %25)
%27 = getelementptr inbounds i32, i32* %3, i64 6
%28 = load i32, i32* %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 6, i32 %28)
%30 = getelementptr inbounds i32, i32* %3, i64 7
%31 = load i32, i32* %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 7, i32 %31)
%33 = getelementptr inbounds i32, i32* %3, i64 8
%34 = load i32, i32* %33
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 8, i32 %34)
%36 = getelementptr inbounds i32, i32* %3, i64 9
%37 = load i32, i32* %36
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 9, i32 %37)
%39 = load i32, i32* %6
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 %39)
%41 = getelementptr inbounds i32, i32* %6, i64 1
%42 = load i32, i32* %41
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 %42)
%44 = getelementptr inbounds i32, i32* %6, i64 2
%45 = load i32, i32* %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 %45)
%47 = getelementptr inbounds i32, i32* %6, i64 3
%48 = load i32, i32* %47
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 3, i32 %48)
%50 = getelementptr inbounds i32, i32* %6, i64 4
%51 = load i32, i32* %50
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 %51)
%53 = getelementptr inbounds i32, i32* %6, i64 5
%54 = load i32, i32* %53
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 %54)
%56 = getelementptr inbounds i32, i32* %6, i64 6
%57 = load i32, i32* %56
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 6, i32 %57)
%59 = getelementptr inbounds i32, i32* %6, i64 7
%60 = load i32, i32* %59
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 %60)
%62 = getelementptr inbounds i32, i32* %6, i64 8
%63 = load i32, i32* %62
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 8, i32 %63)
%65 = getelementptr inbounds i32, i32* %6, i64 9
%66 = load i32, i32* %65
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 9, i32 %66)
%68 = load i32, i32* %9
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 %68)
%70 = getelementptr inbounds i32, i32* %9, i64 1
%71 = load i32, i32* %70
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i32 %71)
%73 = getelementptr inbounds i32, i32* %9, i64 2
%74 = load i32, i32* %73
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 %74)
%76 = getelementptr inbounds i32, i32* %9, i64 3
%77 = load i32, i32* %76
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 3, i32 %77)
%79 = getelementptr inbounds i32, i32* %9, i64 4
%80 = load i32, i32* %79
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 %80)
%82 = getelementptr inbounds i32, i32* %9, i64 5
%83 = load i32, i32* %82
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 5, i32 %83)
%85 = getelementptr inbounds i32, i32* %9, i64 6
%86 = load i32, i32* %85
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 6, i32 %86)
%88 = getelementptr inbounds i32, i32* %9, i64 7
%89 = load i32, i32* %88
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 7, i32 %89)
%91 = getelementptr inbounds i32, i32* %9, i64 8
%92 = load i32, i32* %91
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 8, i32 %92)
%94 = getelementptr inbounds i32, i32* %9, i64 9
%95 = load i32, i32* %94
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 9, i32 %95)
%97 = inttoptr i64 %2 to i8*
tail call void @free(i8* %97)
%98 = inttoptr i64 %5 to i8*
tail call void @free(i8* %98)
%99 = inttoptr i64 %8 to i8*
tail call void @free(i8* %99)
ret i32 0
}