#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*/ free(int *);
int /*<<< orphan*/ inicializar(int **, int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ print(int **, int, int);
int main(int argc, const char *argv[]) {
  int **matriz;
  int i, j, v = 1;
  matriz = (int **)malloc(100 * sizeof(int *));
  for (i = 0; i < 100; i++)
    matriz[i] = (int *)malloc(100 * sizeof(int));
  inicializar(matriz, 100, 100);
  print(matriz, 100, 100);
  for (i = 0; i < 100; i++)
    free(matriz[i]);
  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)
movl   $0x1,-0x24(%rbp)
mov    $0x320,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jge    11a3 <main+0x63>
mov    $0x190,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1172 <main+0x32>
mov    -0x18(%rbp),%rdi
mov    $0x64,%edx
mov    %edx,%esi
call   1040 <inicializar@plt>
mov    -0x18(%rbp),%rdi
mov    $0x64,%edx
mov    %edx,%esi
call   1050 <print@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jge    11f3 <main+0xb3>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ca <main+0x8a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x320,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x190,%edi
call   1060 <malloc@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1160 <main+0x20>
mov    %r14,%rdi
mov    $0x64,%esi
mov    $0x64,%edx
call   1040 <inicializar@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    $0x64,%edx
call   1050 <print@plt>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    11a0 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %9
%10 = call i64 @malloc(i32 800)
%11 = inttoptr i64 %10 to i32**
store i32** %11, i32*** %6
store i32 0, i32* %7
br label %12
12: ; preds = %22, %2
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 100
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = call i64 @malloc(i32 400)
%17 = inttoptr i64 %16 to i32*
%18 = load i32**, i32*** %6
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32*, i32** %18, i64 %20
store i32* %17, i32** %21
br label %22
22: ; preds = %15
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %12
25: ; preds = %12
%26 = load i32**, i32*** %6
%27 = call i32 @inicializar(i32** %26, i32 100, i32 100)
%28 = load i32**, i32*** %6
%29 = call i32 @print(i32** %28, i32 100, i32 100)
store i32 0, i32* %7
br label %30
30: ; preds = %40, %25
%31 = load i32, i32* %7
%32 = icmp slt i32 %31, 100
br i1 %32, label %33, label %43
33: ; preds = %30
%34 = load i32**, i32*** %6
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32*, i32** %34, i64 %36
%38 = load i32*, i32** %37
%39 = call i32 @free(i32* %38)
br label %40
40: ; preds = %33
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %30
43: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 800)
%4 = inttoptr i64 %3 to i32**
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %10, %5 ]
%7 = tail call i64 @malloc(i32 400)
%8 = inttoptr i64 %7 to i32*
%9 = getelementptr inbounds i32*, i32** %4, i64 %6
store i32* %8, i32** %9
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 100
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = tail call i32 @inicializar(i32** %4, i32 100, i32 100)
%14 = tail call i32 @print(i32** %4, i32 100, i32 100)
br label %15
15: ; preds = %12, %15
%16 = phi i64 [ 0, %12 ], [ %20, %15 ]
%17 = getelementptr inbounds i32*, i32** %4, i64 %16
%18 = load i32*, i32** %17
%19 = tail call i32 @free(i32* %18)
%20 = add nuw nsw i64 %16, 1
%21 = icmp eq i64 %20, 100
br i1 %21, label %22, label %15
22: ; preds = %15
ret i32 0
}