#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_trans1_k2(double *, double *, double *, int, int);
int /*<<< orphan*/ matprod_trans1_sub_xrows(double *, double *, double *, int,
                                            int, int, int, int, int, double *);
int /*<<< orphan*/ matprod_trans1_sub_xrowscols(double *, double *, double *,
                                                int, int, int,
                                                int /*<<< orphan*/, int, int,
                                                int, double *);
void matprod_trans1_sub(double *restrict x, double *restrict y,
                        double *restrict z, int n, int k, int m, double *sym) {
  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(n >= 2);
  assert(k >= 2);
  assert(m >= 2);
  if (k == 2) {
    matprod_trans1_k2(x, y, z, n, m);
    return;
  }
  if (k <= (512 + 128) && n <= 48) {
    matprod_trans1_sub_xrowscols(x, y, z, n, k, m, 0, 1, k, n, sym);
    return;
  }
  int cachable = n <= 48 || n <= 48 * (512 + 128) / k
                     ? m
                     : 1 + (95000 / ((512 + 128) + 48));
  int mm = m;
  for (;;) {
    double *xx = x;
    double *yy = y;
    int xrows = k;
    int add = 0;
    int m1 = mm;
    if (m1 > cachable) {
      m1 = mm < 2 * cachable ? mm / 2 : cachable;
      m1 = (m1 + 7) & ~7;
      if (m1 > mm)
        m1 = mm;
    }
    if (xrows > (512 + 128)) {
      while (xrows >= 2 * (512 + 128)) {
        matprod_trans1_sub_xrows(xx, yy, z, n, k, m1, add, 0, (512 + 128), sym);
        xx += (512 + 128);
        yy += (512 + 128);
        xrows -= (512 + 128);
        add = 1;
      }
      if (xrows > (512 + 128)) {
        int nr = (((xrows + 3) >> 1) & ~3);
        matprod_trans1_sub_xrows(xx, yy, z, n, k, m1, add, 0, nr, sym);
        xx += nr;
        yy += nr;
        xrows -= nr;
        add = 1;
      }
    }
    matprod_trans1_sub_xrows(xx, yy, z, n, k, m1, add, 1, xrows, sym);
    mm -= m1;
    if (mm == 0)
      break;
    y += (size_t)m1 * k;
    z += (size_t)m1 * n;
    if (sym) {
      sym += (size_t)m1 * n;
      sym += m1;
    }
  }
}


