// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movl %esi, 0x44(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x4730
cmpl $0x0, %eax
jg 0xe75b
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl $0x1, %edi
callq 0x4660
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %esi
movq %rax, %rdx
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x4730
cmpl $0x5, %eax
je 0xe7a2
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0xc(%rsp)
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
callq 0x4660
movq (%rsp), %rdi
movl 0xc(%rsp), %esi
movq %rax, %rdx
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4e75(%rip), %rdx      # 0x13627
callq 0x47e0
movq 0x48(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x30(%rsp), %rdx
callq 0x4160
movl %eax, 0x2c(%rsp)
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4080
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4613(%rip), %rdx      # 0x12e01
callq 0x47e0
movq 0x48(%rsp), %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq 0x34(%rsp), %rcx
callq 0x4600
movl %eax, 0x28(%rsp)
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4080
cmpl $0x0, 0x34(%rsp)
jge 0xe844
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4d8a(%rip), %rdx      # 0x135c0
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4def(%rip), %rdx      # 0x13643
callq 0x47e0
movq 0x48(%rsp), %rdi
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq 0x34(%rsp), %rcx
callq 0x4600
movl %eax, 0x24(%rsp)
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4080
cmpl $0x0, 0x34(%rsp)
jge 0xe8aa
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4d35(%rip), %rdx      # 0x135d1
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x45c1(%rip), %rdx      # 0x12e7b
callq 0x47e0
movq 0x48(%rsp), %rdi
movl $0x3, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq 0x34(%rsp), %rcx
callq 0x4600
movl %eax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4080
cmpl $0x0, 0x34(%rsp)
jge 0xe910
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4ce3(%rip), %rdx      # 0x135e5
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
cmpl $0x0, 0x30(%rsp)
je 0xe9ce
cmpl $0x0, 0x28(%rsp)
je 0xe952
movl 0x28(%rsp), %eax
movl 0x2c(%rsp), %ecx
andl $0xfff0000, %ecx        # imm = 0xFFF0000
cmpl %ecx, %eax
je 0xe952
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4cb9(%rip), %rdx      # 0x135fd
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
cmpl $0x0, 0x24(%rsp)
je 0xe989
movl 0x24(%rsp), %eax
movl 0x2c(%rsp), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
cmpl %ecx, %eax
je 0xe989
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4c7f(%rip), %rdx      # 0x135fa
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
cmpl $0x0, 0x20(%rsp)
je 0xe9c0
movl 0x20(%rsp), %eax
movl 0x2c(%rsp), %ecx
andl $0x30000000, %ecx       # imm = 0x30000000
cmpl %ecx, %eax
je 0xe9c0
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4c48(%rip), %rdx      # 0x135fa
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movl 0x2c(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x10(%rax)
jmp 0xea2c
cmpl $0x0, 0x28(%rsp)
jne 0xe9f3
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4c47(%rip), %rdx      # 0x1362c
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
cmpl $0x0, 0x24(%rsp)
jne 0xea18
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4c31(%rip), %rdx      # 0x1363b
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movl 0x28(%rsp), %ecx
orl 0x24(%rsp), %ecx
orl 0x20(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x3840(%rip), %rdx      # 0x1227c
callq 0x47e0
movq 0x48(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x30(%rsp), %rdx
callq 0x4160
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4080
cmpl $0x0, 0x30(%rsp)
jne 0xea90
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4bc8(%rip), %rdx      # 0x1364d
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x371d(%rip), %rdx      # 0x121bd
callq 0x47e0
movq 0x48(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x30(%rsp), %rdx
callq 0x4160
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x48(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4080
cmpl $0x0, 0x30(%rsp)
jne 0xeaf4
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x4b84(%rip), %rdx      # 0x1366d
callq 0x4100
movl %eax, 0x54(%rsp)
jmp 0xeafc
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)