// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x1, %esi
callq 0x8c40
testl %eax, %eax
jle 0x109ea
leaq 0x40(%rsp), %r12
leaq 0x38(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %r14, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x8990
testl %eax, %eax
je 0x10b04
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
jmp 0x10ae7
pxor %xmm0, %xmm0
movdqa %xmm0, 0xb0(%rsp)
movdqa %xmm0, 0xa0(%rsp)
movdqa %xmm0, 0x90(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
movdqa %xmm0, 0x40(%rsp)
cmpq %rbx, %r15
setne %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x10ad9
leaq 0x1(%r15), %rax
andq $-0x2, %rax
leaq -0x1(%r15), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x6b34(%rip), %xmm1     # 0x17590
leaq 0x40(%rsp), %rcx
movdqa 0x6b37(%rip), %xmm2     # 0x175a0
pxor %xmm2, %xmm0
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
pcmpeqd %xmm3, %xmm3
movdqa 0x6b2d(%rip), %xmm4     # 0x175b0
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x10ab8
movq %rdx, (%rcx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x10acb
movq %rdx, 0x28(%rcx)
paddq %xmm4, %xmm1
addq $0x50, %rcx
addq $-0x2, %rax
jne 0x10a83
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x84d0
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24(%rsp), %r8
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x8a50
testl %eax, %eax
je 0x10c4c
movl 0x24(%rsp), %eax
pxor %xmm0, %xmm0
movdqa %xmm0, 0xc0(%rsp)
movdqa %xmm0, 0xd0(%rsp)
movdqa %xmm0, 0xe0(%rsp)
movdqa %xmm0, 0xf0(%rsp)
movdqa %xmm0, 0x100(%rsp)
movdqa %xmm0, 0x110(%rsp)
movdqa %xmm0, 0x120(%rsp)
movdqa %xmm0, 0x130(%rsp)
movl %eax, 0x14(%rsp)
cmpl $0x1, %eax
movq %rbx, %rax
movq %r15, 0x18(%rsp)
cmoveq %r15, %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x10bf4
xorl %r12d, %r12d
leaq 0x140(%rsp), %r13
leaq 0x150(%rsp), %rbp
leaq 0xc0(%rsp), %r14
xorl %r15d, %r15d
incq %r15
movq 0x8(%rsp), %rdi
movl %r15d, %esi
movq %r14, %rdx
movq %rbp, %rcx
movq %r13, %r8
callq 0x8a50
testl %eax, %eax
je 0x10bdd
movl 0x14(%rsp), %eax
cmpl %eax, (%r13)
jne 0x10d1a
addl $0x2, %r12d
addq $0x4, %r13
addq $0x8, %rbp
addq $0x20, %r14
cmpq %r15, 0x28(%rsp)
jne 0x10bb2
cmpl $0x0, 0x14(%rsp)
je 0x10cb4
movq 0x18(%rsp), %r13
testq %r13, %r13
je 0x10cff
leaq (,%rbx,8), %r14
xorl %r15d, %r15d
movq %r13, %r12
testq %rbx, %rbx
je 0x10c3e
leaq (%rsp,%r15), %rsi
addq $0xc0, %rsi
leaq (%rsp,%r15), %rdi
addq $0x170, %rdi            # imm = 0x170
movq %r14, %rdx
callq 0x8760
addq $0x20, %r15
decq %r12
jne 0x10c1b
jmp 0x10cff
testq %r15, %r15
je 0x10ca5
movl $0x1, %esi
xorl %r14d, %r14d
movq %r15, 0x18(%rsp)
movq 0x8(%rsp), %rbp
testq %rbx, %rbx
je 0x10c8e
xorl %r13d, %r13d
leaq 0x1(%rsi), %r15
pxor %xmm0, %xmm0
movq %rbp, %rdi
callq 0x8340
movq %xmm0, (%r12,%r13,8)
incq %r13
movq %r15, %rsi
cmpq %r13, %rbx
jne 0x10c6b
jmp 0x10c91
movq %rsi, %r15
incq %r14
addq $0x20, %r12
movq %r15, %rsi
movq 0x18(%rsp), %r15
cmpq %r15, %r14
jne 0x10c63
leaq 0x40(%rsp), %rsi
movq 0x8(%rsp), %rdi
jmp 0x10ae1
movq 0x18(%rsp), %r13
testq %r13, %r13
je 0x10cff
leaq 0x170(%rsp), %rax
leaq 0xc0(%rsp), %rcx
xorl %edx, %edx
testq %rbx, %rbx
je 0x10cef
movq %rcx, %rsi
xorl %edi, %edi
movq (%rsi), %xmm0
movq %xmm0, (%rax,%rdi,8)
incq %rdi
addq $0x20, %rsi
cmpq %rdi, %rbx
jne 0x10cda
incq %rdx
addq $0x20, %rax
addq $0x8, %rcx
cmpq %r13, %rdx
jne 0x10cd0
leaq 0x170(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %r13, %rdx
movq %rbx, %rcx
movq %r13, %r8
jmp 0x10aea
leaq 0x69bc(%rip), %rdx      # 0x176dd
movq 0x8(%rsp), %rdi
movl %r12d, %esi
callq 0x81b0
jmp 0x10af2