#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[][600 + 2], double uold[][600 + 2],
        double solution[][600 + 2], const double omega, const double tol,
        const int m) {
  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][j] + 0.25 * omega *
                             (unew[i - 1][j] + unew[i][j - 1] + uold[i + 1][j] +
                              uold[i][j + 1] - 4.0 * uold[i][j]);
      }
    }
    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    $0x40,%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)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    122d <sor+0x10d>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%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 -0x30(%rbp),%rcx
imul   $0x12d0,%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   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1148 <sor+0x28>
movl   $0x0,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1040 <compute_error@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1438 <sor+0x318>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    13a0 <sor+0x280>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    138d <sor+0x26d>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xd5c(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  0xcac(%rip),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x12d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1278 <sor+0x158>
jmp    1392 <sor+0x272>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1260 <sor+0x140>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1401 <sor+0x2e1>
mov    -0x10(%rbp),%rdi
movslq -0x30(%rbp),%rax
imul   $0x12d0,%rax,%rax
add    %rax,%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x30(%rbp),%rax
imul   $0x12d0,%rax,%rax
add    %rax,%rsi
add    $0x8,%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13a7 <sor+0x287>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1433 <sor+0x313>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1040 <compute_error@plt>
movsd  %xmm0,-0x40(%rbp)
jmp    1249 <sor+0x129>
mov    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movsd  %xmm1,0x40(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %rdx,0x28(%rsp)
mov    %rdi,%rbx
mov    %rcx,0x8(%rsp)
cmp    $0xffffffff,%ecx
jl     11af <sor+0x8f>
mov    0x8(%rsp),%rcx
lea    0x1(%rcx),%eax
add    $0x2,%ecx
imul   $0x12d0,%rax,%rdx
lea    (%rbx,%rdx,1),%r8
add    %rsi,%rdx
shl    $0x3,%rcx
xor    %edi,%edi
xor    %ebp,%ebp
nopl   (%rax)
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  (%rdx,%rbp,1),%xmm0
movsd  %xmm0,(%r8,%rbp,1)
movsd  (%rsi,%rdi,1),%xmm0
movsd  %xmm0,(%rbx,%rdi,1)
movsd  (%rsi,%rbp,1),%xmm0
movsd  %xmm0,(%rbx,%rbp,1)
add    $0x8,%rbp
add    $0x25a,%rax
add    $0x12d0,%rdi
cmp    %rbp,%rcx
jne    1170 <sor+0x50>
mov    0x28(%rsp),%rdi
mov    %rsi,0x20(%rsp)
mov    0x8(%rsp),%rdx
call   1040 <compute_error@plt>
xor    %ebp,%ebp
movsd  %xmm0,0x48(%rsp)
ucomisd 0x40(%rsp),%xmm0
jbe    1362 <sor+0x242>
movsd  0x18(%rsp),%xmm0
mulsd  0xe1b(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x8(%rsp),%rax
lea    0x0(,%rax,8),%edx
lea    0x1(%rax),%r12d
lea    0x12d8(%rbx),%rax
mov    %rax,0x38(%rsp)
mov    0x20(%rsp),%rax
add    $0x12d8,%rax
mov    %rax,0x30(%rsp)
lea    -0x1(%r12),%r13
xor    %ebp,%ebp
mov    %edx,0x14(%rsp)
jmp    1242 <sor+0x122>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x48(%rsp),%xmm0
ucomisd 0x40(%rsp),%xmm0
jbe    1362 <sor+0x242>
mov    %rbp,0x50(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    1323 <sor+0x203>
mov    $0x1,%eax
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%rdi
movsd  0x18(%rsp),%xmm3
movsd  0xd99(%rip),%xmm4
nop
imul   $0x12d0,%rax,%rsi
add    $0x1,%rax
movsd  (%rbx,%rsi,1),%xmm0
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  -0x12d0(%rdi,%rsi,8),%xmm0
ff ff
addsd  0x12d0(%rcx,%rsi,8),%xmm0
addsd  0x8(%rcx,%rsi,8),%xmm0
movsd  (%rcx,%rsi,8),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rdi,%rsi,8)
add    $0x1,%rsi
movapd %xmm2,%xmm0
cmp    %rsi,%r13
jne    1290 <sor+0x170>
add    $0x12d0,%rdi
add    $0x12d0,%rcx
cmp    %r12,%rax
jne    1270 <sor+0x150>
cmpl   $0x0,0x8(%rsp)
jle    1323 <sor+0x203>
mov    %r13,%rbp
mov    0x38(%rsp),%r14
mov    0x30(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
mov    0x14(%rsp),%edx
add    $0x12d0,%r15
add    $0x12d0,%r14
add    $0xffffffffffffffff,%rbp
jne    1300 <sor+0x1e0>
mov    0x50(%rsp),%rbp
add    $0x1,%ebp
imul   $0xcccccccd,%ebp,%eax
ror    $0x2,%eax
cmp    $0xccccccc,%eax
ja     1230 <sor+0x110>
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%rsi
mov    0x8(%rsp),%rdx
call   1040 <compute_error@plt>
mov    0x14(%rsp),%edx
movsd  %xmm0,0x48(%rsp)
jmp    1230 <sor+0x110>
mov    %ebp,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sor([602 x double]* %0, [602 x double]* %1, [602 x double]* %2, double %3, double %4, i32 %5) {
%7 = icmp sgt i32 %5, -2
br i1 %7, label %8, label %29
8: ; preds = %6
%9 = add nsw i32 %5, 1
%10 = zext i32 %9 to i64
%11 = add i32 %5, 2
%12 = zext i32 %11 to i64
br label %13
13: ; preds = %8, %13
%14 = phi i64 [ 0, %8 ], [ %27, %13 ]
%15 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 %14, i64 %10
%16 = load double, double* %15
%17 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 %14, i64 %10
store double %16, double* %17
%18 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 %10, i64 %14
%19 = load double, double* %18
%20 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 %10, i64 %14
store double %19, double* %20
%21 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 %14, i64 0
%22 = load double, double* %21
%23 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 %14, i64 0
store double %22, double* %23
%24 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 0, i64 %14
%25 = load double, double* %24
%26 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 0, i64 %14
store double %25, double* %26
%27 = add nuw nsw i64 %14, 1
%28 = icmp eq i64 %27, %12
br i1 %28, label %29, label %13
29: ; preds = %13, %6
%30 = bitcast [602 x double]* %2 to double**
%31 = bitcast [602 x double]* %1 to double**
%32 = tail call double @compute_error(double** %30, double** %31, i32 %5)
%33 = fcmp ogt double %32, %4
br i1 %33, label %34, label %89
34: ; preds = %29
%35 = icmp slt i32 %5, 1
%36 = fmul double %3, 2.500000e-01
%37 = shl i32 %5, 3
%38 = add nsw i32 %5, 1
%39 = zext i32 %38 to i64
%40 = zext i32 %38 to i64
br label %41
41: ; preds = %34, %86
%42 = phi double [ %32, %34 ], [ %87, %86 ]
%43 = phi i32 [ 0, %34 ], [ %81, %86 ]
br i1 %35, label %80, label %45
44: ; preds = %71
br i1 %35, label %80, label %73
45: ; preds = %41, %71
%46 = phi i64 [ %48, %71 ], [ 1, %41 ]
%47 = add nsw i64 %46, -1
%48 = add nuw nsw i64 %46, 1
%49 = and i64 %48, 4294967295
%50 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 %46, i64 0
%51 = load double, double* %50
br label %52
52: ; preds = %45, %52
%53 = phi double [ %51, %45 ], [ %68, %52 ]
%54 = phi i64 [ 1, %45 ], [ %63, %52 ]
%55 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 %46, i64 %54
%56 = load double, double* %55
%57 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 %47, i64 %54
%58 = load double, double* %57
%59 = fadd double %58, %53
%60 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 %49, i64 %54
%61 = load double, double* %60
%62 = fadd double %59, %61
%63 = add nuw nsw i64 %54, 1
%64 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 %46, i64 %63
%65 = load double, double* %64
%66 = fadd double %62, %65
%67 = tail call double @llvm.fmuladd.f64(double %56, double -4.000000e+00, double %66)
%68 = tail call double @llvm.fmuladd.f64(double %36, double %67, double %56)
%69 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 %46, i64 %54
store double %68, double* %69
%70 = icmp eq i64 %63, %39
br i1 %70, label %71, label %52
71: ; preds = %52
%72 = icmp eq i64 %48, %39
br i1 %72, label %44, label %45
73: ; preds = %44, %73
%74 = phi i64 [ %78, %73 ], [ 1, %44 ]
%75 = getelementptr inbounds [602 x double], [602 x double]* %1, i64 %74, i64 1
%76 = getelementptr inbounds [602 x double], [602 x double]* %0, i64 %74, i64 1
%77 = tail call i32 @memcpy(double* %75, double* %76, i32 %37)
%78 = add nuw nsw i64 %74, 1
%79 = icmp eq i64 %78, %40
br i1 %79, label %80, label %73
80: ; preds = %73, %41, %44
%81 = add nuw nsw i32 %43, 1
%82 = urem i32 %81, 20
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %80
%85 = tail call double @compute_error(double** %30, double** %31, i32 %5)
br label %86
86: ; preds = %84, %80
%87 = phi double [ %85, %84 ], [ %42, %80 ]
%88 = fcmp ogt double %87, %4
br i1 %88, label %41, label %89
89: ; preds = %86, %29
%90 = phi i32 [ 0, %29 ], [ %81, %86 ]
ret i32 %90
}