// File: theolepage[P]prophecy/src/model/../layer/../matrix/matrix.hh
// Function: Matrix<float>::dot(Matrix<float> const&, Matrix<float> const&, transpose)
static Matrix<T> dot(const Matrix& left, const Matrix &right, transpose order)
    {
        if (left.cols_ == right.rows_)
        {
            Matrix result(left.rows_, right.cols_);
            float sum = 0.0f;
            for (int y = 0; y < left.rows_; ++y)
            {
                for (int x = 0; x < right.cols_; ++x)
                {
                    for (int k = 0; k < left.cols_; k++)
                        sum += left(y, k) * right(k, x);
                    result(y, x) = sum;
                    sum = 0;
                }
            }
            return result;
        }
        else if (left.rows_ == right.rows_ && order == transpose::LEFT) // Implicit left transpose
        {
            Matrix result(left.cols_, right.cols_);
            float sum = 0.0f;
            for (int x = 0; x < left.cols_; ++x)
            {
                for (int y = 0; y < right.cols_; ++y)
                {
                    for (int k = 0; k < left.rows_; k++)
                        sum += left(k, x) * right(k, y);
                    result(x, y) = sum;
                    sum = 0;
                }
            }
            return result;
        }
        else if (left.cols_ == right.cols_ && order == transpose::RIGHT) // Implicit right transpose
        {
            Matrix result(left.rows_, right.rows_);
            float sum = 0.0f;
            for (int y = 0; y < left.rows_; ++y)
            {
                for (int x = 0; x < right.rows_; ++x)
                {
                    for (int k = 0; k < right.cols_; k++)
                        sum += left(y, k) * right(x, k);
                    result(y, x) = sum;
                    sum = 0;
                }
            }
            return result;
        }
        else
            throw std::invalid_argument("Bad Matrix multiplication");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x8510
movq -0x78(%rbp), %rdi
movb $0x0, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
callq 0x3710
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x84f8
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x84e8
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x849a
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x8860
movss %xmm0, -0x7c(%rbp)
jmp 0x8443
movq -0x18(%rbp), %rdi
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x8860
movss %xmm0, -0x80(%rbp)
jmp 0x8459
movss -0x80(%rbp), %xmm2
movss -0x7c(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x8421
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x34d0
jmp 0x8855
movq -0x78(%rbp), %rdi
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x8c(%rbp)
movl -0x28(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x37d0
movq %rax, -0x88(%rbp)
jmp 0x84bf
movq -0x88(%rbp), %rax
movss -0x8c(%rbp), %xmm0
movss %xmm0, (%rax)
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x840a
jmp 0x84ea
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x83f3
movb $0x1, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0x850b
movq -0x78(%rbp), %rdi
callq 0x34d0
jmp 0x8848
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x8681
cmpl $0x0, -0x1c(%rbp)
jne 0x8681
movq -0x78(%rbp), %rdi
movb $0x0, -0x3d(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
callq 0x3710
xorps %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x8669
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x8659
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x860b
movq -0x10(%rbp), %rdi
movl -0x50(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x8860
movss %xmm0, -0x90(%rbp)
jmp 0x85ab
movq -0x18(%rbp), %rdi
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
callq 0x8860
movss %xmm0, -0x94(%rbp)
jmp 0x85c4
movss -0x94(%rbp), %xmm2
movss -0x90(%rbp), %xmm0
movss -0x44(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x44(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x8586
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x34d0
jmp 0x8855
movq -0x78(%rbp), %rdi
movss -0x44(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movl -0x48(%rbp), %esi
movl -0x4c(%rbp), %edx
callq 0x37d0
movq %rax, -0xa0(%rbp)
jmp 0x8630
movq -0xa0(%rbp), %rax
movss -0xa4(%rbp), %xmm0
movss %xmm0, (%rax)
xorps %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x856f
jmp 0x865b
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x8558
movb $0x1, -0x3d(%rbp)
testb $0x1, -0x3d(%rbp)
jne 0x867c
movq -0x78(%rbp), %rdi
callq 0x34d0
jmp 0x8848
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x87ef
cmpl $0x1, -0x1c(%rbp)
jne 0x87ef
movq -0x78(%rbp), %rdi
movb $0x0, -0x51(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x3710
xorps %xmm0, %xmm0
movss %xmm0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x87da
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x87ca
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x877c
movq -0x10(%rbp), %rdi
movl -0x5c(%rbp), %esi
movl -0x64(%rbp), %edx
callq 0x8860
movss %xmm0, -0xa8(%rbp)
jmp 0x871c
movq -0x18(%rbp), %rdi
movl -0x60(%rbp), %esi
movl -0x64(%rbp), %edx
callq 0x8860
movss %xmm0, -0xac(%rbp)
jmp 0x8735
movss -0xac(%rbp), %xmm2
movss -0xa8(%rbp), %xmm0
movss -0x58(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x58(%rbp)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x86f7
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x34d0
jmp 0x8855
movq -0x78(%rbp), %rdi
movss -0x58(%rbp), %xmm0
movss %xmm0, -0xbc(%rbp)
movl -0x5c(%rbp), %esi
movl -0x60(%rbp), %edx
callq 0x37d0
movq %rax, -0xb8(%rbp)
jmp 0x87a1
movq -0xb8(%rbp), %rax
movss -0xbc(%rbp), %xmm0
movss %xmm0, (%rax)
xorps %xmm0, %xmm0
movss %xmm0, -0x58(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x86e0
jmp 0x87cc
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x86c9
movb $0x1, -0x51(%rbp)
testb $0x1, -0x51(%rbp)
jne 0x87ed
movq -0x78(%rbp), %rdi
callq 0x34d0
jmp 0x8848
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xc8(%rbp)
leaq 0x18ff(%rip), %rsi      # 0xa10c
callq 0x2220
jmp 0x8814
movq -0xc8(%rbp), %rdi
movq 0x77be(%rip), %rsi      # 0xffe0
movq 0x77a7(%rip), %rdx      # 0xffd0
callq 0x21f0
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x20e0
jmp 0x8855
movq -0x70(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2200
nop