// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/nine_slice.c
// Function: New
static ud_t* New(lua_State *L, unsigned short w, unsigned short h, nk_rect_t subregion, unsigned short l, unsigned short t, unsigned short r, unsigned short b)
    {
    ud_t *ud;
    nk_nine_slice_t *nine_slice;
    int id = 0;
    void *ptr = NULL;

    if(lua_type(L, 1) == LUA_TLIGHTUSERDATA)
        ptr = checklightuserdata(L, 1);
    else
        id = luaL_checkinteger(L, 1);

    nine_slice = (nk_nine_slice_t*)Malloc(L, sizeof(nk_nine_slice_t));
    if(ptr) { nine_slice->img.handle.ptr = ptr; } else { nine_slice->img.handle.id = id; }
    nine_slice->l = l;
    nine_slice->t = t;
    nine_slice->r = r;
    nine_slice->b = b;
    nine_slice->img.w = w;
    nine_slice->img.h = h;
    nine_slice->img.region[0] = (unsigned short)subregion.x;
    nine_slice->img.region[1] = (unsigned short)subregion.y;
    nine_slice->img.region[2] = (unsigned short)subregion.w;
    nine_slice->img.region[3] = (unsigned short)subregion.h;
    ud = newuserdata(L, nine_slice, NINE_SLICE_MT, "nine_slice");
    ud->parent_ud = NULL;
    ud->destructor = freenine_slice;
    if(!ptr) MarkNineSliceId(ud);
    return ud;
    }

// Assembly:
subq $0x58, %rsp
movl %r8d, (%rsp)
movl %ecx, %eax
movl (%rsp), %ecx
movl %eax, 0x4(%rsp)
movl %edx, %eax
movl 0x4(%rsp), %edx
movl %eax, 0x8(%rsp)
movl %esi, %eax
movl 0x8(%rsp), %esi
movl %eax, 0xc(%rsp)
movq %rdi, %r8
movl 0xc(%rsp), %edi
movw %r9w, %ax
movw 0x60(%rsp), %r9w
movlpd %xmm0, 0x48(%rsp)
movlpd %xmm1, 0x50(%rsp)
movq %r8, 0x40(%rsp)
movw %di, 0x3e(%rsp)
movw %si, 0x3c(%rsp)
movw %dx, 0x3a(%rsp)
movw %cx, 0x38(%rsp)
movw %ax, 0x36(%rsp)
movl $0x0, 0x1c(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x15090
cmpl $0x2, %eax
jne 0x2aaeb
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x14a30
movq %rax, 0x10(%rsp)
jmp 0x2aafe
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x14070
movl %eax, 0x1c(%rsp)
movq 0x40(%rsp), %rdi
movl $0x20, %esi
callq 0x14c40
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x2ab29
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
jmp 0x2ab34
movl 0x1c(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movw 0x3a(%rsp), %cx
movq 0x20(%rsp), %rax
movw %cx, 0x18(%rax)
movw 0x38(%rsp), %cx
movq 0x20(%rsp), %rax
movw %cx, 0x1a(%rax)
movw 0x36(%rsp), %cx
movq 0x20(%rsp), %rax
movw %cx, 0x1c(%rax)
movw 0x60(%rsp), %cx
movq 0x20(%rsp), %rax
movw %cx, 0x1e(%rax)
movw 0x3e(%rsp), %cx
movq 0x20(%rsp), %rax
movw %cx, 0x8(%rax)
movw 0x3c(%rsp), %cx
movq 0x20(%rsp), %rax
movw %cx, 0xa(%rax)
cvttss2si 0x48(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0xc(%rax)
cvttss2si 0x4c(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0xe(%rax)
cvttss2si 0x50(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x10(%rax)
cvttss2si 0x54(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x12(%rax)
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7c675(%rip), %rdx     # 0xa7256
leaq 0x7c67a(%rip), %rcx     # 0xa7262
callq 0x15130
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x28(%rsp), %rax
leaq 0x35(%rip), %rcx        # 0x2ac40
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x10(%rsp)
jne 0x2ac31
jmp 0x2ac19
movq 0x28(%rsp), %rax
movl 0x70(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movq 0x28(%rsp), %rax
movl %ecx, 0x70(%rax)
jmp 0x2ac31
movq 0x28(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax,%rax)