#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 const l1_norm(double *, int, int);
double const l1_norm_diff(double *, double *, int, int);
double error(double *mat1, double *mat2, int rows, int cols) {
  const double macheps = 1.110223024625157e-16;
  return l1_norm_diff(mat1, mat2, rows, cols) /
         (macheps * l1_norm(mat1, rows, cols) * l1_norm(mat2, rows, cols));
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <l1_norm_diff@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <l1_norm@plt>
movaps %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <l1_norm@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r15d
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <l1_norm_diff@plt>
movsd  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1030 <l1_norm@plt>
mulsd  0xeab(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1030 <l1_norm@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @error(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store double 0x3CA0000000000002, double* %9
%10 = load double*, double** %5
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call double @l1_norm_diff(double* %10, double* %11, i32 %12, i32 %13)
%15 = load double*, double** %5
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call double @l1_norm(double* %15, i32 %16, i32 %17)
%19 = fmul double 0x3CA0000000000002, %18
%20 = load double*, double** %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call double @l1_norm(double* %20, i32 %21, i32 %22)
%24 = fmul double %19, %23
%25 = fdiv double %14, %24
ret double %25
}

LLVM IR (-O2):
define double @error(double* %0, double* %1, i32 %2, i32 %3) {
%5 = tail call double @l1_norm_diff(double* %0, double* %1, i32 %2, i32 %3)
%6 = tail call double @l1_norm(double* %0, i32 %2, i32 %3)
%7 = fmul double %6, 0x3CA0000000000002
%8 = tail call double @l1_norm(double* %1, i32 %2, i32 %3)
%9 = fmul double %7, %8
%10 = fdiv double %5, %9
ret double %10
}