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

Disassembly:
push ebp
push edi
mov edi, ecx
push esi
push ebx
sub esp, 0x5c
movsx eax, word [esp + 0x80]
mov esi, dword [esp + 0x78]
mov dword [esp + 0x4c], ecx
mov ecx, 0x5b9000
mov ebx, dword [esp + 0x7c]
mov dword [esp], eax
movsx esi, si
movsx ebx, bx
call fcn.004d53b0
mov ecx, edi
sub esp, 4
mov eax, dword [esp + 0x74]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 1
mov dword [esp + 4], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp], eax
call fcn.0052d7d0
mov ecx, 0x5b9000
sub esp, 0x20
call fcn.004d53c0
mov edx, dword [edi + 0x77]
test edx, edx
je 0x5224b3
mov edi, dword [esp + 0x4c]
mov ecx, dword [edi + 0x7b]
test ecx, ecx
je 0x5224b3
movzx eax, word [edi + 0x1c]
movzx ebx, word [edi + 0x1a]
lea esi, [edx + ecx*4 - 4]
movsx edx, word [esi]
sar ax, 5
sar bx, 5
cwde
imul eax, dword [0x59ad30]
movsx ebx, bx
mov ecx, edx
movsx edx, word [esi + 2]
add eax, ebx
imul eax, eax, 0xe
add eax, dword [0x5b39d0]
movzx eax, byte [eax + 0xc]
mov byte [esp + 0x43], al
movsx eax, word [esi - 4]
sub ecx, eax
movsx eax, word [esi - 2]
mov dword [esp + 0x2c], ecx
sub edx, eax
mov dword [esp + 0x30], edx
test ecx, ecx
je 0x522353
setg bl
mov ecx, edi
call fcn.004deae0
movzx ebx, bl
lea ebx, [ebx + ebx - 1]
imul ebx, eax
mov dword [esp + 0x2c], ebx
mov edx, dword [esp + 0x30]
test edx, edx
jne 0x522494
mov eax, dword [esp + 0x4c]
movsx ebx, word [esi]
movsx ebp, word [esi + 2]
mov eax, dword [eax + 0x7b]
mov dword [esp + 0x48], eax
cmp eax, 1
jle 0x5224b3
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x44], esi
xor esi, esi
lea esi, [esi]
mov eax, dword [esp + 0x44]
mov edx, dword [0x59ad30]
mov dword [esp + 0x2c], ebx
movsx eax, word [eax - 4]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x30]
neg eax
imul eax, edx
mov ecx, eax
sub eax, edi
imul eax, eax, 0xe
mov dword [esp + 0x38], eax
mov eax, edx
imul edx, edi, 0xe
imul eax, ebp
mov dword [esp + 0x3c], edx
lea edx, [ecx*8]
add eax, ebx
sub ecx, edx
imul eax, eax, 0xe
add ecx, ecx
add eax, dword [0x5b39d0]
jmp 0x522404
mov edx, dword [esp + 0x3c]
add eax, dword [esp + 0x38]
movzx ebx, byte [esp + 0x43]
add edx, eax
cmp bl, byte [edx + ecx + 0xc]
je 0x5224d0
sub dword [esp + 0x2c], edi
sub ebp, dword [esp + 0x30]
add esi, 1
mov ebx, dword [esp + 0x2c]
cmp dword [esp + 0x34], ebx
jne 0x5223e0
mov ebx, dword [esp + 0x44]
movsx edx, word [ebx - 2]
cmp edx, ebp
jne 0x5223e0
cmp dword [esp + 0x48], 2
jle 0x5224b3
movsx eax, word [ebx - 8]
mov edi, dword [esp + 0x34]
sub edi, eax
movsx eax, word [ebx - 6]
sub ebp, eax
mov dword [esp + 0x30], ebp
test edi, edi
je 0x522455
setg bl
mov ecx, dword [esp + 0x4c]
movzx ebx, bl
call fcn.004deae0
lea ebx, [ebx + ebx - 1]
mov edi, ebx
imul edi, eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x522477
setg bl
mov ecx, dword [esp + 0x4c]
movzx ebx, bl
call fcn.004deae0
lea ebx, [ebx + ebx - 1]
imul ebx, eax
mov dword [esp + 0x30], ebx
mov eax, dword [esp + 0x44]
sub dword [esp + 0x48], 1
movsx ebx, word [eax - 4]
movsx ebp, word [eax - 2]
sub eax, 4
mov dword [esp + 0x44], eax
jmp 0x522388
setg bl
mov ecx, dword [esp + 0x4c]
movzx ebx, bl
call fcn.004deae0
lea ebx, [ebx + ebx - 1]
imul ebx, eax
mov dword [esp + 0x30], ebx
jmp 0x52235f
mov dword [esp + 0x48], 0
mov eax, dword [esp + 0x48]
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret 0x14
mov edi, esi
mov esi, dword [esp + 0x48]
mov ebx, dword [esp + 0x2c]
test esi, esi
je 0x5224b3
mov ecx, dword [esp + 0x4c]
mov eax, dword [ecx + 0x77]
mov dword [ecx + 0x7b], esi
lea eax, [eax + esi*4 - 4]
mov esi, dword [esp + 0x44]
mov dword [esp + 0x2c], eax
movsx eax, word [ecx + 0x16]
movsx ecx, word [ecx + 0x18]
mov edx, eax
sar dx, 5
cmp dx, word [esi]
je 0x522548
cmp dword [esp + 0x48], 2
je 0x52256c
mov esi, dword [esp + 0x4c]
mov eax, dword [esp + 0x2c]
mov word [eax], bx
mov ecx, esi
mov word [eax + 2], bp
mov word [esi + 0x52], bx
movzx eax, word [eax + 2]
mov word [esi + 0x54], ax
call fcn.004deae0
imul eax, edi
sub word [esi + 0x81], ax
mov eax, dword [esp + 0x48]
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret 0x14
mov edx, ecx
sar dx, 5
cmp dx, word [esi + 2]
jne 0x522507
mov esi, dword [esp + 0x4c]
mov eax, ebx
shl eax, 5
mov word [esi + 0x16], ax
mov eax, ebp
shl eax, 5
mov word [esi + 0x18], ax
jmp 0x52250e
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x4c]
mov dword [esp + 8], eax
movsx eax, word [ecx + 0x14]
mov dword [esp + 4], eax
movsx eax, word [ecx + 0x12]
mov ecx, 0x5ba360
mov dword [esp], eax
call fcn.00499d60
sub esp, 0x10
mov esi, eax
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x34], eax
movsx eax, word [ecx + 0x18]
mov dword [esp + 0xc], eax
movsx eax, word [ecx + 0x16]
mov dword [esp + 8], eax
movsx eax, word [ecx + 0x1c]
mov dword [esp + 4], eax
movsx eax, word [ecx + 0x1a]
mov ecx, 0x5ba360
mov dword [esp], eax
call fcn.00499d60
sub esp, 0x10
test esi, esi
je 0x52250e
mov dword [esp + 0x30], eax
test eax, eax
je 0x52250e
mov eax, dword [esp + 0x4c]
movsx ecx, word [eax + 0x16]
movsx edx, word [eax + 0x12]
mov eax, ecx
sub eax, edx
cdq
idiv esi
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x4c]
movsx edx, word [eax + 0x1a]
sub ecx, edx
mov eax, ecx
cdq
idiv dword [esp + 0x30]
cmp dword [esp + 0x38], eax
jne 0x52250e
mov esi, dword [esp + 0x4c]
movsx ecx, word [esi + 0x18]
movsx edx, word [esi + 0x14]
mov eax, ecx
sub eax, edx
cdq
idiv dword [esp + 0x34]
movsx edx, word [esi + 0x1c]
sub ecx, edx
mov dword [esp + 0x34], eax
mov eax, ecx
cdq
idiv dword [esp + 0x30]
cmp dword [esp + 0x34], eax
jne 0x52250e
mov eax, ebx
shl eax, 5
mov word [esi + 0x16], ax
mov eax, ebp
shl eax, 5
mov word [esi + 0x18], ax
jmp 0x52250e