// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x6, -0xc(%rbp)
jge 0x9bf03
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x9bd0d
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, (%rax)
jne 0x9bd12
jmp 0x9bef5
leaq 0x5519f7(%rip), %rax    # 0x5ed710
movq 0xc8(%rax), %rax
movq -0x8(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq *%rax
leaq 0x45e88(%rip), %rax     # 0xe1bc4
cmpl $0x0, (%rax)
jge 0x9bd50
leaq 0x45e7c(%rip), %rax     # 0xe1bc4
movl $0x0, (%rax)
jmp 0x9bd6b
leaq 0x45e6d(%rip), %rax     # 0xe1bc4
cmpl $0x6, (%rax)
jl 0x9bd69
leaq 0x45e61(%rip), %rax     # 0xe1bc4
movl $0x5, (%rax)
jmp 0x9bd6b
leaq 0x55199e(%rip), %rax    # 0x5ed710
movq 0xe8(%rax), %rax
leaq 0x45e44(%rip), %rcx     # 0xe1bc4
movslq (%rcx), %rdx
leaq 0x45dd6(%rip), %rcx     # 0xe1b60
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
callq *%rax
leaq 0x551969(%rip), %rax    # 0x5ed710
movq 0xe8(%rax), %rax
leaq 0x45e0f(%rip), %rcx     # 0xe1bc4
movslq (%rcx), %rdx
leaq 0x45da1(%rip), %rcx     # 0xe1b60
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
callq *%rax
leaq 0x11efd4(%rip), %rax    # 0x1badb0
movss 0x14(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x15be3(%rip), %xmm1    # 0xb19d0
ucomisd %xmm1, %xmm0
jbe 0x9be51
leaq 0x551b5a(%rip), %rax    # 0x5ed954
cmpl $0x0, (%rax)
jle 0x9be17
leaq 0x551b4e(%rip), %rax    # 0x5ed954
cvtsi2ssl (%rax), %xmm0
leaq 0x11ef9f(%rip), %rax    # 0x1badb0
ucomiss 0x14(%rax), %xmm0
jbe 0x9be2c
leaq 0x11ef92(%rip), %rax    # 0x1badb0
cvttss2si 0x14(%rax), %ecx
leaq 0x551b2a(%rip), %rax    # 0x5ed954
movl %ecx, (%rax)
leaq 0x5518dd(%rip), %rax    # 0x5ed710
movq 0xe0(%rax), %rax
leaq 0x551b13(%rip), %rcx    # 0x5ed954
cvtsi2ssl (%rcx), %xmm0
movl $0xde1, %edi            # imm = 0xDE1
movl $0x84fe, %esi           # imm = 0x84FE
callq *%rax
movq -0x8(%rbp), %rax
movzwl 0x38(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x9be9b
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2802, %esi           # imm = 0x2802
movl $0x2901, %edx           # imm = 0x2901
leaq 0x551899(%rip), %rax    # 0x5ed710
callq *0xe8(%rax)
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2803, %esi           # imm = 0x2803
movl $0x2901, %edx           # imm = 0x2901
leaq 0x55187d(%rip), %rax    # 0x5ed710
callq *0xe8(%rax)
jmp 0x9bef3
leaq 0x11ef0e(%rip), %rax    # 0x1badb0
movsbl 0x19(%rax), %edx
movl $0x2900, %eax           # imm = 0x2900
movl $0x812f, %ecx           # imm = 0x812F
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x10(%rbp)
leaq 0x551850(%rip), %rax    # 0x5ed710
movq 0xe8(%rax), %rax
movl -0x10(%rbp), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2802, %esi           # imm = 0x2802
callq *%rax
leaq 0x551833(%rip), %rax    # 0x5ed710
movq 0xe8(%rax), %rax
movl -0x10(%rbp), %edx
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2803, %esi           # imm = 0x2803
callq *%rax
jmp 0x9bef5
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x9bce3
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)