// File: chiku[P]cmatrix/src/impl/matrix/numerical.cpp
// Function: cmatrix::Matrix<double> cmatrix::operator-<double>(cmatrix::Matrix<double>, cmatrix::Matrix<double>)
Matrix<Type> operator - (const Matrix<Type> firstMatrix, const Matrix<Type> secondMatrix)
{
    if (firstMatrix.size != secondMatrix.size) {
        throw Exception::IncompatibleSubtraction(ExceptionBody::IncompatibleSubtraction(firstMatrix.size, secondMatrix.size));
    }

    Matrix<Type> difference(firstMatrix.rows(), firstMatrix.columns());

    for (int i = 0; i < firstMatrix.rows(); i++) {
        for (int j = 0; j < firstMatrix.columns(); j++) {
            difference.access(i, j) = firstMatrix.access(i, j) - secondMatrix.access(i, j);
        }
    }

    return difference;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdx, -0x98(%rbp)
movq %rsi, %rax
movq -0x98(%rbp), %rsi
movq %rax, -0x90(%rbp)
movq %rdi, %rax
movq -0x90(%rbp), %rdi
movq %rax, -0x88(%rbp)
movq %rax, %rcx
movq %rcx, -0x80(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
callq 0x12600
testb $0x1, %al
jne 0x2fcb5
jmp 0x2fd75
movb $0x1, -0x6d(%rbp)
movl $0x10, %edi
callq 0x61c0
movq -0x90(%rbp), %rcx
movq %rax, %rdx
movq -0x98(%rbp), %rax
movq %rdx, -0xa0(%rbp)
movups (%rcx), %xmm0
movaps %xmm0, -0x50(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x60(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %r8
leaq -0x38(%rbp), %rdi
callq 0x30220
jmp 0x2fd04
movq -0xa0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x303e0
jmp 0x2fd16
movq -0xa0(%rbp), %rdi
movb $0x0, -0x6d(%rbp)
leaq 0x56b98(%rip), %rsi     # 0x868c0
leaq 0x6f1(%rip), %rdx       # 0x30420
callq 0x6760
jmp 0x2fefc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x2fd5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6230
testb $0x1, -0x6d(%rbp)
jne 0x2fd64
jmp 0x2fd70
movq -0xa0(%rbp), %rdi
callq 0x62c0
jmp 0x2fef3
movq -0x90(%rbp), %rdi
movb $0x0, -0x6e(%rbp)
callq 0x10160
movq -0x90(%rbp), %rdi
movq %rax, -0xa8(%rbp)
callq 0x10330
movq -0x88(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
callq 0x100e0
movl $0x0, -0x74(%rbp)
movq -0x90(%rbp), %rdi
movslq -0x74(%rbp), %rax
movq %rax, -0xb0(%rbp)
callq 0x10160
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jge 0x2fed0
movl $0x0, -0x78(%rbp)
movq -0x90(%rbp), %rdi
movslq -0x78(%rbp), %rax
movq %rax, -0xb8(%rbp)
callq 0x10330
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jge 0x2fec0
movq -0x90(%rbp), %rdi
movslq -0x74(%rbp), %rsi
movslq -0x78(%rbp), %rdx
callq 0x122e0
movsd %xmm0, -0xc0(%rbp)
jmp 0x2fe2e
movq -0x98(%rbp), %rdi
movslq -0x74(%rbp), %rsi
movslq -0x78(%rbp), %rdx
callq 0x122e0
movsd %xmm0, -0xc8(%rbp)
jmp 0x2fe4c
movq -0x88(%rbp), %rdi
movsd -0xc8(%rbp), %xmm1
movsd -0xc0(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0xd8(%rbp)
movslq -0x74(%rbp), %rsi
movslq -0x78(%rbp), %rdx
callq 0x10e80
movq %rax, -0xd0(%rbp)
jmp 0x2fe85
movq -0xd0(%rbp), %rax
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x2fde6
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
callq 0x105f0
jmp 0x2fef3
jmp 0x2fec2
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x2fdb5
movb $0x1, -0x6e(%rbp)
testb $0x1, -0x6e(%rbp)
jne 0x2fee6
movq -0x88(%rbp), %rdi
callq 0x105f0
movq -0x80(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x67c0
nopl (%rax)