// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonglmath/src/mat.c
// Function: Mul
static int Mul(lua_State *L)
    {
    size_t i, j, k, nr1, nc1, nr2, nc2;
    mat_t m, m1, m2;
    double s;
    if(lua_isnumber(L, 1))
        return Mxs(L, 1, 2);
    if(lua_isnumber(L, 2))
        return Mxs(L, 2, 1);
    if(testvec(L, 2, NULL, NULL, NULL))
        return Mxv(L);
    /* matrix product  NxK * KxM -> NxM  (with N,K,M  != 1) */
    checkmat(L, 1, m1, &nr1, &nc1);
    checkmat(L, 2, m2, &nr2, &nc2);
    if((nc1 != nr2))
        return luaL_error(L, OPERANDS_ERROR);
    for(i=0; i < nr1; i++)
        for(j=0; j < nc2; j++)
            {
            s = 0;
            for(k=0; k < nc1; k++)
                s += m1[i][k] * m2[k][j];
            m[i][j] = s;
            }
    pushmat(L, m, nr1, nc2, nr1, nc2);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x85a0
testl %eax, %eax
je 0xfaf8
pushq $0x1
popq %rsi
pushq $0x2
jmp 0xfb0c
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x85a0
pushq $0x2
popq %rsi
testl %eax, %eax
je 0xfb26
pushq $0x1
popq %rdx
movq %rbx, %rdi
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x100b1
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x8ad0
testl %eax, %eax
je 0xfbe9
pushq $0x1
popq %rsi
leaq 0x120(%rsp), %r14
movq %rsp, %rcx
leaq 0x18(%rsp), %r8
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8560
pushq $0x2
popq %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %r8
callq 0x86d0
cmpl $0x0, (%r15)
jne 0xfbce
movq 0x10(%rsp), %rcx
cmpq 0x18(%rsp), %rcx
jne 0xfbce
movq (%rsp), %rax
xorl %edx, %edx
cmpq %rax, %rdx
je 0xfcf0
xorpd %xmm0, %xmm0
xorl %esi, %esi
cmpq %rsi, %rcx
je 0xfbbf
movsd (%r14,%rsi,8), %xmm1
mulsd 0xa0(%rsp,%rsi,8), %xmm1
addsd %xmm1, %xmm0
incq %rsi
jmp 0xfba2
movsd %xmm0, 0x20(%rsp,%rdx,8)
incq %rdx
addq $0x20, %r14
jmp 0xfb93
leaq 0x6a2b(%rip), %rsi      # 0x16600
leaq 0x6a3e(%rip), %rdx      # 0x1661a
movq %rbx, %rdi
movl $0x270, %ecx            # imm = 0x270
jmp 0xfcbb
pushq $0x1
popq %rbp
leaq 0xa0(%rsp), %r14
movq %rsp, %rcx
leaq 0x18(%rsp), %r12
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r12, %r8
callq 0x8560
pushq $0x2
popq %rsi
leaq 0x20(%rsp), %r15
leaq 0x10(%rsp), %r13
leaq 0x8(%rsp), %r8
movq %rbx, %rdi
movq %r15, %rdx
movq %r13, %rcx
callq 0x8560
movq (%r12), %rax
cmpq (%r13), %rax
jne 0xfca5
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
xorl %esi, %esi
cmpq %rdx, %rsi
je 0xfcd8
movq %rsi, %rdi
shlq $0x5, %rdi
addq %rsp, %rdi
addq $0x120, %rdi            # imm = 0x120
movq %r15, %r8
xorl %r9d, %r9d
cmpq %rcx, %r9
je 0xfc9c
xorpd %xmm0, %xmm0
movq %r8, %r10
xorl %r11d, %r11d
cmpq %r11, %rax
je 0xfc8d
movsd (%r14,%r11,8), %xmm1
mulsd (%r10), %xmm1
addsd %xmm1, %xmm0
incq %r11
addq $0x20, %r10
jmp 0xfc70
movsd %xmm0, (%rdi,%r9,8)
incq %r9
addq $0x8, %r8
jmp 0xfc61
incq %rsi
addq $0x20, %r14
jmp 0xfc41
leaq 0x6954(%rip), %rsi      # 0x16600
leaq 0x6967(%rip), %rdx      # 0x1661a
movq %rbx, %rdi
movl $0x28c, %ecx            # imm = 0x28C
xorl %eax, %eax
callq 0x8b00
movl %eax, %ebp
movl %ebp, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x120(%rsp), %rsi
movq %rbx, %rdi
movq %rdx, %r8
movq %rcx, %r9
callq 0x8500
jmp 0xfcc4
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
movq %rcx, %rdx
xorl %r8d, %r8d
callq 0x8310
jmp 0xfcc2