#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_trans2_n2(double *, double *, double *, int, int,
                                     int);
int /*<<< orphan*/ matprod_trans2_sub_xrows(double *, double *, double *, int,
                                            int, int, int, int, double *);
int /*<<< orphan*/ matprod_trans2_sub_xrowscols(double *, double *, double *,
                                                int, int, int, int, int, int,
                                                int /*<<< orphan*/, int,
                                                double *);
void matprod_trans2_sub(double *restrict x, double *restrict y,
                        double *restrict z, int n, int k, int m, int yrows,
                        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 (n == 2) {
    matprod_trans2_n2(x, y, z, k, m, yrows);
    return;
  }
  if (n <= (1024 - 64) && k <= 32) {
    matprod_trans2_sub_xrowscols(x, y, z, n, k, m, n, yrows, k, 0, 1, sym);
    return;
  }
  int cachable =
      n <= (1024 - 64) ? yrows : 1 + (int)(95000 / ((1024 - 64) + (double)k));
  int mm = yrows;
  for (;;) {
    int m1 = mm;
    if (m1 > cachable) {
      m1 = mm < 2 * cachable ? mm / 2 : cachable;
      m1 = (m1 + 7) & ~7;
      if (m1 > mm)
        m1 = mm;
    }
    double *xx = x;
    double *zz = z;
    int xrows = n;
    if (xrows > (1024 - 64)) {
      while (xrows >= 2 * (1024 - 64)) {
        matprod_trans2_sub_xrows(xx, y, zz, n, k, m, (1024 - 64), m1, sym);
        xx += (1024 - 64);
        zz += (1024 - 64);
        xrows -= (1024 - 64);
      }
      if (xrows > (1024 - 64)) {
        int nr = (((xrows + 3) >> 1) & ~3);
        matprod_trans2_sub_xrows(xx, y, zz, n, k, m, nr, m1, sym);
        xx += nr;
        zz += nr;
        xrows -= nr;
      }
    }
    matprod_trans2_sub_xrows(xx, y, zz, n, k, m, xrows, m1, sym);
    mm -= m1;
    if (mm == 0) {
      break;
    }
    y += m1;
    z += (size_t)m1 * n;
    if (sym) {
      sym += (size_t)m1 * n;
      sym += m1;
    }
  }
}


