#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*/ scanf(char *, int *);
int lerMatrizInteiros(int A[][100], int m, int n) {
  int i, j;
  if (m > 100 || n > 100)
    return 0;
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      scanf("%d", &A[i][j]);
  return 1;
}


x86 assembly (clang, -O0):
<lerMatrizInteiros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1136 <lerMatrizInteiros+0x26>
cmpl   $0x64,-0x18(%rbp)
jle    1142 <lerMatrizInteiros+0x32>
movl   $0x0,-0x4(%rbp)
jmp    11b9 <lerMatrizInteiros+0xa9>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b2 <lerMatrizInteiros+0xa2>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    119f <lerMatrizInteiros+0x8f>
mov    -0x10(%rbp),%rsi
movslq -0x1c(%rbp),%rax
imul   $0x190,%rax,%rax
add    %rax,%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe74(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115c <lerMatrizInteiros+0x4c>
jmp    11a4 <lerMatrizInteiros+0x94>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <lerMatrizInteiros+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerMatrizInteiros>:
xor    %eax,%eax
cmp    $0x64,%esi
jg     11ba <lerMatrizInteiros+0xaa>
cmp    $0x64,%edx
jg     11ba <lerMatrizInteiros+0xaa>
mov    $0x1,%eax
test   %esi,%esi
jle    11ba <lerMatrizInteiros+0xaa>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r12
mov    %esi,%eax
mov    %rax,0x10(%rsp)
mov    %edx,%eax
mov    %rax,0x8(%rsp)
xor    %r14d,%r14d
lea    0xea6(%rip),%rbp
jmp    1175 <lerMatrizInteiros+0x65>
nopl   0x0(%rax)
add    $0x1,%r14
add    $0x190,%r12
cmp    0x10(%rsp),%r14
mov    %r13d,%edx
je     11a7 <lerMatrizInteiros+0x97>
mov    %edx,%r13d
test   %edx,%edx
jle    1160 <lerMatrizInteiros+0x50>
mov    0x8(%rsp),%r15
mov    %r12,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1190 <lerMatrizInteiros+0x80>
jmp    1160 <lerMatrizInteiros+0x50>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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