// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x258, %rsp            # imm = 0x258
movq %rdi, 0x248(%rsp)
movq 0x248(%rsp), %rdi
leaq 0x140(%rsp), %rdx
movl $0x1, %esi
leaq 0x38(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x8560
movq 0x248(%rsp), %rdi
movl $0x2, %esi
callq 0x85a0
cmpl $0x0, %eax
je 0x165cc
movq 0x248(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x8680
movsd %xmm0, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x165ca
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x165b8
movsd 0x8(%rsp), %xmm0
movq 0x18(%rsp), %rcx
leaq 0xc0(%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 0x16578
jmp 0x165ba
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x16563
jmp 0x16638
movq 0x248(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
movl $0x2, %esi
leaq 0x28(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x8560
movq 0x28(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0x16608
movq 0x20(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x16636
movq 0x248(%rsp), %rdi
leaq 0xcfa9(%rip), %rsi      # 0x235c0
leaq 0xcfbc(%rip), %rdx      # 0x235da
movl $0x370, %ecx            # imm = 0x370
movb $0x0, %al
callq 0x8b30
movl %eax, 0x254(%rsp)
jmp 0x1679e
jmp 0x16638
movq 0x248(%rsp), %rdi
movl $0x3, %esi
callq 0x85a0
cmpl $0x0, %eax
je 0x166dc
movq 0x248(%rsp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x8680
movsd %xmm0, (%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x166da
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x166c8
movsd (%rsp), %xmm0
movq 0x18(%rsp), %rcx
leaq 0x40(%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 0x1668c
jmp 0x166ca
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x16677
jmp 0x16742
movq 0x248(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movl $0x3, %esi
leaq 0x28(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x8560
movq 0x28(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0x16715
movq 0x20(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x16740
movq 0x248(%rsp), %rdi
leaq 0xce9c(%rip), %rsi      # 0x235c0
leaq 0xceaf(%rip), %rdx      # 0x235da
movl $0x37d, %ecx            # imm = 0x37D
movb $0x0, %al
callq 0x8b30
movl %eax, 0x254(%rsp)
jmp 0x1679e
jmp 0x16742
leaq 0x1c0(%rsp), %rdi
leaq 0x140(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %r9
callq 0x8140
movq 0x248(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %r9
callq 0x8500
movl %eax, 0x254(%rsp)
movl 0x254(%rsp), %eax
addq $0x258, %rsp            # imm = 0x258
retq
nopl (%rax)