// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonglmath/src/mat.c
// Function: moonglmath_pushmat
int pushmat(lua_State *L, mat_t m, size_t mr, size_t mc, size_t nr, size_t nc)
/* mr, mc = no. of valid colums/rows in m
 */
    {
    size_t i, j;
    checkmatsize(L, nr, nc);
    lua_newtable(L);
    setmetatable(L, MAT_MT);
    for(i=0; i<nr; i++)
        {
        lua_newtable(L); /* row i+1 */
        for(j=0; j<nc; j++)
            {
            lua_pushnumber(L, (i < mr) && (j < mc) ? m[i][j] : 0);
            lua_seti(L, -2, j+1);
            }
        lua_seti(L, -2, i+1);
        }
    for(i=nr; i<4; i++)
        {
        lua_newtable(L); /* empty rows */
        lua_seti(L, -2, i+1);
        }
    lua_pushinteger(L, nr);
    lua_setfield(L, -2, "rows");
    lua_pushinteger(L, nc);
    lua_setfield(L, -2, "columns");
    return 1;
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %r9, 0x20(%rsp)
cmpq $0x1, 0x28(%rsp)
jb 0x120e2
cmpq $0x4, 0x28(%rsp)
ja 0x120e2
cmpq $0x1, 0x20(%rsp)
jb 0x120e2
cmpq $0x4, 0x20(%rsp)
jbe 0x120fe
movq 0x48(%rsp), %rdi
leaq 0x11462(%rip), %rsi     # 0x23550
movb $0x0, %al
callq 0x8b30
movl %eax, 0x54(%rsp)
jmp 0x122ac
jmp 0x12100
movq 0x48(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x8320
movq 0x48(%rsp), %rdi
leaq 0x1123b(%rip), %rsi     # 0x23355
callq 0x89f0
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x12212
movq 0x48(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x8320
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
jae 0x121e7
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x121a3
movq 0x10(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x121a3
movq 0x40(%rsp), %rax
movq 0x18(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rsp)
jmp 0x121ad
xorps %xmm0, %xmm0
movsd %xmm0, (%rsp)
jmp 0x121ad
movq 0x8(%rsp), %rdi
movsd (%rsp), %xmm0
callq 0x8840
movq 0x48(%rsp), %rdi
movq 0x10(%rsp), %rdx
addq $0x1, %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86a0
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x1214f
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %rdx
addq $0x1, %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86a0
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x12128
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x4, 0x18(%rsp)
jae 0x1225a
movq 0x48(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x8320
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %rdx
addq $0x1, %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86a0
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x1221c
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x8540
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x112c9(%rip), %rdx     # 0x23543
callq 0x84e0
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x8540
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x112a9(%rip), %rdx     # 0x23548
callq 0x84e0
movl $0x1, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)