#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 */
double fabs(float);
scalar_t__ isnan(float);
int /*<<< orphan*/ printf(char *, float, float, ...);
bool _assertFloatArrayEqualsE2D(float **expected, float **actual, int rows,
                                int cols, double epsilon, int line) {
  int i, j;
  if (rows <= 0) {
    printf("assertFloatArrayEquals2D FAILED, line: %i, negative or zero array "
           "rows: %i",
           line, rows);
    return false;
  }
  if (cols <= 0) {
    printf("assertFloatArrayEquals2D FAILED, line: %i, negative or zero array "
           "columns: %i",
           line, cols);
    return false;
  }
  for (i = 0; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      if (isnan(expected[i][j]) || isnan(actual[i][j]) ||
          fabs(expected[i][j] - actual[i][j]) > epsilon) {
        printf("assertFloatArrayEquals2D FAILED, line: %i, on (%i, %i) with "
               "array size (%i, %i)\n",
               line, i, j, rows, cols);
        printf("expected: %e, actual: %e, difference: %e\n", expected[i][j],
               actual[i][j], expected[i][j] - actual[i][j]);
        return false;
      }
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<_assertFloatArrayEqualsE2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     117d <_assertFloatArrayEqualsE2D+0x4d>
cvtsi2ssl -0x2c(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
lea    0xe96(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1313 <_assertFloatArrayEqualsE2D+0x1e3>
cmpl   $0x0,-0x20(%rbp)
jg     11ab <_assertFloatArrayEqualsE2D+0x7b>
cvtsi2ssl -0x2c(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
lea    0xeb3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1313 <_assertFloatArrayEqualsE2D+0x1e3>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    130c <_assertFloatArrayEqualsE2D+0x1dc>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    12f9 <_assertFloatArrayEqualsE2D+0x1c9>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1050 <isnan@plt>
cmp    $0x0,%rax
jne    1253 <_assertFloatArrayEqualsE2D+0x123>
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1050 <isnan@plt>
cmp    $0x0,%rax
jne    1253 <_assertFloatArrayEqualsE2D+0x123>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
call   1040 <fabs@plt>
ucomisd -0x28(%rbp),%xmm0
jbe    12e6 <_assertFloatArrayEqualsE2D+0x1b6>
cvtsi2ssl -0x2c(%rbp),%xmm0
cvtsi2ssl -0x30(%rbp),%xmm1
mov    -0x34(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe2c(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe17(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1313 <_assertFloatArrayEqualsE2D+0x1e3>
jmp    12eb <_assertFloatArrayEqualsE2D+0x1bb>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c5 <_assertFloatArrayEqualsE2D+0x95>
jmp    12fe <_assertFloatArrayEqualsE2D+0x1ce>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11b2 <_assertFloatArrayEqualsE2D+0x82>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertFloatArrayEqualsE2D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
mov    %edx,%r12d
test   %edx,%edx
jle    123e <_assertFloatArrayEqualsE2D+0x10e>
test   %ecx,%ecx
jle    1254 <_assertFloatArrayEqualsE2D+0x124>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %r8d,0xc(%rsp)
mov    %ecx,%r13d
mov    %r12d,%eax
mov    %rax,0x10(%rsp)
xor    %r15d,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r15,8),%rax
movss  (%rax,%rbp,4),%xmm0
call   1050 <isnan@plt>
test   %rax,%rax
jne    11e2 <_assertFloatArrayEqualsE2D+0xb2>
mov    (%r14,%r15,8),%rax
movss  (%rax,%rbp,4),%xmm0
call   1050 <isnan@plt>
test   %rax,%rax
jne    11e2 <_assertFloatArrayEqualsE2D+0xb2>
mov    (%rbx,%r15,8),%rax
movss  (%rax,%rbp,4),%xmm0
mov    (%r14,%r15,8),%rax
subss  (%rax,%rbp,4),%xmm0
call   1040 <fabs@plt>
ucomisd (%rsp),%xmm0
ja     11e2 <_assertFloatArrayEqualsE2D+0xb2>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1180 <_assertFloatArrayEqualsE2D+0x50>
add    $0x1,%r15
mov    $0x1,%eax
cmp    0x10(%rsp),%r15
jne    116f <_assertFloatArrayEqualsE2D+0x3f>
jmp    1270 <_assertFloatArrayEqualsE2D+0x140>
xorps  %xmm0,%xmm0
cvtsi2ssl 0xc(%rsp),%xmm0
mov    %r15d,%eax
mov    %rax,(%rsp)
cvtsi2ss %r15d,%xmm1
lea    0xe9b(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    $0x2,%al
call   1030 <printf@plt>
mov    (%rbx,%r15,8),%rax
movss  (%rax,%rbp,4),%xmm0
mov    (%rsp),%rax
mov    (%r14,%rax,8),%rax
movss  (%rax,%rbp,4),%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xeb5(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    126e <_assertFloatArrayEqualsE2D+0x13e>
xorps  %xmm0,%xmm0
cvtsi2ss %r8d,%xmm0
cvtsi2ss %r12d,%xmm1
lea    0xdae(%rip),%rdi
jmp    1267 <_assertFloatArrayEqualsE2D+0x137>
xorps  %xmm0,%xmm0
cvtsi2ss %r8d,%xmm0
cvtsi2ss %ecx,%xmm1
lea    0xde4(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [75 x i8] c"assertFloatArrayEquals2D FAILED, line: %i, negative or zero array rows: %i\00"
@.str.1 = [78 x i8] c"assertFloatArrayEquals2D FAILED, line: %i, negative or zero array columns: %i\00"
@.str.2 = [81 x i8] c"assertFloatArrayEquals2D FAILED, line: %i, on (%i, %i) with array size (%i, %i)\0A\00"
@.str.3 = [42 x i8] c"expected: %e, actual: %e, difference: %e\0A\00"
define i32 @_assertFloatArrayEqualsE2D(float** %0, float** %1, i32 %2, i32 %3, double %4, i32 %5) {
%7 = alloca i32
%8 = alloca float**
%9 = alloca float**
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store float** %0, float*** %8
store float** %1, float*** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double %4, double* %12
store i32 %5, i32* %13
%16 = load i32, i32* %10
%17 = icmp sle i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %6
%19 = load i32, i32* %13
%20 = sitofp i32 %19 to float
%21 = load i32, i32* %10
%22 = sitofp i32 %21 to float
%23 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), float %20, float %22)
store i32 0, i32* %7
br label %147
24: ; preds = %6
%25 = load i32, i32* %11
%26 = icmp sle i32 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %13
%29 = sitofp i32 %28 to float
%30 = load i32, i32* %11
%31 = sitofp i32 %30 to float
%32 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), float %29, float %31)
store i32 0, i32* %7
br label %147
33: ; preds = %24
store i32 0, i32* %14
br label %34
34: ; preds = %143, %33
%35 = load i32, i32* %14
%36 = load i32, i32* %10
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %146
38: ; preds = %34
store i32 0, i32* %15
br label %39
39: ; preds = %139, %38
%40 = load i32, i32* %15
%41 = load i32, i32* %11
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %142
43: ; preds = %39
%44 = load float**, float*** %8
%45 = load i32, i32* %14
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds float*, float** %44, i64 %46
%48 = load float*, float** %47
%49 = load i32, i32* %15
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds float, float* %48, i64 %50
%52 = load float, float* %51
%53 = call i64 @isnan(float %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %90, label %55
55: ; preds = %43
%56 = load float**, float*** %9
%57 = load i32, i32* %14
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds float*, float** %56, i64 %58
%60 = load float*, float** %59
%61 = load i32, i32* %15
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds float, float* %60, i64 %62
%64 = load float, float* %63
%65 = call i64 @isnan(float %64)
%66 = icmp ne i64 %65, 0
br i1 %66, label %90, label %67
67: ; preds = %55
%68 = load float**, float*** %8
%69 = load i32, i32* %14
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds float*, float** %68, i64 %70
%72 = load float*, float** %71
%73 = load i32, i32* %15
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds float, float* %72, i64 %74
%76 = load float, float* %75
%77 = load float**, float*** %9
%78 = load i32, i32* %14
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds float*, float** %77, i64 %79
%81 = load float*, float** %80
%82 = load i32, i32* %15
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds float, float* %81, i64 %83
%85 = load float, float* %84
%86 = fsub float %76, %85
%87 = call double @fabs(float %86)
%88 = load double, double* %12
%89 = fcmp ogt double %87, %88
br i1 %89, label %90, label %138
90: ; preds = %67, %55, %43
%91 = load i32, i32* %13
%92 = sitofp i32 %91 to float
%93 = load i32, i32* %14
%94 = sitofp i32 %93 to float
%95 = load i32, i32* %15
%96 = load i32, i32* %10
%97 = load i32, i32* %11
%98 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), float %92, float %94, i32 %95, i32 %96, i32 %97)
%99 = load float**, float*** %8
%100 = load i32, i32* %14
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds float*, float** %99, i64 %101
%103 = load float*, float** %102
%104 = load i32, i32* %15
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds float, float* %103, i64 %105
%107 = load float, float* %106
%108 = load float**, float*** %9
%109 = load i32, i32* %14
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds float*, float** %108, i64 %110
%112 = load float*, float** %111
%113 = load i32, i32* %15
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds float, float* %112, i64 %114
%116 = load float, float* %115
%117 = load float**, float*** %8
%118 = load i32, i32* %14
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds float*, float** %117, i64 %119
%121 = load float*, float** %120
%122 = load i32, i32* %15
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds float, float* %121, i64 %123
%125 = load float, float* %124
%126 = load float**, float*** %9
%127 = load i32, i32* %14
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds float*, float** %126, i64 %128
%130 = load float*, float** %129
%131 = load i32, i32* %15
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds float, float* %130, i64 %132
%134 = load float, float* %133
%135 = fsub float %125, %134
%136 = fpext float %135 to double
%137 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), float %107, float %116, double %136)
store i32 0, i32* %7
br label %147
138: ; preds = %67
br label %139
139: ; preds = %138
%140 = load i32, i32* %15
%141 = add nsw i32 %140, 1
store i32 %141, i32* %15
br label %39
142: ; preds = %39
br label %143
143: ; preds = %142
%144 = load i32, i32* %14
%145 = add nsw i32 %144, 1
store i32 %145, i32* %14
br label %34
146: ; preds = %34
store i32 1, i32* %7
br label %147
147: ; preds = %146, %90, %27, %18
%148 = load i32, i32* %7
ret i32 %148
}

LLVM IR (-O2):
@.str = [75 x i8] c"assertFloatArrayEquals2D FAILED, line: %i, negative or zero array rows: %i\00"
@.str.1 = [78 x i8] c"assertFloatArrayEquals2D FAILED, line: %i, negative or zero array columns: %i\00"
@.str.2 = [81 x i8] c"assertFloatArrayEquals2D FAILED, line: %i, on (%i, %i) with array size (%i, %i)\0A\00"
@.str.3 = [42 x i8] c"expected: %e, actual: %e, difference: %e\0A\00"
define i32 @_assertFloatArrayEqualsE2D(float** nocapture %0, float** nocapture %1, i32 %2, i32 %3, double %4, i32 %5) {
%7 = icmp slt i32 %2, 1
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = sitofp i32 %5 to float
%10 = sitofp i32 %2 to float
%11 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), float %9, float %10)
br label %72
12: ; preds = %6
%13 = icmp slt i32 %3, 1
br i1 %13, label %17, label %14
14: ; preds = %12
%15 = zext i32 %2 to i64
%16 = zext i32 %3 to i64
br label %21
17: ; preds = %12
%18 = sitofp i32 %5 to float
%19 = sitofp i32 %3 to float
%20 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), float %18, float %19)
br label %72
21: ; preds = %14, %69
%22 = phi i64 [ 0, %14 ], [ %70, %69 ]
%23 = getelementptr inbounds float*, float** %0, i64 %22
%24 = getelementptr inbounds float*, float** %1, i64 %22
br label %25
25: ; preds = %21, %66
%26 = phi i64 [ 0, %21 ], [ %67, %66 ]
%27 = load float*, float** %23
%28 = getelementptr inbounds float, float* %27, i64 %26
%29 = load float, float* %28
%30 = tail call i64 @isnan(float %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %48
32: ; preds = %25
%33 = load float*, float** %24
%34 = getelementptr inbounds float, float* %33, i64 %26
%35 = load float, float* %34
%36 = tail call i64 @isnan(float %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %48
38: ; preds = %32
%39 = load float*, float** %23
%40 = getelementptr inbounds float, float* %39, i64 %26
%41 = load float, float* %40
%42 = load float*, float** %24
%43 = getelementptr inbounds float, float* %42, i64 %26
%44 = load float, float* %43
%45 = fsub float %41, %44
%46 = tail call double @fabs(float %45)
%47 = fcmp ogt double %46, %4
br i1 %47, label %48, label %66
48: ; preds = %38, %32, %25
%49 = trunc i64 %22 to i32
%50 = trunc i64 %26 to i32
%51 = and i64 %22, 4294967295
%52 = and i64 %26, 4294967295
%53 = sitofp i32 %5 to float
%54 = sitofp i32 %49 to float
%55 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), float %53, float %54, i32 %50, i32 %2, i32 %3)
%56 = load float*, float** %23
%57 = getelementptr inbounds float, float* %56, i64 %52
%58 = load float, float* %57
%59 = getelementptr inbounds float*, float** %1, i64 %51
%60 = load float*, float** %59
%61 = getelementptr inbounds float, float* %60, i64 %52
%62 = load float, float* %61
%63 = fsub float %58, %62
%64 = fpext float %63 to double
%65 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), float %58, float %62, double %64)
br label %72
66: ; preds = %38
%67 = add nuw nsw i64 %26, 1
%68 = icmp eq i64 %67, %16
br i1 %68, label %69, label %25
69: ; preds = %66
%70 = add nuw nsw i64 %22, 1
%71 = icmp eq i64 %70, %15
br i1 %71, label %72, label %21
72: ; preds = %69, %48, %17, %8
%73 = phi i32 [ 0, %8 ], [ 0, %17 ], [ 0, %48 ], [ 1, %69 ]
ret i32 %73
}