// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymosttexcache.c
// Function: PTCacheLoadTile
PTCacheTile * PTCacheLoadTile(const char * filename, int effects, int flags)
{
	PTCacheIndex * pci;
	PTCacheTile * tdef;

	if (cachedisabled) {
		return 0;
	}

	pci = ptcache_findhash(filename, effects, flags);
	if (!pci) {
		return 0;
	}

	tdef = ptcache_load(pci->offset);
	if (tdef) {
		tdef->filename = strdup(filename);
		tdef->effects  = effects;
	}
	return tdef;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpb $0x0, 0x65f665(%rip)    # 0x6bd194
jne 0x5dd6b
movl %esi, %ebp
movq %rdi, %r14
callq 0x5da47
testq %rax, %rax
je 0x5dd6b
cmpb $0x0, 0x65f641(%rip)    # 0x6bd190
jne 0x5dd6b
movl 0x10(%rax), %r12d
leaq 0x1379a(%rip), %rdi     # 0x712fa
leaq 0xeb03(%rip), %rsi      # 0x6c66a
callq 0x6ce0
testq %rax, %rax
je 0x5dd1b
movq %rax, %rbx
xorl %r15d, %r15d
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x6c70
leaq 0x24(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
cmpq $0x1, %rax
jne 0x5dd3c
leaq 0x20(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
cmpq $0x1, %rax
jne 0x5dd39
leaq 0x14(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
cmpq $0x1, %rax
jne 0x5dd39
leaq 0x10(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
cmpq $0x1, %rax
jne 0x5dd39
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
xorl %r12d, %r12d
cmpq $0x1, %rax
jne 0x5dd39
movl 0xc(%rsp), %r13d
movl %r13d, %edi
callq 0x5ddf8
movq %rax, %r15
movl 0x24(%rsp), %eax
movl %eax, 0x14(%r15)
movl 0x20(%rsp), %eax
movl %eax, 0x18(%r15)
movl 0x14(%rsp), %eax
movl %eax, 0xc(%r15)
movl 0x10(%rsp), %eax
testl %r13d, %r13d
cmovlel %r12d, %r13d
movl %eax, 0x10(%r15)
imulq $0x18, %r13, %rax
addq $0x18, %rax
movq %rax, 0x28(%rsp)
pushq $0x4
popq %r13
leaq 0x18(%r12), %rax
cmpq %rax, 0x28(%rsp)
je 0x5dd80
movq %rax, 0x30(%rsp)
leaq 0x1c(%rsp), %rdi
movq %r13, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
cmpq $0x1, %rax
jne 0x5dd3c
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
cmpq $0x1, %rax
jne 0x5dd3c
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
cmpq $0x1, %rax
jne 0x5dd3c
movl 0x1c(%rsp), %eax
movl %eax, 0x20(%r15,%r12)
movl 0x18(%rsp), %eax
movl %eax, 0x24(%r15,%r12)
movslq 0x8(%rsp), %r13
movl %r13d, 0x28(%r15,%r12)
movq %r13, %rdi
callq 0x69a0
movq %rax, 0x30(%r15,%r12)
movq %rax, %rdi
movq %r13, %rsi
pushq $0x4
popq %r13
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6550
movq 0x30(%rsp), %r12
cmpq $0x1, %rax
je 0x5dc64
jmp 0x5dd3c
movb $0x1, 0x65f472(%rip)    # 0x6bd194
leaq 0x1345b(%rip), %rdi     # 0x71184
leaq 0x135ca(%rip), %rsi     # 0x712fa
xorl %eax, %eax
callq 0x22427
jmp 0x5dd6b
xorl %r15d, %r15d
movb $0x1, 0x65f44d(%rip)    # 0x6bd190
leaq 0x135d1(%rip), %rdi     # 0x7131b
xorl %eax, %eax
callq 0x22427
callq 0x5d9fc
movq %rbx, %rdi
callq 0x6480
testq %r15, %r15
je 0x5dd6b
movq %r15, %rdi
callq 0x5ddba
xorl %r15d, %r15d
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x6480
movq %r14, %rdi
callq 0x6060
movq %rax, (%r15)
movl %ebp, 0x8(%r15)
jmp 0x5dd6e