// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/structs.c
// Function: moonnuklear_echeckfontconfig
nk_font_config_t *echeckfontconfig(lua_State *L, int arg, float height, int *err)
    {
    int count;
    nk_font_config_t *p;
    if(lua_isnoneornil(L, arg))
        { *err = ERR_NOTPRESENT; lua_pushstring(L, errstring(ERR_NOTPRESENT)); return NULL; }
    if(lua_type(L, arg) != LUA_TTABLE)
        { *err = ERR_TABLE; lua_pushstring(L, errstring(ERR_TABLE)); return NULL; }
    if((p = (nk_font_config_t*)MallocNoErr(L, sizeof(nk_font_config_t))) == NULL)
        { *err = ERR_MEMORY; lua_pushstring(L, errstring(ERR_MEMORY)); return NULL; }

    p->size = height;

    lua_pushstring(L, "merge_mode"); lua_rawget(L, arg); 
    p->merge_mode = optboolean(L, -1, 0); //@@ DOC
    lua_pop(L, 1);

    lua_pushstring(L, "pixel_snap"); lua_rawget(L, arg); 
    p->pixel_snap = optboolean(L, -1, 0); //@@ DOC
    lua_pop(L, 1);

    lua_pushstring(L, "coord_type"); lua_rawget(L, arg); 
    p->coord_type = testfontcoordtype(L, -1, err);
    lua_pop(L, 1);
    if(*err == ERR_NOTPRESENT)
        p->coord_type = NK_COORD_UV;
    else if(*err)
        { lua_pushstring(L, errstring(*err)); return NULL; }
    
    lua_pushstring(L, "spacing"); lua_rawget(L, arg); 
    *err = echeckvec2(L, -1, &p->spacing);
    lua_pop(L, 1);
    if(*err == ERR_NOTPRESENT)
        p->spacing = nk_vec2(0, 0);
    else if(*err)
        { lua_pushstring(L, errstring(*err)); return NULL; }

    lua_pushstring(L, "oversample_v"); lua_rawget(L, arg); 
    p->oversample_v = luaL_optinteger(L, -1, 1);
    lua_pop(L, 1);

    lua_pushstring(L, "oversample_h"); lua_rawget(L, arg);
    p->oversample_h = luaL_optinteger(L, -1, 3);
    lua_pop(L, 1);

    lua_pushstring(L, "fallback_glyph"); lua_rawget(L, arg);
    p->fallback_glyph = luaL_optinteger(L, -1, '?');
    lua_pop(L, 1);

    lua_pushstring(L, "ranges"); lua_rawget(L, arg);
    if(lua_isnil(L, -1))
        { lua_pop(L, 1); pushrunelist(L, nk_font_default_glyph_ranges()); }
    p->range = checkrunelist(L, -1, &count, err);
    lua_pop(L, 1);
    if(*err)
        { Free(L, p); lua_pushstring(L, errstring(*err)); return NULL; }

    *err = ERR_SUCCESS;
    return p;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movss %xmm0, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
callq 0x13df0
testl %eax, %eax
jle 0x5cec5
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13df0
cmpl $0x5, %eax
jne 0x5ced3
movl $0x58, %esi
movq %rbx, %rdi
callq 0x12ba0
testq %rax, %rax
je 0x5cee1
movq %rax, %r12
movq %rax, %r15
movss 0x8(%rsp), %xmm0
movss %xmm0, 0x20(%r12)
leaq 0x159df(%rip), %rsi     # 0x7264b
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x13960
movb %al, 0x19(%r12)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
leaq 0x159b0(%rip), %rsi     # 0x72656
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x13960
movb %al, 0x1a(%r12)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
leaq 0x15981(%rip), %rsi     # 0x72661
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
movq %rbx, %rdi
movl $0x11, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rcx
callq 0x13420
movl %eax, 0x24(%r12)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
movl (%r14), %edi
testl %edi, %edi
je 0x5cd31
cmpl $0x1, %edi
jne 0x5ceed
movl $0x0, 0x24(%r15)
leaq 0xdba4(%rip), %rsi      # 0x6a8dc
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
addq $0x28, %r12
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r12, %rdx
callq 0x14160
movl %eax, (%r14)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
movl (%r14), %edi
testl %edi, %edi
je 0x5cd8e
cmpl $0x1, %edi
jne 0x5ceed
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x12410
movlps %xmm0, (%r12)
leaq 0x158d7(%rip), %rsi     # 0x7266c
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
movl $0x1, %edx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x13310
movb %al, 0x1b(%r15)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
leaq 0x158a8(%rip), %rsi     # 0x72679
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
movl $0x3, %edx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x13310
movb %al, 0x1c(%r15)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
leaq 0x15879(%rip), %rsi     # 0x72686
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
movl $0x3f, %edx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x13310
movl %eax, 0x40(%r15)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
leaq 0xa248(%rip), %rsi      # 0x67091
movq %rbx, %rdi
callq 0x13f90
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13570
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x13df0
testl %eax, %eax
jne 0x5ce89
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
callq 0x122f0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x130e0
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rcx
callq 0x129f0
movq %rax, 0x30(%r15)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x12180
cmpl $0x0, (%r14)
je 0x5cf00
movq %rbx, %rdi
movq %r15, %rsi
callq 0x130d0
movl (%r14), %edi
jmp 0x5ceed
movl $0x1, (%r14)
movl $0x1, %edi
jmp 0x5ceed
movl $0xfffffffc, (%r14)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
jmp 0x5ceed
movl $0xfffffffa, (%r14)     # imm = 0xFFFFFFFA
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
callq 0x13ac0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x13f90
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq