// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonglmath/src/mat.c
// Function: Mat
static int Mat(lua_State *L, size_t nr, size_t nc)
/* mat()  -> square identity
 * mat(m)  m=matrix (any size)
 * mat(v1,...,vnr) nr row vectors,
 * mat(v1,...,vnc) nc column vectors,
 * mat(val1, val2, ...)  values in row-major order
 */
    {
    mat_t m;
    size_t mr, mc, i, j, arg;
    unsigned int isrow;
    checkmatsize(L, nr, nc);
    arg = 1;
    if(lua_isnoneornil(L, arg)) /* square identity (or all zeros if nr != nc) */
        {
        mat_clear(m);
        if(nr == nc)
            for(i = 0; i< nr; i++) m[i][i] = 1;
        return pushmat(L, m, nr, nc, nr, nc);
        }

    if(testmat(L, arg, m, &mr, &mc)) /* initialization from matrix */
        return pushmat(L, m, mr, mc, nr, nc);

    if(testvec(L, arg, NULL, NULL, &isrow)) /*initialization from vectors */
        return Matfromvecs(L, nr, nc, isrow);

    checkmatsize(L, nr, nc);
    for(i = 0; i < nr; i++)
        for(j = 0; j < nc; j++)
            m[i][j] = luaL_optnumber(L, arg++, 0);
    return pushmat(L, m, nr, nc, nr, nc);
    }

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movq %rdx, 0xb8(%rsp)
cmpq $0x1, 0xc0(%rsp)
jb 0x1800b
cmpq $0x4, 0xc0(%rsp)
ja 0x1800b
cmpq $0x1, 0xb8(%rsp)
jb 0x1800b
cmpq $0x4, 0xb8(%rsp)
jbe 0x1802d
movq 0xc8(%rsp), %rdi
leaq 0xb536(%rip), %rsi      # 0x23550
movb $0x0, %al
callq 0x8b30
movl %eax, 0xd4(%rsp)
jmp 0x182d3
jmp 0x1802f
movq $0x1, 0x8(%rsp)
movq 0xc8(%rsp), %rdi
movq 0x8(%rsp), %rax
movl %eax, %esi
callq 0x8d20
cmpl $0x0, %eax
jg 0x18103
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x8530
movq 0xc0(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jne 0x180c5
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0xc0(%rsp), %rax
jae 0x180c3
movq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rsp), %rcx
movsd 0xb012(%rip), %xmm0     # 0x230c0
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x18081
jmp 0x180c5
movq 0xc8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0xb8(%rsp), %rcx
movq 0xc0(%rsp), %r8
movq 0xb8(%rsp), %r9
callq 0x8500
movl %eax, 0xd4(%rsp)
jmp 0x182d3
movq 0xc8(%rsp), %rdi
movq 0x8(%rsp), %rax
movl %eax, %esi
leaq 0x30(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x8a30
cmpl $0x0, %eax
je 0x18163
movq 0xc8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0xc0(%rsp), %r8
movq 0xb8(%rsp), %r9
callq 0x8500
movl %eax, 0xd4(%rsp)
jmp 0x182d3
movq 0xc8(%rsp), %rdi
movq 0x8(%rsp), %rax
movl %eax, %esi
xorl %eax, %eax
movl %eax, %ecx
leaq 0x4(%rsp), %r8
movq %rcx, %rdx
callq 0x8b00
cmpl $0x0, %eax
je 0x181b5
movq 0xc8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
movl 0x4(%rsp), %ecx
callq 0x182f0
movl %eax, 0xd4(%rsp)
jmp 0x182d3
jmp 0x181b7
cmpq $0x1, 0xc0(%rsp)
jb 0x181e3
cmpq $0x4, 0xc0(%rsp)
ja 0x181e3
cmpq $0x1, 0xb8(%rsp)
jb 0x181e3
cmpq $0x4, 0xb8(%rsp)
jbe 0x18205
movq 0xc8(%rsp), %rdi
leaq 0xb35e(%rip), %rsi      # 0x23550
movb $0x0, %al
callq 0x8b30
movl %eax, 0xd4(%rsp)
jmp 0x182d3
jmp 0x18207
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0xc0(%rsp), %rax
jae 0x1829a
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jae 0x18285
movq 0xc8(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rsp)
movl %eax, %esi
xorps %xmm0, %xmm0
callq 0x8370
movq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x18228
jmp 0x18287
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x18210
movq 0xc8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0xb8(%rsp), %rcx
movq 0xc0(%rsp), %r8
movq 0xb8(%rsp), %r9
callq 0x8500
movl %eax, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)