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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x90
mov edi, dword [ebp + 0x10]
mov ebx, dword [ebp + 0xc]
push 0
push 1
push 0x777284
push edi
push ebx
call fcn.005571c0
add esp, 0x14
mov byte [esp + 0x14], al
test al, al
mov dword [esp + 4], ebx
jne 0x500d45
xor esi, esi
inc esi
push 0
push 1
push 0x781d15
push edi
push ebx
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500d35
mov eax, dword [ebp + 8]
cmp edi, 3
mov edx, dword [esp + 4]
je 0x500956
cmp edi, 1
je 0x500d56
test edi, edi
je 0x500a91
mov dword [esp + 0x4c], esi
cvtsi2sd xmm0, esi
movsd qword [esp + 0x50], xmm0
mov dword [esp + 0xc], 0
xor ebx, ebx
mov dword [esp + 0x30], ebx
lea eax, [edx + edi]
mov dword [esp + 8], eax
mov dword [esp + 0x14], edi
lea eax, [edi - 1]
mov dword [esp + 0x10], eax
xor ecx, ecx
xor esi, esi
xor edi, edi
mov dword [esp + 4], edx
movsx ebx, byte [edx + ecx]
mov eax, ebx
add al, 0xc6
cmp al, 0xf6
jb 0x500986
mov eax, 0xcccccccc
cmp eax, esi
mov eax, 0xccccccc
sbb eax, edi
jl 0x500a8e
mov eax, esi
mov edx, 0xa
mul edx
add ebx, 0xffffffd0
lea esi, [edi + edi*4]
lea edi, [edx + esi*2]
mov edx, ebx
xor esi, esi
dec esi
xor edx, esi
mov esi, eax
cmp edx, eax
mov edx, dword [esp + 4]
mov eax, SysReAllocString
sbb eax, edi
jl 0x500a8e
add esi, ebx
adc edi, 0
inc ecx
dec dword [esp + 0x10]
cmp dword [esp + 0x14], ecx
jne 0x5008ef
jmp 0x500d6b
mov ecx, dword [esp + 4]
movzx edx, word [ecx]
xor dx, word [0x781d69]
mov ecx, dword [esp + 4]
mov cl, byte [ecx + 2]
xor cl, byte [0x781d6b]
movzx ecx, cl
or cx, dx
mov edx, dword [esp + 4]
jne 0x5008b7
jmp 0x500f58
add edx, ecx
cmp bl, 0x2e
je 0x500c4d
test ecx, ecx
je 0x500a8e
sub dword [esp + 0x14], ecx
mov dword [esp + 0x18], 0
mov dword [esp + 0x24], 0
xor eax, eax
inc eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 8], edx
mov dword [esp + 0x10], 2
push 0
push 2
push 0x781d77
mov ebx, dword [esp + 0x20]
push ebx
push dword [esp + 0x18]
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500ad5
push 0
push 2
push 0x781d7a
push ebx
push dword [esp + 0x18]
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500ab0
push 0
push 2
push 0x781d7d
push ebx
push dword [esp + 0x18]
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500ab7
push 0
push 1
push 0x781cff
push ebx
push dword [esp + 0x18]
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500abe
push 0
push 1
push 0x781d03
push ebx
push dword [esp + 0x18]
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500aa9
push 0
push 1
push 0x781cfd
push ebx
push dword [esp + 0x18]
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500aa2
push 0
push 1
push 0x781d05
push ebx
push dword [esp + 0x18]
call fcn.005571c0
add esp, 0x14
test al, al
jne 0x500a9b
mov eax, dword [ebp + 8]
mov byte [eax], 0
xor ecx, ecx
jmp 0x500c42
mov eax, 0x79cce0
jmp 0x500ac3
mov eax, 0x79ccd0
jmp 0x500ac3
mov eax, 0x79ccc0
jmp 0x500ac3
mov eax, 0x79cc90
jmp 0x500ada
mov eax, 0x79cca0
jmp 0x500ada
mov eax, 0x79ccb0
xor ecx, ecx
inc ecx
mov dword [esp + 0x10], ecx
jmp 0x500ada
mov edi, dword [esp + 0xc]
jmp 0x500c04
mov eax, 0x79cc80
mov ecx, dword [esp + 0x10]
sub dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x30]
mov ebx, dword [esp + 0x18]
jb 0x500d43
mov edx, dword [eax + 8]
mov dword [esp + 0x2c], edx
mov edx, dword [eax + 0xc]
mov eax, esi
or eax, edi
mov dword [esp + 0x28], edx
je 0x500acc
mov ebx, dword [esp + 0x4c]
mov ecx, ebx
sar ecx, 0x1f
mov eax, esi
mul ebx
mov dword [esp + 4], eax
imul ecx, esi
imul edi, ebx
add edi, edx
add edi, ecx
mov ecx, dword [esp + 0x28]
mov eax, ecx
sar eax, 0x1f
mov esi, ecx
xor esi, eax
mov ebx, dword [esp + 0x2c]
xor ebx, eax
sub ebx, eax
sbb esi, eax
mov eax, edi
sar eax, 0x1f
xor ecx, edi
xor edi, eax
mov edx, dword [esp + 4]
xor edx, eax
sub edx, eax
mov dword [esp + 4], edx
sbb edi, eax
mov eax, ebx
mul dword [esp + 4]
mov dword [esp + 0x48], eax
mov dword [esp + 0x44], edx
mov dword [esp + 0x34], ecx
mov eax, ecx
shr eax, 0x1f
cmp eax, dword [esp + 4]
mov ecx, 0
sbb ecx, edi
jae 0x500b94
xor ecx, ecx
dec ecx
add eax, ecx
mov ecx, SysReAllocString
adc ecx, 0
push edi
push dword [esp + 8]
push ecx
push eax
call fcn.005edf70
cmp eax, ebx
sbb edx, esi
jb 0x500dee
imul ebx, edi
mov eax, dword [esp + 0x44]
add eax, ebx
imul esi, dword [esp + 4]
add esi, eax
mov eax, dword [esp + 0x48]
mov edi, eax
neg edi
mov ecx, 0
sbb ecx, esi
cmp dword [esp + 0x34], 0
cmovns ecx, esi
cmovns edi, eax
xor edx, edx
dec edx
add edx, edi
mov esi, SysReAllocString
adc esi, ecx
add edx, 2
adc esi, 0
cmp edx, 2
sbb esi, 0
mov eax, dword [esp + 0x30]
mov ebx, dword [esp + 0x18]
jb 0x500d97
mov esi, dword [esp + 0xc]
add esi, edi
adc eax, ecx
seto dl
mov edi, eax
sar edi, 0x1f
lea ecx, [edi - 0x80000000]
test dl, dl
cmove edi, esi
test dl, dl
cmove ecx, eax
mov dword [esp + 4], ecx
mov eax, dword [ebp + 8]
mov esi, dword [esp + 8]
mov edx, ebx
mov ecx, dword [esp + 0x24]
or edx, ecx
jne 0x500e13
mov dword [esp + 0xc], edi
mov ebx, dword [esp + 4]
add esi, dword [esp + 0x10]
mov edx, esi
mov edi, dword [esp + 0x14]
test edi, edi
jne 0x5008cf
mov ecx, dword [esp + 0xc]
mov dword [eax], ecx
mov dword [eax + 4], ebx
mov cl, 1
mov byte [eax + 8], cl
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [esp + 0x28], edi
mov dword [esp + 4], edx
mov dword [esp + 0x18], 0
xor eax, eax
inc eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], 0
mov dword [esp + 0x1c], 0
jmp 0x500cc1
mov eax, dword [esp + 0x18]
mov edx, 0xa
mul edx
mov edi, edx
mov edx, ebx
add edx, 0xffffffd0
mov ebx, dword [esp + 0x24]
add ebx, ebx
add eax, edx
mov dword [esp + 0x18], eax
lea ebx, [ebx + ebx*4]
adc ebx, edi
mov dword [esp + 0x24], ebx
mov eax, dword [esp + 0x20]
mov edx, 0xa
mul edx
mov ebx, dword [esp + 0x1c]
lea ebx, [ebx + ebx*4]
lea edx, [edx + ebx*2]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
cmp byte [esp + 0x2c], 0xf5
jbe 0x500d11
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], eax
sub eax, 1
mov dword [esp + 0x10], eax
jb 0x500d09
mov eax, dword [esp + 4]
inc eax
mov dword [esp + 4], eax
movzx eax, byte [eax]
mov ebx, eax
add al, 0xc6
mov byte [esp + 0x2c], al
cmp al, 0xf6
setb al
mov edx, 0xcccccccc
cmp edx, dword [esp + 0x20]
mov edx, 0xccccccc
sbb edx, dword [esp + 0x1c]
setl dl
or dl, al
jne 0x500cba
jmp 0x500c76
mov eax, dword [esp + 8]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x20]
xor eax, 1
or eax, dword [esp + 0x1c]
or ecx, eax
mov eax, dword [esp + 4]
mov dword [esp + 8], eax
mov edi, dword [esp + 0x28]
jne 0x5009c0
jmp 0x500a8e
test edi, edi
je 0x500d43
inc dword [esp + 4]
dec edi
jmp 0x500896
ud2
test edi, edi
je 0x500d43
inc dword [esp + 4]
dec edi
xor esi, esi
dec esi
jmp 0x500896
cmp byte [edx], 0x30
jne 0x5008b7
xor ecx, ecx
mov dword [eax + 4], ecx
mov dword [eax], ecx
jmp 0x500c40
mov dword [esp + 0x18], 0
mov dword [esp + 0x24], 0
xor eax, eax
inc eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0
jmp 0x5009c0
mov dword [esp + 4], ecx
xor edx, edx
dec edx
add edx, dword [esp + 0xc]
mov esi, SysReAllocString
adc esi, eax
add edx, 2
adc esi, 0
xor eax, eax
xor ebx, ebx
inc ebx
cmp ebx, edx
sbb eax, esi
jae 0x500dca
mov eax, dword [ebp + 8]
mov esi, dword [esp + 8]
mov ebx, dword [esp + 0x18]
jmp 0x500c0f
mov edx, dword [esp + 0xc]
xor edx, edi
mov eax, dword [esp + 0x30]
xor eax, dword [esp + 4]
or eax, edx
mov eax, dword [ebp + 8]
mov esi, dword [esp + 8]
mov ebx, dword [esp + 0x18]
je 0x500c0f
int3
xor eax, eax
dec eax
mov edi, eax
add edi, 1
mov ecx, SysReAllocString
adc ecx, 0
cmp dword [esp + 0x34], 0
cmovns edi, eax
mov eax, SysReAllocString
cmovns ecx, eax
jmp 0x500bbe
movd xmm0, ebx
movd xmm1, ecx
movss xmm2, dword [esp + 0x20]
movss xmm3, dword [esp + 0x1c]
punpckldq xmm0, xmm1
movq qword [esp + 0x80], xmm0
fild qword [esp + 0x80]
fstp qword [esp + 0x78]
movsd xmm0, qword [esp + 0x78]
mulsd xmm0, qword [esp + 0x50]
unpcklps xmm2, xmm3
movlps qword [esp + 0x70], xmm2
fild qword [esp + 0x70]
fstp qword [esp + 0x68]
divsd xmm0, qword [esp + 0x68]
movss xmm1, dword [esp + 0x2c]
movss xmm2, dword [esp + 0x28]
unpcklps xmm1, xmm2
movlps qword [esp + 0x60], xmm1
fild qword [esp + 0x60]
fstp qword [esp + 0x58]
mulsd xmm0, qword [esp + 0x58]
xor ebx, ebx
movsd xmm1, qword [0x7772c0]
ucomisd xmm0, xmm1
mov eax, 0xffffffff
cmovb eax, ebx
mov dword [esp + 0xc], eax
mov eax, SysReAllocString
cmovae ebx, eax
movsd xmm2, qword [0x7772c8]
ucomisd xmm2, xmm0
maxsd xmm0, xmm1
movsd qword [esp + 0x38], xmm0
fld qword [esp + 0x38]
fisttp qword [esp + 0x38]
jb 0x500ed1
mov ebx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
mov dword [esp + 0xc], eax
xor edx, edx
dec edx
add edx, dword [esp + 0xc]
mov esi, SysReAllocString
adc esi, ebx
add edx, 2
adc esi, 0
cmp edx, 2
sbb esi, 0
jb 0x500f1f
add edi, dword [esp + 0xc]
mov ecx, dword [esp + 4]
adc ecx, ebx
seto dl
mov eax, ecx
sar eax, 0x1f
lea ebx, [eax - 0x80000000]
test dl, dl
cmove eax, edi
mov dword [esp + 0xc], eax
test dl, dl
cmove ebx, ecx
mov eax, dword [ebp + 8]
mov esi, dword [esp + 8]
jmp 0x500c25
xor edx, edx
dec edx
add edx, edi
mov esi, SysReAllocString
mov eax, dword [esp + 4]
adc esi, eax
add edx, 2
adc esi, 0
xor edi, dword [esp + 0xc]
xor eax, ebx
or eax, edi
je 0x500f13
xor eax, eax
xor ecx, ecx
inc ecx
cmp ecx, edx
sbb eax, esi
mov eax, dword [ebp + 8]
mov esi, dword [esp + 8]
jb 0x500c25
int3
xor esi, esi
xor ecx, ecx
dec ecx
mov edx, ecx
add edx, 1
adc esi, 0x7fffffff
cmp byte [esp + 0x14], 0
cmove edx, ecx
mov ecx, SysReAllocString
cmovne ecx, esi
mov dword [eax], edx
mov dword [eax + 4], ecx
jmp 0x500c40