x86 assembly (clang, -O0):
<matprod_trans1_sub>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x88,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x20(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x2,-0x24(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x2,-0x28(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x2,-0x2c(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x2,-0x28(%rbp)
jne    1224 <matprod_trans1_sub+0xe4>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
call   1040 <matprod_trans1_k2@plt>
jmp    1548 <matprod_trans1_sub+0x408>
cmpl   $0x280,-0x28(%rbp)
jg     1288 <matprod_trans1_sub+0x148>
cmpl   $0x30,-0x24(%rbp)
jg     1288 <matprod_trans1_sub+0x148>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
mov    -0x28(%rbp),%r11d
mov    -0x24(%rbp),%r10d
mov    0x10(%rbp),%rax
xor    %ebx,%ebx
movl   $0x0,(%rsp)
movl   $0x1,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <matprod_trans1_sub_xrowscols@plt>
jmp    1548 <matprod_trans1_sub+0x408>
cmpl   $0x30,-0x24(%rbp)
jle    12ae <matprod_trans1_sub+0x16e>
mov    -0x24(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    $0x7800,%eax
cltd
idivl  -0x28(%rbp)
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
cmp    %ecx,%eax
jg     12b9 <matprod_trans1_sub+0x179>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x60(%rbp)
jmp    12c6 <matprod_trans1_sub+0x186>
mov    $0x8b,%eax
mov    %eax,-0x60(%rbp)
jmp    12c6 <matprod_trans1_sub+0x186>
mov    -0x60(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x30(%rbp),%eax
jle    1354 <matprod_trans1_sub+0x214>
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1325 <matprod_trans1_sub+0x1e5>
mov    -0x34(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x64(%rbp)
jmp    132b <matprod_trans1_sub+0x1eb>
mov    -0x30(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
add    $0x7,%eax
and    $0xfffffff8,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x34(%rbp),%eax
jle    134f <matprod_trans1_sub+0x20f>
mov    -0x34(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    1354 <matprod_trans1_sub+0x214>
cmpl   $0x280,-0x4c(%rbp)
jle    1483 <matprod_trans1_sub+0x343>
jmp    1366 <matprod_trans1_sub+0x226>
cmpl   $0x500,-0x4c(%rbp)
jl     13e6 <matprod_trans1_sub+0x2a6>
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x54(%rbp),%r9d
mov    -0x50(%rbp),%r10d
mov    0x10(%rbp),%rax
xor    %r11d,%r11d
mov    %r10d,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x280,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1060 <matprod_trans1_sub_xrows@plt>
mov    -0x40(%rbp),%rax
add    $0x1400,%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1400,%rax
mov    %rax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
sub    $0x280,%eax
mov    %eax,-0x4c(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1366 <matprod_trans1_sub+0x226>
cmpl   $0x280,-0x4c(%rbp)
jle    147e <matprod_trans1_sub+0x33e>
mov    -0x4c(%rbp),%eax
add    $0x3,%eax
sar    $0x1,%eax
and    $0xfffffffc,%eax
mov    %eax,-0x58(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x54(%rbp),%r9d
mov    -0x50(%rbp),%r11d
mov    -0x58(%rbp),%r10d
mov    0x10(%rbp),%rax
xor    %ebx,%ebx
mov    %r11d,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1060 <matprod_trans1_sub_xrows@plt>
mov    -0x58(%rbp),%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x4c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4c(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1483 <matprod_trans1_sub+0x343>
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x54(%rbp),%r9d
mov    -0x50(%rbp),%r11d
mov    -0x4c(%rbp),%r10d
mov    0x10(%rbp),%rax
mov    %r11d,(%rsp)
movl   $0x1,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1060 <matprod_trans1_sub_xrows@plt>
mov    -0x54(%rbp),%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    14db <matprod_trans1_sub+0x39b>
jmp    1548 <matprod_trans1_sub+0x408>
movslq -0x54(%rbp),%rax
movslq -0x28(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0x54(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,0x10(%rbp)
je     1543 <matprod_trans1_sub+0x403>
movslq -0x54(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    0x10(%rbp),%rax
mov    %rax,0x10(%rbp)
mov    -0x54(%rbp),%ecx
mov    0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,0x10(%rbp)
jmp    12d2 <matprod_trans1_sub+0x192>
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<matprod_trans1_sub>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9d,%ebp
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
xor    %edi,%edi
mov    %r15,0x8(%rsp)
cmp    $0x2,%r15d
setge  %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%r14d
setge  %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%ebp
setge  %dil
call   1050 <assert@plt>
mov    %r14,%r8
cmp    $0x2,%r8d
jne    11dc <matprod_trans1_sub+0x9c>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    0x8(%rsp),%rcx
mov    %ebp,%r8d
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <matprod_trans1_k2@plt>
mov    %rbx,0x20(%rsp)
mov    0xa0(%rsp),%rax
mov    %rax,0x10(%rsp)
cmpl   $0x30,0x8(%rsp)
jg     1231 <matprod_trans1_sub+0xf1>
cmp    $0x280,%r8d
jg     1231 <matprod_trans1_sub+0xf1>
sub    $0x8,%rsp
mov    0x28(%rsp),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    0x10(%rsp),%rcx
mov    %ebp,%r9d
push   0x18(%rsp)
push   %rcx
push   %r8
push   $0x1
push   $0x0
call   1030 <matprod_trans1_sub_xrowscols@plt>
add    $0x98,%rsp
jmp    147f <matprod_trans1_sub+0x33f>
cmpl   $0x31,0x8(%rsp)
jl     124d <matprod_trans1_sub+0x10d>
mov    $0x7800,%eax
xor    %edx,%edx
idiv   %r8d
mov    $0x8b,%ecx
cmp    0x8(%rsp),%eax
jl     124f <matprod_trans1_sub+0x10f>
mov    %ebp,%ecx
lea    (%rcx,%rcx,1),%eax
mov    %eax,0x38(%rsp)
movslq %r8d,%rax
mov    %rax,0x58(%rsp)
movslq 0x8(%rsp),%rax
mov    %rax,0x50(%rsp)
mov    0x20(%rsp),%rax
add    $0x1400,%rax
mov    %rax,0x40(%rsp)
lea    -0x280(%r8),%eax
mov    %eax,0x34(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,0x60(%rsp)
nopl   (%rax)
mov    %ebp,%r15d
cmp    %ecx,%ebp
jle    12bc <matprod_trans1_sub+0x17c>
mov    %ecx,%r15d
cmp    0x38(%rsp),%ebp
jge    12ad <matprod_trans1_sub+0x16d>
mov    %ebp,%r15d
shr    $0x1f,%r15d
add    %ebp,%r15d
sar    %r15d
add    $0x7,%r15d
and    $0xfffffff8,%r15d
cmp    %ebp,%r15d
cmovg  %ebp,%r15d
mov    %r12,0x28(%rsp)
mov    %ebp,0x3c(%rsp)
xor    %r10d,%r10d
mov    0x20(%rsp),%rdi
mov    %rdi,%r14
mov    %r13,%r12
mov    %r8d,%eax
cmp    $0x281,%r8d
jl     140a <matprod_trans1_sub+0x2ca>
xor    %r10d,%r10d
mov    %r8d,%ebx
mov    %r13,%r12
mov    %rdi,%r14
cmp    $0x500,%r8d
jb     13bb <matprod_trans1_sub+0x27b>
mov    %r13,%rsi
mov    %r13,%rbx
mov    0x28(%rsp),%r13
mov    %r13,%rdx
mov    0x8(%rsp),%rcx
mov    %r15d,%r9d
mov    0x10(%rsp),%rbp
push   %rbp
push   $0x280
push   $0x0
push   $0x0
call   1060 <matprod_trans1_sub_xrows@plt>
add    $0x20,%rsp
mov    %rbx,0x48(%rsp)
lea    0x1400(%rbx),%r12
mov    0x34(%rsp),%eax
cmp    $0x500,%eax
jb     1397 <matprod_trans1_sub+0x257>
mov    %eax,%ebx
mov    0x40(%rsp),%r14
mov    0x18(%rsp),%r8
nopl   (%rax)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    0x8(%rsp),%rcx
mov    %r15d,%r9d
push   %rbp
push   $0x280
push   $0x0
push   $0x1
call   1060 <matprod_trans1_sub_xrows@plt>
mov    0x38(%rsp),%r8
add    $0x20,%rsp
add    $0x1400,%r14
add    $0x1400,%r12
add    $0xfffffd80,%ebx
cmp    $0x4ff,%ebx
ja     1350 <matprod_trans1_sub+0x210>
jmp    13a3 <matprod_trans1_sub+0x263>
mov    0x40(%rsp),%r14
mov    %eax,%ebx
mov    0x18(%rsp),%r8
mov    $0x280,%eax
mov    $0x1,%r10d
cmp    $0x281,%ebx
mov    0x48(%rsp),%r13
jb     140a <matprod_trans1_sub+0x2ca>
mov    %r13,%rbp
lea    0x3(%rbx),%r13d
shr    %r13d
and    $0xfffffffc,%r13d
mov    %r14,%rdi
mov    %r12,%rsi
mov    0x28(%rsp),%rdx
mov    0x8(%rsp),%rcx
mov    %r15d,%r9d
push   0x10(%rsp)
push   %r13
push   $0x0
push   %r10
call   1060 <matprod_trans1_sub_xrows@plt>
mov    0x38(%rsp),%r8
add    $0x20,%rsp
lea    (%r14,%r13,8),%r14
lea    (%r12,%r13,8),%r12
sub    %r13d,%ebx
mov    %rbp,%r13
mov    $0x1,%r10d
mov    %ebx,%eax
mov    %r14,%rdi
mov    %r12,%rsi
mov    0x28(%rsp),%r12
mov    %r12,%rdx
mov    0x8(%rsp),%rcx
mov    %r15d,%r9d
mov    0x10(%rsp),%rbx
push   %rbx
push   %rax
push   $0x1
push   %r10
call   1060 <matprod_trans1_sub_xrows@plt>
add    $0x20,%rsp
mov    0x3c(%rsp),%ebp
sub    %r15d,%ebp
je     147b <matprod_trans1_sub+0x33b>
movslq %r15d,%rax
mov    %rax,%rcx
imul   0x50(%rsp),%rcx
lea    (%rbx,%rcx,8),%rdx
lea    (%rdx,%rax,8),%rdx
imul   0x58(%rsp),%rax
lea    0x0(%r13,%rax,8),%r13
lea    (%r12,%rcx,8),%r12
test   %rbx,%rbx
cmovne %rdx,%rbx
mov    %rbx,0x10(%rsp)
mov    0x18(%rsp),%r8
mov    0x60(%rsp),%rcx
jmp    1290 <matprod_trans1_sub+0x150>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @matprod_trans1_sub(double* noalias %0, double* noalias %1, double* noalias %2, i32 %3, i32 %4, i32 %5, double* %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 %3, 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 %5, 1
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = icmp eq i32 %4, 2
br i1 %20, label %21, label %23
21: ; preds = %7
%22 = tail call i32 @matprod_trans1_k2(double* %0, double* %1, double* %2, i32 %3, i32 %5)
br label %109
23: ; preds = %7
%24 = icmp slt i32 %4, 641
%25 = icmp slt i32 %3, 49
%26 = and i1 %25, %24
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 @matprod_trans1_sub_xrowscols(double* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5, i32 0, i32 1, i32 %4, i32 %3, double* %6)
br label %109
29: ; preds = %23
br i1 %25, label %33, label %30
30: ; preds = %29
%31 = sdiv i32 30720, %4
%32 = icmp slt i32 %31, %3
br i1 %32, label %34, label %33
33: ; preds = %30, %29
br label %34
34: ; preds = %30, %33
%35 = phi i32 [ %5, %33 ], [ 139, %30 ]
%36 = icmp sgt i32 %4, 640
%37 = shl nsw i32 %35, 1
%38 = icmp ugt i32 %4, 1279
%39 = sext i32 %4 to i64
%40 = sext i32 %3 to i64
%41 = getelementptr inbounds double, double* %0, i64 640
%42 = add nsw i32 %4, -640
%43 = icmp ugt i32 %42, 1279
br label %44
44: ; preds = %99, %34
%45 = phi double* [ %2, %34 ], [ %104, %99 ]
%46 = phi double* [ %6, %34 ], [ %108, %99 ]
%47 = phi double* [ %1, %34 ], [ %102, %99 ]
%48 = phi i32 [ %5, %34 ], [ %97, %99 ]
%49 = icmp sgt i32 %48, %35
br i1 %49, label %50, label %58
50: ; preds = %44
%51 = icmp slt i32 %48, %37
%52 = sdiv i32 %48, 2
%53 = select i1 %51, i32 %52, i32 %35
%54 = add nsw i32 %53, 7
%55 = and i32 %54, -8
%56 = icmp sgt i32 %55, %48
%57 = select i1 %56, i32 %48, i32 %55
br label %58
58: ; preds = %50, %44
%59 = phi i32 [ %48, %44 ], [ %57, %50 ]
br i1 %36, label %60, label %91
60: ; preds = %58
br i1 %38, label %61, label %78
61: ; preds = %60
%62 = tail call i32 @matprod_trans1_sub_xrows(double* %0, double* %47, double* %45, i32 %3, i32 %4, i32 %59, i32 0, i32 0, i32 640, double* %46)
%63 = getelementptr inbounds double, double* %47, i64 640
br i1 %43, label %64, label %73
64: ; preds = %61, %64
%65 = phi i32 [ %71, %64 ], [ %42, %61 ]
%66 = phi double* [ %70, %64 ], [ %63, %61 ]
%67 = phi double* [ %69, %64 ], [ %41, %61 ]
%68 = tail call i32 @matprod_trans1_sub_xrows(double* %67, double* %66, double* %45, i32 %3, i32 %4, i32 %59, i32 1, i32 0, i32 640, double* %46)
%69 = getelementptr inbounds double, double* %67, i64 640
%70 = getelementptr inbounds double, double* %66, i64 640
%71 = add nsw i32 %65, -640
%72 = icmp ugt i32 %71, 1279
br i1 %72, label %64, label %73
73: ; preds = %64, %61
%74 = phi double* [ %41, %61 ], [ %69, %64 ]
%75 = phi double* [ %63, %61 ], [ %70, %64 ]
%76 = phi i32 [ %42, %61 ], [ %71, %64 ]
%77 = icmp ugt i32 %76, 640
br i1 %77, label %78, label %91
78: ; preds = %60, %73
%79 = phi i32 [ 1, %73 ], [ 0, %60 ]
%80 = phi i32 [ %76, %73 ], [ %4, %60 ]
%81 = phi double* [ %75, %73 ], [ %47, %60 ]
%82 = phi double* [ %74, %73 ], [ %0, %60 ]
%83 = add nuw nsw i32 %80, 3
%84 = lshr i32 %83, 1
%85 = and i32 %84, 2147483644
%86 = tail call i32 @matprod_trans1_sub_xrows(double* %82, double* %81, double* %45, i32 %3, i32 %4, i32 %59, i32 %79, i32 0, i32 %85, double* %46)
%87 = zext i32 %85 to i64
%88 = getelementptr inbounds double, double* %82, i64 %87
%89 = getelementptr inbounds double, double* %81, i64 %87
%90 = sub nuw nsw i32 %80, %85
br label %91
91: ; preds = %73, %78, %58
%92 = phi double* [ %88, %78 ], [ %74, %73 ], [ %0, %58 ]
%93 = phi double* [ %89, %78 ], [ %75, %73 ], [ %47, %58 ]
%94 = phi i32 [ %90, %78 ], [ 640, %73 ], [ %4, %58 ]
%95 = phi i32 [ 1, %78 ], [ 1, %73 ], [ 0, %58 ]
%96 = tail call i32 @matprod_trans1_sub_xrows(double* %92, double* %93, double* %45, i32 %3, i32 %4, i32 %59, i32 %95, i32 1, i32 %94, double* %46)
%97 = sub nsw i32 %48, %59
%98 = icmp eq i32 %97, 0
br i1 %98, label %109, label %99
99: ; preds = %91
%100 = sext i32 %59 to i64
%101 = mul nsw i64 %100, %39
%102 = getelementptr inbounds double, double* %47, i64 %101
%103 = mul nsw i64 %100, %40
%104 = getelementptr inbounds double, double* %45, i64 %103
%105 = icmp eq double* %46, null
%106 = getelementptr inbounds double, double* %46, i64 %103
%107 = getelementptr inbounds double, double* %106, i64 %100
%108 = select i1 %105, double* null, double* %107
br label %44
109: ; preds = %91, %27, %21
ret void
}