#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, int);
int /*<<< orphan*/ scanf(char *, int *);
void ler_matriz(int mat[50][50]) {
  int i, j;
  for (i = 0; i < 50; i++) {
    for (j = 0; j < 50; j++) {
      printf("Informe a posicao [%d][%d]: ", i, j);
      scanf("%d", &mat[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<ler_matriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    11aa <ler_matriz+0x8a>
movl   $0x0,-0x10(%rbp)
cmpl   $0x32,-0x10(%rbp)
jge    1197 <ler_matriz+0x77>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   $0xc8,%rax,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe99(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <ler_matriz+0x24>
jmp    119c <ler_matriz+0x7c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ler_matriz+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ler_matriz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %r13d,%r13d
lea    0xec8(%rip),%r15
lea    0xede(%rip),%r12
nop
mov    %r14,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbp
add    $0x4,%rbx
cmp    $0x32,%rbp
jne    1150 <ler_matriz+0x30>
add    $0x1,%r13
add    $0xc8,%r14
cmp    $0x32,%r13
jne    1140 <ler_matriz+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [29 x i8] c"Informe a posicao [%d][%d]: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @ler_matriz([50 x i32]* %0) {
br label %2
2: ; preds = %1, %13
%3 = phi i64 [ 0, %1 ], [ %14, %13 ]
%4 = trunc i64 %3 to i32
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %11, %5 ]
%7 = trunc i64 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7)
%9 = getelementptr inbounds [50 x i32], [50 x i32]* %0, i64 %3, i64 %6
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, 50
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add nuw nsw i64 %3, 1
%15 = icmp eq i64 %14, 50
br i1 %15, label %16, label %2
16: ; preds = %13
ret void
}