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

Disassembly:
mov ecx, dword [0x82b814]
mov ecx, dword fs:[ecx]
mov ecx, dword [ecx]
lea eax, [esp - 0x10]
cmp eax, dword [ecx + 8]
jbe 0x517d5e
sub esp, 0x90
mov dword [0x7ecb44], 5
mov eax, dword [0x82b968]
test eax, eax
je 0x51785f
mov eax, dword [0x7ecb40]
call fcn.0046b930
mov dword [edi], eax
lea eax, [0x660b40]
mov dword [0x7ecb40], eax
mov eax, dword [esp + 0x94]
movzx ecx, word [eax + 0x46]
test cx, cx
jbe 0x517882
mov ecx, 2
jmp 0x517887
mov ecx, 1
mov dword [esp + 0x3c], ecx
lea eax, [0x643020]
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], ecx
call fcn.00450080
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x3c]
mov dword [0x7ecb4c], ecx
mov dword [0x7ecb50], ecx
mov edx, dword [0x82b968]
test edx, edx
je 0x5178cf
call fcn.0046b940
mov dword [edi], eax
mov edx, dword [0x7ecb48]
mov dword [edi + 4], edx
mov dword [0x7ecb48], eax
mov eax, dword [esp + 0x94]
mov dword [esp], eax
call fcn.005172d0
mov eax, dword [0x7ecb4c]
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x10]
test eax, eax
jbe 0x517d54
mov ebx, dword [esp + 8]
mov ebp, dword [0x7ecb48]
mov esi, dword [esp + 4]
mov dword [ebp + 4], ebx
mov ebx, dword [0x82b968]
test ebx, ebx
je 0x517922
call fcn.0046b940
mov dword [edi], esi
mov ebx, dword [ebp]
mov dword [edi + 4], ebx
mov dword [ebp], esi
mov ebx, dword [esp + 0x3c]
cmp ebx, 1
je 0x517b02
mov ebx, dword [esp + 0x94]
mov esi, dword [ebx + 0x54]
add esi, dword [ebx]
xchg esi, ebx
neg ebx
xchg esi, ebx
imul esi, esi, 0x3c
mov dword [ebp + 8], esi
mov ebp, dword [0x7ecb4c]
cmp ebp, 1
jbe 0x517d48
mov eax, dword [0x7ecb48]
mov dword [eax + 0x14], edx
mov edx, dword [0x82b968]
test edx, edx
je 0x517979
call fcn.0046b940
mov dword [edi], ecx
mov edx, dword [eax + 0x10]
mov dword [edi + 4], edx
mov dword [eax + 0x10], ecx
mov ecx, dword [ebx + 0xa8]
add ecx, dword [ebx]
neg ecx
imul ecx, ecx, 0x3c
mov dword [eax + 0x18], ecx
mov byte [eax + 0x1c], 1
movzx eax, word [ebx + 0x46]
mov word [esp + 0x2e], ax
movzx ecx, word [ebx + 0x9a]
mov word [esp + 0x2c], cx
lea edx, [ebx + 0x44]
add ebx, 0x98
cmp cx, ax
jb 0x5179b9
mov ebp, ebx
mov ebx, edx
mov edx, ebp
mov dword [esp + 0x6c], edx
mov dword [esp + 0x70], ebx
lea eax, [0x647460]
mov dword [esp], eax
mov dword [esp + 4], 0x190
mov dword [esp + 8], 0x190
call fcn.00450080
mov eax, dword [esp + 0xc]
mov dword [0x7ecb58], 0x190
mov dword [0x7ecb5c], 0x190
mov ecx, dword [0x82b968]
test ecx, ecx
je 0x517a11
call fcn.0046b940
mov dword [edi], eax
mov ecx, dword [0x7ecb54]
mov dword [edi + 4], ecx
mov dword [0x7ecb54], eax
call fcn.00512b60
lea edi, [esp + 0x7c]
lea esi, [esp]
call fcn.0046c08e
lea edi, [esp + 0x58]
lea esi, [esp + 0x7c]
call fcn.0046c08e
mov eax, dword [esp + 0x5c]
nop
nop
test eax, 0x80000000
je 0x517a8c
mov ecx, dword [esp + 0x58]
mov edx, ecx
shl ecx, 1
shl eax, 1
shr edx, 0x1f
or eax, edx
mov edx, eax
shl eax, 1
shr edx, 0x1f
shr ecx, 0x1f
or eax, ecx
add eax, 0xd7b17f80
mov dword [esp + 0x60], eax
adc edx, 0xd
mov dword [esp + 0x64], edx
and dword [esp + 0x58], 0x3fffffff
mov dword [esp + 0x5c], 0
movzx eax, word [esp + 0x2c]
movzx ecx, word [esp + 0x2e]
cmp ax, cx
jmp 0x517a99
movzx eax, word [esp + 0x2c]
movzx ecx, word [esp + 0x2e]
cmp ax, cx
mov dword [esp + 0x68], 0
setb al
mov byte [esp + 0x2b], al
setae cl
mov byte [esp + 0x2a], cl
nop
lea edi, [esp]
lea esi, [esp + 0x58]
call fcn.0046c08e
mov byte [esp + 0x14], 0
call fcn.00512760
mov eax, dword [esp + 0x18]
mov dword [esp + 0x30], eax
lea ecx, [eax - 0x64]
movzx edx, byte [esp + 0x2a]
movzx ebx, dl
mov dword [esp + 0x40], ebx
movzx ebp, byte [esp + 0x2b]
xchg ebp, eax
movzx esi, al
xchg ebp, eax
mov dword [esp + 0x44], esi
mov edi, dword [esp + 0x70]
mov dword [esp + 0x48], eax
xor eax, eax
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x48]
jmp 0x517c5a
mov eax, dword [esp + 0x94]
mov eax, dword [eax]
neg eax
imul eax, eax, 0x3c
mov dword [ebp + 8], eax
mov dword [0x7ecb68], 0
mov dword [0x7ecb6c], 0x80000000
mov dword [0x7ecb70], 0xffffffff
mov dword [0x7ecb74], 0x7fffffff
mov eax, dword [0x82b968]
test eax, eax
je 0x517b55
call fcn.0046b940
mov dword [edi], ebp
mov eax, dword [0x7ecb78]
mov dword [edi + 4], eax
mov dword [0x7ecb78], ebp
lea eax, [0x647460]
mov dword [esp], eax
mov dword [esp + 4], 1
mov dword [esp + 8], 1
call fcn.00450080
mov eax, dword [esp + 0xc]
mov dword [0x7ecb58], 1
mov dword [0x7ecb5c], 1
mov ecx, dword [0x82b968]
test ecx, ecx
je 0x517bab
call fcn.0046b940
mov dword [edi], eax
mov edx, dword [0x7ecb54]
mov dword [edi + 4], edx
mov dword [0x7ecb54], eax
mov edx, dword [0x7ecb54]
mov ebx, dword [0x7ecb68]
mov ebp, dword [0x7ecb6c]
mov dword [edx], ebx
mov dword [edx + 4], ebp
mov edx, dword [0x7ecb58]
test edx, edx
jbe 0x517be3
mov eax, dword [0x7ecb54]
mov byte [eax + 8], 0
add esp, 0x90
ret
xor eax, eax
mov ecx, eax
call fcn.0046b9b0
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0xc]
mov ebx, dword [0x7ecb48]
shl eax, 4
mov eax, dword [eax + ebx + 8]
mov ebx, eax
sar eax, 0x1f
mov ebp, dword [esp + 0x50]
mov edi, dword [esp + 0x78]
lea esi, [edi + ebp*4 + 0x14]
mov dword [esp + 0x74], esi
mov esi, dword [esp + 0x34]
inc esi
mov dword [esp + 0x34], esi
mov esi, dword [esp + 0x38]
add esi, 2
sub ecx, ebx
mov dword [edi + ebp*4 + 0xc], ecx
sbb edx, eax
mov dword [edi + ebp*4 + 0x10], edx
movzx edx, byte [esp + 0x2a]
mov eax, dword [esp + 0x74]
mov byte [eax], dl
mov edi, dword [esp + 0x70]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov ebx, dword [esp + 0x40]
movzx ebp, byte [esp + 0x2b]
mov dword [esp + 0x38], esi
mov esi, dword [esp + 0x44]
add eax, 0x64
cmp ecx, eax
jge 0x517d27
mov eax, dword [0x7ecb58]
mov edx, dword [0x7ecb54]
mov esi, dword [esp + 0x38]
cmp esi, eax
jae 0x517d3f
mov dword [esp + 0x78], edx
mov dword [esp + 0x34], ecx
mov dword [esp], ecx
mov dword [esp + 4], edi
call fcn.00517620
mov ecx, dword [0x7ecb4c]
mov eax, dword [esp + 0x38]
lea edx, [eax + eax*2]
mov ebx, dword [esp + 0x40]
cmp ecx, ebx
jbe 0x517d38
mov ebp, dword [esp + 8]
mov esi, dword [esp + 0xc]
mov edi, dword [0x7ecb48]
shl ebx, 4
mov ebx, dword [ebx + edi + 8]
mov edi, ebx
sar ebx, 0x1f
mov dword [esp + 0x54], ebx
mov ebx, dword [esp + 0x78]
lea ecx, [ebx + edx*4 + 8]
inc eax
sub ebp, edi
mov dword [ebx + edx*4], ebp
mov ebp, dword [esp + 0x54]
sbb esi, ebp
mov dword [ebx + edx*4 + 4], esi
movzx ebx, byte [esp + 0x2b]
mov byte [ecx], bl
mov ecx, dword [0x7ecb58]
mov ebp, dword [0x7ecb54]
cmp ecx, eax
jbe 0x517d33
mov dword [esp + 0x50], edx
mov dword [esp + 0x78], ebp
mov eax, dword [esp + 0x34]
mov dword [esp], eax
mov ecx, dword [esp + 0x6c]
mov dword [esp + 4], ecx
call fcn.00517620
mov ecx, dword [0x7ecb4c]
mov eax, dword [esp + 0x44]
cmp ecx, eax
ja 0x517bec
jmp 0x517d2e
add esp, 0x90
ret
call fcn.0046b9b0
call fcn.0046b9b0
mov eax, ebx
call fcn.0046b9b0
mov ecx, eax
mov eax, esi
call fcn.0046b9b0
mov eax, 1
mov ecx, ebp
call fcn.0046b9b0
xor eax, eax
mov ecx, eax
call fcn.0046b9b0
nop
call fcn.0046a530
jmp fcn.00517820