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

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x44
cmp eax, 1
push ebx
mov dword [esp + 8], 0
push esi
push edi
push ebp
je 0x4afbc7
cmp eax, 2
je 0x4afbe0
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x44
ret
mov esi, dword [esp + 0x58]
mov eax, dword [esi + 0x68]
mov ecx, dword [esi + 0xc]
add eax, 0x4a
cmp eax, ecx
jg 0x4afbda
mov eax, ecx
mov dword [esp + 0x1c], eax
jmp 0x4afbfb
mov esi, dword [esp + 0x58]
push 0
push 0
push esi
mov eax, dword [esi + 0x68]
add eax, 0x4a
mov dword [esp + 0x28], eax
call fcn.004aec20
add esp, 0xc
mov eax, dword [esi + 0x2e]
test eax, eax
je 0x4afc17
mov ecx, dword [esi + 0x26]
push ecx
push eax
push esi
call fcn.004b1250
mov dword [esi + 0x2e], 0
add esp, 0xc
mov eax, dword [esi + 0x78]
push eax
call dword [0x4ff344]
mov dword [esp + 0x10], eax
push 0x4ae1c0
mov eax, dword [esi + 0x7c]
mov edx, dword [esp + 0x14]
push eax
xor edi, edi
push edx
call fcn.004aee40
add esp, 0xc
mov edx, dword [esi + 0x7c]
test edx, edx
jle 0x4afc58
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
cmp dword [eax], ecx
jge 0x4afc58
add eax, 8
inc edi
cmp edi, edx
jl 0x4afc48
cmp edi, edx
jl 0x4afc70
mov eax, dword [esi + 0x78]
push eax
call dword [0x4ff330]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x44
ret
mov eax, dword [esi + 0x10]
sub eax, dword [esp + 0x1c]
cmp eax, 0x40000
jl 0x4afc83
mov eax, 0x40000
push eax
push 0x200
call fcn.00489d40
mov dword [esp + 0x20], eax
add esp, 8
test eax, eax
jne 0x4afca6
mov dword [esp + 0x14], 8
jmp 0x4afe35
mov edx, dword [esi + 8]
xor ebx, ebx
lea eax, [esi + 4]
mov dword [esp + 0x38], ebx
mov dword [esp + 0x40], ebx
mov ecx, dword [eax]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x3c], ebx
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], eax
lea ebp, [ecx + edi*8]
mov dword [esp + 0x2c], edx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x34], edx
mov eax, dword [ebp]
push ecx
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], ebx
call dword [0x4ff344]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x4c], eax
push ecx
call fcn.00489c00
mov dword [esp + 0x54], eax
add esp, 4
mov dword [0x50e8ac], ebx
mov ebx, edi
cmp dword [esi + 0x7c], edi
jle 0x4afd5f
add ebp, 4
cmp dword [esp + 0x14], 0
jne 0x4afd7d
mov eax, dword [ebp - 4]
add eax, dword [ebp]
mov dword [esp + 0x38], eax
mov eax, dword [esi + 0x7c]
dec eax
cmp eax, ebx
jle 0x4afd34
mov eax, dword [ebp + 4]
jmp 0x4afd37
mov eax, dword [esi + 0x10]
sub eax, dword [esp + 0x38]
add ebp, 8
inc ebx
mov dword [esp + 0x40], eax
lea eax, [esp + 0x28]
push eax
push esi
call fcn.004afe50
add esp, 8
mov eax, dword [0x50e8ac]
cmp dword [esi + 0x7c], ebx
mov dword [esp + 0x14], eax
jg 0x4afd16
cmp dword [esp + 0x14], 0
jne 0x4afd7d
lea eax, [esp + 0x28]
push eax
push esi
call fcn.004aff10
add esp, 8
mov eax, dword [0x50e8ac]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x18]
push eax
call dword [0x4ff330]
mov eax, dword [esp + 0x18]
push eax
call fcn.00489a40
add esp, 4
cmp dword [esp + 0x14], 0
jne 0x4afe35
lea ebx, [edi + 1]
cmp dword [esi + 0x7c], ebx
jle 0x4afdbf
mov edx, dword [esp + 0x10]
lea eax, [edx + ebx*8 + 4]
mov ecx, dword [eax - 8]
add eax, 8
inc ebx
add dword [eax - 8], ecx
cmp dword [esi + 0x7c], ebx
jg 0x4afdb0
mov eax, dword [esi + 0x64]
xor ebx, ebx
push eax
call dword [0x4ff344]
cmp dword [esi + 0x2a], ebx
jle 0x4afe0d
add eax, 0x18
mov ecx, dword [eax]
cmp dword [esp + 0x1c], ecx
jg 0x4afe04
mov ebp, dword [esi + 0x7c]
dec ebp
cmp edi, ebp
jg 0x4afe04
mov edx, dword [esp + 0x10]
lea edx, [edx + ebp*8]
cmp dword [edx], ecx
jle 0x4afdf6
sub edx, 8
dec ebp
cmp edi, ebp
jle 0x4afdea
cmp edi, ebp
jg 0x4afe04
mov edx, dword [esp + 0x10]
sub ecx, dword [edx + ebp*8 + 4]
mov dword [eax], ecx
add eax, 0x1e
inc ebx
cmp dword [esi + 0x2a], ebx
jg 0x4afdd3
mov eax, dword [esi + 0x64]
push eax
call dword [0x4ff330]
mov edx, dword [esp + 0x10]
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x7c]
sub eax, dword [edx + ecx*8 - 4]
push eax
mov dword [esi + 0x10], eax
push esi
call fcn.004b0710
add esp, 8
mov dword [esi + 0x7c], edi
mov eax, dword [esi + 0x78]
push eax
call dword [0x4ff330]
mov eax, dword [esp + 0x14]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x44
ret