// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movss %xmm0, (%rsp)
movl %esi, %ebp
movq %rdi, %rbx
callq 0x14030
testl %eax, %eax
jle 0x57320
movq %rbx, %rdi
movl %ebp, %esi
callq 0x14030
cmpl $0x5, %eax
jne 0x5732b
pushq $0x58
popq %rsi
movq %rbx, %rdi
callq 0x12c70
testq %rax, %rax
je 0x57336
movq %rax, %r12
movq %rax, %r15
movss (%rsp), %xmm0
movss %xmm0, 0x20(%r12)
leaq 0x144d1(%rip), %rsi     # 0x6b5bb
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x13b60
movb %al, 0x19(%r12)
pushq $-0x2
popq %r13
movq %rbx, %rdi
movl %r13d, %esi
callq 0x12190
leaq 0x144a2(%rip), %rsi     # 0x6b5c6
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
movq %rbx, %rdi
pushq $-0x1
popq %rsi
xorl %edx, %edx
callq 0x13b60
movb %al, 0x1a(%r12)
movq %rbx, %rdi
movl %r13d, %esi
callq 0x12190
leaq 0x14477(%rip), %rsi     # 0x6b5d1
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
pushq $0x11
popq %rsi
movq %rbx, %rdi
pushq $-0x1
popq %rdx
movq %r14, %rcx
callq 0x135b0
movl %eax, 0x24(%r12)
movq %rbx, %rdi
movl %r13d, %esi
callq 0x12190
movl (%r14), %edi
testl %edi, %edi
je 0x571a2
cmpl $0x1, %edi
jne 0x57340
andl $0x0, 0x24(%r15)
leaq 0xc733(%rip), %rsi      # 0x638dc
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
addq $0x28, %r12
pushq $-0x1
popq %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x143f0
movl %eax, (%r14)
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x12190
movl (%r14), %edi
testl %edi, %edi
je 0x571fb
cmpl $0x1, %edi
jne 0x57340
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x12450
movlps %xmm0, (%r12)
leaq 0x143da(%rip), %rsi     # 0x6b5dc
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
pushq $-0x1
popq %r12
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x13470
movb %al, 0x1b(%r15)
pushq $-0x2
popq %r13
movq %rbx, %rdi
movl %r13d, %esi
callq 0x12190
leaq 0x143a9(%rip), %rsi     # 0x6b5e9
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
pushq $0x3
popq %rdx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x13470
movb %al, 0x1c(%r15)
movq %rbx, %rdi
movl %r13d, %esi
callq 0x12190
leaq 0x14380(%rip), %rsi     # 0x6b5f6
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
pushq $0x3f
popq %rdx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x13470
movl %eax, 0x40(%r15)
movq %rbx, %rdi
movl %r13d, %esi
callq 0x12190
leaq 0x8de5(%rip), %rsi      # 0x60091
movq %rbx, %rdi
callq 0x141d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13730
movq %rbx, %rdi
movl %r12d, %esi
callq 0x14030
testl %eax, %eax
jne 0x572e8
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x12190
callq 0x12330
movq %rbx, %rdi
movq %rax, %rsi
callq 0x13230
pushq $-0x1
popq %rsi
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x12ab0
movq %rax, 0x30(%r15)
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x12190
cmpl $0x0, (%r14)
je 0x57353
movq %rbx, %rdi
movq %r15, %rsi
callq 0x13220
movl (%r14), %edi
jmp 0x57340
movl $0x1, (%r14)
pushq $0x1
jmp 0x5733f
movl $0xfffffffc, (%r14)     # imm = 0xFFFFFFFC
pushq $-0x4
jmp 0x5733f
movl $0xfffffffa, (%r14)     # imm = 0xFFFFFFFA
pushq $-0x6
popq %rdi
callq 0x13cc0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x141d0
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq