#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double **dmatrix(int, int, int, int);
int /*<<< orphan*/ free_dmatrix(double **, int, int, int, int);
void xtAx(double **A, double **X, double **C, int N, int J) {
  double **AX;
  int i, j, k;
  AX = dmatrix(1, N, 1, J);
  for (i = 1; i <= J; i++)
    for (j = 1; j <= J; j++)
      C[i][j] = 0.0;
  for (i = 1; i <= N; i++)
    for (j = 1; j <= J; j++)
      AX[i][j] = 0.0;
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= J; j++) {
      for (k = 1; k <= N; k++) {
        if (i <= k)
          AX[i][j] += A[i][k] * X[k][j];
        else
          AX[i][j] += A[k][i] * X[k][j];
      }
    }
  }
  for (i = 1; i <= J; i++)
    for (j = 1; j <= J; j++)
      for (k = 1; k <= N; k++)
        C[i][j] += X[k][i] * AX[k][j];
  for (i = 1; i <= J; i++)
    for (j = i; j <= J; j++)
      C[i][j] = C[j][i] = 0.5 * (C[i][j] + C[j][i]);
  free_dmatrix(AX, 1, N, 1, J);
  return;
}


x86 assembly (clang, -O0):
<xtAx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%ecx
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <dmatrix@plt>
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     11b0 <xtAx+0x90>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     119d <xtAx+0x7d>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    116b <xtAx+0x4b>
jmp    11a2 <xtAx+0x82>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1158 <xtAx+0x38>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     120f <xtAx+0xef>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     11fc <xtAx+0xdc>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ca <xtAx+0xaa>
jmp    1201 <xtAx+0xe1>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b7 <xtAx+0x97>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     132a <xtAx+0x20a>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1317 <xtAx+0x1f7>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1304 <xtAx+0x1e4>
mov    -0x2c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     12a5 <xtAx+0x185>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    12f1 <xtAx+0x1d1>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    12f6 <xtAx+0x1d6>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    123c <xtAx+0x11c>
jmp    1309 <xtAx+0x1e9>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1229 <xtAx+0x109>
jmp    131c <xtAx+0x1fc>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1216 <xtAx+0xf6>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     13e3 <xtAx+0x2c3>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     13d0 <xtAx+0x2b0>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     13bd <xtAx+0x29d>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1357 <xtAx+0x237>
jmp    13c2 <xtAx+0x2a2>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1344 <xtAx+0x224>
jmp    13d5 <xtAx+0x2b5>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1331 <xtAx+0x211>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1489 <xtAx+0x369>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1476 <xtAx+0x356>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xbc6(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13fc <xtAx+0x2dc>
jmp    147b <xtAx+0x35b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13ea <xtAx+0x2ca>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%r8d
mov    $0x1,%ecx
mov    %ecx,%esi
call   1040 <free_dmatrix@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtAx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8d,%ebp
mov    %ecx,%r12d
mov    %rdx,0x20(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x1,%edi
mov    %ecx,%esi
mov    $0x1,%edx
mov    %r8d,%ecx
call   1040 <dmatrix@plt>
mov    %rax,%r13
mov    %ebp,%eax
mov    %rax,0x10(%rsp)
mov    %rbp,0x28(%rsp)
test   %ebp,%ebp
jle    12c2 <xtAx+0x192>
mov    0x10(%rsp),%rcx
lea    0x0(,%rcx,8),%rax
mov    %rax,0x8(%rsp)
lea    -0x1(%rcx),%rax
mov    %ecx,%r15d
and    $0x7,%r15d
mov    $0x1,%ebp
cmp    $0x7,%rax
jb     1280 <xtAx+0x150>
mov    %r15,0x30(%rsp)
mov    0x10(%rsp),%rax
and    $0xfffffff8,%eax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
mov    0x20(%rsp),%r15
nop
mov    0x8(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x10(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x18(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x20(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x28(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x30(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x38(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x40(%r15,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
add    $0x8,%rbp
cmp    %rbp,0x18(%rsp)
jne    11c0 <xtAx+0x90>
add    $0x1,%rbp
mov    0x30(%rsp),%r15
test   %r15,%r15
je     12c2 <xtAx+0x192>
mov    0x20(%rsp),%rax
lea    (%rax,%rbp,8),%rax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x18(%rsp),%rax
mov    (%rax,%rbp,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    12a0 <xtAx+0x170>
test   %r12d,%r12d
mov    0x28(%rsp),%r8
mov    0x20(%rsp),%r15
jle    147a <xtAx+0x34a>
shlq   $0x3,0x10(%rsp)
mov    %r12d,%ebp
lea    -0x1(%rbp),%rax
mov    %ebp,%ecx
and    $0x3,%ecx
mov    %rcx,0x8(%rsp)
mov    $0x1,%r15d
cmp    $0x3,%rax
jb     1384 <xtAx+0x254>
mov    %ebp,%eax
and    $0xfffffffc,%eax
mov    %rax,0x18(%rsp)
xor    %r15d,%r15d
jmp    131b <xtAx+0x1eb>
nopl   0x0(%rax,%rax,1)
add    $0x4,%r15
cmp    %r15,0x18(%rsp)
je     1380 <xtAx+0x250>
test   %r8d,%r8d
jle    1310 <xtAx+0x1e0>
mov    0x8(%r13,%r15,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x10(%rsp),%rdx
mov    %rdx,0x10(%rsp)
call   1030 <memset@plt>
mov    0x10(%r13,%r15,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x10(%rsp),%rdx
call   1030 <memset@plt>
mov    0x18(%r13,%r15,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x10(%rsp),%rdx
call   1030 <memset@plt>
mov    0x20(%r13,%r15,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x10(%rsp),%rdx
call   1030 <memset@plt>
mov    0x28(%rsp),%r8
jmp    1310 <xtAx+0x1e0>
add    $0x1,%r15
cmpq   $0x0,0x8(%rsp)
je     13e0 <xtAx+0x2b0>
lea    0x0(,%r15,8),%rax
add    %r13,%rax
mov    %rax,0x18(%rsp)
xor    %r15d,%r15d
jmp    13bb <xtAx+0x28b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,0x8(%rsp)
je     13e0 <xtAx+0x2b0>
test   %r8d,%r8d
jle    13b0 <xtAx+0x280>
mov    0x18(%rsp),%rax
mov    (%rax,%r15,8),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    0x10(%rsp),%rdx
call   1030 <memset@plt>
mov    0x28(%rsp),%r8
jmp    13b0 <xtAx+0x280>
test   %r12d,%r12d
mov    0x20(%rsp),%r15
jle    147a <xtAx+0x34a>
add    $0x1,%rbp
lea    0x1(%r12),%r9d
lea    0x1(%r8),%ecx
mov    $0x1,%edx
jmp    1419 <xtAx+0x2e9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdx
cmp    %r9,%rdx
je     147a <xtAx+0x34a>
test   %r8d,%r8d
jle    1410 <xtAx+0x2e0>
mov    $0x1,%esi
jmp    1439 <xtAx+0x309>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rsi
cmp    %rcx,%rsi
je     1410 <xtAx+0x2e0>
mov    $0x1,%edi
jmp    146a <xtAx+0x33a>
mov    (%r14,%rdi,8),%rax
movsd  (%rax,%rdx,8),%xmm0
mov    (%rbx,%rdi,8),%rax
mulsd  (%rax,%rsi,8),%xmm0
mov    0x0(%r13,%rdx,8),%rax
addsd  (%rax,%rsi,8),%xmm0
movsd  %xmm0,(%rax,%rsi,8)
add    $0x1,%rdi
cmp    %rdi,%rbp
je     1430 <xtAx+0x300>
cmp    %rdi,%rdx
ja     1440 <xtAx+0x310>
mov    (%r14,%rdx,8),%rax
movsd  (%rax,%rdi,8),%xmm0
jmp    1449 <xtAx+0x319>
test   %r8d,%r8d
jle    1617 <xtAx+0x4e7>
lea    0x1(%r12),%r11d
lea    0x1(%r8),%r10d
lea    -0x1(%r11),%r9
mov    %r9,%rsi
and    $0xfffffffffffffffe,%rsi
neg    %rsi
mov    $0x1,%edi
jmp    14bd <xtAx+0x38d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdi
cmp    %r10,%rdi
je     1576 <xtAx+0x446>
mov    $0x1,%ebp
jmp    14d9 <xtAx+0x3a9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbp
cmp    %r10,%rbp
je     14b0 <xtAx+0x380>
test   %r12d,%r12d
jle    14d0 <xtAx+0x3a0>
mov    (%r15,%rdi,8),%rcx
movsd  (%rcx,%rbp,8),%xmm0
mov    $0x1,%edx
cmp    $0x2,%r11d
je     154b <xtAx+0x41b>
mov    $0x1,%edx
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rdx,8),%rax
movsd  (%rax,%rdi,8),%xmm1
mov    0x0(%r13,%rdx,8),%rax
mulsd  (%rax,%rbp,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx,%rbp,8)
mov    0x8(%rbx,%rdx,8),%rax
movsd  (%rax,%rdi,8),%xmm0
mov    0x8(%r13,%rdx,8),%rax
mulsd  (%rax,%rbp,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rcx,%rbp,8)
lea    (%rsi,%rdx,1),%rax
add    $0x2,%rax
add    $0x2,%rdx
cmp    $0x1,%rax
jne    1500 <xtAx+0x3d0>
test   $0x1,%r9b
je     14d0 <xtAx+0x3a0>
mov    (%rbx,%rdx,8),%rax
movsd  (%rax,%rdi,8),%xmm1
mov    0x0(%r13,%rdx,8),%rax
mulsd  (%rax,%rbp,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx,%rbp,8)
jmp    14d0 <xtAx+0x3a0>
test   %r8d,%r8d
jle    1617 <xtAx+0x4e7>
mov    $0x1,%edi
xor    %ecx,%ecx
movsd  0xa72(%rip),%xmm0
mov    %r15,%rdx
mov    %r10,%rsi
jmp    15b4 <xtAx+0x484>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffffffffffff,%rsi
add    $0x1,%rcx
add    $0x8,%rdx
mov    %r9,%rdi
cmp    %r10,%r9
je     1617 <xtAx+0x4e7>
mov    (%r15,%rdi,8),%rbp
movsd  0x0(%rbp,%rdi,8),%xmm1
addsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%rbp,%rdi,8)
lea    0x1(%rdi),%r9
cmp    %r10,%r9
je     15a0 <xtAx+0x470>
lea    0x0(,%rcx,8),%rbx
add    %rbp,%rbx
mov    $0x2,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rdx,%rbp,8),%rax
movsd  (%rbx,%rbp,8),%xmm1
addsd  (%rax,%rdi,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rax,%rdi,8)
movsd  %xmm1,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rsi
jne    15f0 <xtAx+0x4c0>
jmp    15a0 <xtAx+0x470>
mov    %r13,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    $0x1,%ecx
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <free_dmatrix@plt>

LLVM IR (-O0):
define void @xtAx(double** %0, double** %1, double** %2, i32 %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca double**
%9 = alloca i32
%10 = alloca i32
%11 = alloca double**
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store double** %2, double*** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call double** @dmatrix(i32 1, i32 %15, i32 1, i32 %16)
store double** %17, double*** %11
store i32 1, i32* %12
br label %18
18: ; preds = %40, %5
%19 = load i32, i32* %12
%20 = load i32, i32* %10
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %43
22: ; preds = %18
store i32 1, i32* %13
br label %23
23: ; preds = %36, %22
%24 = load i32, i32* %13
%25 = load i32, i32* %10
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = load double**, double*** %8
%29 = load i32, i32* %12
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double*, double** %28, i64 %30
%32 = load double*, double** %31
%33 = load i32, i32* %13
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
store double 0.000000e+00, double* %35
br label %36
36: ; preds = %27
%37 = load i32, i32* %13
%38 = add nsw i32 %37, 1
store i32 %38, i32* %13
br label %23
39: ; preds = %23
br label %40
40: ; preds = %39
%41 = load i32, i32* %12
%42 = add nsw i32 %41, 1
store i32 %42, i32* %12
br label %18
43: ; preds = %18
store i32 1, i32* %12
br label %44
44: ; preds = %66, %43
%45 = load i32, i32* %12
%46 = load i32, i32* %9
%47 = icmp sle i32 %45, %46
br i1 %47, label %48, label %69
48: ; preds = %44
store i32 1, i32* %13
br label %49
49: ; preds = %62, %48
%50 = load i32, i32* %13
%51 = load i32, i32* %10
%52 = icmp sle i32 %50, %51
br i1 %52, label %53, label %65
53: ; preds = %49
%54 = load double**, double*** %11
%55 = load i32, i32* %12
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double*, double** %54, i64 %56
%58 = load double*, double** %57
%59 = load i32, i32* %13
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
store double 0.000000e+00, double* %61
br label %62
62: ; preds = %53
%63 = load i32, i32* %13
%64 = add nsw i32 %63, 1
store i32 %64, i32* %13
br label %49
65: ; preds = %49
br label %66
66: ; preds = %65
%67 = load i32, i32* %12
%68 = add nsw i32 %67, 1
store i32 %68, i32* %12
br label %44
69: ; preds = %44
store i32 1, i32* %12
br label %70
70: ; preds = %155, %69
%71 = load i32, i32* %12
%72 = load i32, i32* %9
%73 = icmp sle i32 %71, %72
br i1 %73, label %74, label %158
74: ; preds = %70
store i32 1, i32* %13
br label %75
75: ; preds = %151, %74
%76 = load i32, i32* %13
%77 = load i32, i32* %10
%78 = icmp sle i32 %76, %77
br i1 %78, label %79, label %154
79: ; preds = %75
store i32 1, i32* %14
br label %80
80: ; preds = %147, %79
%81 = load i32, i32* %14
%82 = load i32, i32* %9
%83 = icmp sle i32 %81, %82
br i1 %83, label %84, label %150
84: ; preds = %80
%85 = load i32, i32* %12
%86 = load i32, i32* %14
%87 = icmp sle i32 %85, %86
br i1 %87, label %88, label %117
88: ; preds = %84
%89 = load double**, double*** %6
%90 = load i32, i32* %12
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double*, double** %89, i64 %91
%93 = load double*, double** %92
%94 = load i32, i32* %14
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
%97 = load double, double* %96
%98 = load double**, double*** %7
%99 = load i32, i32* %14
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double*, double** %98, i64 %100
%102 = load double*, double** %101
%103 = load i32, i32* %13
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
%106 = load double, double* %105
%107 = load double**, double*** %11
%108 = load i32, i32* %12
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double*, double** %107, i64 %109
%111 = load double*, double** %110
%112 = load i32, i32* %13
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %111, i64 %113
%115 = load double, double* %114
%116 = call double @llvm.fmuladd.f64(double %97, double %106, double %115)
store double %116, double* %114
br label %146
117: ; preds = %84
%118 = load double**, double*** %6
%119 = load i32, i32* %14
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double*, double** %118, i64 %120
%122 = load double*, double** %121
%123 = load i32, i32* %12
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
%126 = load double, double* %125
%127 = load double**, double*** %7
%128 = load i32, i32* %14
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double*, double** %127, i64 %129
%131 = load double*, double** %130
%132 = load i32, i32* %13
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
%135 = load double, double* %134
%136 = load double**, double*** %11
%137 = load i32, i32* %12
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double*, double** %136, i64 %138
%140 = load double*, double** %139
%141 = load i32, i32* %13
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = call double @llvm.fmuladd.f64(double %126, double %135, double %144)
store double %145, double* %143
br label %146
146: ; preds = %117, %88
br label %147
147: ; preds = %146
%148 = load i32, i32* %14
%149 = add nsw i32 %148, 1
store i32 %149, i32* %14
br label %80
150: ; preds = %80
br label %151
151: ; preds = %150
%152 = load i32, i32* %13
%153 = add nsw i32 %152, 1
store i32 %153, i32* %13
br label %75
154: ; preds = %75
br label %155
155: ; preds = %154
%156 = load i32, i32* %12
%157 = add nsw i32 %156, 1
store i32 %157, i32* %12
br label %70
158: ; preds = %70
store i32 1, i32* %12
br label %159
159: ; preds = %210, %158
%160 = load i32, i32* %12
%161 = load i32, i32* %10
%162 = icmp sle i32 %160, %161
br i1 %162, label %163, label %213
163: ; preds = %159
store i32 1, i32* %13
br label %164
164: ; preds = %206, %163
%165 = load i32, i32* %13
%166 = load i32, i32* %10
%167 = icmp sle i32 %165, %166
br i1 %167, label %168, label %209
168: ; preds = %164
store i32 1, i32* %14
br label %169
169: ; preds = %202, %168
%170 = load i32, i32* %14
%171 = load i32, i32* %9
%172 = icmp sle i32 %170, %171
br i1 %172, label %173, label %205
173: ; preds = %169
%174 = load double**, double*** %7
%175 = load i32, i32* %14
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double*, double** %174, i64 %176
%178 = load double*, double** %177
%179 = load i32, i32* %12
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %178, i64 %180
%182 = load double, double* %181
%183 = load double**, double*** %11
%184 = load i32, i32* %14
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds double*, double** %183, i64 %185
%187 = load double*, double** %186
%188 = load i32, i32* %13
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
%191 = load double, double* %190
%192 = load double**, double*** %8
%193 = load i32, i32* %12
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double*, double** %192, i64 %194
%196 = load double*, double** %195
%197 = load i32, i32* %13
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %196, i64 %198
%200 = load double, double* %199
%201 = call double @llvm.fmuladd.f64(double %182, double %191, double %200)
store double %201, double* %199
br label %202
202: ; preds = %173
%203 = load i32, i32* %14
%204 = add nsw i32 %203, 1
store i32 %204, i32* %14
br label %169
205: ; preds = %169
br label %206
206: ; preds = %205
%207 = load i32, i32* %13
%208 = add nsw i32 %207, 1
store i32 %208, i32* %13
br label %164
209: ; preds = %164
br label %210
210: ; preds = %209
%211 = load i32, i32* %12
%212 = add nsw i32 %211, 1
store i32 %212, i32* %12
br label %159
213: ; preds = %159
store i32 1, i32* %12
br label %214
214: ; preds = %265, %213
%215 = load i32, i32* %12
%216 = load i32, i32* %10
%217 = icmp sle i32 %215, %216
br i1 %217, label %218, label %268
218: ; preds = %214
%219 = load i32, i32* %12
store i32 %219, i32* %13
br label %220
220: ; preds = %261, %218
%221 = load i32, i32* %13
%222 = load i32, i32* %10
%223 = icmp sle i32 %221, %222
br i1 %223, label %224, label %264
224: ; preds = %220
%225 = load double**, double*** %8
%226 = load i32, i32* %12
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double*, double** %225, i64 %227
%229 = load double*, double** %228
%230 = load i32, i32* %13
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %229, i64 %231
%233 = load double, double* %232
%234 = load double**, double*** %8
%235 = load i32, i32* %13
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds double*, double** %234, i64 %236
%238 = load double*, double** %237
%239 = load i32, i32* %12
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds double, double* %238, i64 %240
%242 = load double, double* %241
%243 = fadd double %233, %242
%244 = fmul double 5.000000e-01, %243
%245 = load double**, double*** %8
%246 = load i32, i32* %13
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds double*, double** %245, i64 %247
%249 = load double*, double** %248
%250 = load i32, i32* %12
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds double, double* %249, i64 %251
store double %244, double* %252
%253 = load double**, double*** %8
%254 = load i32, i32* %12
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds double*, double** %253, i64 %255
%257 = load double*, double** %256
%258 = load i32, i32* %13
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds double, double* %257, i64 %259
store double %244, double* %260
br label %261
261: ; preds = %224
%262 = load i32, i32* %13
%263 = add nsw i32 %262, 1
store i32 %263, i32* %13
br label %220
264: ; preds = %220
br label %265
265: ; preds = %264
%266 = load i32, i32* %12
%267 = add nsw i32 %266, 1
store i32 %267, i32* %12
br label %214
268: ; preds = %214
%269 = load double**, double*** %11
%270 = load i32, i32* %9
%271 = load i32, i32* %10
%272 = call i32 @free_dmatrix(double** %269, i32 1, i32 %270, i32 1, i32 %271)
ret void
}

LLVM IR (-O2):
define void @xtAx(double** nocapture %0, double** nocapture %1, double** nocapture %2, i32 %3, i32 %4) {
%6 = tail call double** @dmatrix(i32 1, i32 %3, i32 1, i32 %4)
%7 = icmp slt i32 %4, 1
br i1 %7, label %32, label %8
8: ; preds = %5
%9 = zext i32 %4 to i64
%10 = shl nuw nsw i64 %9, 3
%11 = add nuw i32 %4, 1
%12 = zext i32 %11 to i64
%13 = add nsw i64 %12, -1
%14 = add nsw i64 %12, -2
%15 = and i64 %13, 7
%16 = icmp ult i64 %14, 7
br i1 %16, label %19, label %17
17: ; preds = %8
%18 = and i64 %13, -8
br label %45
19: ; preds = %45, %8
%20 = phi i64 [ 1, %8 ], [ %87, %45 ]
%21 = icmp eq i64 %15, 0
br i1 %21, label %32, label %22
22: ; preds = %19, %22
%23 = phi i64 [ %29, %22 ], [ %20, %19 ]
%24 = phi i64 [ %30, %22 ], [ 0, %19 ]
%25 = getelementptr inbounds double*, double** %2, i64 %23
%26 = load double*, double** %25
%27 = getelementptr double, double* %26, i64 1
%28 = bitcast double* %27 to i8*
%29 = add nuw nsw i64 %23, 1
%30 = add i64 %24, 1
%31 = icmp eq i64 %30, %15
br i1 %31, label %32, label %22
32: ; preds = %19, %22, %5
%33 = icmp slt i32 %3, 1
br i1 %33, label %143, label %34
34: ; preds = %32
%35 = zext i32 %4 to i64
%36 = shl nuw nsw i64 %35, 3
%37 = add nuw i32 %3, 1
%38 = zext i32 %37 to i64
%39 = add nsw i64 %38, -1
%40 = add nsw i64 %38, -2
%41 = and i64 %39, 3
%42 = icmp ult i64 %40, 3
br i1 %42, label %113, label %43
43: ; preds = %34
%44 = and i64 %39, -4
br label %90
45: ; preds = %45, %17
%46 = phi i64 [ 1, %17 ], [ %87, %45 ]
%47 = phi i64 [ 0, %17 ], [ %88, %45 ]
%48 = getelementptr inbounds double*, double** %2, i64 %46
%49 = load double*, double** %48
%50 = getelementptr double, double* %49, i64 1
%51 = bitcast double* %50 to i8*
%52 = add nuw nsw i64 %46, 1
%53 = getelementptr inbounds double*, double** %2, i64 %52
%54 = load double*, double** %53
%55 = getelementptr double, double* %54, i64 1
%56 = bitcast double* %55 to i8*
%57 = add nuw nsw i64 %46, 2
%58 = getelementptr inbounds double*, double** %2, i64 %57
%59 = load double*, double** %58
%60 = getelementptr double, double* %59, i64 1
%61 = bitcast double* %60 to i8*
%62 = add nuw nsw i64 %46, 3
%63 = getelementptr inbounds double*, double** %2, i64 %62
%64 = load double*, double** %63
%65 = getelementptr double, double* %64, i64 1
%66 = bitcast double* %65 to i8*
%67 = add nuw nsw i64 %46, 4
%68 = getelementptr inbounds double*, double** %2, i64 %67
%69 = load double*, double** %68
%70 = getelementptr double, double* %69, i64 1
%71 = bitcast double* %70 to i8*
%72 = add nuw nsw i64 %46, 5
%73 = getelementptr inbounds double*, double** %2, i64 %72
%74 = load double*, double** %73
%75 = getelementptr double, double* %74, i64 1
%76 = bitcast double* %75 to i8*
%77 = add nuw nsw i64 %46, 6
%78 = getelementptr inbounds double*, double** %2, i64 %77
%79 = load double*, double** %78
%80 = getelementptr double, double* %79, i64 1
%81 = bitcast double* %80 to i8*
%82 = add nuw nsw i64 %46, 7
%83 = getelementptr inbounds double*, double** %2, i64 %82
%84 = load double*, double** %83
%85 = getelementptr double, double* %84, i64 1
%86 = bitcast double* %85 to i8*
%87 = add nuw nsw i64 %46, 8
%88 = add i64 %47, 8
%89 = icmp eq i64 %88, %18
br i1 %89, label %19, label %45
90: ; preds = %134, %43
%91 = phi i64 [ 1, %43 ], [ %135, %134 ]
%92 = phi i64 [ 0, %43 ], [ %136, %134 ]
br i1 %7, label %134, label %93
93: ; preds = %90
%94 = getelementptr inbounds double*, double** %6, i64 %91
%95 = load double*, double** %94
%96 = getelementptr double, double* %95, i64 1
%97 = bitcast double* %96 to i8*
%98 = add nuw nsw i64 %91, 1
%99 = getelementptr inbounds double*, double** %6, i64 %98
%100 = load double*, double** %99
%101 = getelementptr double, double* %100, i64 1
%102 = bitcast double* %101 to i8*
%103 = add nuw nsw i64 %91, 2
%104 = getelementptr inbounds double*, double** %6, i64 %103
%105 = load double*, double** %104
%106 = getelementptr double, double* %105, i64 1
%107 = bitcast double* %106 to i8*
%108 = add nuw nsw i64 %91, 3
%109 = getelementptr inbounds double*, double** %6, i64 %108
%110 = load double*, double** %109
%111 = getelementptr double, double* %110, i64 1
%112 = bitcast double* %111 to i8*
br label %134
113: ; preds = %134, %34
%114 = phi i64 [ 1, %34 ], [ %135, %134 ]
%115 = icmp eq i64 %41, 0
br i1 %115, label %128, label %116
116: ; preds = %113, %124
%117 = phi i64 [ %125, %124 ], [ %114, %113 ]
%118 = phi i64 [ %126, %124 ], [ 0, %113 ]
br i1 %7, label %124, label %119
119: ; preds = %116
%120 = getelementptr inbounds double*, double** %6, i64 %117
%121 = load double*, double** %120
%122 = getelementptr double, double* %121, i64 1
%123 = bitcast double* %122 to i8*
br label %124
124: ; preds = %119, %116
%125 = add nuw nsw i64 %117, 1
%126 = add i64 %118, 1
%127 = icmp eq i64 %126, %41
br i1 %127, label %128, label %116
128: ; preds = %124, %113
br i1 %33, label %143, label %129
129: ; preds = %128
%130 = add nuw i32 %3, 1
%131 = add i32 %4, 1
%132 = zext i32 %130 to i64
%133 = zext i32 %131 to i64
br label %138
134: ; preds = %90, %93
%135 = add nuw nsw i64 %91, 4
%136 = add i64 %92, 4
%137 = icmp eq i64 %136, %44
br i1 %137, label %113, label %90
138: ; preds = %129, %190
%139 = phi i64 [ 1, %129 ], [ %191, %190 ]
br i1 %7, label %190, label %140
140: ; preds = %138
%141 = getelementptr inbounds double*, double** %0, i64 %139
%142 = getelementptr inbounds double*, double** %6, i64 %139
br label %154
143: ; preds = %190, %32, %128
br i1 %7, label %276, label %144
144: ; preds = %143
%145 = add i32 %3, 1
%146 = add nuw i32 %4, 1
%147 = zext i32 %146 to i64
%148 = zext i32 %145 to i64
%149 = add nsw i64 %148, -1
%150 = and i64 %149, 1
%151 = icmp eq i32 %145, 2
%152 = and i64 %149, -2
%153 = icmp eq i64 %150, 0
br label %193
154: ; preds = %187, %140
%155 = phi i64 [ 1, %140 ], [ %188, %187 ]
br label %156
156: ; preds = %154, %184
%157 = phi i64 [ 1, %154 ], [ %185, %184 ]
%158 = icmp ugt i64 %139, %157
br i1 %158, label %171, label %159
159: ; preds = %156
%160 = load double*, double** %141
%161 = getelementptr inbounds double, double* %160, i64 %157
%162 = load double, double* %161
%163 = getelementptr inbounds double*, double** %1, i64 %157
%164 = load double*, double** %163
%165 = getelementptr inbounds double, double* %164, i64 %155
%166 = load double, double* %165
%167 = load double*, double** %142
%168 = getelementptr inbounds double, double* %167, i64 %155
%169 = load double, double* %168
%170 = tail call double @llvm.fmuladd.f64(double %162, double %166, double %169)
store double %170, double* %168
br label %184
171: ; preds = %156
%172 = getelementptr inbounds double*, double** %0, i64 %157
%173 = load double*, double** %172
%174 = getelementptr inbounds double, double* %173, i64 %139
%175 = load double, double* %174
%176 = getelementptr inbounds double*, double** %1, i64 %157
%177 = load double*, double** %176
%178 = getelementptr inbounds double, double* %177, i64 %155
%179 = load double, double* %178
%180 = load double*, double** %142
%181 = getelementptr inbounds double, double* %180, i64 %155
%182 = load double, double* %181
%183 = tail call double @llvm.fmuladd.f64(double %175, double %179, double %182)
store double %183, double* %181
br label %184
184: ; preds = %159, %171
%185 = add nuw nsw i64 %157, 1
%186 = icmp eq i64 %185, %132
br i1 %186, label %187, label %156
187: ; preds = %184
%188 = add nuw nsw i64 %155, 1
%189 = icmp eq i64 %188, %133
br i1 %189, label %190, label %154
190: ; preds = %187, %138
%191 = add nuw nsw i64 %139, 1
%192 = icmp eq i64 %191, %132
br i1 %192, label %143, label %138
193: ; preds = %248, %144
%194 = phi i64 [ 1, %144 ], [ %249, %248 ]
%195 = getelementptr inbounds double*, double** %2, i64 %194
br label %200
196: ; preds = %248
br i1 %7, label %276, label %197
197: ; preds = %196
%198 = add nuw i32 %4, 1
%199 = zext i32 %198 to i64
br label %251
200: ; preds = %193, %245
%201 = phi i64 [ 1, %193 ], [ %246, %245 ]
br i1 %33, label %245, label %202
202: ; preds = %200
%203 = load double*, double** %195
%204 = getelementptr inbounds double, double* %203, i64 %201
%205 = load double, double* %204
br i1 %151, label %232, label %206
206: ; preds = %202, %206
%207 = phi double [ %228, %206 ], [ %205, %202 ]
%208 = phi i64 [ %229, %206 ], [ 1, %202 ]
%209 = phi i64 [ %230, %206 ], [ 0, %202 ]
%210 = getelementptr inbounds double*, double** %1, i64 %208
%211 = load double*, double** %210
%212 = getelementptr inbounds double, double* %211, i64 %194
%213 = load double, double* %212
%214 = getelementptr inbounds double*, double** %6, i64 %208
%215 = load double*, double** %214
%216 = getelementptr inbounds double, double* %215, i64 %201
%217 = load double, double* %216
%218 = tail call double @llvm.fmuladd.f64(double %213, double %217, double %207)
store double %218, double* %204
%219 = add nuw nsw i64 %208, 1
%220 = getelementptr inbounds double*, double** %1, i64 %219
%221 = load double*, double** %220
%222 = getelementptr inbounds double, double* %221, i64 %194
%223 = load double, double* %222
%224 = getelementptr inbounds double*, double** %6, i64 %219
%225 = load double*, double** %224
%226 = getelementptr inbounds double, double* %225, i64 %201
%227 = load double, double* %226
%228 = tail call double @llvm.fmuladd.f64(double %223, double %227, double %218)
store double %228, double* %204
%229 = add nuw nsw i64 %208, 2
%230 = add i64 %209, 2
%231 = icmp eq i64 %230, %152
br i1 %231, label %232, label %206
232: ; preds = %206, %202
%233 = phi double [ %205, %202 ], [ %228, %206 ]
%234 = phi i64 [ 1, %202 ], [ %229, %206 ]
br i1 %153, label %245, label %235
235: ; preds = %232
%236 = getelementptr inbounds double*, double** %1, i64 %234
%237 = load double*, double** %236
%238 = getelementptr inbounds double, double* %237, i64 %194
%239 = load double, double* %238
%240 = getelementptr inbounds double*, double** %6, i64 %234
%241 = load double*, double** %240
%242 = getelementptr inbounds double, double* %241, i64 %201
%243 = load double, double* %242
%244 = tail call double @llvm.fmuladd.f64(double %239, double %243, double %233)
store double %244, double* %204
br label %245
245: ; preds = %235, %232, %200
%246 = add nuw nsw i64 %201, 1
%247 = icmp eq i64 %246, %147
br i1 %247, label %248, label %200
248: ; preds = %245
%249 = add nuw nsw i64 %194, 1
%250 = icmp eq i64 %249, %147
br i1 %250, label %196, label %193
251: ; preds = %273, %197
%252 = phi i64 [ 1, %197 ], [ %274, %273 ]
%253 = getelementptr inbounds double*, double** %2, i64 %252
%254 = load double*, double** %253
%255 = getelementptr inbounds double, double* %254, i64 %252
%256 = load double, double* %255
%257 = fadd double %256, %256
%258 = fmul double %257, 5.000000e-01
store double %258, double* %255
%259 = add nuw nsw i64 %252, 1
%260 = icmp eq i64 %259, %199
br i1 %260, label %273, label %261
261: ; preds = %251, %261
%262 = phi i64 [ %271, %261 ], [ %259, %251 ]
%263 = getelementptr inbounds double*, double** %2, i64 %262
%264 = load double*, double** %263
%265 = getelementptr inbounds double, double* %254, i64 %262
%266 = load double, double* %265
%267 = getelementptr inbounds double, double* %264, i64 %252
%268 = load double, double* %267
%269 = fadd double %266, %268
%270 = fmul double %269, 5.000000e-01
store double %270, double* %267
store double %270, double* %265
%271 = add nuw nsw i64 %262, 1
%272 = icmp eq i64 %271, %199
br i1 %272, label %273, label %261
273: ; preds = %261, %251
%274 = add nuw nsw i64 %252, 1
%275 = icmp eq i64 %274, %199
br i1 %275, label %276, label %251
276: ; preds = %273, %143, %196
%277 = tail call i32 @free_dmatrix(double** %6, i32 1, i32 %3, i32 1, i32 %4)
ret void
}