// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
cmpl $0x0, 0x2804e(%rip)     # 0x56968
je 0x2e937
movl %r15d, %edi
callq 0x2ebbc
leaq 0x17fcd(%rip), %rdi     # 0x468f8
movq %rax, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x11070
cmpb $0x0, 0x2802e(%rip)     # 0x5696c
jne 0x2e956
movl %r15d, %edi
movl %ebp, %esi
callq 0x2ebdc
testq %rax, %rax
je 0x2e963
movb $0x1, 0x28016(%rip)     # 0x5696c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x111f0
testq %rax, %rax
je 0x2eb9d
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movl %r15d, 0x20(%rax)
movl %ebp, 0x24(%rax)
pushq $0x8
popq %r15
leaq 0x27fda(%rip), %rsi     # 0x56970
xorl %ecx, %ecx
movq %r15, %rdx
movq (%rsi), %r14
testq %r14, %r14
je 0x2e9c8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2f1bd
movq %r14, %rsi
movq %r14, %rcx
movl $0x0, %edx
testl %eax, %eax
js 0x2e99b
je 0x2e956
leaq 0x8(%r14), %rsi
movq %r14, %rcx
jmp 0x2e998
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x1, 0x18(%rbx)
addq %rcx, %rdx
testq %rcx, %rcx
leaq 0x27f8a(%rip), %rax     # 0x56970
cmoveq %rax, %rdx
movq %rbx, (%rdx)
testq %rcx, %rcx
je 0x2eb8d
cmpl $0x1, 0x18(%rcx)
jne 0x2eb8d
movq 0x10(%rcx), %rdx
movq (%rdx), %rsi
cmpq %rsi, %rcx
je 0x2ea30
testq %rsi, %rsi
je 0x2ea1d
cmpl $0x1, 0x18(%rsi)
jne 0x2ea1d
andl $0x0, 0x18(%rsi)
jmp 0x2ea43
movq (%rcx), %rsi
cmpq %rbx, %rsi
je 0x2ea6a
movq %rcx, %rsi
movq %rbx, %rcx
jmp 0x2ead2
movq 0x8(%rdx), %rdi
testq %rdi, %rdi
je 0x2ea56
cmpl $0x1, 0x18(%rdi)
jne 0x2ea56
andl $0x0, 0x18(%rdi)
andl $0x0, 0x18(%rcx)
movl $0x1, 0x18(%rdx)
movq %rdx, %rcx
jmp 0x2eb81
movq 0x8(%rcx), %rdi
cmpq %rbx, %rdi
je 0x2ea8c
movq %rcx, %rdi
movq %rbx, %rcx
jmp 0x2eb3d
movq 0x8(%rsi), %rdi
movq %rdi, (%rcx)
testq %rdi, %rdi
je 0x2eaae
movq %rcx, 0x10(%rdi)
movq 0x10(%rcx), %rdi
movq %rdi, 0x10(%rsi)
movq %rax, %r8
testq %rdi, %rdi
jne 0x2eab6
jmp 0x2eac4
movq (%rdi), %rsi
movq %rsi, 0x8(%rcx)
testq %rsi, %rsi
je 0x2eb17
movq %rcx, 0x10(%rsi)
movq 0x10(%rcx), %rsi
movq %rsi, 0x10(%rdi)
movq %rax, %r8
testq %rsi, %rsi
jne 0x2eb1f
jmp 0x2eb2d
movq %rdx, 0x10(%rsi)
movq 0x10(%rcx), %rdi
xorl %r8d, %r8d
cmpq (%rdi), %rcx
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rsi, (%r8)
movq %rcx, 0x8(%rsi)
movq %rsi, 0x10(%rcx)
movq %rbx, %rsi
andl $0x0, 0x18(%rsi)
movl $0x1, 0x18(%rdx)
movq 0x8(%rdx), %rsi
movq (%rsi), %rdi
movq %rdi, 0x8(%rdx)
testq %rdi, %rdi
je 0x2eaf1
movq %rdx, 0x10(%rdi)
movq 0x10(%rdx), %rdi
movq %rdi, 0x10(%rsi)
movq %rax, %r8
testq %rdi, %rdi
je 0x2eb0f
xorl %r8d, %r8d
cmpq (%rdi), %rdx
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rsi, (%r8)
movq %rdx, (%rsi)
jmp 0x2eb7d
movq %rdx, 0x10(%rdi)
movq 0x10(%rcx), %rsi
xorl %r8d, %r8d
cmpq (%rsi), %rcx
setne %r8b
leaq (%rsi,%r8,8), %r8
movq %rdi, (%r8)
movq %rcx, (%rdi)
movq %rdi, 0x10(%rcx)
movq (%rdx), %rsi
movq %rbx, %rdi
andl $0x0, 0x18(%rdi)
movl $0x1, 0x18(%rdx)
movq 0x8(%rsi), %rdi
movq %rdi, (%rdx)
testq %rdi, %rdi
je 0x2eb58
movq %rdx, 0x10(%rdi)
movq 0x10(%rdx), %rdi
movq %rdi, 0x10(%rsi)
movq %rax, %r8
testq %rdi, %rdi
je 0x2eb76
xorl %r8d, %r8d
cmpq (%rdi), %rdx
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rsi, (%r8)
movq %rdx, 0x8(%rsi)
movq %rsi, 0x10(%rdx)
movq %rcx, %rbx
movq 0x10(%rcx), %rcx
jmp 0x2e9ed
movq 0x27ddc(%rip), %rax     # 0x56970
andl $0x0, 0x18(%rax)
jmp 0x2e956
pushq $-0x6
popq %rdi
callq 0x114c0
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0