// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: clearskins
void clearskins (void)
{
	mdmodel *m;
	int i, j;

	for(i=0;i<nextmodelid;i++)
	{
		m = models[i];
		if (m->mdnum == 1) {
			voxmodel *v = (voxmodel*)m;
			for(j=0;j<MAXPALOOKUPS;j++) {
				if (v->texid[j]) glfunc.glDeleteTextures(1, &v->texid[j]);
				v->texid[j] = 0;
			}
			if (v->vertexbuf) glfunc.glDeleteBuffers(1, &v->vertexbuf);
			if (v->indexbuf) glfunc.glDeleteBuffers(1, &v->indexbuf);
			v->vertexbuf = 0;
			v->indexbuf = 0;
		} else if (m->mdnum == 2 || m->mdnum == 3) {
			md2model *m2 = (md2model*)m;
			mdskinmap_t *sk;
			for(j=0;j<m2->numskins*(HICEFFECTMASK+1);j++)
			{
				if (m2->tex[j] && m2->tex[j]->glpic) {
					glfunc.glDeleteTextures(1, &m2->tex[j]->glpic);
					m2->tex[j]->glpic = 0;
				}
			}

			for(sk=m2->skinmap;sk;sk=sk->next)
			{
				for(j=0;j<(HICEFFECTMASK+1);j++)
				{
					if (sk->tex[j] && sk->tex[j]->glpic) {
						glfunc.glDeleteTextures(1, &sk->tex[j]->glpic);
						sk->tex[j]->glpic = 0;
					}
				}
			}
		}
	}

	for(i=0;i<MAXVOXELS;i++)
	{
		voxmodel *v = (voxmodel*)voxmodels[i]; if (!v) continue;
		for(j=0;j<MAXPALOOKUPS;j++) {
			if (v->texid[j]) glfunc.glDeleteTextures(1,(GLuint*)&v->texid[j]);
			v->texid[j] = 0;
		}
		if (v->vertexbuf) glfunc.glDeleteBuffers(1, &v->vertexbuf);
		if (v->indexbuf) glfunc.glDeleteBuffers(1, &v->indexbuf);
		v->vertexbuf = 0;
		v->indexbuf = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x5ad67c(%rip), %eax    # 0x63c004
jge 0x8ebdf
movq 0x5ad673(%rip), %rax    # 0x63c008
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x8ea87
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jge 0x8ea1e
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x8ea00
leaq 0x55ed31(%rip), %rax    # 0x5ed710
movq 0xc0(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rsi
movslq -0x10(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rsi
movl $0x1, %edi
callq *%rax
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8e9bd
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
je 0x8ea45
leaq 0x55ece1(%rip), %rax    # 0x5ed710
movq 0x110(%rax), %rax
movq -0x18(%rbp), %rsi
addq $0x74, %rsi
movl $0x1, %edi
callq *%rax
movq -0x18(%rbp), %rax
cmpl $0x0, 0x78(%rax)
je 0x8ea6c
leaq 0x55ecba(%rip), %rax    # 0x5ed710
movq 0x110(%rax), %rax
movq -0x18(%rbp), %rsi
addq $0x78, %rsi
movl $0x1, %edi
callq *%rax
movq -0x18(%rbp), %rax
movl $0x0, 0x74(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x78(%rax)
jmp 0x8ebcf
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
je 0x8ea9d
movq -0x8(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x8ebcd
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x20(%rbp), %rcx
movl 0x50(%rcx), %ecx
shll $0x2, %ecx
cmpl %ecx, %eax
jge 0x8eb30
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x8eb20
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, (%rax)
je 0x8eb20
leaq 0x55ec24(%rip), %rax    # 0x5ed710
movq 0xc0(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movslq -0x10(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movl $0x1, %edi
callq *%rax
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl $0x0, (%rax)
jmp 0x8eb22
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8eaac
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x8ebcb
movl $0x0, -0x10(%rbp)
cmpl $0x4, -0x10(%rbp)
jge 0x8ebb8
movq -0x28(%rbp), %rax
movslq -0x10(%rbp), %rcx
cmpq $0x0, 0x18(%rax,%rcx,8)
je 0x8ebab
movq -0x28(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
cmpl $0x0, (%rax)
je 0x8ebab
leaq 0x55eb93(%rip), %rax    # 0x5ed710
movq 0xc0(%rax), %rax
movq -0x28(%rbp), %rcx
movslq -0x10(%rbp), %rdx
movq 0x18(%rcx,%rdx,8), %rsi
movl $0x1, %edi
callq *%rax
movq -0x28(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movl $0x0, (%rax)
jmp 0x8ebad
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8eb4e
jmp 0x8ebba
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x8eb3c
jmp 0x8ebcd
jmp 0x8ebcf
jmp 0x8ebd1
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8e97f
movl $0x0, -0xc(%rbp)
cmpl $0x1000, -0xc(%rbp)     # imm = 0x1000
jge 0x8ecec
movslq -0xc(%rbp), %rcx
leaq 0x5c8442(%rip), %rax    # 0x657040
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x8ec12
jmp 0x8ecde
movl $0x0, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jge 0x8ec7a
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x8ec5c
leaq 0x55ead5(%rip), %rax    # 0x5ed710
movq 0xc0(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rsi
movslq -0x10(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rsi
movl $0x1, %edi
callq *%rax
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8ec19
movq -0x30(%rbp), %rax
cmpl $0x0, 0x74(%rax)
je 0x8eca1
leaq 0x55ea85(%rip), %rax    # 0x5ed710
movq 0x110(%rax), %rax
movq -0x30(%rbp), %rsi
addq $0x74, %rsi
movl $0x1, %edi
callq *%rax
movq -0x30(%rbp), %rax
cmpl $0x0, 0x78(%rax)
je 0x8ecc8
leaq 0x55ea5e(%rip), %rax    # 0x5ed710
movq 0x110(%rax), %rax
movq -0x30(%rbp), %rsi
addq $0x78, %rsi
movl $0x1, %edi
callq *%rax
movq -0x30(%rbp), %rax
movl $0x0, 0x74(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x78(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8ebe6
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)