#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void leMatriz(int **matriz, int lin, int col) {
  printf("\nDigite os valores: ");
  for (int i = 0; i < lin; i++)
    for (int j = 0; j < col; j++)
      scanf("%d", &matriz[i][j]);
}


x86 assembly (clang, -O0):
<leMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a8 <leMatriz+0x88>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1195 <leMatriz+0x75>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe93(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1158 <leMatriz+0x38>
jmp    119a <leMatriz+0x7a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <leMatriz+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leMatriz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
mov    %esi,%ebp
mov    %rdi,%r13
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
jle    119b <leMatriz+0x7b>
mov    %ebp,%r15d
mov    0x4(%rsp),%ebp
shl    $0x2,%rbp
xor    %ebx,%ebx
lea    0xebd(%rip),%r12
jmp    1169 <leMatriz+0x49>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %r15,%rbx
je     119b <leMatriz+0x7b>
cmpl   $0x0,0x4(%rsp)
jle    1160 <leMatriz+0x40>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13,%rbx,8),%rsi
add    %r14,%rsi
mov    %r12,%rdi
call   1040 <scanf@plt>
add    $0x4,%r14
cmp    %r14,%rbp
jne    1180 <leMatriz+0x60>
jmp    1160 <leMatriz+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"\0ADigite os valores: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @leMatriz(i32** nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = icmp sgt i32 %2, 0
%8 = zext i32 %1 to i64
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %6, %15
%11 = phi i64 [ 0, %6 ], [ %16, %15 ]
br i1 %7, label %12, label %15
12: ; preds = %10
%13 = getelementptr inbounds i32*, i32** %0, i64 %11
br label %18
14: ; preds = %15, %3
ret void
15: ; preds = %18, %10
%16 = add nuw nsw i64 %11, 1
%17 = icmp eq i64 %16, %8
br i1 %17, label %14, label %10
18: ; preds = %12, %18
%19 = phi i64 [ 0, %12 ], [ %23, %18 ]
%20 = load i32*, i32** %13
%21 = getelementptr inbounds i32, i32* %20, i64 %19
%22 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %21)
%23 = add nuw nsw i64 %19, 1
%24 = icmp eq i64 %23, %9
br i1 %24, label %15, label %18
}