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

Disassembly:
push ebp
push edi
push esi
mov esi, ecx
push ebx
mov ebx, edx
sub esp, 0x5c
mov edi, dword [esp + 0x70]
mov dword [esp + 0x28], eax
test edi, edi
js 0x804b50
lea eax, [esp + 0x48]
mov dword [esp + 0x48], 0
sub esp, 0xc
mov edx, 0xc
mov dword [esp + 0x38], eax
mov ecx, eax
push 0
mov eax, dword [esp + 0x38]
call fcn.007ec150
add esp, 0x10
mov ebp, eax
test eax, eax
je 0x804cb6
mov esi, dword [esp + 0x48]
sub esp, 0xc
push esi
call fcn.007b8680
add esp, 0x10
cmp ebp, 0x65
cmove ebp, eax
add esp, 0x5c
pop ebx
pop esi
mov eax, ebp
pop edi
pop ebp
ret
mov eax, dword [eax + 0x104]
test eax, eax
je 0x804b6a
mov edi, dword [esp + 0x28]
cmp dword [edi + 0x118], edx
je 0x804c19
cmp dword [esp + 0x70], 0xffffffff
je 0x804c00
lea eax, [esp + 0x48]
mov dword [esp + 0x48], 0
sub esp, 0xc
mov edx, 0xd
mov dword [esp + 0x38], eax
mov ecx, eax
push 0
mov eax, dword [esp + 0x38]
call fcn.007ec150
add esp, 0x10
mov ebp, eax
test eax, eax
jne 0x804b29
mov ebp, dword [esp + 0x28]
mov eax, ebx
mov edi, esi
sar edi, 0x1f
imul dword [ebp + 0x100]
add eax, esi
adc edx, edi
shld edx, eax, 0xa
shl eax, 0xa
push edx
push eax
push 1
push dword [esp + 0x54]
call fcn.0078bb60
mov eax, ebx
imul dword [ebp + 0x100]
add eax, esi
adc edx, edi
shld edx, eax, 0xa
shl eax, 0xa
add eax, 0x3ff
adc edx, 0
push edx
push eax
push 2
push dword [esp + 0x64]
call fcn.0078bb60
add esp, 0x20
jmp 0x804cef
sub esp, 0xc
xor ebp, ebp
push 0
call fcn.007b8680
add esp, 0x10
add esp, 0x5c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
lea edx, [ecx + ecx*2]
mov edi, dword [esp + 0x7c]
or edi, dword [esp + 0x80]
lea eax, [eax + edx*8]
je 0x804e87
mov eax, dword [eax + 0xc]
mov dword [esp + 0x48], eax
test eax, eax
je 0x805068
xor edi, edi
mov dword [esp + 0xc], ebx
xor ebp, ebp
mov ebx, dword [esp + 0x78]
mov dword [esp + 0x10], ecx
mov esi, edi
jmp 0x804c6f
mov eax, dword [esp + 0x48]
mov dword [esi + ebp*4], eax
add ebp, 1
mov eax, dword [esp + 0x48]
mov eax, dword [eax]
mov dword [esp + 0x48], eax
test eax, eax
je 0x804f89
test ebx, ebx
je 0x804c8f
cmp ebx, dword [eax + 0x10]
jg 0x804c5d
sub esp, 4
push ebx
push dword [esp + 0x7c]
push dword [eax + 0xc]
call sub.msvcrt.dll_memcmp
add esp, 0x10
test eax, eax
jne 0x804c5d
cmp edi, ebp
jne 0x804c53
add edi, 0x10
sub esp, 8
lea eax, [edi*4]
push eax
push esi
call fcn.0077dcf0
add esp, 0x10
test eax, eax
je 0x805021
mov esi, eax
jmp 0x804c53
mov edi, dword [esp + 0x28]
mov eax, ebx
imul dword [edi + 0x100]
mov edi, esi
sar edi, 0x1f
add eax, esi
adc edx, edi
shld edx, eax, 0xa
shl eax, 0xa
mov ecx, eax
mov eax, dword [esp + 0x70]
mov ebx, edx
cdq
add eax, ecx
adc edx, ebx
push edx
push eax
push 1
push dword [esp + 0x54]
call fcn.0078bb60
add esp, 0x10
mov esi, dword [esp + 0x48]
mov eax, dword [esp + 0x7c]
or eax, dword [esp + 0x80]
mov dword [esp + 0x24], eax
mov ebp, esi
jmp 0x804ddf
test edi, edi
je 0x804e72
mov ecx, dword [esp + 0x7c]
test ecx, ecx
jne 0x804f30
push 0
lea eax, [esp + 0x44]
push eax
push esi
push dword [esp + 0x18]
mov ecx, dword [esp + 0x88]
mov edx, dword [esp + 0x84]
mov eax, dword [esp + 0x38]
call fcn.007f5ff0
add esp, 0x10
test eax, eax
jne 0x804f80
mov edx, dword [esp + 0x80]
mov ecx, dword [esp + 0x40]
mov ebx, dword [esp + 0x44]
test edx, edx
jne 0x804e72
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ebx
mov eax, dword [esp + 0x24]
xor edx, edx
test eax, eax
mov eax, dword [esp + 0x84]
sete dl
sub esp, 0xc
mov eax, dword [eax + 4]
mov dword [esp + 0x2c], eax
lea edi, [esp + 0x48]
add eax, 1
push edi
push esi
push dword [esp + 0x20]
push dword [esp + 0x2c]
push dword [esp + 0x2c]
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push ebx
push ecx
call fcn.0077c220
add esp, 0x30
test eax, eax
jne 0x804f80
mov eax, dword [esp + 0x84]
mov ecx, dword [esp + 0x3c]
lea edx, [eax + 4]
call fcn.007b8880
test eax, eax
jne 0x804f80
sub esp, 0xc
push ebp
call fcn.007d7120
add esp, 0x10
cmp eax, 0x64
jne 0x804f80
mov dword [esp + 0x3c], 0
sub esp, 8
push 1
push ebp
call fcn.00778270
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], edx
pop ebx
pop esi
push 2
push ebp
call fcn.00778270
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], edx
pop edi
pop eax
push 3
push ebp
call fcn.00778270
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
pop eax
pop edx
push 4
push ebp
call fcn.0078c140
pop ecx
pop ebx
push 4
push ebp
mov esi, eax
call fcn.0078c4f0
mov ecx, dword [esp + 0x50]
mov ebx, dword [esp + 0x54]
mov dword [esp + 0x1c], eax
add esp, 0x10
mov edi, eax
mov edx, ecx
mov eax, dword [esp + 0x74]
or edx, ebx
setne dl
test eax, eax
setne al
test dl, al
jne 0x804d10
mov eax, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
jmp 0x804d79
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0x74]
add eax, 4
call fcn.00770eb0
mov dword [esp + 0x48], eax
test eax, eax
je 0x804b6a
call fcn.0077b440
mov dword [esp + 0xc], eax
test eax, eax
jne 0x805051
mov eax, 0x68
xor edx, edx
call fcn.00767320
mov ebp, eax
test eax, eax
je 0x805051
lea edi, [ebp + 8]
lea eax, [eax + 4]
mov dword [ebp + 4], 0
and edi, 0xfffffffc
mov dword [ebp + 0x64], 0
sub eax, edi
mov ecx, eax
mov eax, dword [esp + 0xc]
add ecx, 0x64
shr ecx, 2
rep stosd dword es:[edi], eax
lea eax, [ebp + 0x60]
mov dword [ebp], 0x7fffffff
mov dword [ebp + 0x38], eax
mov eax, dword [esp + 0x48]
mov dword [ebp + 0x60], eax
mov eax, dword [esp + 0x84]
mov ecx, ebp
lea edx, [eax + 4]
call fcn.007b8880
cmp dword [esp + 0x70], 0xffffffff
mov ebp, eax
je 0x804f27
test ebp, ebp
je 0x804b75
xor esi, esi
jmp 0x804b2d
push dword [esp + 0x2c]
lea eax, [esp + 0x44]
push eax
push esi
push dword [esp + 0x18]
mov ecx, dword [esp + 0x88]
mov edx, dword [esp + 0x84]
mov eax, dword [esp + 0x38]
call fcn.007f5ff0
add esp, 0x10
test eax, eax
jne 0x804f80
mov eax, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
mov ecx, dword [esp + 0x40]
mov ebx, dword [esp + 0x44]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
jmp 0x804d79
mov esi, ebp
mov ebp, eax
jmp 0x804b2d
mov edi, esi
mov ebx, dword [esp + 0xc]
mov esi, dword [esp + 0x10]
cmp ebp, 1
jle 0x80500c
push 0x766a00
push 4
push ebp
push edi
call sub.msvcrt.dll_qsort
add esp, 0x10
call fcn.0077b440
test eax, eax
jne 0x805045
lea eax, [ebp*4 + 0x64]
xor edx, edx
mov dword [esp + 0xc], eax
call fcn.00767320
mov ebp, eax
test eax, eax
je 0x805023
sub esp, 4
push dword [esp + 0x10]
push 0
push eax
call sub.msvcrt.dll_memset
mov ecx, dword [esp + 0x1c]
lea eax, [ebp + 0x60]
add esp, 0xc
mov dword [ebp], 0x7fffffff
sub ecx, 0x64
mov dword [ebp + 0x38], eax
push ecx
push edi
push eax
call sub.msvcrt.dll_memcpy
mov dword [esp], edi
call fcn.007677d0
add esp, 0x10
jmp 0x804f05
test ebp, ebp
jne 0x80507a
sub esp, 0xc
push edi
call fcn.007677d0
add esp, 0x10
jmp 0x804b6a
mov edi, esi
sub esp, 0xc
mov ebp, 7
push edi
call fcn.007677d0
mov dword [esp], 0
call fcn.007b8680
add esp, 0x10
jmp 0x804c0f
sub esp, 0xc
push edi
call fcn.007677d0
add esp, 0x10
sub esp, 0xc
mov ebp, 7
push 0
call fcn.007b8680
add esp, 0x10
jmp 0x804c0f
sub esp, 0xc
push 0
call fcn.007677d0
add esp, 0x10
jmp 0x804b6a
mov ebp, 1
jmp 0x804fa9