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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x508816
sub esp, 0x60
mov eax, dword [esp + 0x64]
mov dword [esp], eax
mov ecx, dword [esp + 0x68]
mov dword [esp + 4], ecx
lea edx, [0x5609e4]
mov dword [esp + 8], edx
mov byte [esp + 0xc], 0
call fcn.0046d750
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
jne 0x508463
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x68]
xor ebx, ebx
xor eax, eax
jmp 0x508482
mov ecx, dword [esp + 0x68]
cmp ecx, eax
jb 0x508810
mov edx, ecx
sub ecx, eax
mov ebx, ecx
neg ecx
sar ecx, 0x1f
and eax, ecx
mov ecx, dword [esp + 0x64]
add eax, ecx
cmp ebx, 1
jl 0x5087be
mov dword [esp + 0x18], ebx
mov dword [esp + 0x3c], eax
mov dword [esp], eax
lea ecx, [0x54de91]
mov dword [esp + 4], ecx
mov dword [esp + 8], 1
call fcn.00402580
movzx eax, byte [esp + 0xc]
test al, al
je 0x5087b6
mov ecx, dword [esp + 0x18]
cmp ecx, 1
jb 0x508806
lea eax, [ecx - 1]
mov dword [esp + 0x28], eax
mov edx, eax
neg eax
sar eax, 0x1f
and eax, 1
mov ebx, dword [esp + 0x3c]
add eax, ebx
mov dword [esp + 0x50], eax
mov dword [esp], eax
mov dword [esp + 4], edx
lea ebx, [0x5609e4]
mov dword [esp + 8], ebx
mov byte [esp + 0xc], 0
call fcn.0046d750
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
jne 0x50850c
xor edx, edx
xor eax, eax
jmp 0x50852e
mov ecx, dword [esp + 0x28]
cmp eax, ecx
ja 0x508801
mov ecx, dword [esp + 0x18]
sub ecx, eax
dec ecx
mov edx, ecx
neg ecx
sar ecx, 0x1f
and eax, ecx
mov ecx, dword [esp + 0x50]
add eax, ecx
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00508010
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x2c], edx
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x4c], ebx
mov dword [esp], eax
mov dword [esp + 4], ecx
call fcn.0046d3a0
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
test ecx, ecx
je 0x50877f
mov dword [esp + 0x5c], eax
mov dword [esp + 0x38], ecx
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
mov ecx, dword [esp + 0x2c]
mov dword [esp + 4], ecx
lea edx, [0x5609e4]
mov dword [esp + 8], edx
mov byte [esp + 0xc], 0
call fcn.0046d750
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
jne 0x5085a8
xor edx, edx
xor eax, eax
jmp 0x5085c5
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
ja 0x5087fc
sub ecx, eax
mov edx, ecx
neg ecx
sar ecx, 0x1f
and eax, ecx
mov ecx, dword [esp + 0x4c]
add eax, ecx
cmp edx, 1
jl 0x508748
mov dword [esp + 0x20], edx
mov dword [esp + 0x40], eax
mov dword [esp], eax
lea ecx, [0x54de93]
mov dword [esp + 4], ecx
mov dword [esp + 8], 1
call fcn.00402580
movzx eax, byte [esp + 0xc]
test al, al
je 0x508748
mov ecx, dword [esp + 0x20]
cmp ecx, 1
jb 0x5087f2
lea eax, [ecx - 1]
mov dword [esp + 0x24], eax
mov edx, eax
neg eax
sar eax, 0x1f
and eax, 1
mov ebx, dword [esp + 0x40]
add eax, ebx
mov dword [esp + 0x48], eax
mov dword [esp], eax
mov dword [esp + 4], edx
lea ebx, [0x5609e4]
mov dword [esp + 8], ebx
mov byte [esp + 0xc], 0
call fcn.0046d750
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
jne 0x50864f
xor edx, edx
xor eax, eax
jmp 0x508671
mov ecx, dword [esp + 0x24]
cmp eax, ecx
ja 0x5087ed
mov ecx, dword [esp + 0x20]
sub ecx, eax
dec ecx
mov edx, ecx
neg ecx
sar ecx, 0x1f
and eax, ecx
mov ecx, dword [esp + 0x48]
add eax, ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x44], eax
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.005080e0
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 8]
mov ebx, dword [esp + 0x14]
test eax, eax
jne 0x508721
mov ebp, dword [esp + 0x1c]
cmp ebp, ebx
je 0x5086a9
xor ebp, ebp
jmp 0x5086e4
mov dword [esp + 0x30], ebx
mov dword [esp + 0x54], ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x58], edx
mov dword [esp], ecx
mov eax, dword [esp + 0x44]
mov dword [esp + 4], eax
mov dword [esp + 8], ebx
call fcn.00402580
movzx eax, byte [esp + 0xc]
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x58]
mov ebx, dword [esp + 0x30]
mov ebp, eax
mov eax, dword [esp + 0x34]
xchg ebp, eax
test al, al
xchg ebp, eax
je 0x508721
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov eax, dword [esp + 0x64]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0x80], eax
add esp, 0x60
ret
mov ebp, dword [esp + 0x5c]
mov dword [esp + 0x6c], ebp
mov ebp, dword [esp + 0x38]
mov dword [esp + 0x70], ebp
mov dword [esp + 0x74], edx
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x80], ebx
add esp, 0x60
ret
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov eax, dword [esp + 0x64]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0x80], eax
add esp, 0x60
ret
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov eax, dword [esp + 0x64]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0x80], eax
add esp, 0x60
ret
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x68]
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x80], edx
add esp, 0x60
ret
call fcn.0045ca60
mov eax, 1
call fcn.0045ca60
call fcn.0045ca60
call fcn.0045ca60
mov eax, 1
call fcn.0045ca60
call fcn.0045ca60
nop
call fcn.0045b540
jmp fcn.00508410