// File: /workspace/github_c_makefile_star2_O3/stetre[P]moongl/src/object.c
// Function: moongl_object_new
int object_new(lua_State *L, uint32_t otype, uint32_t oname)
    {
    rec_t *rec;
    if(trace_objects)
        printf("create %s %d\n", tracename(otype), oname);

    if(track_objects==0)
        return 0;
    if(search(otype, oname))
        {
        /* duplicate value: this should mean that we are working with
         * multiple concurrent GL contexts, so we stop tracking objects
         * (we wouldn't be able to delete them at exit anyway, since
         * we have no control on the current context).
         */
        track_objects = 0;
        return 0; // unexpected(L);
        }

    if((rec = (rec_t*)Malloc(L, sizeof(rec_t))) == NULL) 
        return luaL_error(L, errstring(ERR_MEMORY));

    memset(rec, 0, sizeof(rec_t));
    rec->otype = otype;
    rec->oname = oname;
    insert(rec);

    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
cmpl $0x0, 0x268b8(%rip)     # 0x57968
je 0x310e1
leal -0x1(%r14), %eax
cmpl $0xa, %eax
ja 0x310ca
movl %eax, %eax
leaq 0x23e9c(%rip), %rcx     # 0x54f60
movq (%rcx,%rax,8), %rsi
jmp 0x310d1
leaq 0x18857(%rip), %rsi     # 0x49928
leaq 0x197f8(%rip), %rdi     # 0x4a8d0
movl %ebx, %edx
xorl %eax, %eax
callq 0x11070
cmpb $0x0, 0x26884(%rip)     # 0x5796c
jne 0x3139c
movq 0x2687b(%rip), %rax     # 0x57970
testq %rax, %rax
je 0x31119
cmpl %r14d, 0x20(%rax)
jne 0x31103
cmpl %ebx, 0x24(%rax)
setb %cl
ja 0x31114
testb %cl, %cl
je 0x31373
addq $0x8, %rax
movq (%rax), %rax
jmp 0x310f5
movl $0x28, %esi
movq %r15, %rdi
callq 0x111f0
testq %rax, %rax
je 0x31357
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movl %r14d, 0x20(%rax)
movl %ebx, 0x24(%rax)
movq 0x26829(%rip), %rsi     # 0x57970
testq %rsi, %rsi
je 0x3137c
movq %rsi, %rcx
cmpl %r14d, 0x20(%rsi)
jne 0x3115c
cmpl %ebx, 0x24(%rcx)
setb %dl
jbe 0x31168
xorl %edx, %edx
movq %rcx, %rsi
jmp 0x31179
testb %dl, %dl
je 0x3139c
leaq 0x8(%rcx), %rsi
movl $0x8, %edx
movq (%rsi), %rsi
testq %rsi, %rsi
jne 0x31150
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x1, 0x18(%rax)
movq %rax, (%rcx,%rdx)
leaq 0x267d3(%rip), %rdx     # 0x57970
xorl %esi, %esi
cmpl $0x1, 0x18(%rcx)
jne 0x3134e
movq 0x10(%rcx), %rdi
movq (%rdi), %r8
cmpq %r8, %rcx
je 0x311da
testq %r8, %r8
je 0x311c7
cmpl $0x1, 0x18(%r8)
jne 0x311c7
movl %esi, 0x18(%r8)
jmp 0x311ee
movq (%rcx), %r8
cmpq %rax, %r8
je 0x31214
movq %rcx, %r8
movq %rax, %rcx
jmp 0x31283
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0x31200
cmpl $0x1, 0x18(%r9)
jne 0x31200
movl %esi, 0x18(%r9)
movl %esi, 0x18(%rcx)
movl $0x1, 0x18(%rdi)
movq %rdi, %rcx
jmp 0x3133e
movq 0x8(%rcx), %r9
cmpq %rax, %r9
je 0x31236
movq %rcx, %r9
movq %rax, %rcx
jmp 0x312f6
movq 0x8(%r8), %r9
movq %r9, (%rcx)
testq %r9, %r9
je 0x3125f
movq %rcx, 0x10(%r9)
movq 0x10(%rcx), %r9
movq %r9, 0x10(%r8)
movq %rdx, %r10
testq %r9, %r9
jne 0x31267
jmp 0x31275
movq (%r9), %r8
movq %r8, 0x8(%rcx)
testq %r8, %r8
je 0x312d0
movq %rcx, 0x10(%r8)
movq 0x10(%rcx), %r8
movq %r8, 0x10(%r9)
movq %rdx, %r10
testq %r8, %r8
jne 0x312d8
jmp 0x312e6
movq %rdi, 0x10(%r8)
movq 0x10(%rcx), %r9
xorl %r10d, %r10d
cmpq (%r9), %rcx
setne %r10b
leaq (%r9,%r10,8), %r10
movq %r8, (%r10)
movq %rcx, 0x8(%r8)
movq %r8, 0x10(%rcx)
movq %rax, %r8
movl $0x0, 0x18(%r8)
movl $0x1, 0x18(%rdi)
movq 0x8(%rdi), %rax
movq (%rax), %r8
movq %r8, 0x8(%rdi)
testq %r8, %r8
je 0x312a6
movq %rdi, 0x10(%r8)
movq 0x10(%rdi), %r8
movq %r8, 0x10(%rax)
movq %rdx, %r9
testq %r8, %r8
je 0x312c4
xorl %r9d, %r9d
cmpq (%r8), %rdi
setne %r9b
leaq (%r8,%r9,8), %r9
movq %rax, (%r9)
movq %rdi, (%rax)
movq %rax, 0x10(%rdi)
jmp 0x3133e
movq %rdi, 0x10(%r9)
movq 0x10(%rcx), %r8
xorl %r10d, %r10d
cmpq (%r8), %rcx
setne %r10b
leaq (%r8,%r10,8), %r10
movq %r9, (%r10)
movq %rcx, (%r9)
movq %r9, 0x10(%rcx)
movq (%rdi), %r8
movq %rax, %r9
movl $0x0, 0x18(%r9)
movl $0x1, 0x18(%rdi)
movq 0x8(%r8), %rax
movq %rax, (%rdi)
testq %rax, %rax
je 0x31315
movq %rdi, 0x10(%rax)
movq 0x10(%rdi), %rax
movq %rax, 0x10(%r8)
movq %rdx, %r9
testq %rax, %rax
je 0x31333
xorl %r9d, %r9d
cmpq (%rax), %rdi
setne %r9b
leaq (%rax,%r9,8), %r9
movq %r8, (%r9)
movq %rdi, 0x8(%r8)
movq %r8, 0x10(%rdi)
movq %rcx, %rax
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x3119f
movq 0x2661b(%rip), %rax     # 0x57970
jmp 0x31395
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
callq 0x114c0
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x11ae0
movb $0x1, 0x265f2(%rip)     # 0x5796c
jmp 0x3139c
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movl $0x1, 0x18(%rax)
movq %rax, 0x265db(%rip)     # 0x57970
movl $0x0, 0x18(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq