void set_boundary_conditions(int w_left, int w_right, int w_top, int w_bottom,
                             double **P, double **U, double **V, int nx,
                             int ny) {
  int i, j;
  for (j = 1; j < ny + 1; j++) {
    if (w_left == 1) {
      U[0][j] = 0.0;
      V[0][j] = V[1][j];
    } else if (w_left == 2) {
      U[0][j] = 0.0;
      V[0][j] = -1.0 * V[1][j];
    } else if (w_left == 3) {
      U[0][j] = U[1][j];
      V[0][j] = V[1][j];
    } else if (w_left == 4) {
      U[0][j] = U[nx - 1][j];
      V[0][j] = V[nx - 1][j];
      V[1][j] = V[nx][j];
      P[1][j] = P[nx][j];
    }
    if (w_right == 1) {
      U[nx][j] = 0.0;
      V[nx + 1][j] = V[nx][j];
    } else if (w_right == 2) {
      U[nx][j] = 0.0;
      V[nx + 1][j] = -1.0 * V[nx][j];
    } else if (w_right == 3) {
      U[nx][j] = U[nx - 1][j];
      V[nx + 1][j] = V[nx][j];
    } else if (w_right == 4) {
      U[nx][j] = U[1][j];
      V[nx + 1][j] = V[2][j];
    }
  }
  for (i = 1; i < nx + 1; i++) {
    if (w_bottom == 1) {
      U[i][0] = U[i][1];
      V[i][0] = 0.0;
    } else if (w_bottom == 2) {
      U[i][0] = -1.0 * U[i][1];
      V[i][0] = 0.0;
    } else if (w_bottom == 3) {
      U[i][0] = U[i][1];
      V[i][0] = V[i][1];
    } else if (w_bottom == 4) {
      U[i][0] = U[i][ny - 1];
      U[i][1] = U[i][nx - 1];
      V[i][0] = V[i][ny - 1];
      P[i][1] = P[i][ny];
    }
    if (w_top == 1) {
      U[i][ny + 1] = U[i][ny];
      V[i][ny] = 0.0;
    } else if (w_top == 2) {
      U[i][ny + 1] = -1.0 * U[i][ny];
      V[i][ny] = 0.0;
    } else if (w_top == 3) {
      U[i][ny + 1] = U[i][ny];
      V[i][ny] = V[i][ny - 1];
    } else if (w_top == 4) {
      U[i][ny + 1] = U[i][2];
      V[i][ny] = V[i][1];
    }
  }
}


