#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 */
scalar_t__ DBL_EPSILON;
scalar_t__ fabs(double);
void mlFilterSmall(int l, double A[l][l]) {
  for (int i = 0; i < l; i++) {
    for (int j = 0; j < l; j++) {
      if (fabs(A[i][j]) < DBL_EPSILON)
        A[i][j] = 0.0;
    }
  }
}


x86 assembly (clang, -O0):
<mlFilterSmall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11ca <mlFilterSmall+0xba>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b7 <mlFilterSmall+0xa7>
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <fabs@plt>
mov    0x2e70(%rip),%rcx
cmp    (%rcx),%rax
jge    11a4 <mlFilterSmall+0x94>
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    11a9 <mlFilterSmall+0x99>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1140 <mlFilterSmall+0x30>
jmp    11bc <mlFilterSmall+0xac>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <mlFilterSmall+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlFilterSmall>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,0x10(%rsp)
mov    %edi,0xc(%rsp)
test   %edi,%edi
jle    120f <mlFilterSmall+0xff>
mov    0xc(%rsp),%ecx
mov    %rcx,0x18(%rsp)
mov    %ecx,%ebx
and    $0xfffffffe,%ebx
mov    0x10(%rsp),%rax
lea    0x8(%rax),%rbp
lea    0x0(,%rcx,8),%rax
mov    %rax,0x20(%rsp)
xor    %r14d,%r14d
mov    0x2e8b(%rip),%r15
jmp    1172 <mlFilterSmall+0x62>
nop
add    $0x1,%r14
add    0x20(%rsp),%rbp
cmp    %rcx,%r14
je     120f <mlFilterSmall+0xff>
cmpl   $0x1,0xc(%rsp)
jne    11c0 <mlFilterSmall+0xb0>
xor    %r13d,%r13d
mov    0x18(%rsp),%rcx
test   $0x1,%cl
je     1160 <mlFilterSmall+0x50>
mov    %r14,%rax
imul   %rcx,%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%r12
movsd  (%r12,%r13,8),%xmm0
call   1030 <fabs@plt>
mov    0x18(%rsp),%rcx
cmp    (%r15),%rax
jge    1160 <mlFilterSmall+0x50>
movq   $0x0,(%r12,%r13,8)
jmp    1160 <mlFilterSmall+0x50>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %r13d,%r13d
jmp    11d9 <mlFilterSmall+0xc9>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x2,%r13
cmp    %r13,%rbx
je     117c <mlFilterSmall+0x6c>
movsd  -0x8(%rbp,%r13,8),%xmm0
call   1030 <fabs@plt>
cmp    (%r15),%rax
jge    11f3 <mlFilterSmall+0xe3>
movq   $0x0,-0x8(%rbp,%r13,8)
movsd  0x0(%rbp,%r13,8),%xmm0
call   1030 <fabs@plt>
cmp    (%r15),%rax
jge    11d0 <mlFilterSmall+0xc0>
movq   $0x0,0x0(%rbp,%r13,8)
jmp    11d0 <mlFilterSmall+0xc0>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@DBL_EPSILON = global i64 0
define void @mlFilterSmall(i32 %0, double* nocapture %1) {
%3 = zext i32 %0 to i64
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = and i64 %3, 1
%7 = icmp eq i32 %0, 1
%8 = and i64 %3, 4294967294
%9 = icmp eq i64 %6, 0
br label %10
10: ; preds = %5, %24
%11 = phi i64 [ %25, %24 ], [ 0, %5 ]
%12 = mul nuw nsw i64 %11, %3
%13 = getelementptr inbounds double, double* %1, i64 %12
br i1 %7, label %15, label %27
14: ; preds = %24, %2
ret void
15: ; preds = %44, %10
%16 = phi i64 [ 0, %10 ], [ %45, %44 ]
br i1 %9, label %24, label %17
17: ; preds = %15
%18 = getelementptr inbounds double, double* %13, i64 %16
%19 = load double, double* %18
%20 = tail call i64 @fabs(double %19)
%21 = load i64, i64* @DBL_EPSILON
%22 = icmp slt i64 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %17
store double 0.000000e+00, double* %18
br label %24
24: ; preds = %17, %23, %15
%25 = add nuw nsw i64 %11, 1
%26 = icmp eq i64 %25, %3
br i1 %26, label %14, label %10
27: ; preds = %10, %44
%28 = phi i64 [ %45, %44 ], [ 0, %10 ]
%29 = phi i64 [ %46, %44 ], [ 0, %10 ]
%30 = getelementptr inbounds double, double* %13, i64 %28
%31 = load double, double* %30
%32 = tail call i64 @fabs(double %31)
%33 = load i64, i64* @DBL_EPSILON
%34 = icmp slt i64 %32, %33
br i1 %34, label %35, label %36
35: ; preds = %27
store double 0.000000e+00, double* %30
br label %36
36: ; preds = %27, %35
%37 = or i64 %28, 1
%38 = getelementptr inbounds double, double* %13, i64 %37
%39 = load double, double* %38
%40 = tail call i64 @fabs(double %39)
%41 = load i64, i64* @DBL_EPSILON
%42 = icmp slt i64 %40, %41
br i1 %42, label %43, label %44
43: ; preds = %36
store double 0.000000e+00, double* %38
br label %44
44: ; preds = %43, %36
%45 = add nuw nsw i64 %28, 2
%46 = add i64 %29, 2
%47 = icmp eq i64 %46, %8
br i1 %47, label %15, label %27
}