Function at 0x4504d0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x521252
mov eax, dword fs:[0]
push eax
sub esp, 0x58
push ebx
push esi
push edi
mov eax, dword [0x5750c8]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x20], edi
cmp dword [edi + 0x38], 0
lea eax, [edi + 0x38]
mov dword [esp + 0x18], eax
jne 0x450751
mov eax, dword [edi + 0x44]
lea ebx, [edi + 0x44]
mov dword [esp + 0x28], ebx
test eax, eax
je 0x450751
lea ecx, [esp + 0x2c]
push ecx
call fcn.00438720
mov dword [esp + 0x70], 0
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x450710
lea esi, [ebx + 4]
mov eax, esi
call fcn.00459a40
mov byte [edi + 0x34], al
mov eax, dword [edi + 0x40]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x450563
movzx edx, word [ebx + 0x1a]
mov dword [esp + 0x10], edx
movzx ecx, word [ebx + 0x16]
movzx eax, word [ebx + 0x14]
xor edx, edx
lea ecx, [ecx]
cmp eax, 1
jae 0x45057a
cmp ecx, 1
jb 0x450581
shr eax, 1
shr ecx, 1
inc edx
jmp 0x450570
cmp dword [esp + 0x10], edx
jbe 0x45058b
mov dword [esp + 0x10], edx
movzx eax, word [ebx + 0x1a]
cmp dword [esp + 0x10], eax
jbe 0x450599
mov dword [esp + 0x10], eax
mov ecx, dword [esi]
mov edx, dword [esi + 4]
sub esp, 0xc
mov eax, esp
mov dword [eax], ecx
mov ecx, dword [esi + 8]
mov dword [eax + 4], edx
mov dword [eax + 8], ecx
call fcn.00450070
add esp, 0xc
mov dword [esp + 0x1c], eax
test eax, eax
je 0x4506f5
add edi, 0x14
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x20]
mov dword [esi + 0x3c], 1
mov edi, ebx
call fcn.00406d40
mov edx, dword [esp + 0x18]
mov ecx, dword [esi + 0x3c]
mov eax, dword [eax + 0x60]
push edx
mov edx, dword [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x18]
push edx
movzx edx, word [edi + 0x16]
push 0
push ecx
movzx ecx, word [ebx + 0x14]
push edx
push ecx
push eax
call dword [sym.imp.d3dx9_42.dll_D3DXCreateTexture]
xor ebx, ebx
mov dword [esp + 0x1c], ebx
cmp dword [esp + 0x10], ebx
jbe 0x450710
mov edx, dword [esp + 0x18]
mov eax, dword [edx]
mov ecx, dword [eax]
push 0
push 0
lea edx, [esp + 0x3c]
push edx
push ebx
push eax
mov eax, dword [ecx + 0x4c]
call eax
test eax, eax
js 0x4506e4
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx]
mov edx, dword [edx + 4]
lea eax, [esp + 0x14]
push eax
push ebx
push 0
call edx
mov edx, dword [esp + 0x30]
movzx esi, word [edx + 0x16]
mov edi, eax
mov al, byte [edx + 4]
mov cl, bl
shr esi, cl
cmp al, 1
jne 0x450662
shr esi, 2
test esi, esi
jne 0x45066b
mov esi, 1
mov ecx, dword [esp + 0x34]
mov edx, ecx
imul edx, esi
cmp edx, dword [esp + 0x14]
jne 0x45068f
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x38]
push eax
push edi
push ecx
call sub.MSVCR100.dll_memcpy
add esp, 0xc
jmp 0x4506d5
test al, al
jne 0x4506d5
mov eax, dword [esp + 0x14]
xor edx, edx
div esi
mov ebx, dword [esp + 0x38]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], eax
cmp eax, ecx
jb 0x4506b3
mov dword [esp + 0x20], ecx
test esi, esi
je 0x4506d1
mov edx, dword [esp + 0x20]
push edx
push edi
push ebx
call sub.MSVCR100.dll_memcpy
add edi, dword [esp + 0x30]
add ebx, dword [esp + 0x34]
add esp, 0xc
dec esi
jne 0x4506b7
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
mov eax, dword [eax]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x50]
push ebx
push eax
call edx
inc ebx
mov dword [esp + 0x1c], ebx
cmp ebx, dword [esp + 0x10]
jb 0x450617
jmp 0x450710
mov eax, dword [esp + 0x28]
mov ecx, dword [eax]
mov edx, dword [ecx]
mov edx, dword [edx + 0x18]
lea eax, [esp + 0x3c]
push eax
call edx
lea ecx, [esp + 0x3c]
call fcn.004295d0
mov dword [esp + 0x70], 1
mov ecx, dword [esp + 0x2c]
mov eax, dword [ecx]
mov edx, dword [esp + 0x30]
mov eax, dword [eax + 0x14]
push edx
call eax
push 0
lea ecx, [esp + 0x30]
push ecx
mov dword [esp + 0x78], 0xffffffff
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test eax, eax
je 0x450751
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 4]
call eax
mov ecx, eax
call fcn.004037e0
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret