#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[][100 + 2], double uold[][100 + 2],
        double solution[][100 + 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 = (i % 2) + 1; j < m + 1; j += 2) {
        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) {
      for (j = ((i + 1) % 2) + 1; j < m + 1; j += 2) {
        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   $0x330,%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   $0x330,%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   $0x330,%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   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%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    1596 <sor+0x476>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    13aa <sor+0x28a>
mov    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1397 <sor+0x277>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xd52(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%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   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%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   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  0xca2(%rip),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    1282 <sor+0x162>
jmp    139c <sor+0x27c>
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    14fe <sor+0x3de>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    14eb <sor+0x3cb>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xbfe(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%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   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%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   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  0xb4e(%rip),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x330,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    13d6 <sor+0x2b6>
jmp    14f0 <sor+0x3d0>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13b1 <sor+0x291>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    155f <sor+0x43f>
mov    -0x10(%rbp),%rdi
movslq -0x30(%rbp),%rax
imul   $0x330,%rax,%rax
add    %rax,%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x30(%rbp),%rax
imul   $0x330,%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    1505 <sor+0x3e5>
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    1591 <sor+0x471>
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    $0x68,%rsp
mov    %ecx,%r15d
movsd  %xmm1,0x38(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rdx,0x30(%rsp)
cmp    $0xffffffff,%ecx
jl     11ad <sor+0x8d>
lea    0x1(%r15),%eax
lea    0x2(%r15),%ecx
imul   $0x330,%rax,%rdx
lea    (%rdi,%rdx,1),%r8
add    %rsi,%rdx
shl    $0x3,%rcx
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
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    $0x66,%rax
add    $0x330,%rbx
cmp    %rbp,%rcx
jne    1170 <sor+0x50>
mov    %rdi,0x20(%rsp)
mov    0x30(%rsp),%rdi
mov    %rsi,0x18(%rsp)
mov    %r15d,%edx
call   1040 <compute_error@plt>
xor    %ebx,%ebx
movsd  %xmm0,0x40(%rsp)
ucomisd 0x38(%rsp),%xmm0
jbe    1461 <sor+0x341>
movsd  0x10(%rsp),%xmm0
mulsd  0xe1a(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x0(,%r15,8),%edx
movslq %r15d,%rbp
lea    0x1(%r15),%r12d
mov    0x18(%rsp),%rax
lea    0x660(%rax),%rcx
mov    %rcx,0x60(%rsp)
add    $0x338,%rax
mov    %rax,0x58(%rsp)
mov    0x20(%rsp),%rax
add    $0x338,%rax
mov    %rax,0x50(%rsp)
lea    -0x1(%r12),%rax
mov    %rax,0x48(%rsp)
xor    %ebx,%ebx
mov    %edx,0xc(%rsp)
jmp    126d <sor+0x14d>
nopl   0x0(%rax)
mov    0x2c(%rsp),%ebx
add    $0x1,%ebx
imul   $0xcccccccd,%ebx,%eax
ror    $0x2,%eax
cmp    $0xccccccc,%eax
jbe    1440 <sor+0x320>
movsd  0x40(%rsp),%xmm0
ucomisd 0x38(%rsp),%xmm0
jbe    1461 <sor+0x341>
mov    %ebx,0x2c(%rsp)
test   %r15d,%r15d
jle    1240 <sor+0x120>
mov    $0x1,%eax
mov    $0x1,%esi
movsd  0x10(%rsp),%xmm3
mov    0x18(%rsp),%r8
mov    0x20(%rsp),%r9
movsd  0xd70(%rip),%xmm4
jmp    12b3 <sor+0x193>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rsi
mov    %rsi,%r10
add    $0x1,%eax
cmp    %r12,%r10
je     1340 <sor+0x220>
mov    %esi,%ecx
and    $0x1,%ecx
cmp    %r15d,%ecx
jge    12a0 <sor+0x180>
mov    %eax,%ecx
and    $0x1,%ecx
add    $0x1,%ecx
lea    0x1(%rsi),%r10
mov    %r10d,%ebx
imul   $0x330,%rsi,%rsi
lea    (%r8,%rsi,1),%rdi
add    %r9,%rsi
imul   $0x330,%rbx,%rbx
add    %r8,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x330(%rsi,%rcx,8),%xmm0
ff ff
addsd  -0x8(%rsi,%rcx,8),%xmm0
addsd  (%rbx,%rcx,8),%xmm0
addsd  0x8(%rdi,%rcx,8),%xmm0
movsd  (%rdi,%rcx,8),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rsi,%rcx,8)
add    $0x2,%rcx
cmp    %rbp,%rcx
jle    12f0 <sor+0x1d0>
mov    %r10,%rsi
jmp    12a7 <sor+0x187>
nopl   0x0(%rax)
test   %r15d,%r15d
jle    1240 <sor+0x120>
mov    $0x1,%eax
xor    %ecx,%ecx
mov    0x60(%rsp),%rbx
mov    0x20(%rsp),%rsi
movsd  0x10(%rsp),%xmm3
movsd  0xca0(%rip),%xmm4
jmp    1386 <sor+0x266>
nopw   0x0(%rax,%rax,1)
xor    $0x1,%cl
add    $0x330,%rsi
add    $0x330,%rbx
cmp    %r12,%rax
je     13f0 <sor+0x2d0>
add    $0x1,%rax
mov    %eax,%edi
and    $0x1,%edi
cmp    %r15d,%edi
jge    1370 <sor+0x250>
movzbl %cl,%edi
and    $0x1,%edi
add    $0x1,%rdi
xchg   %ax,%ax
movsd  (%rsi,%rdi,8),%xmm0
addsd  0x328(%rsi,%rdi,8),%xmm0
addsd  (%rbx,%rdi,8),%xmm0
addsd  -0x328(%rbx,%rdi,8),%xmm0
ff ff
movsd  -0x330(%rbx,%rdi,8),%xmm1
ff ff
movapd %xmm1,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x330(%rsi,%rdi,8)
add    $0x2,%rdi
cmp    %rbp,%rdi
jle    13a0 <sor+0x280>
jmp    1370 <sor+0x250>
nopl   (%rax)
test   %r15d,%r15d
jle    1240 <sor+0x120>
mov    0x48(%rsp),%rbx
mov    0x50(%rsp),%r14
mov    0x58(%rsp),%r13
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
mov    0xc(%rsp),%edx
add    $0x330,%r13
add    $0x330,%r14
add    $0xffffffffffffffff,%rbx
jne    1410 <sor+0x2f0>
jmp    1240 <sor+0x120>
nopl   0x0(%rax,%rax,1)
mov    0x30(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
call   1040 <compute_error@plt>
mov    0xc(%rsp),%edx
movsd  %xmm0,0x40(%rsp)
jmp    125b <sor+0x13b>
mov    %ebx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sor([102 x double]* %0, [102 x double]* %1, [102 x double]* %2, double %3, double %4, i32 %5) {
%7 = alloca [102 x double]*
%8 = alloca [102 x double]*
%9 = alloca [102 x double]*
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
store [102 x double]* %0, [102 x double]** %7
store [102 x double]* %1, [102 x double]** %8
store [102 x double]* %2, [102 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 [102 x double]*, [102 x double]** %8
%24 = load i32, i32* %13
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [102 x double], [102 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 [102 x double], [102 x double]* %26, i64 0, i64 %29
%31 = load double, double* %30
%32 = load [102 x double]*, [102 x double]** %7
%33 = load i32, i32* %13
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [102 x double], [102 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 [102 x double], [102 x double]* %35, i64 0, i64 %38
store double %31, double* %39
%40 = load [102 x double]*, [102 x double]** %8
%41 = load i32, i32* %12
%42 = add nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [102 x double], [102 x double]* %40, i64 %43
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [102 x double], [102 x double]* %44, i64 0, i64 %46
%48 = load double, double* %47
%49 = load [102 x double]*, [102 x double]** %7
%50 = load i32, i32* %12
%51 = add nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [102 x double], [102 x double]* %49, i64 %52
%54 = load i32, i32* %13
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [102 x double], [102 x double]* %53, i64 0, i64 %55
store double %48, double* %56
%57 = load [102 x double]*, [102 x double]** %8
%58 = load i32, i32* %13
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [102 x double], [102 x double]* %57, i64 %59
%61 = getelementptr inbounds [102 x double], [102 x double]* %60, i64 0, i64 0
%62 = load double, double* %61
%63 = load [102 x double]*, [102 x double]** %7
%64 = load i32, i32* %13
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [102 x double], [102 x double]* %63, i64 %65
%67 = getelementptr inbounds [102 x double], [102 x double]* %66, i64 0, i64 0
store double %62, double* %67
%68 = load [102 x double]*, [102 x double]** %8
%69 = getelementptr inbounds [102 x double], [102 x double]* %68, i64 0
%70 = load i32, i32* %13
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [102 x double], [102 x double]* %69, i64 0, i64 %71
%73 = load double, double* %72
%74 = load [102 x double]*, [102 x double]** %7
%75 = getelementptr inbounds [102 x double], [102 x double]* %74, i64 0
%76 = load i32, i32* %13
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [102 x double], [102 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 [102 x double]*, [102 x double]** %9
%84 = bitcast [102 x double]* %83 to double**
%85 = load [102 x double]*, [102 x double]** %8
%86 = bitcast [102 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 = %310, %82
%90 = load double, double* %16
%91 = load double, double* %11
%92 = fcmp ogt double %90, %91
br i1 %92, label %93, label %311
93: ; preds = %89
store i32 1, i32* %13
br label %94
94: ; preds = %179, %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 %182
99: ; preds = %94
%100 = load i32, i32* %13
%101 = srem i32 %100, 2
%102 = add nsw i32 %101, 1
store i32 %102, i32* %14
br label %103
103: ; preds = %175, %99
%104 = load i32, i32* %14
%105 = load i32, i32* %12
%106 = add nsw i32 %105, 1
%107 = icmp slt i32 %104, %106
br i1 %107, label %108, label %178
108: ; preds = %103
%109 = load [102 x double]*, [102 x double]** %8
%110 = load i32, i32* %13
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [102 x double], [102 x double]* %109, i64 %111
%113 = load i32, i32* %14
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [102 x double], [102 x double]* %112, i64 0, i64 %114
%116 = load double, double* %115
%117 = load double, double* %10
%118 = fmul double 2.500000e-01, %117
%119 = load [102 x double]*, [102 x double]** %7
%120 = load i32, i32* %13
%121 = sub nsw i32 %120, 1
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [102 x double], [102 x double]* %119, i64 %122
%124 = load i32, i32* %14
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [102 x double], [102 x double]* %123, i64 0, i64 %125
%127 = load double, double* %126
%128 = load [102 x double]*, [102 x double]** %7
%129 = load i32, i32* %13
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [102 x double], [102 x double]* %128, i64 %130
%132 = load i32, i32* %14
%133 = sub nsw i32 %132, 1
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [102 x double], [102 x double]* %131, i64 0, i64 %134
%136 = load double, double* %135
%137 = fadd double %127, %136
%138 = load [102 x double]*, [102 x double]** %8
%139 = load i32, i32* %13
%140 = add nsw i32 %139, 1
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [102 x double], [102 x double]* %138, i64 %141
%143 = load i32, i32* %14
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [102 x double], [102 x double]* %142, i64 0, i64 %144
%146 = load double, double* %145
%147 = fadd double %137, %146
%148 = load [102 x double]*, [102 x double]** %8
%149 = load i32, i32* %13
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [102 x double], [102 x double]* %148, i64 %150
%152 = load i32, i32* %14
%153 = add nsw i32 %152, 1
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [102 x double], [102 x double]* %151, i64 0, i64 %154
%156 = load double, double* %155
%157 = fadd double %147, %156
%158 = load [102 x double]*, [102 x double]** %8
%159 = load i32, i32* %13
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [102 x double], [102 x double]* %158, i64 %160
%162 = load i32, i32* %14
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [102 x double], [102 x double]* %161, i64 0, i64 %163
%165 = load double, double* %164
%166 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %165, double %157)
%167 = call double @llvm.fmuladd.f64(double %118, double %166, double %116)
%168 = load [102 x double]*, [102 x double]** %7
%169 = load i32, i32* %13
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [102 x double], [102 x double]* %168, i64 %170
%172 = load i32, i32* %14
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [102 x double], [102 x double]* %171, i64 0, i64 %173
store double %167, double* %174
br label %175
175: ; preds = %108
%176 = load i32, i32* %14
%177 = add nsw i32 %176, 2
store i32 %177, i32* %14
br label %103
178: ; preds = %103
br label %179
179: ; preds = %178
%180 = load i32, i32* %13
%181 = add nsw i32 %180, 1
store i32 %181, i32* %13
br label %94
182: ; preds = %94
store i32 1, i32* %13
br label %183
183: ; preds = %269, %182
%184 = load i32, i32* %13
%185 = load i32, i32* %12
%186 = add nsw i32 %185, 1
%187 = icmp slt i32 %184, %186
br i1 %187, label %188, label %272
188: ; preds = %183
%189 = load i32, i32* %13
%190 = add nsw i32 %189, 1
%191 = srem i32 %190, 2
%192 = add nsw i32 %191, 1
store i32 %192, i32* %14
br label %193
193: ; preds = %265, %188
%194 = load i32, i32* %14
%195 = load i32, i32* %12
%196 = add nsw i32 %195, 1
%197 = icmp slt i32 %194, %196
br i1 %197, label %198, label %268
198: ; preds = %193
%199 = load [102 x double]*, [102 x double]** %8
%200 = load i32, i32* %13
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [102 x double], [102 x double]* %199, i64 %201
%203 = load i32, i32* %14
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [102 x double], [102 x double]* %202, i64 0, i64 %204
%206 = load double, double* %205
%207 = load double, double* %10
%208 = fmul double 2.500000e-01, %207
%209 = load [102 x double]*, [102 x double]** %7
%210 = load i32, i32* %13
%211 = sub nsw i32 %210, 1
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds [102 x double], [102 x double]* %209, i64 %212
%214 = load i32, i32* %14
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [102 x double], [102 x double]* %213, i64 0, i64 %215
%217 = load double, double* %216
%218 = load [102 x double]*, [102 x double]** %7
%219 = load i32, i32* %13
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds [102 x double], [102 x double]* %218, i64 %220
%222 = load i32, i32* %14
%223 = sub nsw i32 %222, 1
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [102 x double], [102 x double]* %221, i64 0, i64 %224
%226 = load double, double* %225
%227 = fadd double %217, %226
%228 = load [102 x double]*, [102 x double]** %8
%229 = load i32, i32* %13
%230 = add nsw i32 %229, 1
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds [102 x double], [102 x double]* %228, i64 %231
%233 = load i32, i32* %14
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds [102 x double], [102 x double]* %232, i64 0, i64 %234
%236 = load double, double* %235
%237 = fadd double %227, %236
%238 = load [102 x double]*, [102 x double]** %8
%239 = load i32, i32* %13
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [102 x double], [102 x double]* %238, i64 %240
%242 = load i32, i32* %14
%243 = add nsw i32 %242, 1
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds [102 x double], [102 x double]* %241, i64 0, i64 %244
%246 = load double, double* %245
%247 = fadd double %237, %246
%248 = load [102 x double]*, [102 x double]** %8
%249 = load i32, i32* %13
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds [102 x double], [102 x double]* %248, i64 %250
%252 = load i32, i32* %14
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds [102 x double], [102 x double]* %251, i64 0, i64 %253
%255 = load double, double* %254
%256 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %255, double %247)
%257 = call double @llvm.fmuladd.f64(double %208, double %256, double %206)
%258 = load [102 x double]*, [102 x double]** %7
%259 = load i32, i32* %13
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds [102 x double], [102 x double]* %258, i64 %260
%262 = load i32, i32* %14
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds [102 x double], [102 x double]* %261, i64 0, i64 %263
store double %257, double* %264
br label %265
265: ; preds = %198
%266 = load i32, i32* %14
%267 = add nsw i32 %266, 2
store i32 %267, i32* %14
br label %193
268: ; preds = %193
br label %269
269: ; preds = %268
%270 = load i32, i32* %13
%271 = add nsw i32 %270, 1
store i32 %271, i32* %13
br label %183
272: ; preds = %183
store i32 1, i32* %13
br label %273
273: ; preds = %294, %272
%274 = load i32, i32* %13
%275 = load i32, i32* %12
%276 = add nsw i32 %275, 1
%277 = icmp slt i32 %274, %276
br i1 %277, label %278, label %297
278: ; preds = %273
%279 = load [102 x double]*, [102 x double]** %8
%280 = load i32, i32* %13
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds [102 x double], [102 x double]* %279, i64 %281
%283 = getelementptr inbounds [102 x double], [102 x double]* %282, i64 0, i64 1
%284 = load [102 x double]*, [102 x double]** %7
%285 = load i32, i32* %13
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds [102 x double], [102 x double]* %284, i64 %286
%288 = getelementptr inbounds [102 x double], [102 x double]* %287, i64 0, i64 1
%289 = load i32, i32* %12
%290 = sext i32 %289 to i64
%291 = mul i64 %290, 8
%292 = trunc i64 %291 to i32
%293 = call i32 @memcpy(double* %283, double* %288, i32 %292)
br label %294
294: ; preds = %278
%295 = load i32, i32* %13
%296 = add nsw i32 %295, 1
store i32 %296, i32* %13
br label %273
297: ; preds = %273
%298 = load i32, i32* %15
%299 = add nsw i32 %298, 1
store i32 %299, i32* %15
%300 = load i32, i32* %15
%301 = srem i32 %300, 20
%302 = icmp eq i32 %301, 0
br i1 %302, label %303, label %310
303: ; preds = %297
%304 = load [102 x double]*, [102 x double]** %9
%305 = bitcast [102 x double]* %304 to double**
%306 = load [102 x double]*, [102 x double]** %8
%307 = bitcast [102 x double]* %306 to double**
%308 = load i32, i32* %12
%309 = call double @compute_error(double** %305, double** %307, i32 %308)
store double %309, double* %16
br label %310
310: ; preds = %303, %297
br label %89
311: ; preds = %89
%312 = load i32, i32* %15
ret i32 %312
}

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