// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/object.c
// Function: moongl_object_free
void object_free(lua_State *L, uint32_t otype, uint32_t oname)
    {
    rec_t *rec;
    GLuint name = oname;    
    if(trace_objects)
        printf("delete %s %d\n", tracename(otype), oname);
    if(track_objects)
        {
        rec = search(otype, oname);
        if(rec)
            { removeeee(rec); Free(L, rec); }
        }

    switch(otype)
        {
        case OTYPE_BUFFER: glDeleteBuffers(1, &name); break;
        case OTYPE_VERTEX_ARRAY: glDeleteVertexArrays(1, &name); break;
        case OTYPE_SAMPLER: glDeleteSamplers(1, &name); break;
        case OTYPE_TEXTURE: glDeleteTextures(1, &name); break;
        case OTYPE_FRAMEBUFFER: glDeleteFramebuffers(1, &name); break;
        case OTYPE_RENDERBUFFER: glDeleteRenderbuffers(1, &name); break;
        case OTYPE_PROGRAM: glDeleteProgram(name); break;
        case OTYPE_SHADER: glDeleteShader(name); break;
        case OTYPE_PROGRAM_PIPELINE: glDeleteProgramPipelines(1, &name); break;
        case OTYPE_TRANSFORM_FEEDBACK: glDeleteTransformFeedbacks(1, &name); break;
        case OTYPE_QUERY: glDeleteQueries(1, &name); break;
        default:
            unexpected(L);
        }
    CheckError(L);
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, 0x2cf58(%rip)     # 0x68978
je 0x3ba40
movl 0x1c(%rsp), %edi
callq 0x3b8b0
movq %rax, %rsi
movl 0x18(%rsp), %edx
leaq 0x214ed(%rip), %rdi     # 0x5cf26
movb $0x0, %al
callq 0x11070
cmpl $0x0, 0x2ccf9(%rip)     # 0x68740
je 0x3ba7e
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
callq 0x3b9a0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x3ba7c
movq 0x10(%rsp), %rdi
callq 0x3bbd0
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x11370
jmp 0x3ba7e
movl 0x1c(%rsp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, (%rsp)
subl $0xa, %eax
ja 0x3bb96
movq (%rsp), %rax
leaq 0x2144e(%rip), %rcx     # 0x5ceec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2bf38(%rip), %rax     # 0x679f0
callq *(%rax)
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2bcc0(%rip), %rax     # 0x67790
callq *(%rax)
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2b968(%rip), %rax     # 0x67450
callq *(%rax)
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
callq 0x11690
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2b64c(%rip), %rax     # 0x67160
callq *(%rax)
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2baac(%rip), %rax     # 0x675d8
callq *(%rax)
jmp 0x3bbb5
movq 0x2be2e(%rip), %rax     # 0x67968
movq (%rax), %rax
movl 0xc(%rsp), %edi
callq *%rax
jmp 0x3bbb5
movq 0x2b6e4(%rip), %rax     # 0x67230
movq (%rax), %rax
movl 0xc(%rsp), %edi
callq *%rax
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2bf48(%rip), %rax     # 0x67ab0
callq *(%rax)
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2b9cb(%rip), %rax     # 0x67548
callq *(%rax)
jmp 0x3bbb5
movl $0x1, %edi
leaq 0xc(%rsp), %rsi
movq 0x2b8b6(%rip), %rax     # 0x67448
callq *(%rax)
jmp 0x3bbb5
movq 0x20(%rsp), %rdi
leaq 0x166e3(%rip), %rsi     # 0x52285
leaq 0x2138b(%rip), %rdx     # 0x5cf34
movl $0x9a, %ecx
movb $0x0, %al
callq 0x11ae0
movq 0x20(%rsp), %rdi
callq 0x11880
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)