#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(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ preencher(float **, int, int);
int /*<<< orphan*/ print(float **, int, int);
int main(int argc, const char *argv[]) {
  float **matrx;
  int i, j;
  matrx = (float **)malloc(sizeof(float *) * 50);
  for (i = 0; i < 50; i++)
    matrx[i] = (float *)malloc(sizeof(float) * 50);
  preencher(matrx, 50, 50);
  print(matrx, 50, 50);
  for (i = 0; i < 50; i++)
    free(matrx[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x190,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x32,-0x1c(%rbp)
jge    119c <main+0x5c>
mov    $0xc8,%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    116b <main+0x2b>
mov    -0x18(%rbp),%rdi
mov    $0x32,%edx
mov    %edx,%esi
call   1050 <preencher@plt>
mov    -0x18(%rbp),%rdi
mov    $0x32,%edx
mov    %edx,%esi
call   1040 <print@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x32,-0x1c(%rbp)
jge    11ec <main+0xac>
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    11c3 <main+0x83>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x190,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xc8,%edi
call   1060 <malloc@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1160 <main+0x20>
mov    %r14,%rdi
mov    $0x32,%esi
mov    $0x32,%edx
call   1050 <preencher@plt>
mov    %r14,%rdi
mov    $0x32,%esi
mov    $0x32,%edx
call   1040 <print@plt>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x32,%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 float**
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i64 @malloc(i32 400)
%10 = inttoptr i64 %9 to float**
store float** %10, float*** %6
store i32 0, i32* %7
br label %11
11: ; preds = %21, %2
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 50
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = call i64 @malloc(i32 200)
%16 = inttoptr i64 %15 to float*
%17 = load float**, float*** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float*, float** %17, i64 %19
store float* %16, float** %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %11
24: ; preds = %11
%25 = load float**, float*** %6
%26 = call i32 @preencher(float** %25, i32 50, i32 50)
%27 = load float**, float*** %6
%28 = call i32 @print(float** %27, i32 50, i32 50)
store i32 0, i32* %7
br label %29
29: ; preds = %39, %24
%30 = load i32, i32* %7
%31 = icmp slt i32 %30, 50
br i1 %31, label %32, label %42
32: ; preds = %29
%33 = load float**, float*** %6
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds float*, float** %33, i64 %35
%37 = load float*, float** %36
%38 = call i32 @free(float* %37)
br label %39
39: ; preds = %32
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %29
42: ; preds = %29
ret i32 0
}

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