// File: /workspace/github_c_makefile_star2_O1/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, 0x2694c(%rip)     # 0x57968
je 0x3104d
leal -0x1(%r14), %eax
cmpl $0xa, %eax
ja 0x31036
movl %eax, %eax
leaq 0x23f30(%rip), %rcx     # 0x54f60
movq (%rcx,%rax,8), %rsi
jmp 0x3103d
leaq 0x188eb(%rip), %rsi     # 0x49928
leaq 0x1988c(%rip), %rdi     # 0x4a8d0
movl %ebx, %edx
xorl %eax, %eax
callq 0x11070
cmpb $0x0, 0x26918(%rip)     # 0x5796c
jne 0x312e2
movl %r14d, %edi
movl %ebx, %esi
callq 0x312ea
testq %rax, %rax
je 0x31075
movb $0x1, 0x268fc(%rip)     # 0x5796c
jmp 0x312e2
movl $0x28, %esi
movq %r15, %rdi
callq 0x11200
testq %rax, %rax
je 0x310e6
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movl %r14d, 0x20(%rax)
movl %ebx, 0x24(%rax)
movq 0x268c9(%rip), %rsi     # 0x57970
testq %rsi, %rsi
je 0x31102
movq %rsi, %rcx
cmpl %r14d, 0x20(%rsi)
jne 0x310b8
cmpl %ebx, 0x24(%rcx)
seta %dl
setb %sil
movq %rcx, %rdi
testb %dl, %dl
jne 0x310d3
testb %sil, %sil
je 0x312e2
leaq 0x8(%rcx), %rdi
movq (%rdi), %rsi
testq %rsi, %rsi
jne 0x310ac
xorb $0x1, %dl
movzbl %dl, %edx
shll $0x3, %edx
jmp 0x31109
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
callq 0x114d0
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x11ae0
movl $0x8, %edx
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, 0x18(%rax)
testq %rcx, %rcx
je 0x312cd
movq %rax, (%rcx,%rdx)
leaq 0x26845(%rip), %rdx     # 0x57970
xorl %esi, %esi
cmpl $0x1, 0x18(%rcx)
jne 0x312d4
movq 0x10(%rcx), %rdi
movq (%rdi), %r8
cmpq %r8, %rcx
je 0x3115f
testq %r8, %r8
je 0x3114f
cmpl $0x1, 0x18(%r8)
je 0x3116f
movq (%rcx), %r8
cmpq %rax, %r8
je 0x3119d
movq %rcx, %r8
movq %rax, %rcx
jmp 0x311dd
movq 0x8(%rdi), %r8
testq %r8, %r8
je 0x31185
cmpl $0x1, 0x18(%r8)
jne 0x31185
movl %esi, 0x18(%r8)
movl %esi, 0x18(%rcx)
movl $0x1, 0x18(%rdi)
movq %rdi, %rcx
jmp 0x312bb
movq 0x8(%rcx), %r8
cmpq %rax, %r8
je 0x3122d
movq %rcx, %r8
movq %rax, %rcx
jmp 0x3126c
movq 0x8(%r8), %r9
movq %r9, (%rcx)
testq %r9, %r9
je 0x311ad
movq %rcx, 0x10(%r9)
movq 0x10(%rcx), %r10
movq %r10, 0x10(%r8)
movq %rdx, %r9
testq %r10, %r10
je 0x311cf
movq 0x10(%rcx), %r9
xorl %r10d, %r10d
cmpq (%r9), %rcx
setne %r10b
leaq (%r9,%r10,8), %r9
movq %r8, (%r9)
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 0x31200
movq %rdi, 0x10(%r8)
movq 0x10(%rdi), %r9
movq %r9, 0x10(%rax)
movq %rdx, %r8
testq %r9, %r9
je 0x31222
movq 0x10(%rdi), %r8
xorl %r9d, %r9d
cmpq (%r8), %rdi
setne %r9b
leaq (%r8,%r9,8), %r8
movq %rax, (%r8)
movq %rdi, (%rax)
jmp 0x312b7
movq (%r8), %r9
movq %r9, 0x8(%rcx)
testq %r9, %r9
je 0x3123d
movq %rcx, 0x10(%r9)
movq 0x10(%rcx), %r10
movq %r10, 0x10(%r8)
movq %rdx, %r9
testq %r10, %r10
je 0x3125f
movq 0x10(%rcx), %r9
xorl %r10d, %r10d
cmpq (%r9), %rcx
setne %r10b
leaq (%r9,%r10,8), %r9
movq %r8, (%r9)
movq %rcx, (%r8)
movq %r8, 0x10(%rcx)
movq %rax, %r8
movl $0x0, 0x18(%r8)
movl $0x1, 0x18(%rdi)
movq (%rdi), %rax
movq 0x8(%rax), %r8
movq %r8, (%rdi)
testq %r8, %r8
je 0x3128e
movq %rdi, 0x10(%r8)
movq 0x10(%rdi), %r9
movq %r9, 0x10(%rax)
movq %rdx, %r8
testq %r9, %r9
je 0x312b0
movq 0x10(%rdi), %r8
xorl %r9d, %r9d
cmpq (%r8), %rdi
setne %r9b
leaq (%r8,%r9,8), %r8
movq %rax, (%r8)
movq %rdi, 0x8(%rax)
movq %rax, 0x10(%rdi)
movq %rcx, %rax
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x3112d
jmp 0x312d4
movq %rax, 0x2669c(%rip)     # 0x57970
movq 0x26695(%rip), %rax     # 0x57970
movl $0x0, 0x18(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq