// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: gltexapplyprops
void gltexapplyprops (void)
{
	int i;
	PTIter iter;
	PTHead * pth;

	if (glinfo.maxanisotropy > 1.0)
	{
		if (glanisotropy <= 0 || glanisotropy > glinfo.maxanisotropy) glanisotropy = (int)glinfo.maxanisotropy;
	}

	if (gltexfiltermode < 0) gltexfiltermode = 0;
	else if (gltexfiltermode >= (int)numglfiltermodes) gltexfiltermode = numglfiltermodes-1;

	iter = PTIterNew();
	while ((pth = PTIterNext(iter)) != 0) {
		for (i = 0; i < PTHPIC_SIZE; i++) {
			if (pth->pic[i] == 0 || pth->pic[i]->glpic == 0) {
				continue;
			}
			glfunc.glBindTexture(GL_TEXTURE_2D,pth->pic[i]->glpic);
			glfunc.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
			glfunc.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
#ifdef GL_EXT_texture_filter_anisotropic
			if (glinfo.maxanisotropy > 1.0) {
				glfunc.glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
			}
#endif
		}
	}
	PTIterFree(iter);

	{
		int j;
		mdskinmap_t *sk;
		md2model *m;

		for (i=0;i<nextmodelid;i++)
		{
			m = (md2model *)models[i];
			if (m->mdnum < 2) continue;
			for (j=0;j<m->numskins*(HICEFFECTMASK+1);j++)
			{
				if (!m->tex[j] || !m->tex[j]->glpic) continue;
				glfunc.glBindTexture(GL_TEXTURE_2D,m->tex[j]->glpic);
				glfunc.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
				glfunc.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
#ifdef GL_EXT_texture_filter_anisotropic
				if (glinfo.maxanisotropy > 1.0)
					glfunc.glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
#endif
			}

			for (sk=m->skinmap;sk;sk=sk->next)
				for (j=0;j<(HICEFFECTMASK+1);j++)
				{
					if (!sk->tex[j] || !sk->tex[j]->glpic) continue;
					glfunc.glBindTexture(GL_TEXTURE_2D,sk->tex[j]->glpic);
					glfunc.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
					glfunc.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
#ifdef GL_EXT_texture_filter_anisotropic
					if (glinfo.maxanisotropy > 1.0)
						glfunc.glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
#endif
				}
			}
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x12fb48(%rip), %r15    # 0x17d250
movss 0x14(%r15), %xmm0
ucomiss 0x2887f(%rip), %xmm0    # 0x75f94
jbe 0x4d734
movl 0x5ac267(%rip), %eax    # 0x5f9984
testl %eax, %eax
jle 0x4d72a
cvtsi2ss %eax, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x4d734
cvttss2si %xmm0, %eax
movl %eax, 0x5ac250(%rip)    # 0x5f9984
movl 0x56e4a(%rip), %ecx     # 0xa4584
testl %ecx, %ecx
js 0x4d74a
movl $0x5, %eax
cmpl $0x6, %ecx
jge 0x4d74c
jmp 0x4d752
xorl %eax, %eax
movl %eax, 0x56e32(%rip)     # 0xa4584
callq 0x65926
movq %rax, %rbx
movq %rax, %rdi
callq 0x65936
testq %rax, %rax
je 0x4d82f
movq %rax, %r14
leaq 0x5abfcb(%rip), %r12    # 0x5f9740
leaq 0x56da4(%rip), %r13     # 0xa4520
xorl %ebp, %ebp
movq (%r14,%rbp,8), %rax
testq %rax, %rax
je 0x4d80e
movl (%rax), %esi
testl %esi, %esi
je 0x4d80e
movl $0xde1, %edi            # imm = 0xDE1
callq *0xc8(%r12)
movslq 0x56ddf(%rip), %rax     # 0xa4584
shlq $0x4, %rax
movl 0xc(%rax,%r13), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
callq *0xe8(%r12)
movslq 0x56dbd(%rip), %rax     # 0xa4584
shlq $0x4, %rax
movl 0x8(%rax,%r13), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
callq *0xe8(%r12)
movss 0x14(%r15), %xmm0
ucomiss 0x287a5(%rip), %xmm0    # 0x75f94
jbe 0x4d80e
xorps %xmm0, %xmm0
cvtsi2ssl 0x5ac188(%rip), %xmm0 # 0x5f9984
movl $0xde1, %edi            # imm = 0xDE1
movl $0x84fe, %esi           # imm = 0x84FE
callq *0xe0(%r12)
incq %rbp
cmpq $0x6, %rbp
jne 0x4d77e
movq %rbx, %rdi
callq 0x65936
movq %rax, %r14
testq %rax, %rax
jne 0x4d77c
movq %rbx, %rdi
callq 0x6595e
leaq 0x5fa7f6(%rip), %rax    # 0x648034
cmpl $0x0, (%rax)
jle 0x4d9e0
xorl %r14d, %r14d
leaq 0x5abeef(%rip), %r13    # 0x5f9740
leaq 0x56cc8(%rip), %rbp     # 0xa4520
leaq 0x5fa7d9(%rip), %rax    # 0x648038
movq (%rax), %rax
movq (%rax,%r14,8), %r12
cmpl $0x2, (%r12)
jge 0x4d884
incq %r14
leaq 0x5fa7bd(%rip), %rax    # 0x648034
movslq (%rax), %rax
cmpq %rax, %r14
jl 0x4d858
jmp 0x4d9e0
cmpl $0x0, 0x50(%r12)
jle 0x4d932
xorl %ebx, %ebx
movq 0x18(%r12), %rax
movq (%rax,%rbx,8), %rax
testq %rax, %rax
je 0x4d91d
movl (%rax), %esi
testl %esi, %esi
je 0x4d91d
movl $0xde1, %edi            # imm = 0xDE1
callq *0xc8(%r13)
movslq 0x56ccb(%rip), %rax     # 0xa4584
shlq $0x4, %rax
movl 0xc(%rax,%rbp), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
callq *0xe8(%r13)
movslq 0x56cab(%rip), %rax     # 0xa4584
shlq $0x4, %rax
movl 0x8(%rax,%rbp), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
callq *0xe8(%r13)
movss 0x14(%r15), %xmm0
ucomiss 0x28695(%rip), %xmm0    # 0x75f94
jbe 0x4d91d
xorps %xmm0, %xmm0
cvtsi2ssl 0x5ac078(%rip), %xmm0 # 0x5f9984
movl $0xde1, %edi            # imm = 0xDE1
movl $0x84fe, %esi           # imm = 0x84FE
callq *0xe0(%r13)
incq %rbx
movslq 0x50(%r12), %rax
shlq $0x2, %rax
cmpq %rax, %rbx
jl 0x4d892
movq 0x48(%r12), %r12
testq %r12, %r12
je 0x4d86d
xorl %ebx, %ebx
movq 0x18(%r12,%rbx,8), %rax
testq %rax, %rax
je 0x4d9c9
movl (%rax), %esi
testl %esi, %esi
je 0x4d9c9
movl $0xde1, %edi            # imm = 0xDE1
callq *0xc8(%r13)
movslq 0x56c1f(%rip), %rax     # 0xa4584
shlq $0x4, %rax
movl 0xc(%rax,%rbp), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
callq *0xe8(%r13)
movslq 0x56bff(%rip), %rax     # 0xa4584
shlq $0x4, %rax
movl 0x8(%rax,%rbp), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
callq *0xe8(%r13)
movss 0x14(%r15), %xmm0
ucomiss 0x285e9(%rip), %xmm0    # 0x75f94
jbe 0x4d9c9
xorps %xmm0, %xmm0
cvtsi2ssl 0x5abfcc(%rip), %xmm0 # 0x5f9984
movl $0xde1, %edi            # imm = 0xDE1
movl $0x84fe, %esi           # imm = 0x84FE
callq *0xe0(%r13)
incq %rbx
cmpq $0x4, %rbx
jne 0x4d942
movq 0x38(%r12), %r12
jmp 0x4d937
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq