#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__ fabs(double);
double compute_error(double *a_x, double *a_y, double *P, double *fn) {
  double error = 0.0;
  long indx, indx_rght, indx_frnt, indx_lft, indx_bck, i, j, indx_ax, indx_ay;
  for (i = 1; i < (65) - 1; i++) {
    for (j = 1; j < (65) - 1; j++) {
      indx = i * (65) + j;
      indx_rght = indx + 1;
      indx_frnt = indx + (65);
      indx_lft = indx - 1;
      indx_bck = indx - (65);
      indx_ax = i * ((65) - 1) + j;
      indx_ay = i * ((65) - 2) + j;
      error +=
          fabs(a_x[indx_ax - 1] * P[indx_lft] + a_x[indx_ax] * P[indx_rght] +
               a_y[indx_ay - ((65) - 2)] * P[indx_bck] +
               a_y[indx_ay] * P[indx_frnt] -
               (a_x[indx_ax - 1] + a_x[indx_ax] + a_y[indx_ay - ((65) - 2)] +
                a_y[indx_ay]) *
                   P[indx] -
               (1.0) * (1.0) * fn[indx]);
    }
  }
  return (error);
}


x86 assembly (clang, -O0):
<compute_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movq   $0x1,-0x58(%rbp)
cmpq   $0x40,-0x58(%rbp)
jge    12ec <compute_error+0x1dc>
movq   $0x1,-0x60(%rbp)
cmpq   $0x40,-0x60(%rbp)
jge    12d6 <compute_error+0x1c6>
imul   $0x41,-0x58(%rbp),%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
add    $0x41,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rax
sub    $0x41,%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%rax
shl    $0x6,%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
imul   $0x3f,-0x58(%rbp),%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x68(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%rcx
sub    $0x3f,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x68(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x68(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%rcx
sub    $0x3f,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    114b <compute_error+0x3b>
jmp    12db <compute_error+0x1cb>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    1138 <compute_error+0x28>
movsd  -0x28(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_error>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
add    $0x200,%r15
add    $0x208,%r12
add    $0x418,%rbx
add    $0x210,%r14
mov    $0x1,%r13d
xorps  %xmm0,%xmm0
nopl   0x0(%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,(%rsp)
movsd  -0x8(%r12,%rbp,1),%xmm1
movsd  (%r12,%rbp,1),%xmm2
movsd  -0x200(%rbx,%rbp,1),%xmm0
ff ff
mulsd  %xmm2,%xmm0
movsd  -0x210(%rbx,%rbp,1),%xmm3
ff ff
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
movsd  -0x1f8(%r15,%rbp,1),%xmm4
fe ff ff
movsd  (%r15,%rbp,1),%xmm5
movsd  -0x410(%rbx,%rbp,1),%xmm6
ff ff
mulsd  %xmm4,%xmm6
addsd  %xmm3,%xmm6
movsd  (%rbx,%rbp,1),%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
addsd  %xmm5,%xmm1
mulsd  -0x208(%rbx,%rbp,1),%xmm1
ff ff
addsd  %xmm6,%xmm0
subsd  %xmm1,%xmm0
subsd  (%r14,%rbp,1),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
add    $0x8,%rbp
cmp    $0x1f8,%rbp
jne    1160 <compute_error+0x50>
add    $0x1,%r13
add    $0x1f8,%r15
add    $0x200,%r12
add    $0x208,%rbx
add    $0x208,%r14
cmp    $0x40,%r13
jne    1150 <compute_error+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @compute_error(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
store double 0.000000e+00, double* %9
store i64 1, i64* %15
br label %19
19: ; preds = %125, %4
%20 = load i64, i64* %15
%21 = icmp slt i64 %20, 64
br i1 %21, label %22, label %128
22: ; preds = %19
store i64 1, i64* %16
br label %23
23: ; preds = %121, %22
%24 = load i64, i64* %16
%25 = icmp slt i64 %24, 64
br i1 %25, label %26, label %124
26: ; preds = %23
%27 = load i64, i64* %15
%28 = mul nsw i64 %27, 65
%29 = load i64, i64* %16
%30 = add nsw i64 %28, %29
store i64 %30, i64* %10
%31 = load i64, i64* %10
%32 = add nsw i64 %31, 1
store i64 %32, i64* %11
%33 = load i64, i64* %10
%34 = add nsw i64 %33, 65
store i64 %34, i64* %12
%35 = load i64, i64* %10
%36 = sub nsw i64 %35, 1
store i64 %36, i64* %13
%37 = load i64, i64* %10
%38 = sub nsw i64 %37, 65
store i64 %38, i64* %14
%39 = load i64, i64* %15
%40 = mul nsw i64 %39, 64
%41 = load i64, i64* %16
%42 = add nsw i64 %40, %41
store i64 %42, i64* %17
%43 = load i64, i64* %15
%44 = mul nsw i64 %43, 63
%45 = load i64, i64* %16
%46 = add nsw i64 %44, %45
store i64 %46, i64* %18
%47 = load double*, double** %5
%48 = load i64, i64* %17
%49 = sub nsw i64 %48, 1
%50 = getelementptr inbounds double, double* %47, i64 %49
%51 = load double, double* %50
%52 = load double*, double** %7
%53 = load i64, i64* %13
%54 = getelementptr inbounds double, double* %52, i64 %53
%55 = load double, double* %54
%56 = load double*, double** %5
%57 = load i64, i64* %17
%58 = getelementptr inbounds double, double* %56, i64 %57
%59 = load double, double* %58
%60 = load double*, double** %7
%61 = load i64, i64* %11
%62 = getelementptr inbounds double, double* %60, i64 %61
%63 = load double, double* %62
%64 = fmul double %59, %63
%65 = call double @llvm.fmuladd.f64(double %51, double %55, double %64)
%66 = load double*, double** %6
%67 = load i64, i64* %18
%68 = sub nsw i64 %67, 63
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = load double*, double** %7
%72 = load i64, i64* %14
%73 = getelementptr inbounds double, double* %71, i64 %72
%74 = load double, double* %73
%75 = call double @llvm.fmuladd.f64(double %70, double %74, double %65)
%76 = load double*, double** %6
%77 = load i64, i64* %18
%78 = getelementptr inbounds double, double* %76, i64 %77
%79 = load double, double* %78
%80 = load double*, double** %7
%81 = load i64, i64* %12
%82 = getelementptr inbounds double, double* %80, i64 %81
%83 = load double, double* %82
%84 = call double @llvm.fmuladd.f64(double %79, double %83, double %75)
%85 = load double*, double** %5
%86 = load i64, i64* %17
%87 = sub nsw i64 %86, 1
%88 = getelementptr inbounds double, double* %85, i64 %87
%89 = load double, double* %88
%90 = load double*, double** %5
%91 = load i64, i64* %17
%92 = getelementptr inbounds double, double* %90, i64 %91
%93 = load double, double* %92
%94 = fadd double %89, %93
%95 = load double*, double** %6
%96 = load i64, i64* %18
%97 = sub nsw i64 %96, 63
%98 = getelementptr inbounds double, double* %95, i64 %97
%99 = load double, double* %98
%100 = fadd double %94, %99
%101 = load double*, double** %6
%102 = load i64, i64* %18
%103 = getelementptr inbounds double, double* %101, i64 %102
%104 = load double, double* %103
%105 = fadd double %100, %104
%106 = load double*, double** %7
%107 = load i64, i64* %10
%108 = getelementptr inbounds double, double* %106, i64 %107
%109 = load double, double* %108
%110 = fneg double %105
%111 = call double @llvm.fmuladd.f64(double %110, double %109, double %84)
%112 = load double*, double** %8
%113 = load i64, i64* %10
%114 = getelementptr inbounds double, double* %112, i64 %113
%115 = load double, double* %114
%116 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %115, double %111)
%117 = call i64 @fabs(double %116)
%118 = sitofp i64 %117 to double
%119 = load double, double* %9
%120 = fadd double %119, %118
store double %120, double* %9
br label %121
121: ; preds = %26
%122 = load i64, i64* %16
%123 = add nsw i64 %122, 1
store i64 %123, i64* %16
br label %23
124: ; preds = %23
br label %125
125: ; preds = %124
%126 = load i64, i64* %15
%127 = add nsw i64 %126, 1
store i64 %127, i64* %15
br label %19
128: ; preds = %19
%129 = load double, double* %9
ret double %129
}

LLVM IR (-O2):
define double @compute_error(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
br label %5
5: ; preds = %4, %58
%6 = phi double [ 0.000000e+00, %4 ], [ %55, %58 ]
%7 = phi i64 [ 1, %4 ], [ %59, %58 ]
%8 = mul nuw nsw i64 %7, 65
%9 = shl nsw i64 %7, 6
%10 = mul nuw nsw i64 %7, 63
br label %11
11: ; preds = %5, %11
%12 = phi double [ %6, %5 ], [ %55, %11 ]
%13 = phi i64 [ 1, %5 ], [ %56, %11 ]
%14 = add nuw nsw i64 %13, %8
%15 = add nuw nsw i64 %14, 1
%16 = add nuw nsw i64 %14, 65
%17 = add nsw i64 %14, -1
%18 = add nsw i64 %14, -65
%19 = add nuw nsw i64 %13, %9
%20 = add nuw nsw i64 %13, %10
%21 = add nsw i64 %19, -1
%22 = getelementptr inbounds double, double* %0, i64 %21
%23 = load double, double* %22
%24 = getelementptr inbounds double, double* %2, i64 %17
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %0, i64 %19
%27 = load double, double* %26
%28 = getelementptr inbounds double, double* %2, i64 %15
%29 = load double, double* %28
%30 = fmul double %27, %29
%31 = tail call double @llvm.fmuladd.f64(double %23, double %25, double %30)
%32 = add nsw i64 %20, -63
%33 = getelementptr inbounds double, double* %1, i64 %32
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %2, i64 %18
%36 = load double, double* %35
%37 = tail call double @llvm.fmuladd.f64(double %34, double %36, double %31)
%38 = getelementptr inbounds double, double* %1, i64 %20
%39 = load double, double* %38
%40 = getelementptr inbounds double, double* %2, i64 %16
%41 = load double, double* %40
%42 = tail call double @llvm.fmuladd.f64(double %39, double %41, double %37)
%43 = fadd double %23, %27
%44 = fadd double %43, %34
%45 = fadd double %44, %39
%46 = getelementptr inbounds double, double* %2, i64 %14
%47 = load double, double* %46
%48 = fneg double %45
%49 = tail call double @llvm.fmuladd.f64(double %48, double %47, double %42)
%50 = getelementptr inbounds double, double* %3, i64 %14
%51 = load double, double* %50
%52 = tail call double @llvm.fmuladd.f64(double %51, double -1.000000e+00, double %49)
%53 = tail call i64 @fabs(double %52)
%54 = sitofp i64 %53 to double
%55 = fadd double %12, %54
%56 = add nuw nsw i64 %13, 1
%57 = icmp eq i64 %56, 64
br i1 %57, label %58, label %11
58: ; preds = %11
%59 = add nuw nsw i64 %7, 1
%60 = icmp eq i64 %59, 64
br i1 %60, label %61, label %5
61: ; preds = %58
ret double %55
}