#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*/ assert_dbl_near(double, double, double, char const *, int);
void assert_dbl_array_near(double *exp, double *real, size_t n, double tol,
                           char const *caller, int line) {
  for (size_t i = 0; i < n; ++i) {
    assert_dbl_near(exp[i], real[i], tol, caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_dbl_array_near>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1183 <assert_dbl_array_near+0x73>
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <assert_dbl_near@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1139 <assert_dbl_array_near+0x29>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_dbl_array_near>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1166 <assert_dbl_array_near+0x56>
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %rsi,%r12
mov    %rdi,%r13
xor    %ebx,%ebx
movsd  %xmm0,(%rsp)
cs nopw 0x0(%rax,%rax,1)
movsd  0x0(%r13,%rbx,8),%xmm0
movsd  (%r12,%rbx,8),%xmm1
movsd  (%rsp),%xmm2
mov    %r15,%rdi
mov    %r14d,%esi
call   1030 <assert_dbl_near@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <assert_dbl_array_near+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @assert_dbl_array_near(double* %0, double* %1, i64 %2, double %3, i8* %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64
%10 = alloca double
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i64
store double* %0, double** %7
store double* %1, double** %8
store i64 %2, i64* %9
store double %3, double* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
store i64 0, i64* %13
br label %14
14: ; preds = %31, %6
%15 = load i64, i64* %13
%16 = load i64, i64* %9
%17 = icmp ult i64 %15, %16
br i1 %17, label %18, label %34
18: ; preds = %14
%19 = load double*, double** %7
%20 = load i64, i64* %13
%21 = getelementptr inbounds double, double* %19, i64 %20
%22 = load double, double* %21
%23 = load double*, double** %8
%24 = load i64, i64* %13
%25 = getelementptr inbounds double, double* %23, i64 %24
%26 = load double, double* %25
%27 = load double, double* %10
%28 = load i8*, i8** %11
%29 = load i32, i32* %12
%30 = call i32 @assert_dbl_near(double %22, double %26, double %27, i8* %28, i32 %29)
br label %31
31: ; preds = %18
%32 = load i64, i64* %13
%33 = add i64 %32, 1
store i64 %33, i64* %13
br label %14
34: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @assert_dbl_array_near(double* nocapture %0, double* nocapture %1, i64 %2, double %3, i8* %4, i32 %5) {
%7 = icmp eq i64 %2, 0
br i1 %7, label %8, label %9
8: ; preds = %9, %6
ret void
9: ; preds = %6, %9
%10 = phi i64 [ %16, %9 ], [ 0, %6 ]
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 %10
%14 = load double, double* %13
%15 = tail call i32 @assert_dbl_near(double %12, double %14, double %3, i8* %4, i32 %5)
%16 = add nuw i64 %10, 1
%17 = icmp eq i64 %16, %2
br i1 %17, label %8, label %9
}