#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 EXIT_SUCCESS;
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a[9];
  int **arr, i, j;
  arr = (int **)malloc(sizeof(int) * 9 * 9);
  for (i = 0; i < 9; i++) {
    for (j = 0; j < 9; j++) {
      arr[i][j] = 0;
      printf("%d\t", arr[i][j]);
    }
    printf("\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x144,%edi
call   1040 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x9,-0x3c(%rbp)
jge    11c1 <main+0xa1>
movl   $0x0,-0x40(%rbp)
cmpl   $0x9,-0x40(%rbp)
jge    11a5 <main+0x85>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1155 <main+0x35>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1144 <main+0x24>
mov    0x2e18(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x144,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
lea    0xeb7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rax
movl   $0x0,(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0x4(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0x8(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0xc(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0x10(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0x14(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0x18(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0x1c(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movl   $0x0,0x20(%rax)
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x9,%rbx
jne    1150 <main+0x20>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i64 @malloc(i32 324)
%7 = inttoptr i64 %6 to i32**
store i32** %7, i32*** %3
store i32 0, i32* %4
br label %8
8: ; preds = %39, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 9
br i1 %10, label %11, label %42
11: ; preds = %8
store i32 0, i32* %5
br label %12
12: ; preds = %34, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 9
br i1 %14, label %15, label %37
15: ; preds = %12
%16 = load i32**, i32*** %3
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32*, i32** %16, i64 %18
%20 = load i32*, i32** %19
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 0, i32* %23
%24 = load i32**, i32*** %3
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32*, i32** %24, i64 %26
%28 = load i32*, i32** %27
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %15
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %12
37: ; preds = %12
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %8
42: ; preds = %8
%43 = load i32, i32* @EXIT_SUCCESS
ret i32 %43
}

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