#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*/ iguais(double, double);
bool matrizes_iguais(double **M1, double **M2, int l, int c) {
  int i, j;
  for (i = 0; i < l; i++)
    for (j = 0; j < c; j++)
      if (!iguais(M1[i][j], M2[i][j]))
        return false;
  return true;
}


x86 assembly (clang, -O0):
<matrizes_iguais>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11b6 <matrizes_iguais+0xa6>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11a3 <matrizes_iguais+0x93>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <iguais@plt>
cmp    $0x0,%eax
jne    1190 <matrizes_iguais+0x80>
movl   $0x0,-0x4(%rbp)
jmp    11bd <matrizes_iguais+0xad>
jmp    1195 <matrizes_iguais+0x85>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1140 <matrizes_iguais+0x30>
jmp    11a8 <matrizes_iguais+0x98>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112d <matrizes_iguais+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrizes_iguais>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%eax
test   %edx,%edx
jle    118c <matrizes_iguais+0x7c>
mov    %ecx,%r15d
mov    %rsi,%r13
mov    %rdi,%rbp
mov    %edx,%eax
mov    %rax,(%rsp)
mov    %ecx,%ebx
xor    %r12d,%r12d
jmp    114a <matrizes_iguais+0x3a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    (%rsp),%r12
je     119b <matrizes_iguais+0x8b>
test   %r15d,%r15d
jle    1140 <matrizes_iguais+0x30>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%rbp,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm0
mov    0x0(%r13,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm1
call   1030 <iguais@plt>
test   %eax,%eax
je     118a <matrizes_iguais+0x7a>
add    $0x1,%r14
cmp    %r14,%rbx
jne    1160 <matrizes_iguais+0x50>
jmp    1140 <matrizes_iguais+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
jmp    118c <matrizes_iguais+0x7c>

LLVM IR (-O0):
define i32 @matrizes_iguais(double** %0, double** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 0, i32* %10
br label %12
12: ; preds = %48, %4
%13 = load i32, i32* %10
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %51
16: ; preds = %12
store i32 0, i32* %11
br label %17
17: ; preds = %44, %16
%18 = load i32, i32* %11
%19 = load i32, i32* %9
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %47
21: ; preds = %17
%22 = load double**, double*** %6
%23 = load i32, i32* %10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double*, double** %22, i64 %24
%26 = load double*, double** %25
%27 = load i32, i32* %11
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
%31 = load double**, double*** %7
%32 = load i32, i32* %10
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double*, double** %31, i64 %33
%35 = load double*, double** %34
%36 = load i32, i32* %11
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = call i32 @iguais(double %30, double %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %21
store i32 0, i32* %5
br label %52
43: ; preds = %21
br label %44
44: ; preds = %43
%45 = load i32, i32* %11
%46 = add nsw i32 %45, 1
store i32 %46, i32* %11
br label %17
47: ; preds = %17
br label %48
48: ; preds = %47
%49 = load i32, i32* %10
%50 = add nsw i32 %49, 1
store i32 %50, i32* %10
br label %12
51: ; preds = %12
store i32 1, i32* %5
br label %52
52: ; preds = %51, %42
%53 = load i32, i32* %5
ret i32 %53
}

LLVM IR (-O2):
define i32 @matrizes_iguais(double** nocapture %0, double** nocapture %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %31
6: ; preds = %4
%7 = icmp sgt i32 %3, 0
%8 = zext i32 %2 to i64
%9 = zext i32 %3 to i64
br label %10
10: ; preds = %6, %28
%11 = phi i64 [ 0, %6 ], [ %29, %28 ]
br i1 %7, label %12, label %28
12: ; preds = %10
%13 = getelementptr inbounds double*, double** %0, i64 %11
%14 = getelementptr inbounds double*, double** %1, i64 %11
br label %17
15: ; preds = %17
%16 = icmp eq i64 %27, %9
br i1 %16, label %28, label %17
17: ; preds = %12, %15
%18 = phi i64 [ 0, %12 ], [ %27, %15 ]
%19 = load double*, double** %13
%20 = getelementptr inbounds double, double* %19, i64 %18
%21 = load double, double* %20
%22 = load double*, double** %14
%23 = getelementptr inbounds double, double* %22, i64 %18
%24 = load double, double* %23
%25 = tail call i32 @iguais(double %21, double %24)
%26 = icmp eq i32 %25, 0
%27 = add nuw nsw i64 %18, 1
br i1 %26, label %31, label %15
28: ; preds = %15, %10
%29 = add nuw nsw i64 %11, 1
%30 = icmp eq i64 %29, %8
br i1 %30, label %31, label %10
31: ; preds = %28, %17, %4
%32 = phi i32 [ 1, %4 ], [ 0, %17 ], [ 1, %28 ]
ret i32 %32
}