// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/font.c
// Function: New
static int New(lua_State *L)
/* user_font = user_font(height, width_func, texture_id, query_func) */
    {
    ud_t *ud;
    int ref1, ref2;
    nk_user_font_t *font;
    float height = luaL_checknumber(L, 1);
    int texture_id = luaL_checknumber(L, 3);
    if(!lua_isfunction(L, 2)) return argerrorc(L, 2, ERR_TYPE);
    if(!lua_isfunction(L, 4)) return argerrorc(L, 4, ERR_TYPE);
    lua_pushvalue(L, 2); ref1 = luaL_ref(L, LUA_REGISTRYINDEX);
    lua_pushvalue(L, 4); ref2 = luaL_ref(L, LUA_REGISTRYINDEX);

    font = (nk_user_font_t*)Malloc(L, sizeof(nk_user_font_t));
    ud = newuserdata(L, font, FONT_MT, "font (user)");
    ud->parent_ud = NULL;
    ud->font = NULL;
    ud->ref1 = ref1;
    ud->ref2 = ref2;
    ud->destructor = freefont;
    MarkAllocated(ud);

    font->userdata.ptr = ud;
    font->height = height; /* max height of the font */
    font->width = WidthCallback; /* font string width in pixel callback */
    font->query = QueryCallback; /* font glyph callback to query drawing info */
    font->texture.id = texture_id; /* texture handle to the used font atlas or texture */
    return 1;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0x13950
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
movq 0x38(%rsp), %rdi
movl $0x3, %esi
callq 0x13950
cvttsd2si %xmm0, %eax
movl %eax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movl $0x2, %esi
callq 0x15090
cmpl $0x6, %eax
je 0x27cac
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
callq 0x14d10
movq 0x10(%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x134c0
movl %eax, 0x44(%rsp)
jmp 0x27e0f
movq 0x38(%rsp), %rdi
movl $0x4, %esi
callq 0x15090
cmpl $0x6, %eax
je 0x27cef
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
callq 0x14d10
movq 0x8(%rsp), %rdi
movq %rax, %rdx
movl $0x4, %esi
callq 0x134c0
movl %eax, 0x44(%rsp)
jmp 0x27e0f
movq 0x38(%rsp), %rdi
movl $0x2, %esi
callq 0x13eb0
movq 0x38(%rsp), %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x13840
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rdi
movl $0x4, %esi
callq 0x13eb0
movq 0x38(%rsp), %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x13840
movl %eax, 0x28(%rsp)
movq 0x38(%rsp), %rdi
movl $0x28, %esi
callq 0x14c40
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7f359(%rip), %rdx     # 0xa70b1
leaq 0x85315(%rip), %rcx     # 0xad074
callq 0x15130
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x30(%rsp), %rax
movq $0x0, 0x20(%rax)
movl 0x2c(%rsp), %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x74(%rax)
movl 0x28(%rsp), %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x78(%rax)
movq 0x30(%rsp), %rax
leaq -0x527(%rip), %rcx      # 0x27880
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rax
movl 0x70(%rax), %ecx
orl $0x20, %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x70(%rax)
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movss 0x1c(%rsp), %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0x8(%rax)
movq 0x20(%rsp), %rax
leaq 0xc9(%rip), %rcx        # 0x27eb0
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
leaq 0x1b9(%rip), %rcx       # 0x27fb0
movq %rcx, 0x18(%rax)
movl 0x18(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x20(%rax)
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)