// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonsndfile/src/structs.c
// Function: moonsndfile_checkinfo
int checkinfo(lua_State *L, int arg, SF_INFO *p)
    {
    int err, isnum;
    int code, format, subformat, endianness;
    if(lua_isnoneornil(L, arg))
        return luaL_argerror(L, arg, errstring(ERR_NOTPRESENT));
    if(lua_type(L, arg) != LUA_TTABLE)
        return luaL_argerror(L, arg, errstring(ERR_TABLE));

    lua_getfield(L, arg, "code");
    code = lua_tointegerx(L, -1, &isnum); lua_pop(L, 1);

    lua_getfield(L, arg, "format");
    format = testformat(L, -1, &err); lua_pop(L, 1);
    if(err<0) return luaL_argerror(L, arg, "invalid 'format'");

    lua_getfield(L, arg, "subformat");
    subformat = testsubformat(L, -1, &err); lua_pop(L, 1);
    if(err<0) return luaL_argerror(L, arg, "invalid 'subformat'");

    lua_getfield(L, arg, "endianness");
    endianness = testendianness(L, -1, &err); lua_pop(L, 1);
    if(err < 0) return luaL_argerror(L, arg, "invalid 'endianness'");/* defaults to 0 */

    if(isnum)
        {
        if(format && format != (code & SF_FORMAT_TYPEMASK))
            return luaL_argerror(L, arg, "format is present and does not match with code");
        if(subformat && subformat != (code & SF_FORMAT_SUBMASK))
            return luaL_argerror(L, arg, "subformat is present and does not match with code");
        if(endianness && endianness != (code & SF_FORMAT_ENDMASK))
            return luaL_argerror(L, arg, "subformat is present and does not match with code");
        p->format = code;
        }
    else
        {
        if(format==0)
            return luaL_argerror(L, arg, "missing format");
        if(subformat==0)
            return luaL_argerror(L, arg, "missing subformat");
        p->format = format | subformat | endianness;
        }

    lua_getfield(L, arg, "samplerate");
    p->samplerate = lua_tointegerx(L, -1, &isnum); lua_pop(L, 1);
    if(!isnum) return luaL_argerror(L, arg, "missing or invalid 'samplerate'");

    lua_getfield(L, arg, "channels");
    p->channels = lua_tointegerx(L, -1, &isnum); lua_pop(L, 1);
    if(!isnum) return luaL_argerror(L, arg, "missing or invalid 'channels'");

    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
callq 0x4730
testl %eax, %eax
jle 0xa2fb
movq %r14, %rdi
movl %ebx, %esi
callq 0x4730
cmpl $0x5, %eax
jne 0xa2ff
leaq 0x348e(%rip), %rdx      # 0xd637
movq %r14, %rdi
movl %ebx, %esi
callq 0x47e0
pushq $-0x1
popq %rbp
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x4170
movq %rax, 0x10(%rsp)
pushq $-0x2
popq %r13
movq %r14, %rdi
movl %r13d, %esi
callq 0x4080
leaq 0x2c34(%rip), %rdx      # 0xce14
movq %r14, %rdi
movl %ebx, %esi
callq 0x47e0
pushq $0x1
popq %rsi
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movl %ebp, %edx
movq %r12, %rcx
callq 0x4600
movl %eax, %ebp
movq %r14, %rdi
movl %r13d, %esi
callq 0x4080
cmpl $0x0, (%r12)
js 0xa322
leaq 0x3435(%rip), %rdx      # 0xd653
movq %r14, %rdi
movl %ebx, %esi
callq 0x47e0
pushq $0x2
popq %rsi
pushq $-0x1
popq %rdx
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movq %r12, %rcx
callq 0x4600
movl %eax, %r13d
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x4080
cmpl $0x0, (%r12)
js 0xa32e
leaq 0x2c30(%rip), %rdx      # 0xce8e
movq %r14, %rdi
movl %ebx, %esi
callq 0x47e0
pushq $0x3
popq %rsi
pushq $-0x1
popq %rdx
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movq %r12, %rcx
callq 0x4600
movl %eax, 0x8(%rsp)
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x4080
cmpl $0x0, (%r12)
js 0xa33a
cmpl $0x0, 0x4(%rsp)
je 0xa346
testl %ebp, %ebp
sete %al
movq 0x10(%rsp), %rdx
movl %edx, %ecx
andl $0xfff0000, %ecx        # imm = 0xFFF0000
cmpl %ecx, %ebp
sete %cl
orb %al, %cl
je 0xa3e5
testl %r13d, %r13d
sete %al
movzwl %dx, %ecx
cmpl %ecx, %r13d
sete %cl
orb %al, %cl
je 0xa2ef
movl 0x8(%rsp), %esi
testl %esi, %esi
sete %al
movl %edx, %ecx
andl $0x30000000, %ecx       # imm = 0x30000000
cmpl %ecx, %esi
sete %cl
orb %al, %cl
jne 0xa362
leaq 0x3314(%rip), %rdx      # 0xd60a
jmp 0xa407
pushq $0x1
jmp 0xa301
pushq $-0x4
popq %rdi
callq 0x4660
movq %r14, %rdi
movl %ebx, %esi
movq %rax, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4110
leaq 0x32a7(%rip), %rdx      # 0xd5d0
jmp 0xa407
leaq 0x32ac(%rip), %rdx      # 0xd5e1
jmp 0xa407
leaq 0x32b4(%rip), %rdx      # 0xd5f5
jmp 0xa407
testl %ebp, %ebp
je 0xa3ee
testl %r13d, %r13d
je 0xa3f7
orl %ebp, %r13d
orl 0x8(%rsp), %r13d
movl %r13d, %edx
movl %edx, 0x10(%r15)
leaq 0x1f0f(%rip), %rdx      # 0xc27c
movq %r14, %rdi
movl %ebx, %esi
callq 0x47e0
pushq $-0x1
popq %rsi
leaq 0x4(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x4170
movl %eax, 0x8(%r15)
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x4080
cmpl $0x0, (%r12)
je 0xa400
leaq 0x1e16(%rip), %rdx      # 0xc1bd
movq %r14, %rdi
movl %ebx, %esi
callq 0x47e0
pushq $-0x1
popq %rsi
leaq 0x4(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x4170
movl %eax, 0xc(%r15)
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x4080
xorl %eax, %eax
cmpl $0x0, (%r12)
jne 0xa411
leaq 0x329a(%rip), %rdx      # 0xd67d
jmp 0xa407
leaq 0x3221(%rip), %rdx      # 0xd60d
jmp 0xa407
leaq 0x3247(%rip), %rdx      # 0xd63c
jmp 0xa407
leaq 0x324d(%rip), %rdx      # 0xd64b
jmp 0xa407
leaq 0x3256(%rip), %rdx      # 0xd65d
movq %r14, %rdi
movl %ebx, %esi
callq 0x4110
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq