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

Disassembly:
push ebp
mov eax, ecx
push edi
push esi
push ebx
sub esp, 0x8c
movzx edx, word [eax + 0x1c]
movzx eax, word [eax + 0x1a]
mov esi, dword [esp + 0xa0]
mov dword [esp + 0x58], ecx
mov word [esp + 0x2c], ax
sar ax, 5
mov ecx, dword [esp + 0xa8]
mov ebx, dword [esi]
cwde
mov esi, dword [esp + 0xa4]
mov byte [esp + 0x30], cl
sub eax, ebx
mov esi, dword [esi]
add eax, 1
cmp eax, 2
ja 0x5311fe
sar dx, 5
movsx eax, dx
sub eax, esi
add eax, 1
cmp eax, 2
jbe 0x531330
movzx ecx, cl
mov dword [esp + 4], esi
mov esi, dword [esp + 0x58]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], 0
mov ecx, esi
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], 1
mov dword [esp + 0xc], 0xf
mov dword [esp + 8], 1
mov dword [esp], ebx
call fcn.0052d7d0
sub esp, 0x20
test eax, eax
je 0x531330
movzx ebp, word [esi + 0x1c]
movzx edx, word [esi + 0x1a]
mov eax, esi
mov esi, dword [esi + 0x77]
sar bp, 5
sar dx, 5
movsx ebx, bp
movsx edi, dx
mov dword [esp + 0x2c], ebx
mov ebx, 2
test esi, esi
je 0x53127d
mov ecx, dword [eax + 0x7b]
test ecx, ecx
jne 0x531368
lea esi, [esp + 0x7c]
lea ebp, [esp + 0x78]
lea esi, [esi]
mov dword [esp + 0x10], esi
mov ecx, 0x5ba360
mov dword [esp + 0xc], ebp
mov dword [esp + 8], 3
mov dword [esp + 4], 3
mov dword [esp], ebx
call fcn.0049a650
mov ecx, edi
sub esp, 0x14
mov eax, dword [esp + 0x7c]
add ecx, dword [esp + 0x78]
js 0x531348
mov edx, dword [0x59ad30]
add eax, dword [esp + 0x2c]
js 0x531348
cmp edx, ecx
jle 0x531348
cmp dword [0x59ad2c], eax
jle 0x531348
imul edx, eax
mov dword [esp + 0x34], eax
movzx eax, byte [esp + 0x30]
add edx, ecx
imul edx, edx, 0xe
add edx, dword [0x5b39d0]
cmp byte [edx + 0xc], al
jne 0x531348
movsx eax, word [edx + 2]
imul eax, eax, 0x1c
add eax, dword [0x5b67e4]
cmp byte [eax - 0x14], 1
je 0x531348
test byte [edx], 1
je 0x531348
cmp word [edx + 4], 0
jne 0x531348
mov eax, dword [esp + 0x34]
mov ebx, dword [esp + 0xa0]
mov esi, dword [esp + 0xa4]
mov dword [ebx], ecx
mov dword [esi], eax
lea esi, [esi]
mov eax, 1
add esp, 0x8c
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
add ebx, 1
cmp ebx, 0xa
jne 0x531288
add esp, 0x8c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
mov ebx, dword [esp + 0x58]
lea eax, [esi + 4]
mov dword [esp + 0x34], edx
mov dword [esp + 0x50], eax
mov ecx, ebx
call fcn.004deae0
mov edx, dword [esp + 0x34]
mov dword [esp + 0x3c], eax
mov eax, dword [ebx + 0x7b]
mov dword [esp + 0x5c], eax
movsx eax, word [esi]
cmp ax, dx
mov dword [esp + 0x30], eax
movzx edx, word [esi + 2]
je 0x531679
movsx ebx, dx
mov dword [esp + 0x2c], ebx
mov ebx, dword [esp + 0x3c]
mov dword [esp + 0x6c], ebx
cmp dword [esp + 0x5c], 1
jle 0x5315c9
mov esi, dword [0x5b39d0]
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x60], 0
mov dword [esp + 0x54], 1
mov dword [esp + 0x64], esi
mov esi, dword [0x59ad30]
mov dword [esp + 0x68], esi
mov esi, dword [0x5b67e4]
mov dword [esp + 0x44], esi
mov esi, dword [esp + 0x30]
lea esi, [esi]
mov ecx, dword [esp + 0x50]
movsx edx, word [ecx]
mov edi, edx
movsx edx, word [ecx + 2]
sub edi, eax
movsx eax, word [ecx - 2]
mov dword [esp + 0x38], edi
sub edx, eax
mov ecx, edx
mov dword [esp + 0x30], edx
mov edx, edi
neg edx
mov eax, ecx
cmovs edx, edi
neg eax
cmovs eax, ecx
cmp edx, eax
cmovge eax, edx
mov dword [esp + 0x34], eax
test edi, edi
je 0x531443
mov eax, edi
sar eax, 0x1f
or eax, 1
imul eax, dword [esp + 0x3c]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x53145a
sar eax, 0x1f
or eax, 1
imul eax, dword [esp + 0x3c]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x34]
test eax, eax
je 0x5315a0
mov edi, dword [esp + 0x30]
mov edx, dword [esp + 0x68]
mov ecx, dword [esp + 0x38]
mov eax, edi
lea ebp, [ebx + edi]
imul eax, edx
lea edi, [esi + ecx]
add eax, ecx
xor ecx, ecx
imul eax, eax, 0xe
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x40], eax
mov eax, edx
mov edx, dword [esp + 0x64]
imul eax, ebp
add eax, edi
imul eax, eax, 0xe
lea edx, [edx + eax + 2]
jmp 0x5314c6
mov ecx, dword [esp + 0x3c]
add edx, dword [esp + 0x40]
add dword [esp + 0x2c], ecx
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x34], eax
jle 0x5315a0
mov eax, dword [esp + 0x30]
add ebp, eax
mov eax, dword [esp + 0x38]
add edi, eax
movsx eax, word [edx]
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x4c], esi
mov esi, edi
mov dword [esp + 0x48], ebx
mov ebx, ebp
imul eax, eax, 0x1c
cmp byte [ecx + eax - 0x14], 1
je 0x5314a0
mov ecx, dword [esp + 0x2c]
movzx eax, word [esp + 0x60]
sub ax, word [esp + 0x6c]
test ecx, ecx
je 0x53151f
mov eax, dword [esp + 0x50]
cmp dword [esp + 0x54], 1
mov word [eax], di
mov word [eax + 2], bp
je 0x531693
add dword [esp + 0x54], 1
mov eax, dword [esp + 0x3c]
add eax, ecx
add eax, dword [esp + 0x60]
sub ax, word [esp + 0x6c]
mov esi, dword [esp + 0x58]
mov edx, dword [esp + 0x48]
mov ebx, dword [esp + 0x54]
mov word [esi + 0x54], dx
add edx, ebp
mov word [esi + 0x81], ax
mov eax, edx
mov dword [esi + 0x7b], ebx
shr eax, 0x1f
mov ebx, dword [esp + 0x4c]
add eax, edx
mov edx, dword [esp + 0x68]
mov word [esi + 0x52], bx
sar eax, 1
add ebx, edi
mov esi, dword [esp + 0x64]
mov ecx, eax
mov eax, ebx
imul edx, ecx
shr eax, 0x1f
add eax, ebx
mov ebx, dword [esp + 0x44]
sar eax, 1
add edx, eax
imul edx, edx, 0xe
movsx edx, word [esi + edx + 2]
imul edx, edx, 0x1c
cmp byte [ebx + edx - 0x14], 1
je 0x53165d
mov esi, dword [esp + 0xa0]
mov dword [esi], eax
mov eax, dword [esp + 0xa4]
mov dword [eax], ecx
mov eax, 1
jmp 0x531335
mov edi, dword [esp + 0x34]
add dword [esp + 0x54], 1
add dword [esp + 0x60], edi
mov eax, dword [esp + 0x54]
add dword [esp + 0x50], 4
mov edi, dword [esp + 0x50]
cmp dword [esp + 0x5c], eax
je 0x5315c9
movsx eax, word [edi - 4]
jmp 0x5313f8
mov eax, dword [esp + 0x58]
mov esi, dword [esp + 0x5c]
mov eax, dword [eax + 0x77]
lea edx, [eax + esi*4 - 4]
mov eax, dword [esp + 0xa0]
mov ecx, dword [eax]
mov eax, dword [esp + 0xa4]
mov ebx, dword [eax]
movsx eax, word [edx]
sub eax, ecx
mov esi, eax
neg esi
cmovns eax, esi
cmp eax, 1
jg 0x531611
movsx eax, word [edx + 2]
sub eax, ebx
mov edx, eax
neg edx
cmovns eax, edx
cmp eax, 1
jle 0x531330
mov esi, dword [esp + 0x58]
mov eax, dword [esi]
mov dword [esp], ecx
mov ecx, esi
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], ebx
call dword [eax + 0x7c]
xor eax, eax
sub esp, 0x20
jmp 0x531335
mov eax, dword [esp + 0xa0]
mov dword [eax], edi
mov eax, dword [esp + 0xa4]
mov dword [eax], ebp
mov eax, 1
jmp 0x531335
cmp dx, bp
jne 0x5313a1
mov dword [esp + 0x30], edi
mov dword [esp + 0x6c], 0
jmp 0x5313b0
mov eax, dword [esp + 0x58]
mov edx, dword [eax + 0x77]
movsx ebx, word [eax + 0x12]
movsx eax, word [edx]
shl eax, 5
cmp ebx, eax
jne 0x53150b
mov eax, dword [esp + 0x58]
movsx ebx, word [eax + 0x14]
movsx eax, word [edx + 2]
shl eax, 5
cmp ebx, eax
jne 0x53150b
mov ebx, dword [esp + 0x58]
mov eax, edi
shl eax, 5
mov word [ebx + 0x16], ax
mov eax, ebp
shl eax, 5
mov word [ebx + 0x18], ax
jmp 0x53150b