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

Disassembly:
push 0xffffffffffffffff
push 0x52b0d0
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov eax, dword [0x56b1dc]
xor eax, esp
push eax
lea eax, [esp + 0x44]
mov dword fs:[0], eax
mov ecx, dword [esp + 0x5c]
mov ebp, dword [esp + 0x54]
mov eax, dword [ebp + 0x50]
test eax, eax
je 0x4999e0
cmp dword [eax + 0x58], 0
je 0x4999e0
mov esi, dword [esp + 0x58]
test esi, esi
je 0x4999e0
cmp dword [ebp + 0x48], 0
je 0x4999e0
mov eax, dword [esi]
mov edx, dword [eax + 4]
xor ebx, ebx
test ecx, ecx
setle bl
sub ebx, 1
and ebx, ecx
mov ecx, esi
mov dword [esp + 0x5c], ebx
call edx
cmp dword [ebp + 0x14], eax
jg 0x4999e0
mov eax, dword [esi]
mov edx, dword [eax + 8]
mov ecx, esi
call edx
mov ecx, dword [ebp + 0x18]
add ecx, ebx
cmp ecx, eax
jg 0x4999e0
mov esi, dword [ebp + 0x48]
lea eax, [esi + 0x188]
mov dword [esp + 0x54], eax
call fcn.00488e80
mov edi, eax
lea eax, [edi + 1]
cdq
sub eax, edx
sar eax, 1
cmp edi, 2
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], eax
jne 0x4996a3
mov dword [esp + 0x18], edi
add esi, 0x148
call fcn.0047ed50
test eax, eax
je 0x499705
mov esi, dword [ebp + 0x48]
add esi, 0x148
call fcn.0047ed70
test eax, eax
je 0x499705
mov eax, dword [ebp + 0x48]
movzx edx, byte [eax + 0x14c]
push 0
push edx
lea esi, [eax + 0x148]
call fcn.0047ed70
mov esi, dword [ebp + 0x48]
push eax
add esi, 0x148
call fcn.0047ed50
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0x14]
add ecx, ebx
push ecx
push edx
push ebx
mov ebx, eax
mov eax, dword [esp + 0x70]
call fcn.00483510
mov ebx, dword [esp + 0x5c]
mov esi, dword [ebp + 0x50]
mov dword [esp + 0x1c], 0
call fcn.004698f0
cmp eax, 1
jne 0x499852
mov eax, dword [ebp + 8]
xor ecx, ecx
cmp eax, ecx
je 0x49976c
cmp eax, 3
je 0x499776
cmp eax, 1
je 0x49976c
mov esi, dword [esp + 0x58]
mov eax, dword [esi]
mov edx, dword [eax + 4]
push ecx
push 1
push 1
push ecx
push ecx
mov ecx, esi
mov dword [esp + 0x2c], edi
call edx
push eax
push 0
push 0
push esi
mov esi, dword [esp + 0x78]
call fcn.004893f0
mov eax, edi
add esp, 0x24
mov dword [esp + 0x1c], 1
sub eax, edi
jmp 0x499854
cmp eax, 3
je 0x499776
cmp eax, 1
jne 0x49977a
mov dword [esp + 0x18], edi
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], ecx
mov eax, dword [esp + 0x54]
mov esi, edi
sub esi, dword [esp + 0x18]
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x20], esi
call fcn.00488e80
cmp esi, eax
jge 0x499801
jmp 0x4997b4
mov esi, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x18]
jge 0x499801
cmp eax, edi
jge 0x499801
cmp esi, edi
jge 0x499801
mov edi, esi
mov esi, dword [esp + 0x54]
call fcn.00472050
mov ebx, eax
lea esi, [esp + 0x30]
call fcn.00492700
mov esi, dword [esp + 0x20]
mov eax, dword [esp + 0x54]
add dword [esp + 0x1c], 1
add esi, 1
mov dword [esp + 0x20], esi
call fcn.00488e80
cmp esi, eax
mov edi, dword [esp + 0x24]
mov ebx, dword [esp + 0x5c]
jl 0x4997b0
mov eax, dword [ebp + 0x14]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x58]
push 0
push 1
push 1
sub eax, edi
add eax, dword [esp + 0x24]
push 0
push 0
add eax, ebx
push eax
push ebx
push ecx
push edx
lea esi, [esp + 0x54]
call fcn.004893f0
add esp, 0x24
mov eax, esi
call fcn.0046bc10
mov dword [esp + 0x1c], 1
mov dword [esp + 0x4c], 0xffffffff
call fcn.004860d0
mov eax, dword [esp + 0x18]
sub eax, edi
jmp 0x499854
xor eax, eax
cmp dword [ebp + 8], 2
jne 0x499866
mov ecx, edi
sub ecx, dword [esp + 0x28]
mov dword [esp + 0x18], ecx
jmp 0x499872
mov dword [esp + 0x18], 0
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x54]
push 0
push 1
push edx
mov edx, dword [ebp + 0x18]
push 0
add edx, ecx
add edx, ebx
push edx
add eax, ebx
push 0
push eax
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x74]
push 0
push eax
call fcn.004893f0
mov edx, dword [ebp + 0x18]
mov ecx, dword [esp + 0x40]
add edx, dword [esp + 0x3c]
mov eax, dword [ebp + 0x14]
add esp, 0x24
push 0
push 1
push ecx
mov ecx, dword [esp + 0x38]
push 1
add edx, ebx
push edx
mov edx, dword [esp + 0x6c]
sub eax, edi
push eax
push ecx
push eax
push edx
call fcn.004893f0
mov eax, dword [ebp + 8]
xor ecx, ecx
add esp, 0x24
cmp eax, ecx
je 0x4999be
cmp eax, 3
je 0x4999be
cmp eax, 1
je 0x4999be
cmp edi, 2
mov eax, dword [esp + 0x28]
mov dword [esp + 0x1c], eax
jne 0x4998ff
mov dword [esp + 0x1c], edi
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], ecx
mov eax, dword [esp + 0x54]
mov esi, edi
sub esi, dword [esp + 0x1c]
mov dword [esp + 0x4c], 1
mov dword [esp + 0x20], ecx
mov dword [esp + 0x28], esi
call fcn.00488e80
cmp esi, eax
jge 0x499981
jmp 0x499938
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x1c]
jge 0x499981
cmp eax, edi
jge 0x499981
cmp esi, edi
jge 0x499981
mov edi, esi
mov esi, dword [esp + 0x54]
call fcn.00472050
mov ebx, eax
lea esi, [esp + 0x30]
call fcn.00492700
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x54]
add dword [esp + 0x20], 1
add esi, 1
mov dword [esp + 0x28], esi
call fcn.00488e80
cmp esi, eax
mov ebx, dword [esp + 0x5c]
jl 0x499930
mov ecx, dword [ebp + 0x18]
sub ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
mov edx, dword [ebp + 0x14]
push 0
push 1
push 1
push 1
add ebx, ecx
push ebx
sub edx, eax
push edx
push ebx
push eax
mov eax, dword [esp + 0x78]
push eax
lea esi, [esp + 0x54]
call fcn.004893f0
add esp, 0x24
mov eax, esi
call fcn.0046bc10
call fcn.004860d0
jmp 0x4999e0
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp + 0x14]
push ecx
push 1
push 1
push 1
sub edx, edi
add ebx, edx
push ebx
push eax
push ebx
push ecx
mov ecx, dword [esp + 0x78]
push ecx
call fcn.004893f0
add esp, 0x24
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret 0xc