// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/num/mtx.c
// Function: tt_mtx_mul
int tt_mtx_mul(struct tt_mtx *mo,
		const struct tt_mtx *mi1, const struct tt_mtx *mi2)
{
	tt_assert(mi1->cols == mi2->rows);
	tt_assert(mo->rows == mi1->rows);
	tt_assert(mo->cols == mi2->cols);

	for (int i = 0; i < mi1->rows; i++) {
		double *v1 = _tt_mtx_row(mi1, i);
		for (int j = 0; j < mi2->cols; j++) {
			double o = 0.0f;
			double *v2 = _tt_mtx_el(mi2, 0, j);
			for (int k = 0; k < mi1->cols; k++) {
				o += (*v1) * (*v2);
				v1++;
				v2 += mi2->cols;
			}
			*_tt_mtx_el(mo, i, j) = o;
		}
	}

	return 0;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x48(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x40(%rsp), %rcx
cmpl (%rcx), %eax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x1551
xorl %edi, %edi
leaq 0x6c50(%rip), %rsi      # 0x8181
leaq 0x6c54(%rip), %rdx      # 0x818c
leaq 0x6c67(%rip), %rcx      # 0x81a6
movl $0x14, %r8d
movb $0x0, %al
callq 0x3600
callq 0x1040
jmp 0x1553
jmp 0x1555
movq 0x50(%rsp), %rax
movl (%rax), %eax
movq 0x48(%rsp), %rcx
cmpl (%rcx), %eax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x15a2
xorl %edi, %edi
leaq 0x6bff(%rip), %rsi      # 0x8181
leaq 0x6c03(%rip), %rdx      # 0x818c
leaq 0x6c16(%rip), %rcx      # 0x81a6
movl $0x15, %r8d
movb $0x0, %al
callq 0x3600
callq 0x1040
jmp 0x15a4
jmp 0x15a6
movq 0x50(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x40(%rsp), %rcx
cmpl 0x4(%rcx), %eax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x15f5
xorl %edi, %edi
leaq 0x6bac(%rip), %rsi      # 0x8181
leaq 0x6bb0(%rip), %rdx      # 0x818c
leaq 0x6bc3(%rip), %rcx      # 0x81a6
movl $0x16, %r8d
movb $0x0, %al
callq 0x3600
callq 0x1040
jmp 0x15f7
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x48(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x1718
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x1720
movq %rax, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x1706
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %edx
xorl %esi, %esi
callq 0x17a0
movq %rax, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x48(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x16ce
movq 0x30(%rsp), %rax
movsd (%rax), %xmm0
movq 0x18(%rsp), %rax
movsd (%rax), %xmm2
movsd 0x20(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x18(%rsp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x1663
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x50(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl 0x2c(%rsp), %edx
callq 0x17a0
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x162b
jmp 0x1708
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x15ff
xorl %eax, %eax
addq $0x58, %rsp
retq
nop