x86 assembly (clang, -O0):
<set_boundary_conditions>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1470 <set_boundary_conditions+0x370>
cmpl   $0x1,-0x4(%rbp)
jne    117d <set_boundary_conditions+0x7d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12d2 <set_boundary_conditions+0x1d2>
cmpl   $0x2,-0x4(%rbp)
jne    11c8 <set_boundary_conditions+0xc8>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  0xe52(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12cd <set_boundary_conditions+0x1cd>
cmpl   $0x3,-0x4(%rbp)
jne    1219 <set_boundary_conditions+0x119>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12c8 <set_boundary_conditions+0x1c8>
cmpl   $0x4,-0x4(%rbp)
jne    12c3 <set_boundary_conditions+0x1c3>
mov    -0x20(%rbp),%rax
mov    0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12c8 <set_boundary_conditions+0x1c8>
jmp    12cd <set_boundary_conditions+0x1cd>
jmp    12d2 <set_boundary_conditions+0x1d2>
cmpl   $0x1,-0x8(%rbp)
jne    1328 <set_boundary_conditions+0x228>
mov    -0x20(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    145d <set_boundary_conditions+0x35d>
cmpl   $0x2,-0x8(%rbp)
jne    1386 <set_boundary_conditions+0x286>
mov    -0x20(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  0xc9e(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1458 <set_boundary_conditions+0x358>
cmpl   $0x3,-0x8(%rbp)
jne    13f3 <set_boundary_conditions+0x2f3>
mov    -0x20(%rbp),%rax
mov    0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1453 <set_boundary_conditions+0x353>
cmpl   $0x4,-0x8(%rbp)
jne    144e <set_boundary_conditions+0x34e>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq 0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1453 <set_boundary_conditions+0x353>
jmp    1458 <set_boundary_conditions+0x358>
jmp    145d <set_boundary_conditions+0x35d>
jmp    1462 <set_boundary_conditions+0x362>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1129 <set_boundary_conditions+0x29>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    17c3 <set_boundary_conditions+0x6c3>
cmpl   $0x1,-0x10(%rbp)
jne    14cb <set_boundary_conditions+0x3cb>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1625 <set_boundary_conditions+0x525>
cmpl   $0x2,-0x10(%rbp)
jne    1516 <set_boundary_conditions+0x416>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0xb17(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1620 <set_boundary_conditions+0x520>
cmpl   $0x3,-0x10(%rbp)
jne    1567 <set_boundary_conditions+0x467>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
jmp    161b <set_boundary_conditions+0x51b>
cmpl   $0x4,-0x10(%rbp)
jne    1616 <set_boundary_conditions+0x516>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,0x8(%rax)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,0x8(%rax)
jmp    161b <set_boundary_conditions+0x51b>
jmp    1620 <set_boundary_conditions+0x520>
jmp    1625 <set_boundary_conditions+0x525>
cmpl   $0x1,-0xc(%rbp)
jne    167b <set_boundary_conditions+0x57b>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    17b0 <set_boundary_conditions+0x6b0>
cmpl   $0x2,-0xc(%rbp)
jne    16d9 <set_boundary_conditions+0x5d9>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
movsd  0x963(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    17ab <set_boundary_conditions+0x6ab>
cmpl   $0x3,-0xc(%rbp)
jne    1746 <set_boundary_conditions+0x646>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    17a6 <set_boundary_conditions+0x6a6>
cmpl   $0x4,-0xc(%rbp)
jne    17a1 <set_boundary_conditions+0x6a1>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq 0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    17a6 <set_boundary_conditions+0x6a6>
jmp    17ab <set_boundary_conditions+0x6ab>
jmp    17b0 <set_boundary_conditions+0x6b0>
jmp    17b5 <set_boundary_conditions+0x6b5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1477 <set_boundary_conditions+0x377>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_boundary_conditions>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    0x48(%rsp),%r15d
mov    0x40(%rsp),%ebx
mov    0x38(%rsp),%r10
test   %r15d,%r15d
jle    131a <set_boundary_conditions+0x21a>
lea    -0x1(%rbx),%eax
cltq
movslq %ebx,%rbp
mov    %r8,-0x10(%rsp)
lea    0x8(%r8),%rbx
mov    %rbx,-0x8(%rsp)
mov    %rax,%r8
lea    0x1(%rbp),%eax
movslq %eax,%r13
lea    0x1(%r15),%eax
mov    %eax,-0x14(%rsp)
mov    %r15d,%ebx
shl    $0x3,%rbx
xor    %r14d,%r14d
add    $0xffffffff,%edi
add    $0xffffffff,%esi
lea    0xec1(%rip),%r11
movaps 0xe9a(%rip),%xmm0
lea    0xea3(%rip),%r15
jmp    11a9 <set_boundary_conditions+0xa9>
nop
mov    0x8(%r9),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    (%r9,%rbp,8),%rax
movsd  %xmm1,0x8(%rax,%r14,1)
mov    0x10(%r10),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    (%r10,%r13,8),%rax
movsd  %xmm1,0x8(%rax,%r14,1)
add    $0x8,%r14
cmp    %r14,%rbx
je     12ff <set_boundary_conditions+0x1ff>
cmp    $0x3,%edi
ja     128f <set_boundary_conditions+0x18f>
movslq (%r15,%rdi,4),%rax
add    %r15,%rax
jmp    *%rax
mov    (%r9),%rax
movq   $0x0,0x8(%rax,%r14,1)
jmp    1215 <set_boundary_conditions+0x115>
nopl   0x0(%rax)
mov    (%r9),%rax
movq   $0x0,0x8(%rax,%r14,1)
mov    0x8(%r10),%rax
movsd  0x8(%rax,%r14,1),%xmm1
xorps  %xmm0,%xmm1
mov    %r10,%rax
jmp    1285 <set_boundary_conditions+0x185>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r9),%rax
mov    0x8(%r9),%r12
movsd  0x8(%r12,%r14,1),%xmm1
movsd  %xmm1,0x8(%rax,%r14,1)
mov    0x8(%r10),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    %r10,%rax
jmp    1285 <set_boundary_conditions+0x185>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r9,%r8,8),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    (%r9),%rax
movsd  %xmm1,0x8(%rax,%r14,1)
mov    (%r10,%r8,8),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    (%r10),%rax
movsd  %xmm1,0x8(%rax,%r14,1)
mov    (%r10,%rbp,8),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    0x8(%r10),%rax
movsd  %xmm1,0x8(%rax,%r14,1)
mov    -0x10(%rsp),%rax
mov    (%rax,%rbp,8),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm1,0x8(%rax,%r14,1)
cmp    $0x3,%esi
ja     119c <set_boundary_conditions+0x9c>
movslq (%r11,%rsi,4),%rax
add    %r11,%rax
jmp    *%rax
mov    (%r9,%rbp,8),%rax
movq   $0x0,0x8(%rax,%r14,1)
mov    (%r10,%rbp,8),%rax
jmp    118a <set_boundary_conditions+0x8a>
nopw   0x0(%rax,%rax,1)
mov    (%r9,%rbp,8),%rax
movq   $0x0,0x8(%rax,%r14,1)
mov    (%r10,%rbp,8),%rax
movsd  0x8(%rax,%r14,1),%xmm1
xorps  %xmm0,%xmm1
jmp    1191 <set_boundary_conditions+0x91>
mov    (%r9,%r8,8),%rax
movsd  0x8(%rax,%r14,1),%xmm1
mov    (%r9,%rbp,8),%rax
movsd  %xmm1,0x8(%rax,%r14,1)
mov    (%r10,%rbp,8),%rax
jmp    118a <set_boundary_conditions+0x8a>
mov    -0x10(%rsp),%r8
mov    0x40(%rsp),%ebx
mov    0x48(%rsp),%r15d
mov    -0x14(%rsp),%esi
test   %ebx,%ebx
jg     1326 <set_boundary_conditions+0x226>
jmp    14ae <set_boundary_conditions+0x3ae>
lea    0x1(%r15),%esi
test   %ebx,%ebx
jle    14ae <set_boundary_conditions+0x3ae>
lea    -0x1(%r15),%eax
movslq %eax,%r14
lea    -0x1(%rbx),%r11d
movslq %r15d,%rbp
movslq %esi,%r15
add    $0x1,%ebx
mov    $0x1,%edi
add    $0xffffffff,%ecx
add    $0xffffffff,%edx
lea    0xcf4(%rip),%r12
movaps 0xcad(%rip),%xmm0
lea    0xcd6(%rip),%r13
jmp    138a <set_boundary_conditions+0x28a>
nopl   0x0(%rax)
mov    (%r9,%rdi,8),%rax
movsd  0x10(%rax),%xmm1
movsd  %xmm1,(%rax,%r15,8)
mov    (%r10,%rdi,8),%rsi
movsd  0x8(%rsi),%xmm1
movsd  %xmm1,(%rsi,%rbp,8)
add    $0x1,%rdi
cmp    %rdi,%rbx
je     14ae <set_boundary_conditions+0x3ae>
cmp    $0x3,%ecx
ja     1400 <set_boundary_conditions+0x300>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    (%r9,%rdi,8),%rax
movsd  0x8(%rax),%xmm1
movsd  %xmm1,(%rax)
jmp    13bf <set_boundary_conditions+0x2bf>
nopl   0x0(%rax,%rax,1)
mov    (%r9,%rdi,8),%rax
movsd  0x8(%rax),%xmm1
xorps  %xmm0,%xmm1
movlps %xmm1,(%rax)
mov    (%r10,%rdi,8),%rax
movq   $0x0,(%rax)
cmp    $0x3,%edx
jbe    1409 <set_boundary_conditions+0x309>
jmp    137d <set_boundary_conditions+0x27d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r9,%rdi,8),%rax
movsd  0x8(%rax),%xmm1
movsd  %xmm1,(%rax)
mov    (%r10,%rdi,8),%rax
movsd  0x8(%rax),%xmm1
movsd  %xmm1,(%rax)
nopw   0x0(%rax,%rax,1)
cmp    $0x3,%edx
ja     137d <set_boundary_conditions+0x27d>
movslq (%r12,%rdx,4),%rax
add    %r12,%rax
jmp    *%rax
mov    (%r9,%rdi,8),%rax
movsd  (%rax,%rbp,8),%xmm1
movsd  %xmm1,(%rax,%r15,8)
jmp    1481 <set_boundary_conditions+0x381>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r9,%rdi,8),%rax
movsd  (%rax,%r14,8),%xmm1
movsd  %xmm1,(%rax)
movsd  (%rax,%r11,8),%xmm1
movsd  %xmm1,0x8(%rax)
mov    (%r10,%rdi,8),%rax
movsd  (%rax,%r14,8),%xmm1
movsd  %xmm1,(%rax)
mov    (%r8,%rdi,8),%rax
movsd  (%rax,%rbp,8),%xmm1
movsd  %xmm1,0x8(%rax)
cmp    $0x3,%edx
jbe    1409 <set_boundary_conditions+0x309>
jmp    137d <set_boundary_conditions+0x27d>
nop
mov    (%r9,%rdi,8),%rax
movsd  (%rax,%rbp,8),%xmm1
xorps  %xmm0,%xmm1
movlps %xmm1,(%rax,%r15,8)
mov    (%r10,%rdi,8),%rsi
xorps  %xmm1,%xmm1
jmp    1378 <set_boundary_conditions+0x278>
nopl   (%rax)
mov    (%r9,%rdi,8),%rax
movsd  (%rax,%rbp,8),%xmm1
movsd  %xmm1,(%rax,%r15,8)
mov    (%r10,%rdi,8),%rsi
movsd  (%rsi,%r14,8),%xmm1
jmp    1378 <set_boundary_conditions+0x278>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @set_boundary_conditions(i32 %0, i32 %1, i32 %2, i32 %3, double** %4, double** %5, double** %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double**
%15 = alloca double**
%16 = alloca double**
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store double** %4, double*** %14
store double** %5, double*** %15
store double** %6, double*** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
store i32 1, i32* %20
br label %21
21: ; preds = %312, %9
%22 = load i32, i32* %20
%23 = load i32, i32* %18
%24 = add nsw i32 %23, 1
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %315
26: ; preds = %21
%27 = load i32, i32* %10
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %49
29: ; preds = %26
%30 = load double**, double*** %15
%31 = getelementptr inbounds double*, double** %30, i64 0
%32 = load double*, double** %31
%33 = load i32, i32* %20
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
store double 0.000000e+00, double* %35
%36 = load double**, double*** %16
%37 = getelementptr inbounds double*, double** %36, i64 1
%38 = load double*, double** %37
%39 = load i32, i32* %20
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = load double**, double*** %16
%44 = getelementptr inbounds double*, double** %43, i64 0
%45 = load double*, double** %44
%46 = load i32, i32* %20
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
store double %42, double* %48
br label %172
49: ; preds = %26
%50 = load i32, i32* %10
%51 = icmp eq i32 %50, 2
br i1 %51, label %52, label %73
52: ; preds = %49
%53 = load double**, double*** %15
%54 = getelementptr inbounds double*, double** %53, i64 0
%55 = load double*, double** %54
%56 = load i32, i32* %20
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
store double 0.000000e+00, double* %58
%59 = load double**, double*** %16
%60 = getelementptr inbounds double*, double** %59, i64 1
%61 = load double*, double** %60
%62 = load i32, i32* %20
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = fmul double -1.000000e+00, %65
%67 = load double**, double*** %16
%68 = getelementptr inbounds double*, double** %67, i64 0
%69 = load double*, double** %68
%70 = load i32, i32* %20
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
store double %66, double* %72
br label %171
73: ; preds = %49
%74 = load i32, i32* %10
%75 = icmp eq i32 %74, 3
br i1 %75, label %76, label %103
76: ; preds = %73
%77 = load double**, double*** %15
%78 = getelementptr inbounds double*, double** %77, i64 1
%79 = load double*, double** %78
%80 = load i32, i32* %20
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %79, i64 %81
%83 = load double, double* %82
%84 = load double**, double*** %15
%85 = getelementptr inbounds double*, double** %84, i64 0
%86 = load double*, double** %85
%87 = load i32, i32* %20
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
store double %83, double* %89
%90 = load double**, double*** %16
%91 = getelementptr inbounds double*, double** %90, i64 1
%92 = load double*, double** %91
%93 = load i32, i32* %20
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %92, i64 %94
%96 = load double, double* %95
%97 = load double**, double*** %16
%98 = getelementptr inbounds double*, double** %97, i64 0
%99 = load double*, double** %98
%100 = load i32, i32* %20
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
store double %96, double* %102
br label %170
103: ; preds = %73
%104 = load i32, i32* %10
%105 = icmp eq i32 %104, 4
br i1 %105, label %106, label %169
106: ; preds = %103
%107 = load double**, double*** %15
%108 = load i32, i32* %17
%109 = sub nsw i32 %108, 1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double*, double** %107, i64 %110
%112 = load double*, double** %111
%113 = load i32, i32* %20
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %112, i64 %114
%116 = load double, double* %115
%117 = load double**, double*** %15
%118 = getelementptr inbounds double*, double** %117, i64 0
%119 = load double*, double** %118
%120 = load i32, i32* %20
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %119, i64 %121
store double %116, double* %122
%123 = load double**, double*** %16
%124 = load i32, i32* %17
%125 = sub nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double*, double** %123, i64 %126
%128 = load double*, double** %127
%129 = load i32, i32* %20
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
%132 = load double, double* %131
%133 = load double**, double*** %16
%134 = getelementptr inbounds double*, double** %133, i64 0
%135 = load double*, double** %134
%136 = load i32, i32* %20
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %135, i64 %137
store double %132, double* %138
%139 = load double**, double*** %16
%140 = load i32, i32* %17
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double*, double** %139, i64 %141
%143 = load double*, double** %142
%144 = load i32, i32* %20
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %143, i64 %145
%147 = load double, double* %146
%148 = load double**, double*** %16
%149 = getelementptr inbounds double*, double** %148, i64 1
%150 = load double*, double** %149
%151 = load i32, i32* %20
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %150, i64 %152
store double %147, double* %153
%154 = load double**, double*** %14
%155 = load i32, i32* %17
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double*, double** %154, i64 %156
%158 = load double*, double** %157
%159 = load i32, i32* %20
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds double, double* %158, i64 %160
%162 = load double, double* %161
%163 = load double**, double*** %14
%164 = getelementptr inbounds double*, double** %163, i64 1
%165 = load double*, double** %164
%166 = load i32, i32* %20
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
store double %162, double* %168
br label %169
169: ; preds = %106, %103
br label %170
170: ; preds = %169, %76
br label %171
171: ; preds = %170, %52
br label %172
172: ; preds = %171, %29
%173 = load i32, i32* %11
%174 = icmp eq i32 %173, 1
br i1 %174, label %175, label %202
175: ; preds = %172
%176 = load double**, double*** %15
%177 = load i32, i32* %17
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double*, double** %176, i64 %178
%180 = load double*, double** %179
%181 = load i32, i32* %20
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %180, i64 %182
store double 0.000000e+00, double* %183
%184 = load double**, double*** %16
%185 = load i32, i32* %17
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double*, double** %184, i64 %186
%188 = load double*, double** %187
%189 = load i32, i32* %20
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds double, double* %188, i64 %190
%192 = load double, double* %191
%193 = load double**, double*** %16
%194 = load i32, i32* %17
%195 = add nsw i32 %194, 1
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double*, double** %193, i64 %196
%198 = load double*, double** %197
%199 = load i32, i32* %20
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds double, double* %198, i64 %200
store double %192, double* %201
br label %311
202: ; preds = %172
%203 = load i32, i32* %11
%204 = icmp eq i32 %203, 2
br i1 %204, label %205, label %233
205: ; preds = %202
%206 = load double**, double*** %15
%207 = load i32, i32* %17
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double*, double** %206, i64 %208
%210 = load double*, double** %209
%211 = load i32, i32* %20
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %210, i64 %212
store double 0.000000e+00, double* %213
%214 = load double**, double*** %16
%215 = load i32, i32* %17
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds double*, double** %214, i64 %216
%218 = load double*, double** %217
%219 = load i32, i32* %20
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %218, i64 %220
%222 = load double, double* %221
%223 = fmul double -1.000000e+00, %222
%224 = load double**, double*** %16
%225 = load i32, i32* %17
%226 = add nsw i32 %225, 1
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double*, double** %224, i64 %227
%229 = load double*, double** %228
%230 = load i32, i32* %20
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %229, i64 %231
store double %223, double* %232
br label %310
233: ; preds = %202
%234 = load i32, i32* %11
%235 = icmp eq i32 %234, 3
br i1 %235, label %236, label %273
236: ; preds = %233
%237 = load double**, double*** %15
%238 = load i32, i32* %17
%239 = sub nsw i32 %238, 1
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds double*, double** %237, i64 %240
%242 = load double*, double** %241
%243 = load i32, i32* %20
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds double, double* %242, i64 %244
%246 = load double, double* %245
%247 = load double**, double*** %15
%248 = load i32, i32* %17
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds double*, double** %247, i64 %249
%251 = load double*, double** %250
%252 = load i32, i32* %20
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds double, double* %251, i64 %253
store double %246, double* %254
%255 = load double**, double*** %16
%256 = load i32, i32* %17
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double*, double** %255, i64 %257
%259 = load double*, double** %258
%260 = load i32, i32* %20
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds double, double* %259, i64 %261
%263 = load double, double* %262
%264 = load double**, double*** %16
%265 = load i32, i32* %17
%266 = add nsw i32 %265, 1
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds double*, double** %264, i64 %267
%269 = load double*, double** %268
%270 = load i32, i32* %20
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %269, i64 %271
store double %263, double* %272
br label %309
273: ; preds = %233
%274 = load i32, i32* %11
%275 = icmp eq i32 %274, 4
br i1 %275, label %276, label %308
276: ; preds = %273
%277 = load double**, double*** %15
%278 = getelementptr inbounds double*, double** %277, i64 1
%279 = load double*, double** %278
%280 = load i32, i32* %20
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds double, double* %279, i64 %281
%283 = load double, double* %282
%284 = load double**, double*** %15
%285 = load i32, i32* %17
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double*, double** %284, i64 %286
%288 = load double*, double** %287
%289 = load i32, i32* %20
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds double, double* %288, i64 %290
store double %283, double* %291
%292 = load double**, double*** %16
%293 = getelementptr inbounds double*, double** %292, i64 2
%294 = load double*, double** %293
%295 = load i32, i32* %20
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds double, double* %294, i64 %296
%298 = load double, double* %297
%299 = load double**, double*** %16
%300 = load i32, i32* %17
%301 = add nsw i32 %300, 1
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double*, double** %299, i64 %302
%304 = load double*, double** %303
%305 = load i32, i32* %20
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds double, double* %304, i64 %306
store double %298, double* %307
br label %308
308: ; preds = %276, %273
br label %309
309: ; preds = %308, %236
br label %310
310: ; preds = %309, %205
br label %311
311: ; preds = %310, %175
br label %312
312: ; preds = %311
%313 = load i32, i32* %20
%314 = add nsw i32 %313, 1
store i32 %314, i32* %20
br label %21
315: ; preds = %21
store i32 1, i32* %19
br label %316
316: ; preds = %608, %315
%317 = load i32, i32* %19
%318 = load i32, i32* %17
%319 = add nsw i32 %318, 1
%320 = icmp slt i32 %317, %319
br i1 %320, label %321, label %611
321: ; preds = %316
%322 = load i32, i32* %13
%323 = icmp eq i32 %322, 1
br i1 %323, label %324, label %344
324: ; preds = %321
%325 = load double**, double*** %15
%326 = load i32, i32* %19
%327 = sext i32 %326 to i64
%328 = getelementptr inbounds double*, double** %325, i64 %327
%329 = load double*, double** %328
%330 = getelementptr inbounds double, double* %329, i64 1
%331 = load double, double* %330
%332 = load double**, double*** %15
%333 = load i32, i32* %19
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds double*, double** %332, i64 %334
%336 = load double*, double** %335
%337 = getelementptr inbounds double, double* %336, i64 0
store double %331, double* %337
%338 = load double**, double*** %16
%339 = load i32, i32* %19
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds double*, double** %338, i64 %340
%342 = load double*, double** %341
%343 = getelementptr inbounds double, double* %342, i64 0
store double 0.000000e+00, double* %343
br label %468
344: ; preds = %321
%345 = load i32, i32* %13
%346 = icmp eq i32 %345, 2
br i1 %346, label %347, label %368
347: ; preds = %344
%348 = load double**, double*** %15
%349 = load i32, i32* %19
%350 = sext i32 %349 to i64
%351 = getelementptr inbounds double*, double** %348, i64 %350
%352 = load double*, double** %351
%353 = getelementptr inbounds double, double* %352, i64 1
%354 = load double, double* %353
%355 = fmul double -1.000000e+00, %354
%356 = load double**, double*** %15
%357 = load i32, i32* %19
%358 = sext i32 %357 to i64
%359 = getelementptr inbounds double*, double** %356, i64 %358
%360 = load double*, double** %359
%361 = getelementptr inbounds double, double* %360, i64 0
store double %355, double* %361
%362 = load double**, double*** %16
%363 = load i32, i32* %19
%364 = sext i32 %363 to i64
%365 = getelementptr inbounds double*, double** %362, i64 %364
%366 = load double*, double** %365
%367 = getelementptr inbounds double, double* %366, i64 0
store double 0.000000e+00, double* %367
br label %467
368: ; preds = %344
%369 = load i32, i32* %13
%370 = icmp eq i32 %369, 3
br i1 %370, label %371, label %398
371: ; preds = %368
%372 = load double**, double*** %15
%373 = load i32, i32* %19
%374 = sext i32 %373 to i64
%375 = getelementptr inbounds double*, double** %372, i64 %374
%376 = load double*, double** %375
%377 = getelementptr inbounds double, double* %376, i64 1
%378 = load double, double* %377
%379 = load double**, double*** %15
%380 = load i32, i32* %19
%381 = sext i32 %380 to i64
%382 = getelementptr inbounds double*, double** %379, i64 %381
%383 = load double*, double** %382
%384 = getelementptr inbounds double, double* %383, i64 0
store double %378, double* %384
%385 = load double**, double*** %16
%386 = load i32, i32* %19
%387 = sext i32 %386 to i64
%388 = getelementptr inbounds double*, double** %385, i64 %387
%389 = load double*, double** %388
%390 = getelementptr inbounds double, double* %389, i64 1
%391 = load double, double* %390
%392 = load double**, double*** %16
%393 = load i32, i32* %19
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds double*, double** %392, i64 %394
%396 = load double*, double** %395
%397 = getelementptr inbounds double, double* %396, i64 0
store double %391, double* %397
br label %466
398: ; preds = %368
%399 = load i32, i32* %13
%400 = icmp eq i32 %399, 4
br i1 %400, label %401, label %465
401: ; preds = %398
%402 = load double**, double*** %15
%403 = load i32, i32* %19
%404 = sext i32 %403 to i64
%405 = getelementptr inbounds double*, double** %402, i64 %404
%406 = load double*, double** %405
%407 = load i32, i32* %18
%408 = sub nsw i32 %407, 1
%409 = sext i32 %408 to i64
%410 = getelementptr inbounds double, double* %406, i64 %409
%411 = load double, double* %410
%412 = load double**, double*** %15
%413 = load i32, i32* %19
%414 = sext i32 %413 to i64
%415 = getelementptr inbounds double*, double** %412, i64 %414
%416 = load double*, double** %415
%417 = getelementptr inbounds double, double* %416, i64 0
store double %411, double* %417
%418 = load double**, double*** %15
%419 = load i32, i32* %19
%420 = sext i32 %419 to i64
%421 = getelementptr inbounds double*, double** %418, i64 %420
%422 = load double*, double** %421
%423 = load i32, i32* %17
%424 = sub nsw i32 %423, 1
%425 = sext i32 %424 to i64
%426 = getelementptr inbounds double, double* %422, i64 %425
%427 = load double, double* %426
%428 = load double**, double*** %15
%429 = load i32, i32* %19
%430 = sext i32 %429 to i64
%431 = getelementptr inbounds double*, double** %428, i64 %430
%432 = load double*, double** %431
%433 = getelementptr inbounds double, double* %432, i64 1
store double %427, double* %433
%434 = load double**, double*** %16
%435 = load i32, i32* %19
%436 = sext i32 %435 to i64
%437 = getelementptr inbounds double*, double** %434, i64 %436
%438 = load double*, double** %437
%439 = load i32, i32* %18
%440 = sub nsw i32 %439, 1
%441 = sext i32 %440 to i64
%442 = getelementptr inbounds double, double* %438, i64 %441
%443 = load double, double* %442
%444 = load double**, double*** %16
%445 = load i32, i32* %19
%446 = sext i32 %445 to i64
%447 = getelementptr inbounds double*, double** %444, i64 %446
%448 = load double*, double** %447
%449 = getelementptr inbounds double, double* %448, i64 0
store double %443, double* %449
%450 = load double**, double*** %14
%451 = load i32, i32* %19
%452 = sext i32 %451 to i64
%453 = getelementptr inbounds double*, double** %450, i64 %452
%454 = load double*, double** %453
%455 = load i32, i32* %18
%456 = sext i32 %455 to i64
%457 = getelementptr inbounds double, double* %454, i64 %456
%458 = load double, double* %457
%459 = load double**, double*** %14
%460 = load i32, i32* %19
%461 = sext i32 %460 to i64
%462 = getelementptr inbounds double*, double** %459, i64 %461
%463 = load double*, double** %462
%464 = getelementptr inbounds double, double* %463, i64 1
store double %458, double* %464
br label %465
465: ; preds = %401, %398
br label %466
466: ; preds = %465, %371
br label %467
467: ; preds = %466, %347
br label %468
468: ; preds = %467, %324
%469 = load i32, i32* %12
%470 = icmp eq i32 %469, 1
br i1 %470, label %471, label %498
471: ; preds = %468
%472 = load double**, double*** %15
%473 = load i32, i32* %19
%474 = sext i32 %473 to i64
%475 = getelementptr inbounds double*, double** %472, i64 %474
%476 = load double*, double** %475
%477 = load i32, i32* %18
%478 = sext i32 %477 to i64
%479 = getelementptr inbounds double, double* %476, i64 %478
%480 = load double, double* %479
%481 = load double**, double*** %15
%482 = load i32, i32* %19
%483 = sext i32 %482 to i64
%484 = getelementptr inbounds double*, double** %481, i64 %483
%485 = load double*, double** %484
%486 = load i32, i32* %18
%487 = add nsw i32 %486, 1
%488 = sext i32 %487 to i64
%489 = getelementptr inbounds double, double* %485, i64 %488
store double %480, double* %489
%490 = load double**, double*** %16
%491 = load i32, i32* %19
%492 = sext i32 %491 to i64
%493 = getelementptr inbounds double*, double** %490, i64 %492
%494 = load double*, double** %493
%495 = load i32, i32* %18
%496 = sext i32 %495 to i64
%497 = getelementptr inbounds double, double* %494, i64 %496
store double 0.000000e+00, double* %497
br label %607
498: ; preds = %468
%499 = load i32, i32* %12
%500 = icmp eq i32 %499, 2
br i1 %500, label %501, label %529
501: ; preds = %498
%502 = load double**, double*** %15
%503 = load i32, i32* %19
%504 = sext i32 %503 to i64
%505 = getelementptr inbounds double*, double** %502, i64 %504
%506 = load double*, double** %505
%507 = load i32, i32* %18
%508 = sext i32 %507 to i64
%509 = getelementptr inbounds double, double* %506, i64 %508
%510 = load double, double* %509
%511 = fmul double -1.000000e+00, %510
%512 = load double**, double*** %15
%513 = load i32, i32* %19
%514 = sext i32 %513 to i64
%515 = getelementptr inbounds double*, double** %512, i64 %514
%516 = load double*, double** %515
%517 = load i32, i32* %18
%518 = add nsw i32 %517, 1
%519 = sext i32 %518 to i64
%520 = getelementptr inbounds double, double* %516, i64 %519
store double %511, double* %520
%521 = load double**, double*** %16
%522 = load i32, i32* %19
%523 = sext i32 %522 to i64
%524 = getelementptr inbounds double*, double** %521, i64 %523
%525 = load double*, double** %524
%526 = load i32, i32* %18
%527 = sext i32 %526 to i64
%528 = getelementptr inbounds double, double* %525, i64 %527
store double 0.000000e+00, double* %528
br label %606
529: ; preds = %498
%530 = load i32, i32* %12
%531 = icmp eq i32 %530, 3
br i1 %531, label %532, label %569
532: ; preds = %529
%533 = load double**, double*** %15
%534 = load i32, i32* %19
%535 = sext i32 %534 to i64
%536 = getelementptr inbounds double*, double** %533, i64 %535
%537 = load double*, double** %536
%538 = load i32, i32* %18
%539 = sext i32 %538 to i64
%540 = getelementptr inbounds double, double* %537, i64 %539
%541 = load double, double* %540
%542 = load double**, double*** %15
%543 = load i32, i32* %19
%544 = sext i32 %543 to i64
%545 = getelementptr inbounds double*, double** %542, i64 %544
%546 = load double*, double** %545
%547 = load i32, i32* %18
%548 = add nsw i32 %547, 1
%549 = sext i32 %548 to i64
%550 = getelementptr inbounds double, double* %546, i64 %549
store double %541, double* %550
%551 = load double**, double*** %16
%552 = load i32, i32* %19
%553 = sext i32 %552 to i64
%554 = getelementptr inbounds double*, double** %551, i64 %553
%555 = load double*, double** %554
%556 = load i32, i32* %18
%557 = sub nsw i32 %556, 1
%558 = sext i32 %557 to i64
%559 = getelementptr inbounds double, double* %555, i64 %558
%560 = load double, double* %559
%561 = load double**, double*** %16
%562 = load i32, i32* %19
%563 = sext i32 %562 to i64
%564 = getelementptr inbounds double*, double** %561, i64 %563
%565 = load double*, double** %564
%566 = load i32, i32* %18
%567 = sext i32 %566 to i64
%568 = getelementptr inbounds double, double* %565, i64 %567
store double %560, double* %568
br label %605
569: ; preds = %529
%570 = load i32, i32* %12
%571 = icmp eq i32 %570, 4
br i1 %571, label %572, label %604
572: ; preds = %569
%573 = load double**, double*** %15
%574 = load i32, i32* %19
%575 = sext i32 %574 to i64
%576 = getelementptr inbounds double*, double** %573, i64 %575
%577 = load double*, double** %576
%578 = getelementptr inbounds double, double* %577, i64 2
%579 = load double, double* %578
%580 = load double**, double*** %15
%581 = load i32, i32* %19
%582 = sext i32 %581 to i64
%583 = getelementptr inbounds double*, double** %580, i64 %582
%584 = load double*, double** %583
%585 = load i32, i32* %18
%586 = add nsw i32 %585, 1
%587 = sext i32 %586 to i64
%588 = getelementptr inbounds double, double* %584, i64 %587
store double %579, double* %588
%589 = load double**, double*** %16
%590 = load i32, i32* %19
%591 = sext i32 %590 to i64
%592 = getelementptr inbounds double*, double** %589, i64 %591
%593 = load double*, double** %592
%594 = getelementptr inbounds double, double* %593, i64 1
%595 = load double, double* %594
%596 = load double**, double*** %16
%597 = load i32, i32* %19
%598 = sext i32 %597 to i64
%599 = getelementptr inbounds double*, double** %596, i64 %598
%600 = load double*, double** %599
%601 = load i32, i32* %18
%602 = sext i32 %601 to i64
%603 = getelementptr inbounds double, double* %600, i64 %602
store double %595, double* %603
br label %604
604: ; preds = %572, %569
br label %605
605: ; preds = %604, %532
br label %606
606: ; preds = %605, %501
br label %607
607: ; preds = %606, %471
br label %608
608: ; preds = %607
%609 = load i32, i32* %19
%610 = add nsw i32 %609, 1
store i32 %610, i32* %19
br label %316
611: ; preds = %316
ret void
}

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