#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(double);
double verification(double *a, double *b, double *c0, double *c1, int n) {
  double diff, maxA, maxB;
  int i;
  diff = fabs(c1[0] - c0[0]);
  maxA = fabs(a[0]);
  maxB = fabs(b[0]);
  for (i = 0; i < n * n; i++) {
    if (fabs(c1[i] - c0[i]) > diff)
      diff = fabs(c1[i] - c0[i]);
    if (fabs(a[i]) > maxA)
      maxA = fabs(a[i]);
    if (fabs(b[i]) > maxB)
      maxB = fabs(b[i]);
  }
  return diff / (maxA * maxB);
}


x86 assembly (clang, -O0):
<verification>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movaps 0xed1(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xeb9(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xea1(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    126e <verification+0x16e>
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xe5e(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    11db <verification+0xdb>
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xe2e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe11(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    121b <verification+0x11b>
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdee(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdd1(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    125b <verification+0x15b>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdae(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1260 <verification+0x160>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    116f <verification+0x6f>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<verification>:
movsd  (%rcx),%xmm3
subsd  (%rdx),%xmm3
movapd 0xef0(%rip),%xmm1
movsd  (%rdi),%xmm2
movhpd (%rsi),%xmm2
andpd  %xmm1,%xmm3
andpd  %xmm1,%xmm2
imul   %r8d,%r8d
test   %r8d,%r8d
je     1137 <verification+0x37>
maxsd  %xmm3,%xmm3
maxpd  %xmm2,%xmm2
cmp    $0x1,%r8d
jne    113d <verification+0x3d>
movapd %xmm3,%xmm0
jmp    1185 <verification+0x85>
mov    %r8d,%r8d
mov    $0x1,%eax
movapd %xmm2,%xmm4
nopl   0x0(%rax)
movsd  (%rcx,%rax,8),%xmm0
subsd  (%rdx,%rax,8),%xmm0
andpd  %xmm1,%xmm0
maxsd  %xmm3,%xmm0
movsd  (%rdi,%rax,8),%xmm2
movhpd (%rsi,%rax,8),%xmm2
andpd  %xmm1,%xmm2
maxpd  %xmm4,%xmm2
add    $0x1,%rax
movapd %xmm0,%xmm3
movapd %xmm2,%xmm4
cmp    %rax,%r8
jne    1150 <verification+0x50>
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @verification(double* %0, double* %1, double* %2, double* %3, i32 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store i32 %4, i32* %10
%15 = load double*, double** %9
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = load double*, double** %8
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fsub double %17, %20
%22 = call double @llvm.fabs.f64(double %21)
store double %22, double* %11
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = call double @llvm.fabs.f64(double %25)
store double %26, double* %12
%27 = load double*, double** %7
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = call double @llvm.fabs.f64(double %29)
store double %30, double* %13
store i32 0, i32* %14
br label %31
31: ; preds = %98, %5
%32 = load i32, i32* %14
%33 = load i32, i32* %10
%34 = load i32, i32* %10
%35 = mul nsw i32 %33, %34
%36 = icmp slt i32 %32, %35
br i1 %36, label %37, label %101
37: ; preds = %31
%38 = load double*, double** %9
%39 = load i32, i32* %14
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = load double*, double** %8
%44 = load i32, i32* %14
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = fsub double %42, %47
%49 = call double @llvm.fabs.f64(double %48)
%50 = load double, double* %11
%51 = fcmp ogt double %49, %50
br i1 %51, label %52, label %65
52: ; preds = %37
%53 = load double*, double** %9
%54 = load i32, i32* %14
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %53, i64 %55
%57 = load double, double* %56
%58 = load double*, double** %8
%59 = load i32, i32* %14
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
%62 = load double, double* %61
%63 = fsub double %57, %62
%64 = call double @llvm.fabs.f64(double %63)
store double %64, double* %11
br label %65
65: ; preds = %52, %37
%66 = load double*, double** %6
%67 = load i32, i32* %14
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = call double @llvm.fabs.f64(double %70)
%72 = load double, double* %12
%73 = fcmp ogt double %71, %72
br i1 %73, label %74, label %81
74: ; preds = %65
%75 = load double*, double** %6
%76 = load i32, i32* %14
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %75, i64 %77
%79 = load double, double* %78
%80 = call double @llvm.fabs.f64(double %79)
store double %80, double* %12
br label %81
81: ; preds = %74, %65
%82 = load double*, double** %7
%83 = load i32, i32* %14
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
%86 = load double, double* %85
%87 = call double @llvm.fabs.f64(double %86)
%88 = load double, double* %13
%89 = fcmp ogt double %87, %88
br i1 %89, label %90, label %97
90: ; preds = %81
%91 = load double*, double** %7
%92 = load i32, i32* %14
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
%95 = load double, double* %94
%96 = call double @llvm.fabs.f64(double %95)
store double %96, double* %13
br label %97
97: ; preds = %90, %81
br label %98
98: ; preds = %97
%99 = load i32, i32* %14
%100 = add nsw i32 %99, 1
store i32 %100, i32* %14
br label %31
101: ; preds = %31
%102 = load double, double* %11
%103 = load double, double* %12
%104 = load double, double* %13
%105 = fmul double %103, %104
%106 = fdiv double %102, %105
ret double %106
}

LLVM IR (-O2):
define double @verification(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, i32 %4) {
%6 = load double, double* %3
%7 = load double, double* %2
%8 = fsub double %6, %7
%9 = tail call double @llvm.fabs.f64(double %8)
%10 = load double, double* %0
%11 = load double, double* %1
%12 = insertelement <2 x double> poison, double %10, i64 0
%13 = insertelement <2 x double> %12, double %11, i64 1
%14 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %13)
%15 = mul i32 %4, %4
%16 = icmp eq i32 %15, 0
br i1 %16, label %50, label %17
17: ; preds = %5
%18 = zext i32 %15 to i64
%19 = fsub double %6, %7
%20 = tail call double @llvm.fabs.f64(double %19)
%21 = fcmp ogt double %20, %9
%22 = select i1 %21, double %20, double %9
%23 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %13)
%24 = fcmp ogt <2 x double> %23, %14
%25 = select <2 x i1> %24, <2 x double> %23, <2 x double> %14
%26 = icmp eq i32 %15, 1
br i1 %26, label %50, label %27
27: ; preds = %17, %27
%28 = phi i64 [ %48, %27 ], [ 1, %17 ]
%29 = phi double [ %42, %27 ], [ %22, %17 ]
%30 = phi <2 x double> [ %47, %27 ], [ %25, %17 ]
%31 = getelementptr inbounds double, double* %3, i64 %28
%32 = load double, double* %31
%33 = getelementptr inbounds double, double* %2, i64 %28
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %0, i64 %28
%36 = load double, double* %35
%37 = getelementptr inbounds double, double* %1, i64 %28
%38 = load double, double* %37
%39 = fsub double %32, %34
%40 = tail call double @llvm.fabs.f64(double %39)
%41 = fcmp ogt double %40, %29
%42 = select i1 %41, double %40, double %29
%43 = insertelement <2 x double> poison, double %36, i64 0
%44 = insertelement <2 x double> %43, double %38, i64 1
%45 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %44)
%46 = fcmp ogt <2 x double> %45, %30
%47 = select <2 x i1> %46, <2 x double> %45, <2 x double> %30
%48 = add nuw nsw i64 %28, 1
%49 = icmp eq i64 %48, %18
br i1 %49, label %50, label %27
50: ; preds = %27, %17, %5
%51 = phi double [ %9, %5 ], [ %22, %17 ], [ %42, %27 ]
%52 = phi <2 x double> [ %14, %5 ], [ %25, %17 ], [ %47, %27 ]
%53 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%54 = fmul <2 x double> %52, %53
%55 = extractelement <2 x double> %54, i64 0
%56 = fdiv double %51, %55
ret double %56
}