#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 scalar_t__ z;
typedef scalar_t__ y;
typedef scalar_t__ x;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ matprod_mat_mat_sub_xrows(double *, double *, double *, int,
                                             int, int, int, int);
int /*<<< orphan*/ matprod_trans12_m2(double *, double *, double *, int, int);
void matprod_trans12_sub(double *restrict x, double *restrict y,
                         double *restrict z, int n, int k, int m, int zcols) {
  assert(((uintptr_t)(x) & (1 - 1)) == 0);
  assert(((uintptr_t)(y) & (1 - 1)) == 0);
  assert(((uintptr_t)(z) & (1 - 1)) == 0);
  x = (x);
  y = (y);
  z = (z);
  assert(m >= 2);
  assert(k >= 2);
  assert(n >= 2);
  assert(zcols >= 2);
  if (m == 2) {
    assert(zcols == 2);
    matprod_trans12_m2(x, y, z, n, k);
    return;
  }
  int zr, zc;
  zc = 128;
  if (zc > zcols) {
    zc = zcols;
  }
  zr = (2048 / zc) & ~3;
  if (zr > n) {
    zr = n;
  }
  double zelem[zr * zc + 3];
  double *ztmp = zelem;
  while ((((uintptr_t)ztmp) & (1 - 1)) != 0) {
    ztmp += 1;
  }
  int j = 0;
  while (j < zcols) {
    int remaining_cols = zcols - j;
    int zzc = remaining_cols <= zc      ? remaining_cols
              : remaining_cols - zc < 3 ? (remaining_cols / 2) & ~3
                                        : zc;
    double *xx = x;
    int i = 0;
    while (i < n) {
      int remaining_rows = n - i;
      int zzr = remaining_rows <= zr      ? remaining_rows
                : remaining_rows - zr < 3 ? remaining_rows / 2
                                          : zr;
      matprod_mat_mat_sub_xrows(y, xx, ztmp, m, k, zzr, zzc, zzc);
      int ii, jj;
      for (ii = 0; ii < zzr; ii++) {
        for (jj = 0; jj < zzc; jj++) {
          z[i + ii + (size_t)jj * n] = ztmp[jj + ii * zzc];
        }
      }
      xx += (size_t)zzr * k;
      i += zzr;
    }
    y += zzc;
    z += (size_t)zzc * n;
    j += zzc;
  }
}


