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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x40
mov ecx, dword [edi]
and al, 2
mov dword [esp + 0x14], ecx
mov ecx, dword [ecx + 4]
mov dword [esp + 8], ecx
mov cl, al
movsx eax, byte [edi + 0x44]
push ebx
mov ebx, dword [edi + eax*4 + 0x74]
mov edx, dword [ebx + 0x40]
push esi
movzx esi, word [edi + 0x46]
mov dword [esp + 0x24], eax
mov ax, word [edx + esi*2]
mov dh, al
mov dword [esp + 0x28], 0
mov byte [esp + 0xb], cl
mov dword [esp + 0x18], esi
mov dword [esp + 0x20], ebx
mov dl, ah
movzx eax, dx
movzx edx, word [ebx + 0x18]
and eax, edx
add eax, dword [ebx + 0x38]
mov dword [esp + 0x14], eax
test cl, cl
je 0x489d39
cmp byte [ebx + 8], 0
je 0x489d2a
push eax
push ebx
call fcn.004825e0
movzx ecx, word [ebx + 0x14]
mov edx, dword [esp + 0x18]
mov edx, dword [edx + 0x24]
movzx eax, ax
lea ecx, [eax + ecx + 2]
add edx, edx
mov eax, 0xaaaaaaab
mul edx
shr edx, 1
add esp, 8
cmp ecx, edx
jg 0x489d2a
mov dword [esp + 0x28], 1
jmp 0x489d39
mov esi, edi
call fcn.00481e60
test eax, eax
jne 0x489f7f
cmp byte [ebx + 8], 0
jne 0x489d7c
and byte [edi + 0x40], 0xf1
xor eax, eax
cmp byte [edi + 0x42], 1
mov word [edi + 0x22], ax
jne 0x489d6d
movzx eax, word [edi + 0x46]
test ax, ax
je 0x489d6d
movsx ecx, byte [edi + 0x44]
mov edx, dword [edi + ecx*4 + 0x74]
cmp byte [edx + 8], 0
je 0x489d6d
dec eax
mov word [edi + 0x46], ax
jmp 0x489d7c
mov eax, edi
call fcn.004869f0
test eax, eax
jne 0x489f7f
test byte [edi + 0x40], 0x20
je 0x489d98
mov ecx, dword [edi + 0x34]
mov eax, dword [esp + 0x10]
mov edx, edi
call fcn.00481ef0
test eax, eax
jne 0x489f7f
cmp dword [edi + 0x70], 0
jne 0x489db7
mov eax, dword [edi + 0x14]
mov ecx, dword [edi + 0x10]
mov edx, dword [edi + 0x34]
push 0
push eax
push ecx
mov ecx, dword [esp + 0x28]
call fcn.00481d20
add esp, 0xc
mov esi, dword [ebx + 0x48]
call fcn.0047e1d0
test eax, eax
jne 0x489f7f
mov edx, dword [esp + 0x14]
push edx
lea eax, [esp + 0x34]
mov ecx, ebx
call fcn.004873b0
movzx ecx, word [esp + 0x46]
mov edx, dword [esp + 0x1c]
add esp, 4
mov dword [esp + 0xc], eax
lea eax, [esp + 0xc]
push eax
push ecx
push edx
mov esi, ebx
call fcn.004877f0
mov eax, dword [esp + 0x18]
add esp, 0xc
test eax, eax
jne 0x489f7f
cmp byte [ebx + 8], al
jne 0x489ee2
movsx eax, byte [edi + 0x44]
mov ebx, dword [edi + eax*4 + 0x74]
mov ecx, dword [esp + 0x24]
mov edx, dword [edi + ecx*4 + 0x78]
mov eax, dword [edx + 4]
movzx ecx, word [ebx + 0x16]
mov edx, dword [ebx + 0x40]
mov esi, dword [ebx + 0x38]
mov dword [esp + 0x2c], eax
mov ax, word [edx + ecx*2 - 2]
movzx edx, word [ebx + 0x18]
mov ch, al
mov cl, ah
movzx eax, cx
and eax, edx
add eax, esi
add esi, 4
mov dword [esp + 0x14], eax
cmp eax, esi
jae 0x489e5d
mov eax, 0x10971
call fcn.004e60d0
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push eax
mov eax, dword [ebx + 0x4c]
push ebx
call eax
mov edx, dword [esp + 0x18]
mov esi, dword [ebx + 0x48]
movzx ecx, ax
mov eax, dword [edx + 0x50]
add esp, 8
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x10], eax
call fcn.0047e1d0
mov dword [esp + 0xc], eax
test eax, eax
jne 0x489eb8
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0xc]
push ecx
mov ecx, dword [esp + 0x20]
push edx
mov edx, dword [esp + 0x20]
add eax, 0xfffffffc
push eax
mov eax, dword [esp + 0x2c]
push edx
push eax
mov eax, dword [esp + 0x24]
add ecx, 4
call fcn.00487930
add esp, 0x14
movzx eax, word [ebx + 0x16]
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0xc]
push ecx
push edx
dec eax
push eax
mov esi, ebx
call fcn.004877f0
mov eax, dword [esp + 0x18]
add esp, 0xc
test eax, eax
jne 0x489f7f
mov ebx, dword [esp + 0x20]
push edi
call fcn.004897e0
add esp, 4
test eax, eax
jne 0x489f7f
movsx ecx, byte [edi + 0x44]
mov esi, dword [esp + 0x24]
cmp ecx, esi
jle 0x489f34
nop
mov al, byte [edi + 0x44]
movsx edx, al
mov ecx, dword [edi + edx*4 + 0x74]
dec al
mov byte [edi + 0x44], al
test ecx, ecx
je 0x489f1f
mov eax, dword [ecx + 0x48]
push eax
call fcn.0047dba0
add esp, 4
movsx ecx, byte [edi + 0x44]
cmp ecx, esi
jg 0x489f00
push edi
call fcn.004897e0
add esp, 4
test eax, eax
jne 0x489f7f
cmp dword [esp + 0x28], 0
je 0x489f6d
mov byte [edi + 0x42], 2
movzx edx, word [ebx + 0x16]
cmp dword [esp + 0x18], edx
jl 0x489f60
mov dword [edi + 0x3c], 0xffffffff
mov cx, word [ebx + 0x16]
dec cx
mov word [edi + 0x46], cx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x3c], 1
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, edi
call fcn.00485fd0
cmp byte [esp + 0xb], 0
je 0x489f7f
mov byte [edi + 0x42], 3
pop esi
pop ebx
mov esp, ebp
pop ebp
ret