// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/polymosttex.c
// Function: pt_load_applyparameters
static void pt_load_applyparameters(PTHead * pth)
{
	int i;

	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);

		if (gltexfiltermode < 0) {
			gltexfiltermode = 0;
		} else if (gltexfiltermode >= (int)numglfiltermodes) {
			gltexfiltermode = numglfiltermodes-1;
		}
		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) {
			if (glanisotropy <= 0 || glanisotropy > glinfo.maxanisotropy) {
				glanisotropy = (int)glinfo.maxanisotropy;
			}
			glfunc.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glanisotropy);
		}
#endif

		if (! (pth->flags & PTH_CLAMPED)) {
			glfunc.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
			glfunc.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
		} else {     //For sprite textures, clamping looks better than wrapping
			GLint c = glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP;
			glfunc.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, c);
			glfunc.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, c);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x59253d(%rip), %r15    # 0x5fa740
leaq 0x3d37a(%rip), %r12     # 0xa5584
leaq 0x11603f(%rip), %r13    # 0x17e250
movq (%rbx,%r14,8), %rax
testq %rax, %rax
je 0x68322
movl (%rax), %esi
testl %esi, %esi
je 0x68322
movl $0xde1, %edi            # imm = 0xDE1
callq *0xc8(%r15)
movl (%r12), %eax
testl %eax, %eax
js 0x68248
movl $0x5, %ecx
cmpl $0x6, %eax
jae 0x6824a
jmp 0x68250
xorl %ecx, %ecx
movl %ecx, (%r12)
movl %ecx, %eax
movl %eax, %eax
shlq $0x4, %rax
leaq 0x3d2c3(%rip), %rbp     # 0xa5520
movl 0xc(%rbp,%rax), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
callq *0xe8(%r15)
movslq (%r12), %rax
shlq $0x4, %rax
movl 0x8(%rbp,%rax), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
callq *0xe8(%r15)
movss 0x14(%r13), %xmm0
ucomiss 0xee78(%rip), %xmm0     # 0x77114
jbe 0x682dc
leaq 0x5926df(%rip), %rax    # 0x5fa984
movl (%rax), %eax
testl %eax, %eax
jle 0x682b7
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x682c4
cvttss2si %xmm0, %eax
leaq 0x5926c2(%rip), %rcx    # 0x5fa984
movl %eax, (%rcx)
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movl $0xde1, %edi            # imm = 0xDE1
movl $0x84fe, %esi           # imm = 0x84FE
callq *0xe0(%r15)
cmpb $0x0, 0x19(%r13)
movl $0x812f, %ebp           # imm = 0x812F
movl $0x2900, %eax           # imm = 0x2900
cmovel %eax, %ebp
movzwl 0x38(%rbx), %eax
testb $0x1, %al
movl $0x2901, %eax           # imm = 0x2901
cmovel %eax, %ebp
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2802, %esi           # imm = 0x2802
movl %ebp, %edx
callq *0xe8(%r15)
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2803, %esi           # imm = 0x2803
movl %ebp, %edx
callq *0xe8(%r15)
incq %r14
cmpq $0x6, %r14
jne 0x68211
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop