void error_check(int n, double dx, double dy, double **u) {
  int i, j;
  double xxexp, yy, temp, error;
#pragma omp parallel for reduction(+ : error) private(i, j, xxexp, yy, temp)
  for (i = 0; i < n; i++) {
    xxexp = exp(dx * (i - 1));
    for (j = 0; j < n; j++) {
      yy = dy * (j - 1);
      temp = (u[i][j]) - xxexp * exp(-2.0 * yy);
      error += temp * temp;
    }
  }
  error = sqrt(error) / (n * n);
  printf("Erro : %g\n", error);
}


x86 assembly (clang, -O0):
<error_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1248 <error_check+0x118>
movsd  -0x10(%rbp),%xmm0
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1235 <error_check+0x105>
movsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe30(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1040 <exp@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1180 <error_check+0x50>
jmp    123a <error_check+0x10a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1150 <error_check+0x20>
movsd  -0x48(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xd96(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_check>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r15
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r14d
mov    %edi,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
call   1040 <exp@plt>
xorpd  0xe83(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
xor    %ebp,%ebp
movsd  (%rsp),%xmm1
nopw   0x0(%rax,%rax,1)
movsd  %xmm1,(%rsp)
lea    -0x1(%rbp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
mov    (%r15,%rbx,8),%rax
movsd  (%rax,%rbp,8),%xmm1
movsd  %xmm1,0x18(%rsp)
mulsd  0xe54(%rip),%xmm0
call   1040 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm0,%xmm1
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1190 <error_check+0x60>
movsd  %xmm1,(%rsp)
add    $0x1,%rbx
cmp    %r12,%rbx
jne    1160 <error_check+0x30>
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     120e <error_check+0xde>
sqrtsd %xmm0,%xmm0
jmp    1213 <error_check+0xe3>
call   1050 <sqrt@plt>
imul   %r14d,%r14d
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
divsd  %xmm1,%xmm0
lea    0xdee(%rip),%rdi
mov    $0x1,%al
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Erro : %g\0A\00"
define void @error_check(i32 %0, double %1, double %2, double** %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double**
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double** %3, double*** %8
store i32 0, i32* %9
br label %15
15: ; preds = %59, %4
%16 = load i32, i32* %9
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %62
19: ; preds = %15
%20 = load double, double* %6
%21 = load i32, i32* %9
%22 = sub nsw i32 %21, 1
%23 = sitofp i32 %22 to double
%24 = fmul double %20, %23
%25 = call double @exp(double %24)
store double %25, double* %11
store i32 0, i32* %10
br label %26
26: ; preds = %55, %19
%27 = load i32, i32* %10
%28 = load i32, i32* %5
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %58
30: ; preds = %26
%31 = load double, double* %7
%32 = load i32, i32* %10
%33 = sub nsw i32 %32, 1
%34 = sitofp i32 %33 to double
%35 = fmul double %31, %34
store double %35, double* %12
%36 = load double**, double*** %8
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double*, double** %36, i64 %38
%40 = load double*, double** %39
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
%44 = load double, double* %43
%45 = load double, double* %11
%46 = load double, double* %12
%47 = fmul double -2.000000e+00, %46
%48 = call double @exp(double %47)
%49 = fneg double %45
%50 = call double @llvm.fmuladd.f64(double %49, double %48, double %44)
store double %50, double* %13
%51 = load double, double* %13
%52 = load double, double* %13
%53 = load double, double* %14
%54 = call double @llvm.fmuladd.f64(double %51, double %52, double %53)
store double %54, double* %14
br label %55
55: ; preds = %30
%56 = load i32, i32* %10
%57 = add nsw i32 %56, 1
store i32 %57, i32* %10
br label %26
58: ; preds = %26
br label %59
59: ; preds = %58
%60 = load i32, i32* %9
%61 = add nsw i32 %60, 1
store i32 %61, i32* %9
br label %15
62: ; preds = %15
%63 = load double, double* %14
%64 = call double @sqrt(double %63)
%65 = load i32, i32* %5
%66 = load i32, i32* %5
%67 = mul nsw i32 %65, %66
%68 = sitofp i32 %67 to double
%69 = fdiv double %64, %68
store double %69, double* %14
%70 = load double, double* %14
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %70)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Erro : %g\0A\00"
define void @error_check(i32 %0, double %1, double %2, double** nocapture %3) {
%5 = icmp sgt i32 %0, 0
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %33, %4
%8 = phi i64 [ 0, %4 ], [ %34, %33 ]
%9 = phi double [ undef, %4 ], [ %30, %33 ]
%10 = trunc i64 %8 to i32
%11 = add i32 %10, -1
%12 = sitofp i32 %11 to double
%13 = fmul double %12, %1
%14 = tail call double @exp(double %13)
%15 = getelementptr inbounds double*, double** %3, i64 %8
%16 = fneg double %14
br label %17
17: ; preds = %7, %17
%18 = phi i64 [ 0, %7 ], [ %31, %17 ]
%19 = phi double [ %9, %7 ], [ %30, %17 ]
%20 = trunc i64 %18 to i32
%21 = add i32 %20, -1
%22 = sitofp i32 %21 to double
%23 = fmul double %22, %2
%24 = load double*, double** %15
%25 = getelementptr inbounds double, double* %24, i64 %18
%26 = load double, double* %25
%27 = fmul double %23, -2.000000e+00
%28 = tail call double @exp(double %27)
%29 = tail call double @llvm.fmuladd.f64(double %16, double %28, double %26)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %29, double %19)
%31 = add nuw nsw i64 %18, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %17
33: ; preds = %17
%34 = add nuw nsw i64 %8, 1
%35 = icmp eq i64 %34, %6
br i1 %35, label %36, label %7
36: ; preds = %33
%37 = tail call double @sqrt(double %30)
%38 = mul nsw i32 %0, %0
%39 = sitofp i32 %38 to double
%40 = fdiv double %37, %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %40)
ret void
}