#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 compute_error(double **, double **, int const);
int /*<<< orphan*/ memcpy(double *, double *, int const);
int sor(double unew[][500 + 2], double uold[][500 + 2],
        double solution[][500 + 2], const double omega, const double tol,
        const int m, const double h2) {
  int i, j;
  for (i = 0; i < m + 2; ++i) {
    unew[i][m + 1] = uold[i][m + 1];
    unew[m + 1][i] = uold[m + 1][i];
    unew[i][0] = uold[i][0];
    unew[0][i] = uold[0][i];
  }
  int iters = 0;
  double error = compute_error(solution, uold, m);
  while (error > tol) {
    for (i = 1; i < m + 1; ++i) {
      for (j = 1; j < m + 1; ++j) {
        unew[i][j] = (uold[i + 1][j] + uold[i - 1][j] + uold[i][j + 1] +
                      uold[i][j - 1] - (uold[i][j])) *
                     0.25;
      }
    }
    for (i = 1; i < m + 1; ++i) {
      memcpy(&uold[i][1], &unew[i][1], m * sizeof(double));
    }
    ++iters;
    if (iters % 20 == 0) {
      error = compute_error(solution, uold, m);
    }
  }
  return iters;
}


x86 assembly (clang, -O0):
<sor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
movsd  %xmm2,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1232 <sor+0x112>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    114d <sor+0x2d>
movl   $0x0,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1040 <compute_error@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1409 <sor+0x2e9>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1371 <sor+0x251>
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    135e <sor+0x23e>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movslq -0x40(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movslq -0x40(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xccf(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0xfb0,%rcx,%rcx
add    %rcx,%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    127d <sor+0x15d>
jmp    1363 <sor+0x243>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1265 <sor+0x145>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    13d2 <sor+0x2b2>
mov    -0x10(%rbp),%rdi
movslq -0x3c(%rbp),%rax
imul   $0xfb0,%rax,%rax
add    %rax,%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x3c(%rbp),%rax
imul   $0xfb0,%rax,%rax
add    %rax,%rsi
add    $0x8,%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1378 <sor+0x258>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1404 <sor+0x2e4>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1040 <compute_error@plt>
movsd  %xmm0,-0x50(%rbp)
jmp    124e <sor+0x12e>
mov    -0x44(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movsd  %xmm1,0x38(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rcx,0x8(%rsp)
cmp    $0xffffffff,%ecx
jl     11af <sor+0x8f>
mov    0x8(%rsp),%rcx
lea    0x1(%rcx),%eax
add    $0x2,%ecx
imul   $0xfb0,%rax,%rdx
lea    (%rdi,%rdx,1),%r8
add    %rsi,%rdx
shl    $0x3,%rcx
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
movsd  (%rdx,%rbp,1),%xmm0
movsd  %xmm0,(%r8,%rbp,1)
movsd  (%rsi,%rbx,1),%xmm0
movsd  %xmm0,(%rdi,%rbx,1)
movsd  (%rsi,%rbp,1),%xmm0
movsd  %xmm0,(%rdi,%rbp,1)
add    $0x8,%rbp
add    $0x1f6,%rax
add    $0xfb0,%rbx
cmp    %rbp,%rcx
jne    1170 <sor+0x50>
mov    %rdi,0x28(%rsp)
mov    0x20(%rsp),%rdi
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rbp
mov    %ebp,%edx
call   1040 <compute_error@plt>
xor    %ebx,%ebx
movsd  %xmm0,0x40(%rsp)
ucomisd 0x38(%rsp),%xmm0
jbe    14bb <sor+0x39b>
lea    0x0(,%rbp,8),%eax
mov    %eax,0x1c(%rsp)
lea    0x1(%rbp),%r13d
lea    -0x1(%r13),%r12
mov    %r12,0x30(%rsp)
and    $0xfffffffffffffffc,%r12
lea    0x1(%r12),%rax
mov    %rax,0x80(%rsp)
mov    0x10(%rsp),%rax
lea    0x1f78(%rax),%rcx
mov    %rcx,0x70(%rsp)
lea    0x1f60(%rax),%rcx
mov    %rcx,0x68(%rsp)
mov    0x28(%rsp),%rcx
lea    0xfc8(%rcx),%rdx
mov    %rdx,0x60(%rsp)
lea    0xfb0(%rcx),%rdx
mov    %rdx,0x58(%rsp)
add    $0xfb8,%rax
mov    %rax,0x50(%rsp)
lea    0xfb8(%rcx),%rax
mov    %rax,0x48(%rsp)
xor    %ebx,%ebx
jmp    1272 <sor+0x152>
nopl   0x0(%rax)
movsd  0x40(%rsp),%xmm0
ucomisd 0x38(%rsp),%xmm0
jbe    14bb <sor+0x39b>
mov    %rbx,0x78(%rsp)
test   %ebp,%ebp
jle    1483 <sor+0x363>
mov    $0x1,%ebp
mov    0x68(%rsp),%rax
mov    0x58(%rsp),%rcx
mov    0x60(%rsp),%rdx
mov    0x70(%rsp),%rsi
xor    %edi,%edi
mov    0x10(%rsp),%r11
mov    0x28(%rsp),%r14
mov    0x30(%rsp),%r15
movsd  0xd5f(%rip),%xmm4
movapd 0xd47(%rip),%xmm5
jmp    12eb <sor+0x1cb>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdi
add    $0xfb0,%rsi
add    $0xfb0,%rdx
add    $0xfb0,%rcx
add    $0xfb0,%rax
mov    %r8,%rbp
cmp    %r13,%r8
je     1440 <sor+0x320>
lea    0x1(%rbp),%r8
mov    $0x1,%ebx
cmp    $0x4,%r15
jb     13f0 <sor+0x2d0>
imul   $0xfb0,%rdi,%r9
lea    (%r11,%r9,1),%rbx
lea    (%rbx,%r13,8),%r10
add    $0x1f60,%r10
imul   $0xfb0,%rbp,%rbp
lea    (%r14,%rbp,1),%rbx
add    $0x8,%rbx
cmp    %r10,%rbx
jae    1345 <sor+0x225>
add    %r11,%r9
add    $0x8,%r9
add    %r14,%rbp
lea    0x0(%rbp,%r13,8),%rbp
mov    $0x1,%ebx
cmp    %rbp,%r9
jb     13f0 <sor+0x2d0>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movupd -0x10(%rsi,%rbx,8),%xmm0
movupd (%rsi,%rbx,8),%xmm1
movupd -0x1f70(%rsi,%rbx,8),%xmm2
ff ff
addpd  %xmm0,%xmm2
movupd -0x1f60(%rsi,%rbx,8),%xmm0
ff ff
addpd  %xmm1,%xmm0
movupd -0xfb8(%rsi,%rbx,8),%xmm1
ff ff
movupd -0xfa8(%rsi,%rbx,8),%xmm3
ff ff
addpd  %xmm0,%xmm3
addpd  %xmm1,%xmm2
movupd -0xfc8(%rsi,%rbx,8),%xmm0
ff ff
addpd  %xmm2,%xmm0
addpd  %xmm1,%xmm3
movupd -0xfc0(%rsi,%rbx,8),%xmm1
ff ff
subpd  %xmm1,%xmm0
movupd -0xfb0(%rsi,%rbx,8),%xmm1
ff ff
subpd  %xmm1,%xmm3
mulpd  %xmm5,%xmm0
mulpd  %xmm5,%xmm3
movupd %xmm0,-0x10(%rdx,%rbx,8)
movupd %xmm3,(%rdx,%rbx,8)
add    $0x4,%rbx
cmp    %rbx,%r12
jne    1350 <sor+0x230>
mov    0x80(%rsp),%rbx
cmp    %r12,%r15
je     12c0 <sor+0x1a0>
nopl   0x0(%rax,%rax,1)
movsd  (%rax,%rbx,8),%xmm0
addsd  -0x1f60(%rax,%rbx,8),%xmm0
ff ff
addsd  -0xfa8(%rax,%rbx,8),%xmm0
ff ff
addsd  -0xfb8(%rax,%rbx,8),%xmm0
ff ff
subsd  -0xfb0(%rax,%rbx,8),%xmm0
ff ff
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rcx,%rbx,8)
lea    0x1(%rbx),%rbp
mov    %rbp,%rbx
cmp    %rbp,%r13
jne    13f0 <sor+0x2d0>
jmp    12c0 <sor+0x1a0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%rsp),%rbp
test   %ebp,%ebp
jle    1483 <sor+0x363>
mov    0x30(%rsp),%rbx
mov    0x48(%rsp),%r14
mov    0x50(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
mov    0x1c(%rsp),%edx
call   1030 <memcpy@plt>
add    $0xfb0,%r15
add    $0xfb0,%r14
add    $0xffffffffffffffff,%rbx
jne    1460 <sor+0x340>
mov    0x78(%rsp),%rbx
add    $0x1,%ebx
imul   $0xcccccccd,%ebx,%eax
ror    $0x2,%eax
cmp    $0xccccccc,%eax
ja     1260 <sor+0x140>
mov    0x20(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    %ebp,%edx
call   1040 <compute_error@plt>
movsd  %xmm0,0x40(%rsp)
jmp    1260 <sor+0x140>
mov    %ebx,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sor([502 x double]* %0, [502 x double]* %1, [502 x double]* %2, double %3, double %4, i32 %5, double %6) {
%8 = alloca [502 x double]*
%9 = alloca [502 x double]*
%10 = alloca [502 x double]*
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
store [502 x double]* %0, [502 x double]** %8
store [502 x double]* %1, [502 x double]** %9
store [502 x double]* %2, [502 x double]** %10
store double %3, double* %11
store double %4, double* %12
store i32 %5, i32* %13
store double %6, double* %14
store i32 0, i32* %15
br label %19
19: ; preds = %81, %7
%20 = load i32, i32* %15
%21 = load i32, i32* %13
%22 = add nsw i32 %21, 2
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %84
24: ; preds = %19
%25 = load [502 x double]*, [502 x double]** %9
%26 = load i32, i32* %15
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [502 x double], [502 x double]* %25, i64 %27
%29 = load i32, i32* %13
%30 = add nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [502 x double], [502 x double]* %28, i64 0, i64 %31
%33 = load double, double* %32
%34 = load [502 x double]*, [502 x double]** %8
%35 = load i32, i32* %15
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [502 x double], [502 x double]* %34, i64 %36
%38 = load i32, i32* %13
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [502 x double], [502 x double]* %37, i64 0, i64 %40
store double %33, double* %41
%42 = load [502 x double]*, [502 x double]** %9
%43 = load i32, i32* %13
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [502 x double], [502 x double]* %42, i64 %45
%47 = load i32, i32* %15
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [502 x double], [502 x double]* %46, i64 0, i64 %48
%50 = load double, double* %49
%51 = load [502 x double]*, [502 x double]** %8
%52 = load i32, i32* %13
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [502 x double], [502 x double]* %51, i64 %54
%56 = load i32, i32* %15
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [502 x double], [502 x double]* %55, i64 0, i64 %57
store double %50, double* %58
%59 = load [502 x double]*, [502 x double]** %9
%60 = load i32, i32* %15
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [502 x double], [502 x double]* %59, i64 %61
%63 = getelementptr inbounds [502 x double], [502 x double]* %62, i64 0, i64 0
%64 = load double, double* %63
%65 = load [502 x double]*, [502 x double]** %8
%66 = load i32, i32* %15
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [502 x double], [502 x double]* %65, i64 %67
%69 = getelementptr inbounds [502 x double], [502 x double]* %68, i64 0, i64 0
store double %64, double* %69
%70 = load [502 x double]*, [502 x double]** %9
%71 = getelementptr inbounds [502 x double], [502 x double]* %70, i64 0
%72 = load i32, i32* %15
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [502 x double], [502 x double]* %71, i64 0, i64 %73
%75 = load double, double* %74
%76 = load [502 x double]*, [502 x double]** %8
%77 = getelementptr inbounds [502 x double], [502 x double]* %76, i64 0
%78 = load i32, i32* %15
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [502 x double], [502 x double]* %77, i64 0, i64 %79
store double %75, double* %80
br label %81
81: ; preds = %24
%82 = load i32, i32* %15
%83 = add nsw i32 %82, 1
store i32 %83, i32* %15
br label %19
84: ; preds = %19
store i32 0, i32* %17
%85 = load [502 x double]*, [502 x double]** %10
%86 = bitcast [502 x double]* %85 to double**
%87 = load [502 x double]*, [502 x double]** %9
%88 = bitcast [502 x double]* %87 to double**
%89 = load i32, i32* %13
%90 = call double @compute_error(double** %86, double** %88, i32 %89)
store double %90, double* %18
br label %91
91: ; preds = %209, %84
%92 = load double, double* %18
%93 = load double, double* %12
%94 = fcmp ogt double %92, %93
br i1 %94, label %95, label %210
95: ; preds = %91
store i32 1, i32* %15
br label %96
96: ; preds = %168, %95
%97 = load i32, i32* %15
%98 = load i32, i32* %13
%99 = add nsw i32 %98, 1
%100 = icmp slt i32 %97, %99
br i1 %100, label %101, label %171
101: ; preds = %96
store i32 1, i32* %16
br label %102
102: ; preds = %164, %101
%103 = load i32, i32* %16
%104 = load i32, i32* %13
%105 = add nsw i32 %104, 1
%106 = icmp slt i32 %103, %105
br i1 %106, label %107, label %167
107: ; preds = %102
%108 = load [502 x double]*, [502 x double]** %9
%109 = load i32, i32* %15
%110 = add nsw i32 %109, 1
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [502 x double], [502 x double]* %108, i64 %111
%113 = load i32, i32* %16
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [502 x double], [502 x double]* %112, i64 0, i64 %114
%116 = load double, double* %115
%117 = load [502 x double]*, [502 x double]** %9
%118 = load i32, i32* %15
%119 = sub nsw i32 %118, 1
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [502 x double], [502 x double]* %117, i64 %120
%122 = load i32, i32* %16
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [502 x double], [502 x double]* %121, i64 0, i64 %123
%125 = load double, double* %124
%126 = fadd double %116, %125
%127 = load [502 x double]*, [502 x double]** %9
%128 = load i32, i32* %15
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [502 x double], [502 x double]* %127, i64 %129
%131 = load i32, i32* %16
%132 = add nsw i32 %131, 1
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds [502 x double], [502 x double]* %130, i64 0, i64 %133
%135 = load double, double* %134
%136 = fadd double %126, %135
%137 = load [502 x double]*, [502 x double]** %9
%138 = load i32, i32* %15
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [502 x double], [502 x double]* %137, i64 %139
%141 = load i32, i32* %16
%142 = sub nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [502 x double], [502 x double]* %140, i64 0, i64 %143
%145 = load double, double* %144
%146 = fadd double %136, %145
%147 = load [502 x double]*, [502 x double]** %9
%148 = load i32, i32* %15
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [502 x double], [502 x double]* %147, i64 %149
%151 = load i32, i32* %16
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [502 x double], [502 x double]* %150, i64 0, i64 %152
%154 = load double, double* %153
%155 = fsub double %146, %154
%156 = fmul double %155, 2.500000e-01
%157 = load [502 x double]*, [502 x double]** %8
%158 = load i32, i32* %15
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [502 x double], [502 x double]* %157, i64 %159
%161 = load i32, i32* %16
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [502 x double], [502 x double]* %160, i64 0, i64 %162
store double %156, double* %163
br label %164
164: ; preds = %107
%165 = load i32, i32* %16
%166 = add nsw i32 %165, 1
store i32 %166, i32* %16
br label %102
167: ; preds = %102
br label %168
168: ; preds = %167
%169 = load i32, i32* %15
%170 = add nsw i32 %169, 1
store i32 %170, i32* %15
br label %96
171: ; preds = %96
store i32 1, i32* %15
br label %172
172: ; preds = %193, %171
%173 = load i32, i32* %15
%174 = load i32, i32* %13
%175 = add nsw i32 %174, 1
%176 = icmp slt i32 %173, %175
br i1 %176, label %177, label %196
177: ; preds = %172
%178 = load [502 x double]*, [502 x double]** %9
%179 = load i32, i32* %15
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [502 x double], [502 x double]* %178, i64 %180
%182 = getelementptr inbounds [502 x double], [502 x double]* %181, i64 0, i64 1
%183 = load [502 x double]*, [502 x double]** %8
%184 = load i32, i32* %15
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [502 x double], [502 x double]* %183, i64 %185
%187 = getelementptr inbounds [502 x double], [502 x double]* %186, i64 0, i64 1
%188 = load i32, i32* %13
%189 = sext i32 %188 to i64
%190 = mul i64 %189, 8
%191 = trunc i64 %190 to i32
%192 = call i32 @memcpy(double* %182, double* %187, i32 %191)
br label %193
193: ; preds = %177
%194 = load i32, i32* %15
%195 = add nsw i32 %194, 1
store i32 %195, i32* %15
br label %172
196: ; preds = %172
%197 = load i32, i32* %17
%198 = add nsw i32 %197, 1
store i32 %198, i32* %17
%199 = load i32, i32* %17
%200 = srem i32 %199, 20
%201 = icmp eq i32 %200, 0
br i1 %201, label %202, label %209
202: ; preds = %196
%203 = load [502 x double]*, [502 x double]** %10
%204 = bitcast [502 x double]* %203 to double**
%205 = load [502 x double]*, [502 x double]** %9
%206 = bitcast [502 x double]* %205 to double**
%207 = load i32, i32* %13
%208 = call double @compute_error(double** %204, double** %206, i32 %207)
store double %208, double* %18
br label %209
209: ; preds = %202, %196
br label %91
210: ; preds = %91
%211 = load i32, i32* %17
ret i32 %211
}

LLVM IR (-O2):
define i32 @sor([502 x double]* %0, [502 x double]* %1, [502 x double]* %2, double %3, double %4, i32 %5, double %6) {
%8 = icmp sgt i32 %5, -2
br i1 %8, label %9, label %30
9: ; preds = %7
%10 = add nsw i32 %5, 1
%11 = zext i32 %10 to i64
%12 = add i32 %5, 2
%13 = zext i32 %12 to i64
br label %14
14: ; preds = %9, %14
%15 = phi i64 [ 0, %9 ], [ %28, %14 ]
%16 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %15, i64 %11
%17 = load double, double* %16
%18 = getelementptr inbounds [502 x double], [502 x double]* %0, i64 %15, i64 %11
store double %17, double* %18
%19 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %11, i64 %15
%20 = load double, double* %19
%21 = getelementptr inbounds [502 x double], [502 x double]* %0, i64 %11, i64 %15
store double %20, double* %21
%22 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %15, i64 0
%23 = load double, double* %22
%24 = getelementptr inbounds [502 x double], [502 x double]* %0, i64 %15, i64 0
store double %23, double* %24
%25 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 0, i64 %15
%26 = load double, double* %25
%27 = getelementptr inbounds [502 x double], [502 x double]* %0, i64 0, i64 %15
store double %26, double* %27
%28 = add nuw nsw i64 %15, 1
%29 = icmp eq i64 %28, %13
br i1 %29, label %30, label %14
30: ; preds = %14, %7
%31 = bitcast [502 x double]* %2 to double**
%32 = bitcast [502 x double]* %1 to double**
%33 = tail call double @compute_error(double** %31, double** %32, i32 %5)
%34 = fcmp ogt double %33, %4
br i1 %34, label %35, label %158
35: ; preds = %30
%36 = icmp slt i32 %5, 1
%37 = shl i32 %5, 3
%38 = add nsw i32 %5, 1
%39 = zext i32 %38 to i64
%40 = zext i32 %38 to i64
%41 = add nsw i64 %39, -1
%42 = icmp ult i64 %41, 4
%43 = and i64 %41, -4
%44 = or i64 %43, 1
%45 = icmp eq i64 %41, %43
br label %46
46: ; preds = %35, %155
%47 = phi double [ %33, %35 ], [ %156, %155 ]
%48 = phi i32 [ 0, %35 ], [ %150, %155 ]
br i1 %36, label %149, label %50
49: ; preds = %139
br i1 %36, label %149, label %142
50: ; preds = %46, %139
%51 = phi i64 [ %141, %139 ], [ 0, %46 ]
%52 = phi i64 [ %53, %139 ], [ 1, %46 ]
%53 = add nuw nsw i64 %52, 1
%54 = and i64 %53, 4294967295
%55 = add nsw i64 %52, -1
br i1 %42, label %116, label %56
56: ; preds = %50
%57 = add i64 %51, 2
%58 = getelementptr [502 x double], [502 x double]* %1, i64 %57, i64 %39
%59 = getelementptr [502 x double], [502 x double]* %1, i64 %51, i64 1
%60 = getelementptr [502 x double], [502 x double]* %0, i64 %52, i64 %39
%61 = getelementptr [502 x double], [502 x double]* %0, i64 %52, i64 1
%62 = icmp ult double* %61, %58
%63 = icmp ult double* %59, %60
%64 = and i1 %62, %63
br i1 %64, label %116, label %65
65: ; preds = %56, %65
%66 = phi i64 [ %113, %65 ], [ 0, %56 ]
%67 = or i64 %66, 1
%68 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %54, i64 %67
%69 = bitcast double* %68 to <2 x double>*
%70 = load <2 x double>, <2 x double>* %69
%71 = getelementptr inbounds double, double* %68, i64 2
%72 = bitcast double* %71 to <2 x double>*
%73 = load <2 x double>, <2 x double>* %72
%74 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %55, i64 %67
%75 = bitcast double* %74 to <2 x double>*
%76 = load <2 x double>, <2 x double>* %75
%77 = getelementptr inbounds double, double* %74, i64 2
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = fadd <2 x double> %70, %76
%81 = fadd <2 x double> %73, %79
%82 = or i64 %66, 2
%83 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %52, i64 %82
%84 = bitcast double* %83 to <2 x double>*
%85 = load <2 x double>, <2 x double>* %84
%86 = getelementptr inbounds double, double* %83, i64 2
%87 = bitcast double* %86 to <2 x double>*
%88 = load <2 x double>, <2 x double>* %87
%89 = fadd <2 x double> %80, %85
%90 = fadd <2 x double> %81, %88
%91 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %52, i64 %66
%92 = bitcast double* %91 to <2 x double>*
%93 = load <2 x double>, <2 x double>* %92
%94 = getelementptr inbounds double, double* %91, i64 2
%95 = bitcast double* %94 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = fadd <2 x double> %89, %93
%98 = fadd <2 x double> %90, %96
%99 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %52, i64 %67
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %99, i64 2
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = fsub <2 x double> %97, %101
%106 = fsub <2 x double> %98, %104
%107 = fmul <2 x double> %105, <double 2.500000e-01, double 2.500000e-01>
%108 = fmul <2 x double> %106, <double 2.500000e-01, double 2.500000e-01>
%109 = getelementptr inbounds [502 x double], [502 x double]* %0, i64 %52, i64 %67
%110 = bitcast double* %109 to <2 x double>*
store <2 x double> %107, <2 x double>* %110
%111 = getelementptr inbounds double, double* %109, i64 2
%112 = bitcast double* %111 to <2 x double>*
store <2 x double> %108, <2 x double>* %112
%113 = add nuw i64 %66, 4
%114 = icmp eq i64 %113, %43
br i1 %114, label %115, label %65
115: ; preds = %65
br i1 %45, label %139, label %116
116: ; preds = %56, %50, %115
%117 = phi i64 [ 1, %56 ], [ 1, %50 ], [ %44, %115 ]
br label %118
118: ; preds = %116, %118
%119 = phi i64 [ %125, %118 ], [ %117, %116 ]
%120 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %54, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %55, i64 %119
%123 = load double, double* %122
%124 = fadd double %121, %123
%125 = add nuw nsw i64 %119, 1
%126 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %52, i64 %125
%127 = load double, double* %126
%128 = fadd double %124, %127
%129 = add nsw i64 %119, -1
%130 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %52, i64 %129
%131 = load double, double* %130
%132 = fadd double %128, %131
%133 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %52, i64 %119
%134 = load double, double* %133
%135 = fsub double %132, %134
%136 = fmul double %135, 2.500000e-01
%137 = getelementptr inbounds [502 x double], [502 x double]* %0, i64 %52, i64 %119
store double %136, double* %137
%138 = icmp eq i64 %125, %39
br i1 %138, label %139, label %118
139: ; preds = %118, %115
%140 = icmp eq i64 %53, %39
%141 = add i64 %51, 1
br i1 %140, label %49, label %50
142: ; preds = %49, %142
%143 = phi i64 [ %147, %142 ], [ 1, %49 ]
%144 = getelementptr inbounds [502 x double], [502 x double]* %1, i64 %143, i64 1
%145 = getelementptr inbounds [502 x double], [502 x double]* %0, i64 %143, i64 1
%146 = tail call i32 @memcpy(double* %144, double* %145, i32 %37)
%147 = add nuw nsw i64 %143, 1
%148 = icmp eq i64 %147, %40
br i1 %148, label %149, label %142
149: ; preds = %142, %46, %49
%150 = add nuw nsw i32 %48, 1
%151 = urem i32 %150, 20
%152 = icmp eq i32 %151, 0
br i1 %152, label %153, label %155
153: ; preds = %149
%154 = tail call double @compute_error(double** %31, double** %32, i32 %5)
br label %155
155: ; preds = %153, %149
%156 = phi double [ %154, %153 ], [ %47, %149 ]
%157 = fcmp ogt double %156, %4
br i1 %157, label %46, label %158
158: ; preds = %155, %30
%159 = phi i32 [ 0, %30 ], [ %150, %155 ]
ret i32 %159
}