// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonglmath/src/mat.c
// Function: moonglmath_mat_Smoothstep
int mat_Smoothstep(lua_State *L)
    {
    mat_t dst, m, edge0, edge1;
    size_t nr, nc, nr1, nc1, i, j;
    checkmat(L, 1, m, &nr, &nc);
    if(lua_isnumber(L, 2))
        {
        double k = lua_tonumber(L, 2);
        for(i=0; i<nr; i++)
            for(j=0; j<nc; j++)
                edge0[i][j] = k;
        }
    else
        {
        checkmat(L, 2, edge0, &nr1, &nc1);
        if(nr1 != nr || nc1 != nc)
            return luaL_error(L, OPERANDS_ERROR);
        }
    if(lua_isnumber(L, 3))
        {
        double k = lua_tonumber(L, 3);
        for(i=0; i<nr; i++)
            for(j=0; j<nc; j++)
                edge1[i][j] = k;
        }
    else
        {
        checkmat(L, 3, edge1, &nr1, &nc1);
        if(nr1 != nr || nc1 != nc)
            return luaL_error(L, OPERANDS_ERROR);
        }
    mat_smoothstep(dst, m, edge0, edge1, nr, nc);
    return pushmat(L, dst, nr, nc, nr, nc);
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
leaq 0x120(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %rsp, %r8
movl $0x1, %esi
callq 0x8520
movq %rbx, %rdi
movl $0x2, %esi
callq 0x8560
testl %eax, %eax
je 0xfa29
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x8630
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xf8ed
movq (%rsp), %rcx
leaq 0x1(%rcx), %rdx
andq $-0x2, %rdx
leaq -0x1(%rcx), %rsi
movq %rsi, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
leaq 0xa8(%rsp), %rsi
xorl %edi, %edi
movdqa 0x7d37(%rip), %xmm2     # 0x17590
movdqa 0x7d3f(%rip), %xmm3     # 0x175a0
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x7d3f(%rip), %xmm5     # 0x175b0
testq %rcx, %rcx
je 0xf8e1
xorl %r8d, %r8d
movdqa %xmm2, %xmm6
movdqa %xmm6, %xmm7
pxor %xmm3, %xmm7
movdqa %xmm7, %xmm8
pcmpgtd %xmm1, %xmm8
pcmpeqd %xmm1, %xmm7
pshufd $0xf5, %xmm7, %xmm9     # xmm9 = xmm7[1,1,3,3]
pand %xmm8, %xmm9
pshufd $0xf5, %xmm8, %xmm7     # xmm7 = xmm8[1,1,3,3]
por %xmm9, %xmm7
movd %xmm7, %r9d
notl %r9d
testb $0x1, %r9b
je 0xf8be
movsd %xmm0, -0x8(%rsi,%r8,8)
pxor %xmm4, %xmm7
pextrw $0x4, %xmm7, %r9d
testb $0x1, %r9b
je 0xf8d4
movsd %xmm0, (%rsi,%r8,8)
addq $0x2, %r8
paddq %xmm5, %xmm6
cmpq %r8, %rdx
jne 0xf87d
incq %rdi
addq $0x20, %rsi
cmpq %rax, %rdi
jne 0xf871
movq %rbx, %rdi
movl $0x3, %esi
callq 0x8560
testl %eax, %eax
je 0xfa7c
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x8630
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xf9dc
movq (%rsp), %rcx
leaq 0x1(%rcx), %rdx
andq $-0x2, %rdx
leaq -0x1(%rcx), %rsi
movq %rsi, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
leaq 0x28(%rsp), %rsi
xorl %edi, %edi
movdqa 0x7c48(%rip), %xmm2     # 0x17590
movdqa 0x7c50(%rip), %xmm3     # 0x175a0
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x7c50(%rip), %xmm5     # 0x175b0
testq %rcx, %rcx
je 0xf9d0
xorl %r8d, %r8d
movdqa %xmm2, %xmm6
movdqa %xmm6, %xmm7
pxor %xmm3, %xmm7
movdqa %xmm7, %xmm8
pcmpgtd %xmm1, %xmm8
pcmpeqd %xmm1, %xmm7
pshufd $0xf5, %xmm7, %xmm9     # xmm9 = xmm7[1,1,3,3]
pand %xmm8, %xmm9
pshufd $0xf5, %xmm8, %xmm7     # xmm7 = xmm8[1,1,3,3]
por %xmm9, %xmm7
movd %xmm7, %r9d
notl %r9d
testb $0x1, %r9b
je 0xf9ad
movsd %xmm0, -0x8(%rsi,%r8,8)
pxor %xmm4, %xmm7
pextrw $0x4, %xmm7, %r9d
testb $0x1, %r9b
je 0xf9c3
movsd %xmm0, (%rsi,%r8,8)
addq $0x2, %r8
paddq %xmm5, %xmm6
cmpq %r8, %rdx
jne 0xf96c
incq %rdi
addq $0x20, %rsi
cmpq %rax, %rdi
jne 0xf960
movq 0x8(%rsp), %r8
movq (%rsp), %r9
leaq 0x1a0(%rsp), %r14
leaq 0x120(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r14, %rdi
callq 0x8130
movq 0x8(%rsp), %rdx
movq (%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rdx, %r8
movq %rcx, %r9
callq 0x84d0
jmp 0xfad1
leaq 0xa0(%rsp), %rdx
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
movl $0x2, %esi
movq %r14, %rcx
callq 0x8520
movq (%r14), %rax
cmpq 0x8(%rsp), %rax
jne 0xfa64
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
je 0xf8ed
leaq 0x7bd2(%rip), %rsi      # 0x1763d
leaq 0x7be5(%rip), %rdx      # 0x17657
movq %rbx, %rdi
movl $0x370, %ecx            # imm = 0x370
jmp 0xfaca
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
movl $0x3, %esi
movq %r14, %rcx
callq 0x8520
movq (%r14), %rax
cmpq 0x8(%rsp), %rax
jne 0xfab4
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
je 0xf9dc
leaq 0x7b82(%rip), %rsi      # 0x1763d
leaq 0x7b95(%rip), %rdx      # 0x17657
movq %rbx, %rdi
movl $0x37d, %ecx            # imm = 0x37D
xorl %eax, %eax
callq 0x8a80
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
retq