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

Disassembly:
sub esp, 0x4c
mov eax, dword [esp + 0x5c]
imul eax, eax
push ebx
push ebp
push esi
push edi
cdq
mov ebx, eax
mov edi, edx
mov ecx, edi
shld ecx, eax, 1
add eax, eax
mov dword [esp + 0x38], ecx
mov dword [esp + 0x34], eax
shld ecx, eax, 1
add eax, eax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x70]
imul eax, eax
cdq
mov ecx, eax
mov eax, edx
mov esi, eax
mov dword [esp + 0x70], ecx
shld esi, ecx, 1
mov dword [esp + 0x10], eax
add ecx, ecx
mov dword [esp + 0x30], esi
mov eax, ecx
mov dword [esp + 0x2c], ecx
mov edx, esi
shld edx, eax, 1
push esi
add eax, eax
mov dword [esp + 0x44], edx
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x70]
cdq
mov ebp, eax
mov eax, edx
push ecx
push eax
push ebp
mov dword [esp + 0x2c], eax
call fcn.00417290
and dword [esp + 0x28], 0
mov ecx, eax
and dword [esp + 0x24], 0
mov esi, edx
shld esi, ecx, 1
mov dword [esp + 0x6c], esi
add ecx, ecx
mov esi, dword [esp + 0x10]
shrd dword [esp + 0x70], esi, 1
mov dword [esp + 0x14], ecx
sar esi, 1
mov dword [esp + 0x10], esi
mov esi, dword [esp + 0x70]
sub esi, eax
mov eax, dword [esp + 0x10]
sbb eax, edx
add esi, dword [esp + 0x34]
mov dword [esp + 0x70], esi
adc eax, dword [esp + 0x38]
shrd ebx, edi, 1
mov dword [esp + 0x10], eax
sar edi, 1
sub ebx, ecx
mov ecx, dword [esp + 0x60]
sbb edi, dword [esp + 0x6c]
add ebx, dword [esp + 0x2c]
adc edi, dword [esp + 0x30]
xor esi, esi
xor eax, eax
mov dword [esp + 0x18], esi
test byte [ecx + 0xd8], 4
mov dword [esp + 0x20], eax
je 0x5090c0
test edi, edi
jg 0x508fc3
jl 0x508eaa
test ebx, ebx
jae 0x508fc3
add esi, dword [esp + 0x68]
mov eax, dword [esp + 0x64]
add eax, ebp
push esi
push eax
push ecx
mov dword [esp + 0x58], eax
call fcn.00508037
mov eax, dword [esp + 0x70]
sub eax, ebp
push esi
push eax
push dword [esp + 0x74]
mov dword [esp + 0x68], eax
call fcn.00508037
mov esi, dword [esp + 0x30]
add esp, 0x18
mov eax, esi
or eax, dword [esp + 0x20]
je 0x508f0f
mov esi, dword [esp + 0x68]
sub esi, dword [esp + 0x18]
push esi
push dword [esp + 0x50]
push dword [esp + 0x68]
call fcn.00508037
push esi
push dword [esp + 0x60]
push dword [esp + 0x74]
call fcn.00508037
mov esi, dword [esp + 0x30]
add esp, 0x18
mov edx, dword [esp + 0x28]
add esi, 1
mov eax, dword [esp + 0x24]
push 0
pop ecx
adc dword [esp + 0x20], ecx
add edx, dword [esp + 0x44]
mov dword [esp + 0x18], esi
adc eax, dword [esp + 0x48]
mov dword [esp + 0x28], edx
mov dword [esp + 0x24], eax
cmp dword [esp + 0x10], ecx
jg 0x508f5d
jl 0x508f43
cmp dword [esp + 0x70], ecx
jae 0x508f5d
mov ecx, edx
add ecx, dword [esp + 0x34]
adc eax, dword [esp + 0x38]
add dword [esp + 0x70], ecx
adc dword [esp + 0x10], eax
add ebx, edx
adc edi, dword [esp + 0x24]
jmp 0x508fa9
mov ecx, dword [esp + 0x3c]
add ebp, 0xffffffff
adc dword [esp + 0x1c], 0xffffffff
sub dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x40]
sbb dword [esp + 0x6c], ecx
mov ecx, edx
sub ecx, dword [esp + 0x14]
sbb eax, dword [esp + 0x6c]
add ecx, dword [esp + 0x34]
adc eax, dword [esp + 0x38]
add dword [esp + 0x70], ecx
mov ecx, edx
adc dword [esp + 0x10], eax
sub ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
sbb eax, dword [esp + 0x6c]
add ecx, dword [esp + 0x2c]
adc eax, dword [esp + 0x30]
add ebx, ecx
adc edi, eax
mov ecx, dword [esp + 0x60]
test edi, edi
jl 0x508eaa
jg 0x508fbf
test ebx, ebx
jb 0x508eaa
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x68]
add edx, esi
mov esi, dword [esp + 0x64]
push edx
add esi, ebp
mov dword [esp + 0x74], edx
push esi
push ecx
call fcn.00508037
mov eax, dword [esp + 0x74]
sub eax, dword [esp + 0x24]
push eax
push esi
push dword [esp + 0x74]
mov dword [esp + 0x68], eax
call fcn.00508037
mov eax, ebp
add esp, 0x18
or eax, dword [esp + 0x1c]
je 0x509022
mov esi, dword [esp + 0x64]
push dword [esp + 0x70]
sub esi, ebp
push esi
push dword [esp + 0x68]
call fcn.00508037
push dword [esp + 0x5c]
push esi
push dword [esp + 0x74]
call fcn.00508037
add esp, 0x18
mov eax, dword [esp + 0x14]
add ebp, 0xffffffff
mov edx, dword [esp + 0x6c]
adc dword [esp + 0x1c], 0xffffffff
sub eax, dword [esp + 0x3c]
mov dword [esp + 0x14], eax
sbb edx, dword [esp + 0x40]
mov dword [esp + 0x6c], edx
test edi, edi
jg 0x50908a
jl 0x50904c
test ebx, ebx
jae 0x50908a
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
add esi, 1
mov edx, dword [esp + 0x24]
adc dword [esp + 0x20], 0
add eax, dword [esp + 0x44]
mov ecx, eax
mov dword [esp + 0x28], eax
adc edx, dword [esp + 0x48]
sub ecx, dword [esp + 0x14]
mov eax, edx
mov dword [esp + 0x18], esi
sbb eax, dword [esp + 0x6c]
add ecx, dword [esp + 0x2c]
mov dword [esp + 0x24], edx
adc eax, dword [esp + 0x30]
jmp 0x50909a
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x18]
sub ecx, eax
mov eax, dword [esp + 0x30]
sbb eax, edx
add ebx, ecx
mov ecx, dword [esp + 0x60]
adc edi, eax
cmp dword [esp + 0x1c], 0
jg 0x508fc3
jl 0x509314
test ebp, ebp
jae 0x508fc3
jmp 0x509314
test edi, edi
jg 0x5091e6
jl 0x5090d2
test ebx, ebx
jae 0x5091e6
mov eax, dword [esp + 0x1c]
mov edx, ebp
shld eax, edx, 1
add edx, edx
add edx, 1
push edx
adc eax, 0
mov dword [esp + 0x54], edx
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x68]
sub eax, ebp
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x6c]
add eax, esi
push eax
push dword [esp + 0x20]
push ecx
call fcn.00507b4d
mov eax, esi
add esp, 0x10
or eax, dword [esp + 0x20]
je 0x50912e
push dword [esp + 0x50]
mov eax, dword [esp + 0x6c]
sub eax, esi
push eax
push dword [esp + 0x20]
push dword [esp + 0x6c]
call fcn.00507b4d
add esp, 0x10
mov edx, dword [esp + 0x28]
add esi, 1
mov eax, dword [esp + 0x24]
push 0
pop ecx
adc dword [esp + 0x20], ecx
add edx, dword [esp + 0x44]
mov dword [esp + 0x28], edx
adc eax, dword [esp + 0x48]
mov dword [esp + 0x24], eax
cmp dword [esp + 0x10], ecx
jg 0x509178
jl 0x50915e
cmp dword [esp + 0x70], ecx
jae 0x509178
mov ecx, edx
add ecx, dword [esp + 0x34]
adc eax, dword [esp + 0x38]
add dword [esp + 0x70], ecx
adc dword [esp + 0x10], eax
add ebx, edx
adc edi, dword [esp + 0x24]
jmp 0x5091c4
mov ecx, dword [esp + 0x3c]
add ebp, 0xffffffff
adc dword [esp + 0x1c], 0xffffffff
sub dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x40]
sbb dword [esp + 0x6c], ecx
mov ecx, edx
sub ecx, dword [esp + 0x14]
sbb eax, dword [esp + 0x6c]
add ecx, dword [esp + 0x34]
adc eax, dword [esp + 0x38]
add dword [esp + 0x70], ecx
mov ecx, edx
adc dword [esp + 0x10], eax
sub ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
sbb eax, dword [esp + 0x6c]
add ecx, dword [esp + 0x2c]
adc eax, dword [esp + 0x30]
add ebx, ecx
adc edi, eax
mov ecx, dword [esp + 0x60]
test edi, edi
jl 0x5090d2
jg 0x5091da
test ebx, ebx
jb 0x5090d2
mov ecx, dword [esp + 0x60]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x18], esi
mov edx, dword [esp + 0x68]
add edx, esi
mov dword [esp + 0x50], esi
mov dword [esp + 0x4c], eax
mov dword [esp + 0x38], edx
mov edx, esi
mov esi, dword [esp + 0x64]
sub edx, dword [esp + 0x50]
sbb eax, dword [esp + 0x4c]
add edx, 1
push edx
push dword [esp + 0x3c]
adc eax, 0
mov dword [esp + 0x78], edx
add esi, ebp
mov dword [esp + 0x60], eax
push esi
push ecx
call fcn.0050849d
push dword [esp + 0x80]
mov eax, dword [esp + 0x7c]
sub eax, dword [esp + 0x2c]
push eax
push esi
push dword [esp + 0x7c]
mov dword [esp + 0x54], eax
call fcn.0050849d
mov eax, ebp
add esp, 0x20
or eax, dword [esp + 0x1c]
je 0x50927b
push dword [esp + 0x70]
mov esi, dword [esp + 0x68]
push dword [esp + 0x3c]
sub esi, ebp
push esi
push dword [esp + 0x6c]
call fcn.0050849d
push dword [esp + 0x80]
push dword [esp + 0x48]
push esi
push dword [esp + 0x7c]
call fcn.0050849d
add esp, 0x20
mov eax, dword [esp + 0x14]
add ebp, 0xffffffff
mov edx, dword [esp + 0x6c]
adc dword [esp + 0x1c], 0xffffffff
sub eax, dword [esp + 0x3c]
mov dword [esp + 0x14], eax
sbb edx, dword [esp + 0x40]
mov dword [esp + 0x6c], edx
test edi, edi
jg 0x5092e3
jl 0x5092a5
test ebx, ebx
jae 0x5092e3
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
add esi, 1
mov edx, dword [esp + 0x24]
adc dword [esp + 0x20], 0
add eax, dword [esp + 0x44]
mov ecx, eax
mov dword [esp + 0x28], eax
adc edx, dword [esp + 0x48]
sub ecx, dword [esp + 0x14]
mov eax, edx
mov dword [esp + 0x18], esi
sbb eax, dword [esp + 0x6c]
add ecx, dword [esp + 0x2c]
mov dword [esp + 0x24], edx
adc eax, dword [esp + 0x30]
jmp 0x5092f3
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x18]
sub ecx, eax
mov eax, dword [esp + 0x30]
sbb eax, edx
add ebx, ecx
mov ecx, dword [esp + 0x60]
adc edi, eax
cmp dword [esp + 0x1c], 0
mov eax, dword [esp + 0x20]
jg 0x5091f8
jl 0x509314
test ebp, ebp
jae 0x5091f8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret 0x14