#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 */
typedef int /*<<< orphan*/ matrix;

/* Variables and functions */
int fabs(double);
int /*<<< orphan*/ memset(double **, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, double, ...);
char r(int, char *, int);
int main() {
  int c, i, j, k, x, d;
  double matrix[20][20 + 1], res[20], sum = 0;
  for (d = 4; d <= 20; ++d) {
    for (c = 0; c <= 20; ++c) {
      memset(matrix, 0, sizeof(matrix));
      for (x = 1; x < (1 << d); ++x) {
        char dice[20 + 1];
        int i, n = 0;
        for (i = 0; i < d; ++i)
          if (x & 1 << i)
            dice[n++] = i + 1;
        matrix[n - 1][d] += c == 0 ? dice[n - 1] : r(n, dice, c);
      }
      for (i = 0; i < d; ++i) {
        matrix[i][i] = 1;
        if (i)
          matrix[i][i - 1] = (double)i / d - 1;
        if (i < d - 1)
          matrix[i][i + 1] = -(i + 2.0) / d;
      }
      for (i = 0; i < d; ++i) {
        double tmp;
        k = i;
        for (j = i + 1; j < d; ++j)
          if (fabs(matrix[k][i]) < fabs(matrix[j][i]))
            k = j;
        if (fabs(matrix[k][i]) < 1e-10)
          break;
        for (j = 0; j <= d; ++j)
          tmp = matrix[i][j], matrix[i][j] = matrix[k][j], matrix[k][j] = tmp;
        for (k = i + 1; k < d; ++k) {
          tmp = matrix[k][i] / matrix[i][i];
          for (j = 0; j <= d; ++j)
            matrix[k][j] -= tmp * matrix[i][j];
        }
      }
      if (i < d) {
        printf("Error. Rank = %d < %d\n", i, d);
        return 1;
      }
      sum += matrix[d - 1][d] / matrix[d - 1][d - 1];
      printf("S(%d, %d) = %lf\n", d, c,
             matrix[d - 1][d] / matrix[d - 1][d - 1]);
    }
  }
  printf("%lf\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xde8(%rbp)
ff
movl   $0x4,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jg     174c <main+0x60c>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     1739 <main+0x5f9>
lea    -0xd40(%rbp),%rdi
xor    %esi,%esi
mov    $0xd20,%edx
call   1050 <memset@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jge    12b7 <main+0x177>
movl   $0x0,-0xe08(%rbp)
movl   $0x0,-0xe04(%rbp)
mov    -0xe04(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    122e <main+0xee>
mov    -0x18(%rbp),%eax
mov    -0xe04(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1215 <main+0xd5>
mov    -0xe04(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0xe08(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xe08(%rbp)
cltq
mov    %cl,-0xe00(%rbp,%rax,1)
jmp    121a <main+0xda>
mov    -0xe04(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe04(%rbp)
jmp    11c4 <main+0x84>
cmpl   $0x0,-0x8(%rbp)
jne    1256 <main+0x116>
mov    -0xe08(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0xe00(%rbp,%rax,1),%eax
ff
mov    %eax,-0xe14(%rbp)
jmp    1274 <main+0x134>
mov    -0xe08(%rbp),%edi
lea    -0xe00(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <r@plt>
movsbl %al,%eax
mov    %eax,-0xe14(%rbp)
mov    -0xe14(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0xe08(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <main+0x59>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13af <main+0x26f>
movslq -0xc(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  0xd1d(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
cmpl   $0x0,-0xc(%rbp)
je     1337 <main+0x1f7>
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcf8(%rip),%xmm1
subsd  %xmm1,%xmm0
movslq -0xc(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    139c <main+0x25c>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xcbb(%rip),%xmm1
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movslq -0xc(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13a1 <main+0x261>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12be <main+0x17e>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1641 <main+0x501>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1452 <main+0x312>
movslq -0x14(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <fabs@plt>
mov    %eax,-0xe18(%rbp)
movslq -0x10(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <fabs@plt>
mov    %eax,%ecx
mov    -0xe18(%rbp),%eax
cmp    %ecx,%eax
jge    143f <main+0x2ff>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1444 <main+0x304>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13d1 <main+0x291>
movslq -0x14(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xb7f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1490 <main+0x350>
jmp    1641 <main+0x501>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1539 <main+0x3f9>
movslq -0xc(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe10(%rbp)
ff
movslq -0x14(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0xc(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xe10(%rbp),%xmm0
ff
movslq -0x14(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1497 <main+0x357>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    162e <main+0x4ee>
movslq -0x14(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0xc(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe10(%rbp)
ff
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     161b <main+0x4db>
movsd  -0xe10(%rbp),%xmm0
ff
movslq -0xc(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x14(%rbp),%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1599 <main+0x459>
jmp    1620 <main+0x4e0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1542 <main+0x402>
jmp    1633 <main+0x4f3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13b6 <main+0x276>
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    166f <main+0x52f>
cvtsi2sdl -0xc(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
lea    0x9bc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1769 <main+0x629>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
addsd  -0xde8(%rbp),%xmm0
ff
movsd  %xmm0,-0xde8(%rbp)
ff
cvtsi2sdl -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0xd40(%rbp),%rax
imul   $0xa8,%rcx,%rcx
add    %rcx,%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm1
lea    0x90b(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1175 <main+0x35>
jmp    173e <main+0x5fe>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1164 <main+0x24>
movsd  -0xde8(%rbp),%xmm0
ff
lea    0x8e0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xdf8,%rsp
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
xorps  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    $0x5,%ebp
mov    $0x4,%r14d
xor    %ecx,%ecx
mov    %rcx,0x50(%rsp)
movsd  0xe82(%rip),%xmm0
mov    %rbp,%r13
and    $0xfffffffffffffffc,%r13
mov    %r14,%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x48(%rsp)
mov    %rbp,%rcx
and    %rax,%rcx
mov    %rcx,0x20(%rsp)
lea    -0x2(%rcx),%rax
mov    %rax,0x38(%rsp)
shr    %rax
add    $0x1,%rax
mov    %rax,0x70(%rsp)
lea    (%rsp,%rbp,8),%rax
add    $0xd0,%rax
mov    %rax,0x90(%rsp)
mov    $0x1,%ebx
mov    %r14d,%ecx
shl    %cl,%ebx
lea    -0x1(%r14),%rax
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
mov    %rax,0x88(%rsp)
imul   $0xa8,%rax,%rax
add    %rsp,%rax
add    $0xd0,%rax
lea    (%rax,%r14,8),%rax
mov    %rax,0x78(%rsp)
movsd  %xmm1,0x40(%rsp)
divsd  %xmm1,%xmm0
movsd  %xmm0,0x80(%rsp)
xor    %eax,%eax
mov    %ebx,0x18(%rsp)
mov    %r14,(%rsp)
mov    %rbp,0x98(%rsp)
mov    %r13,0x28(%rsp)
mov    %eax,0x1c(%rsp)
lea    0xd0(%rsp),%rdi
xor    %esi,%esi
mov    $0xd20,%edx
call   1050 <memset@plt>
cmp    $0x2,%ebx
mov    0x48(%rsp),%rdi
jl     1370 <main+0x230>
mov    %ebx,%r8d
mov    $0x1,%r15d
jmp    12ba <main+0x17a>
cs nopw 0x0(%rax,%rax,1)
nop
test   %edx,%edx
je     1350 <main+0x210>
mov    %ebx,%edi
lea    0xb0(%rsp),%rsi
call   1030 <r@plt>
mov    0x18(%rsp),%r8d
mov    0x48(%rsp),%rdi
add    $0xffffffff,%ebx
movslq %ebx,%rcx
movsbl %al,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
imul   $0xa8,%rcx,%rax
add    %rsp,%rax
add    $0xd0,%rax
addsd  (%rax,%r14,8),%xmm0
movsd  %xmm0,(%rax,%r14,8)
add    $0x1,%r15d
cmp    %r8d,%r15d
je     1370 <main+0x230>
xor    %ebx,%ebx
mov    $0x0,%ecx
cmpq   $0xfffffffffffffffd,0x50(%rsp)
jne    12f0 <main+0x1b0>
test   $0x1,%r14b
mov    0x1c(%rsp),%edx
je     1260 <main+0x120>
bt     %ecx,%r15d
jae    1260 <main+0x120>
add    $0x1,%cl
movslq %ebx,%rax
add    $0x1,%ebx
mov    %cl,0xb0(%rsp,%rax,1)
jmp    1260 <main+0x120>
xchg   %ax,%ax
xor    %ebx,%ebx
xor    %eax,%eax
jmp    1313 <main+0x1d3>
cs nopw 0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x2,%rcx
add    $0x1,%rdx
mov    %rdx,%rax
cmp    %rcx,%rdi
je     12c9 <main+0x189>
bt     %eax,%r15d
jae    1329 <main+0x1e9>
movslq %ebx,%rcx
add    $0x1,%ebx
lea    0x1(%rax),%edx
mov    %dl,0xb0(%rsp,%rcx,1)
lea    0x1(%rax),%rdx
bt     %edx,%r15d
jae    1300 <main+0x1c0>
movslq %ebx,%rcx
add    $0x1,%ebx
lea    0x2(%rax),%esi
mov    %sil,0xb0(%rsp,%rcx,1)
jmp    1300 <main+0x1c0>
cs nopw 0x0(%rax,%rax,1)
movslq %ebx,%rcx
mov    0xaf(%rsp,%rcx,1),%al
add    $0xffffffffffffffff,%rcx
jmp    1287 <main+0x147>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movabs $0x3ff0000000000000,%rdx
mov    %rdx,0xd0(%rsp)
movsd  0x80(%rsp),%xmm0
movsd  %xmm0,0xd8(%rsp)
mov    $0x1,%eax
movapd 0xc7f(%rip),%xmm1
mov    0x88(%rsp),%rsi
movsd  0x40(%rsp),%xmm2
jmp    13c9 <main+0x289>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %r14,%rax
je     1420 <main+0x2e0>
imul   $0xa8,%rax,%rcx
add    %rsp,%rcx
add    $0xd0,%rcx
mov    %rdx,(%rcx,%rax,8)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm2,%xmm0
addsd  0xc17(%rip),%xmm0
movsd  %xmm0,-0x8(%rcx,%rax,8)
cmp    %rsi,%rax
jae    13c0 <main+0x280>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xc05(%rip),%xmm0
xorpd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rcx,%rax,8)
jmp    13c0 <main+0x280>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edx
lea    0x178(%rsp),%rax
mov    %rax,0x60(%rsp)
lea    0xd0(%rsp),%r15
lea    0x188(%rsp),%rcx
mov    %rcx,0x58(%rsp)
lea    0xd8(%rsp),%rcx
lea    0xe0(%rsp),%rbx
xor    %esi,%esi
jmp    14b1 <main+0x371>
nopl   0x0(%rax,%rax,1)
mov    0x68(%rsp),%rdx
add    $0x1,%rdx
mov    0xa0(%rsp),%rax
add    $0xb0,%rax
add    $0xa8,%rbx
mov    0x10(%rsp),%rcx
add    $0xa8,%rcx
addq   $0xa8,0x58(%rsp)
add    $0xa8,%r15
addq   $0xa8,0x60(%rsp)
mov    0x8(%rsp),%rsi
cmp    %r14,%rsi
je     1860 <main+0x720>
mov    %rcx,0x10(%rsp)
mov    %rsi,%rbp
lea    0x1(%rsi),%rcx
mov    %rcx,0x8(%rsp)
cmp    %r14,%rcx
mov    %rdx,0x68(%rsp)
mov    %rax,0xa0(%rsp)
jae    1550 <main+0x410>
mov    %rax,%r13
mov    %rdx,%r14
mov    %ebp,%r12d
mov    %rbp,0xa8(%rsp)
jmp    150c <main+0x3cc>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14
add    $0xa8,%r13
mov    %ecx,%r12d
cmp    (%rsp),%r14
mov    0xa8(%rsp),%rbp
jae    1552 <main+0x412>
movslq %r12d,%rax
imul   $0xa8,%rax,%rax
add    %rsp,%rax
add    $0xd0,%rax
movsd  (%rax,%rbp,8),%xmm0
call   1060 <fabs@plt>
mov    %eax,%ebp
movsd  0x0(%r13),%xmm0
call   1060 <fabs@plt>
mov    %r14d,%ecx
cmp    %eax,%ebp
jl     14f0 <main+0x3b0>
mov    %r12d,%ecx
jmp    14f0 <main+0x3b0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%ecx
movslq %ecx,%rax
imul   $0xa8,%rax,%r12
lea    (%rsp,%r12,1),%r14
add    $0xd0,%r14
movsd  (%r14,%rbp,8),%xmm0
call   1060 <fabs@plt>
test   %eax,%eax
jle    18ec <main+0x7ac>
mov    %rbp,%r8
imul   $0xa8,%rbp,%rax
lea    (%rsp,%rax,1),%rdi
add    $0xd0,%rdi
mov    0x98(%rsp),%rbp
cmp    $0x2,%rbp
jb     15be <main+0x47e>
mov    0x90(%rsp),%rax
add    %r12,%rax
cmp    %rax,%rdi
jae    1660 <main+0x520>
lea    (%rdi,%rbp,8),%rax
cmp    %rax,%r14
jae    1660 <main+0x520>
mov    %r14,%rsi
xor    %ecx,%ecx
mov    (%rsp),%r14
movapd 0xa51(%rip),%xmm4
mov    0x28(%rsp),%r13
mov    0x20(%rsp),%r10
mov    0x38(%rsp),%r11
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%r9
mov    %rcx,%rax
test   $0x1,%bpl
je     160c <main+0x4cc>
movsd  (%rdi,%rcx,8),%xmm0
movsd  (%rsi,%rcx,8),%xmm1
movsd  %xmm1,(%rdi,%rcx,8)
movsd  %xmm0,(%rsi,%rcx,8)
mov    %rcx,%rax
or     $0x1,%rax
cmp    %rcx,%r14
je     1700 <main+0x5c0>
lea    0xd8(%rsp),%rcx
add    %rcx,%r12
movsd  -0x8(%rdx,%rax,8),%xmm0
movsd  -0x8(%r12,%rax,8),%xmm1
movsd  %xmm1,-0x8(%rdx,%rax,8)
movsd  %xmm0,-0x8(%r12,%rax,8)
movsd  (%rdx,%rax,8),%xmm0
movsd  (%r12,%rax,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
movsd  %xmm0,(%r12,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbp
jne    1620 <main+0x4e0>
jmp    1700 <main+0x5c0>
xchg   %ax,%ax
mov    0x38(%rsp),%r11
mov    %r14,%rsi
test   %r11,%r11
je     1822 <main+0x6e2>
lea    0xe0(%rsp),%rax
lea    (%rax,%r12,1),%rcx
xor    %eax,%eax
mov    (%rsp),%r14
movapd 0x995(%rip),%xmm4
mov    0x28(%rsp),%r13
mov    0x20(%rsp),%r10
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%r9
nop
movups -0x10(%rbx,%rax,8),%xmm0
movups -0x10(%rcx,%rax,8),%xmm1
movups %xmm1,-0x10(%rbx,%rax,8)
movups %xmm0,-0x10(%rcx,%rax,8)
movupd (%rbx,%rax,8),%xmm0
movupd (%rcx,%rax,8),%xmm1
movupd %xmm1,(%rbx,%rax,8)
movupd %xmm0,(%rcx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r13
jne    16a0 <main+0x560>
testb  $0x1,0x70(%rsp)
je     16ef <main+0x5af>
movupd (%rdi,%rax,8),%xmm0
mov    %rsi,%rcx
movupd (%rsi,%rax,8),%xmm1
movupd %xmm1,(%rdi,%rax,8)
movupd %xmm0,(%rsi,%rax,8)
mov    %r10,%rcx
cmp    %r10,%rbp
jne    15e8 <main+0x4a8>
nopl   0x0(%rax,%rax,1)
cmp    %r14,%r9
jae    1460 <main+0x320>
mov    %rdi,%r12
lea    (%rdi,%r8,8),%r9
mov    0x60(%rsp),%rdx
mov    0x58(%rsp),%rsi
mov    0x68(%rsp),%rdi
jmp    174b <main+0x60b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdi
add    $0xa8,%rsi
add    $0xa8,%rdx
cmp    %r14,%rdi
jae    1460 <main+0x320>
imul   $0xa8,%rdi,%rax
lea    (%rsp,%rax,1),%rcx
add    $0xd0,%rcx
movsd  (%rcx,%r8,8),%xmm0
xorpd  %xmm4,%xmm0
divsd  (%r9),%xmm0
cmp    $0x2,%rbp
jae    1780 <main+0x640>
xor    %eax,%eax
jmp    1800 <main+0x6c0>
nopl   0x0(%rax)
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
xor    %eax,%eax
test   %r11,%r11
je     17ca <main+0x68a>
nop
movupd -0x10(%rbx,%rax,8),%xmm2
mulpd  %xmm1,%xmm2
movupd -0x10(%rsi,%rax,8),%xmm3
addpd  %xmm2,%xmm3
movupd (%rsi,%rax,8),%xmm2
movupd %xmm3,-0x10(%rsi,%rax,8)
movupd (%rbx,%rax,8),%xmm3
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm3,(%rsi,%rax,8)
add    $0x4,%rax
cmp    %rax,%r13
jne    1790 <main+0x650>
testb  $0x1,0x70(%rsp)
je     17e9 <main+0x6a9>
movupd (%r12,%rax,8),%xmm2
movupd (%rcx,%rax,8),%xmm3
mulpd  %xmm2,%xmm1
addpd  %xmm3,%xmm1
movupd %xmm1,(%rcx,%rax,8)
mov    %r10,%rax
cmp    %r10,%rbp
je     1730 <main+0x5f0>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdx,%rax,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
add    $0x1,%rax
cmp    %rax,%rbp
jne    1800 <main+0x6c0>
jmp    1730 <main+0x5f0>
xor    %eax,%eax
mov    (%rsp),%r14
movapd 0x7f0(%rip),%xmm4
mov    0x28(%rsp),%r13
mov    0x20(%rsp),%r10
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%r9
testb  $0x1,0x70(%rsp)
jne    16d8 <main+0x598>
jmp    16ef <main+0x5af>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x78(%rsp),%rax
movsd  (%rax),%xmm1
divsd  -0x8(%rax),%xmm1
movsd  0x30(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0x7c2(%rip),%rdi
movsd  0x40(%rsp),%xmm0
mov    0x1c(%rsp),%ebx
mov    %ebx,%esi
mov    $0x2,%al
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x1,%eax
cmp    $0x15,%eax
mov    0x18(%rsp),%ebx
jne    1224 <main+0xe4>
add    $0x1,%r14
add    $0x1,%rbp
addq   $0x1,0x50(%rsp)
cmp    $0x15,%r14
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
movsd  0x732(%rip),%xmm0
jne    117e <main+0x3e>
lea    0x778(%rip),%rdi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
jmp    190a <main+0x7ca>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
lea    0x736(%rip),%rdi
mov    (%rsp),%rsi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0xdf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Error. Rank = %d < %d\0A\00"
@.str.1 = [17 x i8] c"S(%d, %d) = %lf\0A\00"
@.str.2 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [20 x [21 x double]]
%9 = alloca [20 x double]
%10 = alloca double
%11 = alloca [21 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %10
store i32 4, i32* %7
br label %15
15: ; preds = %334, %0
%16 = load i32, i32* %7
%17 = icmp sle i32 %16, 20
br i1 %17, label %18, label %337
18: ; preds = %15
store i32 0, i32* %2
br label %19
19: ; preds = %330, %18
%20 = load i32, i32* %2
%21 = icmp sle i32 %20, 20
br i1 %21, label %22, label %333
22: ; preds = %19
%23 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 0
%24 = bitcast [21 x double]* %23 to double**
%25 = call i32 @memset(double** %24, i32 0, i32 3360)
store i32 1, i32* %6
br label %26
26: ; preds = %82, %22
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = shl i32 1, %28
%30 = icmp slt i32 %27, %29
br i1 %30, label %31, label %85
31: ; preds = %26
store i32 0, i32* %13
store i32 0, i32* %12
br label %32
32: ; preds = %51, %31
%33 = load i32, i32* %12
%34 = load i32, i32* %7
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %54
36: ; preds = %32
%37 = load i32, i32* %6
%38 = load i32, i32* %12
%39 = shl i32 1, %38
%40 = and i32 %37, %39
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %50
42: ; preds = %36
%43 = load i32, i32* %12
%44 = add nsw i32 %43, 1
%45 = trunc i32 %44 to i8
%46 = load i32, i32* %13
%47 = add nsw i32 %46, 1
store i32 %47, i32* %13
%48 = sext i32 %46 to i64
%49 = getelementptr inbounds [21 x i8], [21 x i8]* %11, i64 0, i64 %48
store i8 %45, i8* %49
br label %50
50: ; preds = %42, %36
br label %51
51: ; preds = %50
%52 = load i32, i32* %12
%53 = add nsw i32 %52, 1
store i32 %53, i32* %12
br label %32
54: ; preds = %32
%55 = load i32, i32* %2
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %64
57: ; preds = %54
%58 = load i32, i32* %13
%59 = sub nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [21 x i8], [21 x i8]* %11, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
br label %70
64: ; preds = %54
%65 = load i32, i32* %13
%66 = getelementptr inbounds [21 x i8], [21 x i8]* %11, i64 0, i64 0
%67 = load i32, i32* %2
%68 = call signext i8 @r(i32 %65, i8* %66, i32 %67)
%69 = sext i8 %68 to i32
br label %70
70: ; preds = %64, %57
%71 = phi i32 [ %63, %57 ], [ %69, %64 ]
%72 = sitofp i32 %71 to double
%73 = load i32, i32* %13
%74 = sub nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %75
%77 = load i32, i32* %7
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [21 x double], [21 x double]* %76, i64 0, i64 %78
%80 = load double, double* %79
%81 = fadd double %80, %72
store double %81, double* %79
br label %82
82: ; preds = %70
%83 = load i32, i32* %6
%84 = add nsw i32 %83, 1
store i32 %84, i32* %6
br label %26
85: ; preds = %26
store i32 0, i32* %3
br label %86
86: ; preds = %134, %85
%87 = load i32, i32* %3
%88 = load i32, i32* %7
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %137
90: ; preds = %86
%91 = load i32, i32* %3
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %92
%94 = load i32, i32* %3
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [21 x double], [21 x double]* %93, i64 0, i64 %95
store double 1.000000e+00, double* %96
%97 = load i32, i32* %3
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %113
99: ; preds = %90
%100 = load i32, i32* %3
%101 = sitofp i32 %100 to double
%102 = load i32, i32* %7
%103 = sitofp i32 %102 to double
%104 = fdiv double %101, %103
%105 = fsub double %104, 1.000000e+00
%106 = load i32, i32* %3
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %107
%109 = load i32, i32* %3
%110 = sub nsw i32 %109, 1
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [21 x double], [21 x double]* %108, i64 0, i64 %111
store double %105, double* %112
br label %113
113: ; preds = %99, %90
%114 = load i32, i32* %3
%115 = load i32, i32* %7
%116 = sub nsw i32 %115, 1
%117 = icmp slt i32 %114, %116
br i1 %117, label %118, label %133
118: ; preds = %113
%119 = load i32, i32* %3
%120 = sitofp i32 %119 to double
%121 = fadd double %120, 2.000000e+00
%122 = fneg double %121
%123 = load i32, i32* %7
%124 = sitofp i32 %123 to double
%125 = fdiv double %122, %124
%126 = load i32, i32* %3
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %127
%129 = load i32, i32* %3
%130 = add nsw i32 %129, 1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [21 x double], [21 x double]* %128, i64 0, i64 %131
store double %125, double* %132
br label %133
133: ; preds = %118, %113
br label %134
134: ; preds = %133
%135 = load i32, i32* %3
%136 = add nsw i32 %135, 1
store i32 %136, i32* %3
br label %86
137: ; preds = %86
store i32 0, i32* %3
br label %138
138: ; preds = %275, %137
%139 = load i32, i32* %3
%140 = load i32, i32* %7
%141 = icmp slt i32 %139, %140
br i1 %141, label %142, label %278
142: ; preds = %138
%143 = load i32, i32* %3
store i32 %143, i32* %5
%144 = load i32, i32* %3
%145 = add nsw i32 %144, 1
store i32 %145, i32* %4
br label %146
146: ; preds = %171, %142
%147 = load i32, i32* %4
%148 = load i32, i32* %7
%149 = icmp slt i32 %147, %148
br i1 %149, label %150, label %174
150: ; preds = %146
%151 = load i32, i32* %5
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %152
%154 = load i32, i32* %3
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [21 x double], [21 x double]* %153, i64 0, i64 %155
%157 = load double, double* %156
%158 = call i32 @fabs(double %157)
%159 = load i32, i32* %4
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %160
%162 = load i32, i32* %3
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [21 x double], [21 x double]* %161, i64 0, i64 %163
%165 = load double, double* %164
%166 = call i32 @fabs(double %165)
%167 = icmp slt i32 %158, %166
br i1 %167, label %168, label %170
168: ; preds = %150
%169 = load i32, i32* %4
store i32 %169, i32* %5
br label %170
170: ; preds = %168, %150
br label %171
171: ; preds = %170
%172 = load i32, i32* %4
%173 = add nsw i32 %172, 1
store i32 %173, i32* %4
br label %146
174: ; preds = %146
%175 = load i32, i32* %5
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %176
%178 = load i32, i32* %3
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds [21 x double], [21 x double]* %177, i64 0, i64 %179
%181 = load double, double* %180
%182 = call i32 @fabs(double %181)
%183 = sitofp i32 %182 to double
%184 = fcmp olt double %183, 1.000000e-10
br i1 %184, label %185, label %186
185: ; preds = %174
br label %278
186: ; preds = %174
store i32 0, i32* %4
br label %187
187: ; preds = %219, %186
%188 = load i32, i32* %4
%189 = load i32, i32* %7
%190 = icmp sle i32 %188, %189
br i1 %190, label %191, label %222
191: ; preds = %187
%192 = load i32, i32* %3
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %193
%195 = load i32, i32* %4
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [21 x double], [21 x double]* %194, i64 0, i64 %196
%198 = load double, double* %197
store double %198, double* %14
%199 = load i32, i32* %5
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %200
%202 = load i32, i32* %4
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds [21 x double], [21 x double]* %201, i64 0, i64 %203
%205 = load double, double* %204
%206 = load i32, i32* %3
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %207
%209 = load i32, i32* %4
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [21 x double], [21 x double]* %208, i64 0, i64 %210
store double %205, double* %211
%212 = load double, double* %14
%213 = load i32, i32* %5
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %214
%216 = load i32, i32* %4
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [21 x double], [21 x double]* %215, i64 0, i64 %217
store double %212, double* %218
br label %219
219: ; preds = %191
%220 = load i32, i32* %4
%221 = add nsw i32 %220, 1
store i32 %221, i32* %4
br label %187
222: ; preds = %187
%223 = load i32, i32* %3
%224 = add nsw i32 %223, 1
store i32 %224, i32* %5
br label %225
225: ; preds = %271, %222
%226 = load i32, i32* %5
%227 = load i32, i32* %7
%228 = icmp slt i32 %226, %227
br i1 %228, label %229, label %274
229: ; preds = %225
%230 = load i32, i32* %5
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %231
%233 = load i32, i32* %3
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds [21 x double], [21 x double]* %232, i64 0, i64 %234
%236 = load double, double* %235
%237 = load i32, i32* %3
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %238
%240 = load i32, i32* %3
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds [21 x double], [21 x double]* %239, i64 0, i64 %241
%243 = load double, double* %242
%244 = fdiv double %236, %243
store double %244, double* %14
store i32 0, i32* %4
br label %245
245: ; preds = %267, %229
%246 = load i32, i32* %4
%247 = load i32, i32* %7
%248 = icmp sle i32 %246, %247
br i1 %248, label %249, label %270
249: ; preds = %245
%250 = load double, double* %14
%251 = load i32, i32* %3
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %252
%254 = load i32, i32* %4
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds [21 x double], [21 x double]* %253, i64 0, i64 %255
%257 = load double, double* %256
%258 = load i32, i32* %5
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %259
%261 = load i32, i32* %4
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds [21 x double], [21 x double]* %260, i64 0, i64 %262
%264 = load double, double* %263
%265 = fneg double %250
%266 = call double @llvm.fmuladd.f64(double %265, double %257, double %264)
store double %266, double* %263
br label %267
267: ; preds = %249
%268 = load i32, i32* %4
%269 = add nsw i32 %268, 1
store i32 %269, i32* %4
br label %245
270: ; preds = %245
br label %271
271: ; preds = %270
%272 = load i32, i32* %5
%273 = add nsw i32 %272, 1
store i32 %273, i32* %5
br label %225
274: ; preds = %225
br label %275
275: ; preds = %274
%276 = load i32, i32* %3
%277 = add nsw i32 %276, 1
store i32 %277, i32* %3
br label %138
278: ; preds = %185, %138
%279 = load i32, i32* %3
%280 = load i32, i32* %7
%281 = icmp slt i32 %279, %280
br i1 %281, label %282, label %287
282: ; preds = %278
%283 = load i32, i32* %3
%284 = sitofp i32 %283 to double
%285 = load i32, i32* %7
%286 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %284, i32 %285)
store i32 1, i32* %1
br label %340
287: ; preds = %278
%288 = load i32, i32* %7
%289 = sub nsw i32 %288, 1
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %290
%292 = load i32, i32* %7
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds [21 x double], [21 x double]* %291, i64 0, i64 %293
%295 = load double, double* %294
%296 = load i32, i32* %7
%297 = sub nsw i32 %296, 1
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %298
%300 = load i32, i32* %7
%301 = sub nsw i32 %300, 1
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds [21 x double], [21 x double]* %299, i64 0, i64 %302
%304 = load double, double* %303
%305 = fdiv double %295, %304
%306 = load double, double* %10
%307 = fadd double %306, %305
store double %307, double* %10
%308 = load i32, i32* %7
%309 = sitofp i32 %308 to double
%310 = load i32, i32* %2
%311 = load i32, i32* %7
%312 = sub nsw i32 %311, 1
%313 = sext i32 %312 to i64
%314 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %313
%315 = load i32, i32* %7
%316 = sext i32 %315 to i64
%317 = getelementptr inbounds [21 x double], [21 x double]* %314, i64 0, i64 %316
%318 = load double, double* %317
%319 = load i32, i32* %7
%320 = sub nsw i32 %319, 1
%321 = sext i32 %320 to i64
%322 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %8, i64 0, i64 %321
%323 = load i32, i32* %7
%324 = sub nsw i32 %323, 1
%325 = sext i32 %324 to i64
%326 = getelementptr inbounds [21 x double], [21 x double]* %322, i64 0, i64 %325
%327 = load double, double* %326
%328 = fdiv double %318, %327
%329 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %309, i32 %310, double %328)
br label %330
330: ; preds = %287
%331 = load i32, i32* %2
%332 = add nsw i32 %331, 1
store i32 %332, i32* %2
br label %19
333: ; preds = %19
br label %334
334: ; preds = %333
%335 = load i32, i32* %7
%336 = add nsw i32 %335, 1
store i32 %336, i32* %7
br label %15
337: ; preds = %15
%338 = load double, double* %10
%339 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %338)
store i32 0, i32* %1
br label %340
340: ; preds = %337, %282
%341 = load i32, i32* %1
ret i32 %341
}

LLVM IR (-O2):
@.str = [23 x i8] c"Error. Rank = %d < %d\0A\00"
@.str.1 = [17 x i8] c"S(%d, %d) = %lf\0A\00"
@.str.2 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca [20 x [21 x double]]
%2 = alloca [21 x i8]
%3 = bitcast [20 x [21 x double]]* %1 to i8*
%4 = bitcast [20 x [21 x double]]* %1 to double**
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 0, i64 1
br label %8
8: ; preds = %0, %322
%9 = phi i64 [ 0, %0 ], [ %326, %322 ]
%10 = phi i64 [ 4, %0 ], [ %323, %322 ]
%11 = phi i64 [ 5, %0 ], [ %324, %322 ]
%12 = phi double [ 0.000000e+00, %0 ], [ %318, %322 ]
%13 = and i64 %11, 9223372036854775806
%14 = add nsw i64 %13, -2
%15 = lshr exact i64 %14, 1
%16 = add nuw nsw i64 %15, 1
%17 = and i64 %11, 9223372036854775806
%18 = add nsw i64 %17, -2
%19 = lshr exact i64 %18, 1
%20 = add nuw nsw i64 %19, 1
%21 = getelementptr [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 0, i64 %11
%22 = trunc i64 %10 to i32
%23 = shl nuw i32 1, %22
%24 = icmp sgt i32 %23, 1
%25 = add nsw i64 %10, -1
%26 = sitofp i32 %22 to double
%27 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %25, i64 %10
%28 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %25, i64 %25
%29 = fdiv double -2.000000e+00, %26
%30 = and i64 %10, 1
%31 = icmp eq i64 %9, -3
%32 = and i64 %10, 9223372036854775806
%33 = icmp eq i64 %30, 0
%34 = icmp ult i64 %11, 2
%35 = and i64 %11, 9223372036854775806
%36 = and i64 %20, 1
%37 = icmp eq i64 %18, 0
%38 = and i64 %20, 9223372036854775806
%39 = icmp eq i64 %36, 0
%40 = icmp eq i64 %11, %35
%41 = and i64 %11, 1
%42 = icmp eq i64 %41, 0
%43 = icmp ult i64 %11, 2
%44 = and i64 %11, 9223372036854775806
%45 = and i64 %16, 1
%46 = icmp eq i64 %14, 0
%47 = and i64 %16, 9223372036854775806
%48 = icmp eq i64 %45, 0
%49 = icmp eq i64 %11, %44
br label %50
50: ; preds = %8, %314
%51 = phi double [ %12, %8 ], [ %318, %314 ]
%52 = phi i32 [ 0, %8 ], [ %320, %314 ]
%53 = call i32 @memset(double** %4, i32 0, i32 3360)
br i1 %24, label %54, label %56
54: ; preds = %50
%55 = icmp eq i32 %52, 0
br label %57
56: ; preds = %114, %50
store double 1.000000e+00, double* %6
store double %29, double* %7
br label %123
57: ; preds = %54, %114
%58 = phi i32 [ 1, %54 ], [ %121, %114 ]
br i1 %31, label %89, label %59
59: ; preds = %57, %84
%60 = phi i32 [ %85, %84 ], [ 0, %57 ]
%61 = phi i32 [ %86, %84 ], [ 0, %57 ]
%62 = phi i64 [ %87, %84 ], [ 0, %57 ]
%63 = shl nuw i32 1, %61
%64 = and i32 %63, %58
%65 = icmp eq i32 %64, 0
br i1 %65, label %72, label %66
66: ; preds = %59
%67 = trunc i32 %61 to i8
%68 = or i8 %67, 1
%69 = add nsw i32 %60, 1
%70 = sext i32 %60 to i64
%71 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %70
store i8 %68, i8* %71
br label %72
72: ; preds = %59, %66
%73 = phi i32 [ %69, %66 ], [ %60, %59 ]
%74 = or i32 %61, 1
%75 = shl nuw i32 1, %74
%76 = and i32 %75, %58
%77 = icmp eq i32 %76, 0
br i1 %77, label %84, label %78
78: ; preds = %72
%79 = trunc i32 %74 to i8
%80 = add nuw nsw i8 %79, 1
%81 = add nsw i32 %73, 1
%82 = sext i32 %73 to i64
%83 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %82
store i8 %80, i8* %83
br label %84
84: ; preds = %78, %72
%85 = phi i32 [ %81, %78 ], [ %73, %72 ]
%86 = add nuw nsw i32 %61, 2
%87 = add nuw nsw i64 %62, 2
%88 = icmp eq i64 %87, %32
br i1 %88, label %89, label %59
89: ; preds = %84, %57
%90 = phi i32 [ undef, %57 ], [ %85, %84 ]
%91 = phi i32 [ 0, %57 ], [ %85, %84 ]
%92 = phi i32 [ 0, %57 ], [ %86, %84 ]
br i1 %33, label %103, label %93
93: ; preds = %89
%94 = shl nuw i32 1, %92
%95 = and i32 %94, %58
%96 = icmp eq i32 %95, 0
br i1 %96, label %103, label %97
97: ; preds = %93
%98 = trunc i32 %92 to i8
%99 = add i8 %98, 1
%100 = add nsw i32 %91, 1
%101 = sext i32 %91 to i64
%102 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %101
store i8 %99, i8* %102
br label %103
103: ; preds = %93, %97, %89
%104 = phi i32 [ %90, %89 ], [ %100, %97 ], [ %91, %93 ]
br i1 %55, label %105, label %110
105: ; preds = %103
%106 = add nsw i32 %104, -1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %107
%109 = load i8, i8* %108
br label %114
110: ; preds = %103
%111 = call signext i8 @r(i32 %104, i8* %5, i32 %52)
%112 = add nsw i32 %104, -1
%113 = sext i32 %112 to i64
br label %114
114: ; preds = %110, %105
%115 = phi i64 [ %113, %110 ], [ %107, %105 ]
%116 = phi i8 [ %111, %110 ], [ %109, %105 ]
%117 = sitofp i8 %116 to double
%118 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %115, i64 %10
%119 = load double, double* %118
%120 = fadd double %119, %117
store double %120, double* %118
%121 = add nuw nsw i32 %58, 1
%122 = icmp eq i32 %121, %23
br i1 %122, label %56, label %57
123: ; preds = %56, %143
%124 = phi i64 [ 1, %56 ], [ %144, %143 ]
%125 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %124, i64 %124
store double 1.000000e+00, double* %125
%126 = trunc i64 %124 to i32
%127 = sitofp i32 %126 to double
%128 = fdiv double %127, %26
%129 = fadd double %128, -1.000000e+00
%130 = add nsw i64 %124, -1
%131 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %124, i64 %130
store double %129, double* %131
%132 = icmp ult i64 %124, %25
br i1 %132, label %135, label %133
133: ; preds = %123
%134 = add nuw nsw i64 %124, 1
br label %143
135: ; preds = %123
%136 = trunc i64 %124 to i32
%137 = sitofp i32 %136 to double
%138 = fadd double %137, 2.000000e+00
%139 = fneg double %138
%140 = fdiv double %139, %26
%141 = add nuw nsw i64 %124, 1
%142 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %124, i64 %141
store double %140, double* %142
br label %143
143: ; preds = %133, %135
%144 = phi i64 [ %134, %133 ], [ %141, %135 ]
%145 = icmp eq i64 %144, %10
br i1 %145, label %149, label %123
146: ; preds = %306, %234
%147 = add nuw nsw i64 %151, 1
%148 = icmp eq i64 %154, %10
br i1 %148, label %314, label %149
149: ; preds = %143, %146
%150 = phi i64 [ %154, %146 ], [ 0, %143 ]
%151 = phi i64 [ %147, %146 ], [ 1, %143 ]
%152 = getelementptr [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 0
%153 = getelementptr [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %11
%154 = add nuw nsw i64 %150, 1
%155 = icmp ult i64 %154, %10
%156 = trunc i64 %150 to i32
br i1 %155, label %157, label %172
157: ; preds = %149, %157
%158 = phi i64 [ %170, %157 ], [ %151, %149 ]
%159 = phi i32 [ %169, %157 ], [ %156, %149 ]
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %160, i64 %150
%162 = load double, double* %161
%163 = call i32 @fabs(double %162)
%164 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %158, i64 %150
%165 = load double, double* %164
%166 = call i32 @fabs(double %165)
%167 = icmp slt i32 %163, %166
%168 = trunc i64 %158 to i32
%169 = select i1 %167, i32 %168, i32 %159
%170 = add nuw nsw i64 %158, 1
%171 = icmp ult i64 %170, %10
br i1 %171, label %157, label %172
172: ; preds = %157, %149
%173 = phi i32 [ %156, %149 ], [ %169, %157 ]
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 %150
%176 = load double, double* %175
%177 = call i32 @fabs(double %176)
%178 = icmp slt i32 %177, 1
br i1 %178, label %309, label %179
179: ; preds = %172
br i1 %34, label %223, label %180
180: ; preds = %179
%181 = getelementptr [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 0
%182 = mul nsw i64 %174, 21
%183 = getelementptr double, double* %21, i64 %182
%184 = icmp ult double* %152, %183
%185 = icmp ult double* %181, %153
%186 = and i1 %184, %185
br i1 %186, label %223, label %187
187: ; preds = %180
br i1 %37, label %211, label %188
188: ; preds = %187, %188
%189 = phi i64 [ %208, %188 ], [ 0, %187 ]
%190 = phi i64 [ %209, %188 ], [ 0, %187 ]
%191 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %189
%192 = bitcast double* %191 to <2 x double>*
%193 = load <2 x double>, <2 x double>* %192
%194 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 %189
%195 = bitcast double* %194 to <2 x double>*
%196 = load <2 x double>, <2 x double>* %195
%197 = bitcast double* %191 to <2 x double>*
store <2 x double> %196, <2 x double>* %197
%198 = bitcast double* %194 to <2 x double>*
store <2 x double> %193, <2 x double>* %198
%199 = or i64 %189, 2
%200 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %199
%201 = bitcast double* %200 to <2 x double>*
%202 = load <2 x double>, <2 x double>* %201
%203 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 %199
%204 = bitcast double* %203 to <2 x double>*
%205 = load <2 x double>, <2 x double>* %204
%206 = bitcast double* %200 to <2 x double>*
store <2 x double> %205, <2 x double>* %206
%207 = bitcast double* %203 to <2 x double>*
store <2 x double> %202, <2 x double>* %207
%208 = add nuw i64 %189, 4
%209 = add nuw i64 %190, 2
%210 = icmp eq i64 %209, %38
br i1 %210, label %211, label %188
211: ; preds = %188, %187
%212 = phi i64 [ 0, %187 ], [ %208, %188 ]
br i1 %39, label %222, label %213
213: ; preds = %211
%214 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %212
%215 = bitcast double* %214 to <2 x double>*
%216 = load <2 x double>, <2 x double>* %215
%217 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 %212
%218 = bitcast double* %217 to <2 x double>*
%219 = load <2 x double>, <2 x double>* %218
%220 = bitcast double* %214 to <2 x double>*
store <2 x double> %219, <2 x double>* %220
%221 = bitcast double* %217 to <2 x double>*
store <2 x double> %216, <2 x double>* %221
br label %222
222: ; preds = %211, %213
br i1 %40, label %234, label %223
223: ; preds = %180, %179, %222
%224 = phi i64 [ 0, %180 ], [ 0, %179 ], [ %35, %222 ]
br i1 %42, label %231, label %225
225: ; preds = %223
%226 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %224
%227 = load double, double* %226
%228 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 %224
%229 = load double, double* %228
store double %229, double* %226
store double %227, double* %228
%230 = or i64 %224, 1
br label %231
231: ; preds = %225, %223
%232 = phi i64 [ %224, %223 ], [ %230, %225 ]
%233 = icmp eq i64 %10, %224
br i1 %233, label %234, label %237
234: ; preds = %231, %237, %222
br i1 %155, label %235, label %146
235: ; preds = %234
%236 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %150
br label %250
237: ; preds = %231, %237
%238 = phi i64 [ %248, %237 ], [ %232, %231 ]
%239 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %238
%240 = load double, double* %239
%241 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 %238
%242 = load double, double* %241
store double %242, double* %239
store double %240, double* %241
%243 = add nuw nsw i64 %238, 1
%244 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %243
%245 = load double, double* %244
%246 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %174, i64 %243
%247 = load double, double* %246
store double %247, double* %244
store double %245, double* %246
%248 = add nuw nsw i64 %238, 2
%249 = icmp eq i64 %248, %11
br i1 %249, label %234, label %237
250: ; preds = %235, %306
%251 = phi i64 [ %151, %235 ], [ %307, %306 ]
%252 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %251, i64 %150
%253 = load double, double* %252
%254 = load double, double* %236
%255 = fneg double %253
%256 = fdiv double %255, %254
br i1 %43, label %295, label %257
257: ; preds = %250
%258 = insertelement <2 x double> poison, double %256, i64 0
%259 = shufflevector <2 x double> %258, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %46, label %283, label %260
260: ; preds = %257, %260
%261 = phi i64 [ %280, %260 ], [ 0, %257 ]
%262 = phi i64 [ %281, %260 ], [ 0, %257 ]
%263 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %261
%264 = bitcast double* %263 to <2 x double>*
%265 = load <2 x double>, <2 x double>* %264
%266 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %251, i64 %261
%267 = bitcast double* %266 to <2 x double>*
%268 = load <2 x double>, <2 x double>* %267
%269 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %259, <2 x double> %265, <2 x double> %268)
%270 = bitcast double* %266 to <2 x double>*
store <2 x double> %269, <2 x double>* %270
%271 = or i64 %261, 2
%272 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %271
%273 = bitcast double* %272 to <2 x double>*
%274 = load <2 x double>, <2 x double>* %273
%275 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %251, i64 %271
%276 = bitcast double* %275 to <2 x double>*
%277 = load <2 x double>, <2 x double>* %276
%278 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %259, <2 x double> %274, <2 x double> %277)
%279 = bitcast double* %275 to <2 x double>*
store <2 x double> %278, <2 x double>* %279
%280 = add nuw i64 %261, 4
%281 = add nuw i64 %262, 2
%282 = icmp eq i64 %281, %47
br i1 %282, label %283, label %260
283: ; preds = %260, %257
%284 = phi i64 [ 0, %257 ], [ %280, %260 ]
br i1 %48, label %294, label %285
285: ; preds = %283
%286 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %284
%287 = bitcast double* %286 to <2 x double>*
%288 = load <2 x double>, <2 x double>* %287
%289 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %251, i64 %284
%290 = bitcast double* %289 to <2 x double>*
%291 = load <2 x double>, <2 x double>* %290
%292 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %259, <2 x double> %288, <2 x double> %291)
%293 = bitcast double* %289 to <2 x double>*
store <2 x double> %292, <2 x double>* %293
br label %294
294: ; preds = %283, %285
br i1 %49, label %306, label %295
295: ; preds = %250, %294
%296 = phi i64 [ 0, %250 ], [ %44, %294 ]
br label %297
297: ; preds = %295, %297
%298 = phi i64 [ %304, %297 ], [ %296, %295 ]
%299 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %150, i64 %298
%300 = load double, double* %299
%301 = getelementptr inbounds [20 x [21 x double]], [20 x [21 x double]]* %1, i64 0, i64 %251, i64 %298
%302 = load double, double* %301
%303 = call double @llvm.fmuladd.f64(double %256, double %300, double %302)
store double %303, double* %301
%304 = add nuw nsw i64 %298, 1
%305 = icmp eq i64 %304, %11
br i1 %305, label %306, label %297
306: ; preds = %297, %294
%307 = add nuw nsw i64 %251, 1
%308 = icmp ult i64 %307, %10
br i1 %308, label %250, label %146
309: ; preds = %172
%310 = trunc i64 %10 to i32
%311 = trunc i64 %150 to i32
%312 = sitofp i32 %311 to double
%313 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %312, i32 %310)
br label %329
314: ; preds = %146
%315 = load double, double* %27
%316 = load double, double* %28
%317 = fdiv double %315, %316
%318 = fadd double %51, %317
%319 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %26, i32 %52, double %317)
%320 = add nuw nsw i32 %52, 1
%321 = icmp eq i32 %320, 21
br i1 %321, label %322, label %50
322: ; preds = %314
%323 = add nuw nsw i64 %10, 1
%324 = add nuw nsw i64 %11, 1
%325 = icmp eq i64 %323, 21
%326 = add i64 %9, 1
br i1 %325, label %327, label %8
327: ; preds = %322
%328 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %318)
br label %329
329: ; preds = %327, %309
%330 = phi i32 [ 1, %309 ], [ 0, %327 ]
ret i32 %330
}