x86 assembly (clang, -O0):
<matprod_trans2_sub>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8d,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0x18(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x28(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x2,-0x2c(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x30(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x34(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x2c(%rbp)
jne    122d <matprod_trans2_sub+0xed>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    0x10(%rbp),%r9d
call   1050 <matprod_trans2_n2@plt>
jmp    1525 <matprod_trans2_sub+0x3e5>
cmpl   $0x3c0,-0x2c(%rbp)
jg     1299 <matprod_trans2_sub+0x159>
cmpl   $0x20,-0x30(%rbp)
jg     1299 <matprod_trans2_sub+0x159>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
mov    -0x2c(%rbp),%ebx
mov    0x10(%rbp),%r11d
mov    -0x30(%rbp),%r10d
mov    0x18(%rbp),%rax
xor    %r14d,%r14d
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x1,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1060 <matprod_trans2_sub_xrowscols@plt>
jmp    1525 <matprod_trans2_sub+0x3e5>
cmpl   $0x3c0,-0x2c(%rbp)
jg     12b1 <matprod_trans2_sub+0x171>
mov    0x10(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    12d8 <matprod_trans2_sub+0x198>
cvtsi2sdl -0x30(%rbp),%xmm0
movsd  0xd4a(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xd36(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x38(%rbp),%eax
jle    1349 <matprod_trans2_sub+0x209>
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    131a <matprod_trans2_sub+0x1da>
mov    -0x3c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x60(%rbp)
jmp    1320 <matprod_trans2_sub+0x1e0>
mov    -0x38(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    $0x7,%eax
and    $0xfffffff8,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jle    1344 <matprod_trans2_sub+0x204>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    1349 <matprod_trans2_sub+0x209>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x3c0,-0x54(%rbp)
jle    146b <matprod_trans2_sub+0x32b>
jmp    1371 <matprod_trans2_sub+0x231>
cmpl   $0x780,-0x54(%rbp)
jl     13df <matprod_trans2_sub+0x29f>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
mov    -0x40(%rbp),%r10d
mov    0x18(%rbp),%rax
movl   $0x3c0,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <matprod_trans2_sub_xrows@plt>
mov    -0x48(%rbp),%rax
add    $0x1e00,%rax
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rax
add    $0x1e00,%rax
mov    %rax,-0x50(%rbp)
mov    -0x54(%rbp),%eax
sub    $0x3c0,%eax
mov    %eax,-0x54(%rbp)
jmp    1371 <matprod_trans2_sub+0x231>
cmpl   $0x3c0,-0x54(%rbp)
jle    1466 <matprod_trans2_sub+0x326>
mov    -0x54(%rbp),%eax
add    $0x3,%eax
sar    $0x1,%eax
and    $0xfffffffc,%eax
mov    %eax,-0x58(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
mov    -0x58(%rbp),%r11d
mov    -0x40(%rbp),%r10d
mov    0x18(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <matprod_trans2_sub_xrows@plt>
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    -0x50(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x54(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x54(%rbp)
jmp    146b <matprod_trans2_sub+0x32b>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
mov    -0x54(%rbp),%r11d
mov    -0x40(%rbp),%r10d
mov    0x18(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <matprod_trans2_sub_xrows@plt>
mov    -0x40(%rbp),%ecx
mov    -0x3c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    14bb <matprod_trans2_sub+0x37b>
jmp    1525 <matprod_trans2_sub+0x3e5>
mov    -0x40(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movslq -0x40(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,0x18(%rbp)
je     1520 <matprod_trans2_sub+0x3e0>
movslq -0x40(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    0x18(%rbp),%rax
mov    %rax,0x18(%rbp)
mov    -0x40(%rbp),%ecx
mov    0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,0x18(%rbp)
jmp    12e4 <matprod_trans2_sub+0x1a4>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<matprod_trans2_sub>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %rdi,0x10(%rsp)
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,%ebp
setge  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%r15d
setge  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%r14d
setge  %dil
call   1030 <assert@plt>
mov    0x90(%rsp),%r10d
mov    %rbp,(%rsp)
cmp    $0x2,%ebp
jne    11e3 <matprod_trans2_sub+0xa3>
mov    0x10(%rsp),%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %r10d,%r9d
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <matprod_trans2_n2@plt>
mov    %r14d,0xc(%rsp)
mov    0x98(%rsp),%rax
cmpl   $0x3c0,(%rsp)
jg     1231 <matprod_trans2_sub+0xf1>
cmp    $0x20,%r15d
jg     1231 <matprod_trans2_sub+0xf1>
mov    0x10(%rsp),%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    (%rsp),%rcx
mov    %r15d,%r8d
mov    0xc(%rsp),%r9d
push   %rax
push   $0x1
push   $0x0
push   %r15
push   %r10
push   %rcx
call   1060 <matprod_trans2_sub_xrowscols@plt>
add    $0x88,%rsp
jmp    143c <matprod_trans2_sub+0x2fc>
mov    %r10d,%ecx
cmpl   $0x3c1,(%rsp)
mov    %rbx,%rdx
jl     1260 <matprod_trans2_sub+0x120>
cvtsi2sd %r15d,%xmm0
addsd  0xdb3(%rip),%xmm0
movsd  0xdb3(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ecx
add    $0x1,%ecx
lea    (%rcx,%rcx,1),%esi
mov    %esi,0x2c(%rsp)
movslq (%rsp),%rsi
mov    %rsi,0x40(%rsp)
mov    %r15,0x18(%rsp)
mov    %rcx,0x48(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %r10d,%ebp
cmp    %ecx,%r10d
jle    12a9 <matprod_trans2_sub+0x169>
mov    %ecx,%ebp
cmp    0x2c(%rsp),%r10d
jge    129c <matprod_trans2_sub+0x15c>
mov    %r10d,%ebp
shr    $0x1f,%ebp
add    %r10d,%ebp
sar    %ebp
add    $0x7,%ebp
and    $0xfffffff8,%ebp
cmp    %r10d,%ebp
cmovg  %r10d,%ebp
mov    %r10,0x50(%rsp)
mov    0x10(%rsp),%r14
mov    %rdx,%r15
mov    (%rsp),%rcx
mov    %ecx,%r10d
cmp    $0x3c1,%ecx
mov    %rbp,0x20(%rsp)
jl     13c4 <matprod_trans2_sub+0x284>
mov    (%rsp),%rcx
mov    %ecx,%ebx
mov    %rdx,%r15
mov    0x10(%rsp),%r14
cmp    $0x780,%ecx
mov    %rdx,0x38(%rsp)
jb     1366 <matprod_trans2_sub+0x226>
mov    (%rsp),%rbx
mov    %rdx,%r15
mov    0x10(%rsp),%r14
nopl   0x0(%rax)
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    0x8(%rsp),%rcx
mov    0x20(%rsp),%r8
mov    0x14(%rsp),%r9d
push   %rax
push   %rbp
push   $0x3c0
mov    %rax,%r12
call   1040 <matprod_trans2_sub_xrows@plt>
mov    0x40(%rsp),%rbp
mov    %r12,%rax
add    $0x20,%rsp
add    $0x1e00,%r14
add    $0x1e00,%r15
add    $0xfffffc40,%ebx
cmp    $0x77f,%ebx
ja     1300 <matprod_trans2_sub+0x1c0>
mov    $0x3c0,%r10d
cmp    $0x3c1,%ebx
mov    0x38(%rsp),%rdx
jb     13c4 <matprod_trans2_sub+0x284>
mov    %r13,0x30(%rsp)
lea    0x3(%rbx),%r12d
shr    %r12d
and    $0xfffffffc,%r12d
sub    $0x8,%rsp
mov    %r14,%rdi
mov    0x38(%rsp),%rsi
mov    %r15,%rdx
mov    0x8(%rsp),%rcx
mov    0x20(%rsp),%r8
mov    0x14(%rsp),%r9d
push   %rax
push   %rbp
push   %r12
mov    %rax,%r13
call   1040 <matprod_trans2_sub_xrows@plt>
mov    0x40(%rsp),%rbp
mov    %r13,%rax
mov    0x58(%rsp),%rdx
mov    0x50(%rsp),%r13
add    $0x20,%rsp
lea    (%r14,%r12,8),%r14
lea    (%r15,%r12,8),%r15
sub    %r12d,%ebx
mov    %ebx,%r10d
mov    %rdx,%r12
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    0x8(%rsp),%rcx
mov    0x20(%rsp),%r15
mov    %r15d,%r8d
mov    0x14(%rsp),%r9d
push   %rax
push   %rbp
push   %r10
mov    %rax,%rbx
call   1040 <matprod_trans2_sub_xrows@plt>
mov    0x40(%rsp),%rax
add    $0x20,%rsp
mov    0x50(%rsp),%r10
sub    %eax,%r10d
je     1438 <matprod_trans2_sub+0x2f8>
cltq
lea    0x0(%r13,%rax,8),%r13
mov    %rax,%rcx
imul   0x40(%rsp),%rcx
mov    %r12,%rdx
lea    (%r12,%rcx,8),%rdx
test   %rbx,%rbx
lea    (%rbx,%rcx,8),%rcx
lea    (%rcx,%rax,8),%rax
cmovne %rax,%rbx
mov    %rbx,%rax
mov    0x48(%rsp),%rcx
jmp    1280 <matprod_trans2_sub+0x140>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @matprod_trans2_sub(double* noalias %0, double* noalias %1, double* noalias %2, i32 %3, i32 %4, i32 %5, i32 %6, double* %7) {
%9 = tail call i32 @assert(i32 1)
%10 = tail call i32 @assert(i32 1)
%11 = tail call i32 @assert(i32 1)
%12 = icmp sgt i32 %3, 1
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = icmp sgt i32 %4, 1
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = icmp sgt i32 %5, 1
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = icmp eq i32 %3, 2
br i1 %21, label %22, label %24
22: ; preds = %8
%23 = tail call i32 @matprod_trans2_n2(double* %0, double* %1, double* %2, i32 %4, i32 %5, i32 %6)
br label %99
24: ; preds = %8
%25 = icmp slt i32 %3, 961
%26 = icmp slt i32 %4, 33
%27 = and i1 %25, %26
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = tail call i32 @matprod_trans2_sub_xrowscols(double* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5, i32 %3, i32 %6, i32 %4, i32 0, i32 1, double* %7)
br label %99
30: ; preds = %24
br i1 %25, label %37, label %31
31: ; preds = %30
%32 = sitofp i32 %4 to double
%33 = fadd double %32, 9.600000e+02
%34 = fdiv double 9.500000e+04, %33
%35 = fptosi double %34 to i32
%36 = add nsw i32 %35, 1
br label %37
37: ; preds = %30, %31
%38 = phi i32 [ %36, %31 ], [ %6, %30 ]
%39 = icmp sgt i32 %3, 960
%40 = shl nsw i32 %38, 1
%41 = icmp ugt i32 %3, 1919
%42 = sext i32 %3 to i64
br label %43
43: ; preds = %90, %37
%44 = phi double* [ %2, %37 ], [ %94, %90 ]
%45 = phi double* [ %7, %37 ], [ %98, %90 ]
%46 = phi double* [ %1, %37 ], [ %92, %90 ]
%47 = phi i32 [ %6, %37 ], [ %88, %90 ]
%48 = icmp sgt i32 %47, %38
br i1 %48, label %49, label %57
49: ; preds = %43
%50 = icmp slt i32 %47, %40
%51 = sdiv i32 %47, 2
%52 = select i1 %50, i32 %51, i32 %38
%53 = add nsw i32 %52, 7
%54 = and i32 %53, -8
%55 = icmp sgt i32 %54, %47
%56 = select i1 %55, i32 %47, i32 %54
br label %57
57: ; preds = %49, %43
%58 = phi i32 [ %47, %43 ], [ %56, %49 ]
br i1 %39, label %59, label %83
59: ; preds = %57
br i1 %41, label %60, label %71
60: ; preds = %59, %60
%61 = phi i32 [ %67, %60 ], [ %3, %59 ]
%62 = phi double* [ %66, %60 ], [ %44, %59 ]
%63 = phi double* [ %65, %60 ], [ %0, %59 ]
%64 = tail call i32 @matprod_trans2_sub_xrows(double* %63, double* %46, double* %62, i32 %3, i32 %4, i32 %5, i32 960, i32 %58, double* %45)
%65 = getelementptr inbounds double, double* %63, i64 960
%66 = getelementptr inbounds double, double* %62, i64 960
%67 = add nsw i32 %61, -960
%68 = icmp ugt i32 %67, 1919
br i1 %68, label %60, label %69
69: ; preds = %60
%70 = icmp ugt i32 %67, 960
br i1 %70, label %71, label %83
71: ; preds = %59, %69
%72 = phi i32 [ %67, %69 ], [ %3, %59 ]
%73 = phi double* [ %66, %69 ], [ %44, %59 ]
%74 = phi double* [ %65, %69 ], [ %0, %59 ]
%75 = add nuw nsw i32 %72, 3
%76 = lshr i32 %75, 1
%77 = and i32 %76, 2147483644
%78 = tail call i32 @matprod_trans2_sub_xrows(double* %74, double* %46, double* %73, i32 %3, i32 %4, i32 %5, i32 %77, i32 %58, double* %45)
%79 = zext i32 %77 to i64
%80 = getelementptr inbounds double, double* %74, i64 %79
%81 = getelementptr inbounds double, double* %73, i64 %79
%82 = sub nuw nsw i32 %72, %77
br label %83
83: ; preds = %69, %71, %57
%84 = phi double* [ %80, %71 ], [ %65, %69 ], [ %0, %57 ]
%85 = phi double* [ %81, %71 ], [ %66, %69 ], [ %44, %57 ]
%86 = phi i32 [ %82, %71 ], [ 960, %69 ], [ %3, %57 ]
%87 = tail call i32 @matprod_trans2_sub_xrows(double* %84, double* %46, double* %85, i32 %3, i32 %4, i32 %5, i32 %86, i32 %58, double* %45)
%88 = sub nsw i32 %47, %58
%89 = icmp eq i32 %88, 0
br i1 %89, label %99, label %90
90: ; preds = %83
%91 = sext i32 %58 to i64
%92 = getelementptr inbounds double, double* %46, i64 %91
%93 = mul nsw i64 %91, %42
%94 = getelementptr inbounds double, double* %44, i64 %93
%95 = icmp eq double* %45, null
%96 = getelementptr inbounds double, double* %45, i64 %93
%97 = getelementptr inbounds double, double* %96, i64 %91
%98 = select i1 %95, double* null, double* %97
br label %43
99: ; preds = %83, %28, %22
ret void
}