// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
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 0xfa6d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x8630
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xf934
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 0x7cf0(%rip), %xmm2     # 0x17590
movdqa 0x7cf8(%rip), %xmm3     # 0x175a0
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x7cf8(%rip), %xmm5     # 0x175b0
testq %rcx, %rcx
je 0xf928
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 0xf905
movsd %xmm0, -0x8(%rsi,%r8,8)
pxor %xmm4, %xmm7
pextrw $0x4, %xmm7, %r9d
testb $0x1, %r9b
je 0xf91b
movsd %xmm0, (%rsi,%r8,8)
addq $0x2, %r8
paddq %xmm5, %xmm6
cmpq %r8, %rdx
jne 0xf8c4
incq %rdi
addq $0x20, %rsi
cmpq %rax, %rdi
jne 0xf8b8
movq %rbx, %rdi
movl $0x3, %esi
callq 0x8560
testl %eax, %eax
je 0xfac0
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x8630
movq 0x8(%rsp), %rax
movq (%rsp), %r9
testq %rax, %rax
je 0xfa26
leaq 0x1(%r9), %rcx
andq $-0x2, %rcx
leaq -0x1(%r9), %rdx
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
leaq 0x28(%rsp), %rdx
xorl %esi, %esi
movdqa 0x7bfe(%rip), %xmm2     # 0x17590
movdqa 0x7c06(%rip), %xmm3     # 0x175a0
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x7c06(%rip), %xmm5     # 0x175b0
testq %r9, %r9
je 0xfa17
xorl %edi, %edi
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, %r8d
notl %r8d
testb $0x1, %r8b
je 0xf9f5
movsd %xmm0, -0x8(%rdx,%rdi,8)
pxor %xmm4, %xmm7
pextrw $0x4, %xmm7, %r8d
testb $0x1, %r8b
je 0xfa0a
movsd %xmm0, (%rdx,%rdi,8)
addq $0x2, %rdi
paddq %xmm5, %xmm6
cmpq %rdi, %rcx
jne 0xf9b5
incq %rsi
addq $0x20, %rdx
cmpq %rax, %rsi
jne 0xf9aa
movq %rax, %r14
leaq 0x1a0(%rsp), %r15
leaq 0x120(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
movq %r14, %r8
callq 0x8130
movq 0x8(%rsp), %rdx
movq (%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %rdx, %r8
movq %rcx, %r9
callq 0x84d0
jmp 0xfb15
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 0xfaa8
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
je 0xf934
leaq 0x7b8e(%rip), %rsi      # 0x1763d
leaq 0x7ba1(%rip), %rdx      # 0x17657
movq %rbx, %rdi
movl $0x370, %ecx            # imm = 0x370
jmp 0xfb0e
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), %r14
cmpq 0x8(%rsp), %r14
jne 0xfaf8
movq 0x10(%rsp), %r9
cmpq (%rsp), %r9
je 0xfa26
leaq 0x7b3e(%rip), %rsi      # 0x1763d
leaq 0x7b51(%rip), %rdx      # 0x17657
movq %rbx, %rdi
movl $0x37d, %ecx            # imm = 0x37D
xorl %eax, %eax
callq 0x8a80
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %r15
retq