x86 assembly (clang, -O0):
<matprod_trans12_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x24(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x20(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x1c(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x24(%rbp)
jne    1234 <matprod_trans12_sub+0x104>
cmpl   $0x2,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1050 <matprod_trans12_m2@plt>
jmp    14c0 <matprod_trans12_sub+0x390>
movl   $0x80,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    0x10(%rbp),%eax
jle    124d <matprod_trans12_sub+0x11d>
mov    0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x800,%eax
cltd
idivl  -0x2c(%rbp)
and    $0xfffffffc,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    126e <matprod_trans12_sub+0x13e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x2c(%rbp),%ecx
imul   %ecx,%eax
add    $0x3,%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x38(%rbp)
lea    0xf(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x40(%rbp)
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
je     12c3 <matprod_trans12_sub+0x193>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
jmp    12a0 <matprod_trans12_sub+0x170>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    14b9 <matprod_trans12_sub+0x389>
mov    0x10(%rbp),%eax
sub    -0x4c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     12f6 <matprod_trans12_sub+0x1c6>
mov    -0x50(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    1327 <matprod_trans12_sub+0x1f7>
mov    -0x50(%rbp),%eax
sub    -0x2c(%rbp),%eax
cmp    $0x3,%eax
jge    131b <matprod_trans12_sub+0x1eb>
mov    -0x50(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
and    $0xfffffffc,%eax
mov    %eax,-0x7c(%rbp)
jmp    1321 <matprod_trans12_sub+0x1f1>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    147e <matprod_trans12_sub+0x34e>
mov    -0x1c(%rbp),%eax
sub    -0x64(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     1368 <matprod_trans12_sub+0x238>
mov    -0x68(%rbp),%eax
mov    %eax,-0x80(%rbp)
jmp    139f <matprod_trans12_sub+0x26f>
mov    -0x68(%rbp),%eax
sub    -0x28(%rbp),%eax
cmp    $0x3,%eax
jge    138d <matprod_trans12_sub+0x25d>
mov    -0x68(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x84(%rbp)
jmp    1396 <matprod_trans12_sub+0x266>
mov    -0x28(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x6c(%rbp),%r9d
mov    -0x54(%rbp),%r10d
mov    -0x54(%rbp),%eax
sub    $0x10,%rsp
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <matprod_mat_mat_sub_xrows@plt>
add    $0x10,%rsp
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jge    1458 <matprod_trans12_sub+0x328>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    1445 <matprod_trans12_sub+0x315>
mov    -0x48(%rbp),%rax
mov    -0x74(%rbp),%ecx
mov    -0x70(%rbp),%edx
imul   -0x54(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x64(%rbp),%ecx
add    -0x70(%rbp),%ecx
movslq %ecx,%rcx
movslq -0x74(%rbp),%rdx
movslq -0x1c(%rbp),%rsi
imul   %rsi,%rdx
add    %rdx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    13f2 <matprod_trans12_sub+0x2c2>
jmp    144a <matprod_trans12_sub+0x31a>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    13df <matprod_trans12_sub+0x2af>
movslq -0x6c(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x6c(%rbp),%eax
add    -0x64(%rbp),%eax
mov    %eax,-0x64(%rbp)
jmp    133c <matprod_trans12_sub+0x20c>
mov    -0x54(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movslq -0x54(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x54(%rbp),%eax
add    -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
jmp    12ca <matprod_trans12_sub+0x19a>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matprod_trans12_sub>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r9d,%r15d
mov    %r8d,%ebx
mov    %ecx,%r14d
mov    %rdx,%r12
mov    %rsi,-0x50(%rbp)
mov    %rdi,-0x88(%rbp)
mov    0x10(%rbp),%r13d
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%r15d
setge  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
setge  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%r14d
setge  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%r13d
setge  %dil
call   1030 <assert@plt>
cmp    $0x2,%r15d
jne    11f4 <matprod_trans12_sub+0xc4>
xor    %edi,%edi
cmp    $0x2,%r13d
sete   %dil
call   1030 <assert@plt>
mov    -0x88(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    %r12,%rdx
mov    %r14d,%ecx
mov    %ebx,%r8d
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <matprod_trans12_m2@plt>
mov    %ebx,-0x30(%rbp)
mov    %rsp,-0xa8(%rbp)
cmp    $0x80,%r13d
mov    $0x80,%ebx
cmovl  %r13d,%ebx
xor    %r9d,%r9d
mov    $0x800,%eax
xor    %edx,%edx
idiv   %ebx
mov    %eax,%r10d
and    $0xfffffffc,%r10d
cmp    %r14d,%r10d
cmovg  %r14d,%r10d
mov    %r10d,%eax
imul   %ebx,%eax
add    $0x3,%eax
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rdx
sub    %rax,%rdx
mov    %rdx,-0x58(%rbp)
mov    %rdx,%rsp
test   %r13d,%r13d
mov    -0x50(%rbp),%rdi
jle    1646 <matprod_trans12_sub+0x516>
mov    %r15d,%ecx
mov    %r14d,%edx
mov    %r13d,%esi
movslq %r14d,%r11
movslq -0x30(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x58(%rbp),%r8
lea    0x30(%r8),%rax
mov    %rax,-0xb8(%rbp)
mov    %r11,%r15
shl    $0x5,%r15
mov    %r11,%r13
shl    $0x6,%r13
lea    0x8(%r8),%rax
mov    %rax,-0xb0(%rbp)
mov    %r11,-0x60(%rbp)
lea    (%r11,%r11,1),%r14
mov    %edx,-0x80(%rbp)
mov    %ebx,-0x78(%rbp)
mov    %r10d,-0x74(%rbp)
mov    %ecx,-0x7c(%rbp)
mov    %esi,-0x3c(%rbp)
jmp    12da <matprod_trans12_sub+0x1aa>
mov    -0x38(%rbp),%r12
mov    -0x3c(%rbp),%esi
mov    -0x90(%rbp),%rax
lea    (%rdi,%rax,8),%rdi
imul   -0x60(%rbp),%rax
lea    (%r12,%rax,8),%r12
add    %r9d,%r11d
mov    %r11d,%r9d
cmp    %esi,%r11d
jge    1646 <matprod_trans12_sub+0x516>
mov    %esi,%eax
sub    %r9d,%eax
mov    %eax,%r8d
sub    %ebx,%r8d
jle    1630 <matprod_trans12_sub+0x500>
mov    %ebx,%r11d
cmp    $0x2,%r8d
jg     1305 <matprod_trans12_sub+0x1d5>
mov    %eax,%r11d
shr    $0x1f,%r11d
add    %eax,%r11d
sar    %r11d
and    $0xfffffffc,%r11d
test   %edx,%edx
jle    163b <matprod_trans12_sub+0x50b>
cmp    $0x1,%edx
sete   -0x70(%rbp)
movslq %r11d,%rbx
mov    %r12,-0x38(%rbp)
mov    %r11d,%r12d
mov    %r12d,%esi
and    $0xfffffffc,%esi
mov    %rsi,-0xf0(%rbp)
lea    -0x4(%rsi),%r8
mov    %r8,-0xe8(%rbp)
shr    $0x2,%r8
add    $0x1,%r8
cmp    $0x4,%r11d
setae  %al
and    -0x70(%rbp),%al
mov    %al,-0x29(%rbp)
mov    %r8,%rsi
mov    %r8,-0xe0(%rbp)
and    $0xfffffffffffffffe,%r8
mov    %r8,-0xd8(%rbp)
mov    %r12,%rax
neg    %rax
mov    %rax,-0xf8(%rbp)
mov    %rbx,-0x90(%rbp)
lea    0x0(,%rbx,8),%rax
mov    %rax,-0x100(%rbp)
mov    -0x38(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0xc0(%rbp)
xor    %esi,%esi
mov    -0x88(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    %r9,-0xd0(%rbp)
mov    -0x30(%rbp),%r8d
mov    %rdi,-0x50(%rbp)
mov    %r11,-0xa0(%rbp)
jmp    140a <matprod_trans12_sub+0x2da>
nopw   0x0(%rax,%rax,1)
mov    -0x40(%rbp),%edx
movslq %edx,%rax
imul   -0xc8(%rbp),%rax
ff
mov    -0x68(%rbp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,-0x68(%rbp)
mov    -0x44(%rbp),%esi
add    %edx,%esi
mov    -0x80(%rbp),%edx
cmp    %edx,%esi
mov    -0x30(%rbp),%r8d
mov    -0x50(%rbp),%rdi
mov    -0x7c(%rbp),%ecx
mov    -0x78(%rbp),%ebx
mov    -0x74(%rbp),%r10d
mov    -0xd0(%rbp),%r9
mov    -0xa0(%rbp),%r11
jge    12b0 <matprod_trans12_sub+0x180>
mov    %edx,%eax
sub    %esi,%eax
mov    %eax,%edx
sub    %r10d,%edx
mov    %esi,-0x44(%rbp)
jle    1430 <matprod_trans12_sub+0x300>
mov    %r10d,%ebx
cmp    $0x2,%edx
jg     1432 <matprod_trans12_sub+0x302>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
jmp    1432 <matprod_trans12_sub+0x302>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
mov    -0x68(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    %ebx,%r9d
push   %r11
push   %r11
call   1040 <matprod_mat_mat_sub_xrows@plt>
add    $0x10,%rsp
mov    %ebx,-0x40(%rbp)
test   %ebx,%ebx
jle    13c0 <matprod_trans12_sub+0x290>
movslq -0x44(%rbp),%rcx
mov    -0x40(%rbp),%eax
mov    %rax,-0x70(%rbp)
mov    -0xc0(%rbp),%rax
mov    %rcx,-0x98(%rbp)
lea    (%rax,%rcx,8),%r9
mov    -0x38(%rbp),%r10
mov    -0xb0(%rbp),%rdi
mov    -0xb8(%rbp),%rax
xor    %r11d,%r11d
jmp    14b3 <matprod_trans12_sub+0x383>
nopl   0x0(%rax)
add    $0x1,%r11
mov    -0x100(%rbp),%rcx
add    %rcx,%rax
add    $0x8,%r9
add    %rcx,%rdi
add    $0x8,%r10
cmp    -0x70(%rbp),%r11
je     13c0 <matprod_trans12_sub+0x290>
cmpl   $0x0,-0xa0(%rbp)
jle    1490 <matprod_trans12_sub+0x360>
mov    %r11,%rcx
imul   -0x90(%rbp),%rcx
ff
mov    -0x98(%rbp),%rdx
lea    (%r11,%rdx,1),%r8
cmpb   $0x0,-0x29(%rbp)
je     1580 <matprod_trans12_sub+0x450>
cmpq   $0x0,-0xe8(%rbp)
je     1616 <matprod_trans12_sub+0x4e6>
mov    -0xd8(%rbp),%rdx
mov    %r9,%rsi
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movups -0x30(%rax,%rbx,8),%xmm0
movups -0x20(%rax,%rbx,8),%xmm1
movups %xmm0,-0x10(%rsi)
movups %xmm1,(%rsi)
movups -0x10(%rax,%rbx,8),%xmm0
movups (%rax,%rbx,8),%xmm1
movups %xmm0,-0x10(%rsi,%r15,1)
movups %xmm1,(%rsi,%r15,1)
add    $0x8,%rbx
add    %r13,%rsi
add    $0xfffffffffffffffe,%rdx
jne    1500 <matprod_trans12_sub+0x3d0>
testb  $0x1,-0xe0(%rbp)
je     1561 <matprod_trans12_sub+0x431>
lea    (%rbx,%rcx,1),%rdx
mov    -0x58(%rbp),%rsi
movups (%rsi,%rdx,8),%xmm0
movups 0x10(%rsi,%rdx,8),%xmm1
imul   -0x60(%rbp),%rbx
add    %r8,%rbx
mov    -0x38(%rbp),%rdx
movups %xmm0,(%rdx,%rbx,8)
movups %xmm1,0x10(%rdx,%rbx,8)
mov    %r8,%rsi
mov    -0xf0(%rbp),%rdx
mov    %rdx,%r8
cmp    %r12,%rdx
je     1490 <matprod_trans12_sub+0x360>
jmp    1586 <matprod_trans12_sub+0x456>
nopl   0x0(%rax)
mov    %r8,%rsi
xor    %r8d,%r8d
mov    %r8,%rbx
test   $0x1,%r12b
je     15b6 <matprod_trans12_sub+0x486>
add    %r8,%rcx
mov    -0x58(%rbp),%rdx
movsd  (%rdx,%rcx,8),%xmm0
mov    %r8,%rcx
imul   -0x60(%rbp),%rcx
add    %rsi,%rcx
mov    -0x38(%rbp),%rdx
movsd  %xmm0,(%rdx,%rcx,8)
mov    %r8,%rbx
or     $0x1,%rbx
not    %r8
cmp    -0xf8(%rbp),%r8
je     1490 <matprod_trans12_sub+0x360>
mov    -0x60(%rbp),%rsi
mov    %rsi,%rcx
imul   %rbx,%rcx
lea    (%r10,%rcx,8),%rdx
lea    0x1(%rbx),%rcx
imul   %rsi,%rcx
lea    (%r10,%rcx,8),%rsi
mov    -0x98(%rbp),%rcx
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rdi,%rbx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
movsd  (%rdi,%rbx,8),%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
add    $0x2,%rbx
add    %r14,%rcx
cmp    %rbx,%r12
jne    15f0 <matprod_trans12_sub+0x4c0>
jmp    1490 <matprod_trans12_sub+0x360>
xor    %ebx,%ebx
testb  $0x1,-0xe0(%rbp)
jne    153b <matprod_trans12_sub+0x40b>
jmp    1561 <matprod_trans12_sub+0x431>
nopw   0x0(%rax,%rax,1)
mov    %eax,%r11d
test   %edx,%edx
jg     130d <matprod_trans12_sub+0x1dd>
movslq %r11d,%rax
mov    -0x3c(%rbp),%esi
jmp    12be <matprod_trans12_sub+0x18e>
mov    -0xa8(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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