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

Disassembly:
sub esp, 0x58
xor ecx, ecx
push ebx
push esi
push edi
mov edi, dword [esp + 0x68]
mov ebx, 0x28
mov edx, edi
mov esi, ebx
mov ax, word [edx]
test ax, ax
jge 0x40288c
cmp ax, 0x8000
jne 0x40288a
mov eax, 0x7fff
jmp 0x40288c
neg eax
cmp ax, cx
jle 0x402893
mov ecx, eax
add edx, 2
dec esi
jne 0x402875
xor eax, eax
test cx, cx
je 0x4028b9
movsx eax, cx
shl eax, 0x10
push eax
call fcn.00403ba0
add esp, 4
cmp ax, 6
jle 0x4028b9
xor esi, esi
jmp 0x4028c0
mov esi, 6
sub esi, eax
mov edx, edi
lea ecx, [esp + 0x14]
mov dword [esp + 0x10], esi
push ebp
lea eax, [esp + 0x18]
sub edx, ecx
mov edi, ebx
mov bp, word [edx + eax]
mov cx, si
sar bp, cl
add eax, 2
dec edi
mov word [eax - 2], bp
jne 0x4028d3
mov ecx, dword [esp + 0x70]
xor esi, esi
movsx edi, word [esp + 0x1a]
lea edx, [ecx - 0x50]
mov dword [esp + 0x10], ebx
mov dword [esp + 0x6c], ebx
add ecx, 0xfffffffc
movsx eax, word [ecx - 0x2a]
movsx ebx, word [esp + 0x3a]
movsx ebp, word [ecx - 0x28]
imul eax, ebx
movsx ebx, word [esp + 0x3c]
imul ebp, ebx
movsx ebx, word [esp + 0x3e]
add eax, ebp
movsx ebp, word [ecx - 0x26]
imul ebp, ebx
movsx ebx, word [esp + 0x40]
add eax, ebp
movsx ebp, word [ecx - 0x24]
imul ebp, ebx
movsx ebx, word [esp + 0x42]
add eax, ebp
movsx ebp, word [ecx - 0x22]
imul ebp, ebx
movsx ebx, word [esp + 0x44]
add eax, ebp
movsx ebp, word [ecx - 0x20]
imul ebp, ebx
movsx ebx, word [esp + 0x46]
add eax, ebp
movsx ebp, word [ecx - 0x1e]
imul ebp, ebx
movsx ebx, word [esp + 0x48]
add eax, ebp
movsx ebp, word [ecx - 0x1c]
imul ebp, ebx
movsx ebx, word [edx + 2]
imul ebx, edi
add eax, ebp
movsx ebp, word [ecx - 0x1a]
add eax, ebx
movsx ebx, word [esp + 0x4a]
imul ebp, ebx
movsx ebx, word [esp + 0x4c]
add eax, ebp
movsx ebp, word [ecx - 0x18]
imul ebp, ebx
movsx ebx, word [esp + 0x4e]
add eax, ebp
movsx ebp, word [ecx - 0x16]
imul ebp, ebx
movsx ebx, word [esp + 0x50]
add eax, ebp
movsx ebp, word [ecx - 0x14]
imul ebp, ebx
movsx ebx, word [esp + 0x52]
add eax, ebp
movsx ebp, word [ecx - 0x12]
imul ebp, ebx
movsx ebx, word [esp + 0x54]
add eax, ebp
movsx ebp, word [ecx - 0x10]
imul ebp, ebx
movsx ebx, word [esp + 0x56]
add eax, ebp
movsx ebp, word [ecx - 0xe]
imul ebp, ebx
movsx ebx, word [esp + 0x58]
add eax, ebp
movsx ebp, word [ecx - 0xc]
imul ebp, ebx
movsx ebx, word [esp + 0x5a]
add eax, ebp
movsx ebp, word [ecx - 0xa]
imul ebp, ebx
movsx ebx, word [esp + 0x5c]
add eax, ebp
movsx ebp, word [ecx - 8]
imul ebp, ebx
movsx ebx, word [esp + 0x5e]
add eax, ebp
movsx ebp, word [ecx - 6]
imul ebp, ebx
movsx ebx, word [esp + 0x60]
add eax, ebp
movsx ebp, word [ecx - 4]
imul ebp, ebx
movsx ebx, word [esp + 0x62]
add eax, ebp
movsx ebp, word [ecx - 2]
imul ebp, ebx
movsx ebx, word [esp + 0x66]
add eax, ebp
movsx ebp, word [ecx + 2]
imul ebp, ebx
movsx ebx, word [esp + 0x1c]
add eax, ebp
movsx ebp, word [ecx - 0x48]
imul ebp, ebx
movsx ebx, word [esp + 0x1e]
add eax, ebp
movsx ebp, word [ecx - 0x46]
imul ebp, ebx
movsx ebx, word [esp + 0x20]
add eax, ebp
movsx ebp, word [ecx - 0x44]
imul ebp, ebx
movsx ebx, word [esp + 0x22]
add eax, ebp
movsx ebp, word [ecx - 0x42]
imul ebp, ebx
movsx ebx, word [esp + 0x24]
add eax, ebp
movsx ebp, word [ecx - 0x40]
imul ebp, ebx
movsx ebx, word [esp + 0x26]
add eax, ebp
movsx ebp, word [ecx - 0x3e]
imul ebp, ebx
movsx ebx, word [esp + 0x28]
add eax, ebp
movsx ebp, word [ecx - 0x3c]
imul ebp, ebx
movsx ebx, word [esp + 0x2a]
add eax, ebp
movsx ebp, word [ecx - 0x3a]
imul ebp, ebx
movsx ebx, word [esp + 0x2c]
add eax, ebp
movsx ebp, word [ecx - 0x38]
imul ebp, ebx
movsx ebx, word [esp + 0x2e]
add eax, ebp
movsx ebp, word [ecx - 0x36]
imul ebp, ebx
movsx ebx, word [esp + 0x30]
add eax, ebp
movsx ebp, word [ecx - 0x34]
imul ebp, ebx
movsx ebx, word [esp + 0x32]
add eax, ebp
movsx ebp, word [ecx - 0x32]
imul ebp, ebx
movsx ebx, word [esp + 0x34]
add eax, ebp
movsx ebp, word [ecx - 0x30]
imul ebp, ebx
movsx ebx, word [esp + 0x36]
add eax, ebp
movsx ebp, word [ecx - 0x2e]
imul ebp, ebx
movsx ebx, word [esp + 0x38]
add eax, ebp
movsx ebp, word [ecx - 0x2c]
imul ebp, ebx
movsx ebx, word [esp + 0x64]
add eax, ebp
movsx ebp, word [ecx]
imul ebp, ebx
movsx ebx, word [esp + 0x18]
add eax, ebp
movsx ebp, word [edx]
imul ebp, ebx
add eax, ebp
cmp eax, esi
jle 0x402b35
mov esi, dword [esp + 0x6c]
mov dword [esp + 0x10], esi
mov esi, eax
mov eax, dword [esp + 0x6c]
sub edx, 2
inc eax
sub ecx, 2
cmp eax, 0x78
mov dword [esp + 0x6c], eax
jle 0x402900
mov edx, dword [esp + 0x78]
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x70]
mov ecx, 6
mov word [edx], ax
sub ecx, edi
add esi, esi
movsx edx, ax
sar esi, cl
xor edi, edi
xor ecx, ecx
shl edx, 1
mov eax, ecx
add ecx, 2
sub eax, edx
movsx eax, word [eax + ebx]
sar eax, 3
mov ebp, eax
imul ebp, eax
add edi, ebp
cmp ecx, 0x4e
jle 0x402b74
shl edi, 1
test esi, esi
pop ebp
jg 0x402ba5
mov eax, dword [esp + 0x70]
pop edi
pop esi
pop ebx
mov word [eax], 0
add esp, 0x58
ret
cmp esi, edi
jl 0x402bb9
mov ecx, dword [esp + 0x70]
pop edi
pop esi
pop ebx
mov word [ecx], 3
add esp, 0x58
ret
push edi
call fcn.00403ba0
movsx ecx, ax
shl esi, cl
shl edi, cl
add esp, 4
sar esi, 0x10
sar edi, 0x10
xor ebx, ebx
movsx edx, bx
mov ax, word [edx*2 + 0x47bab0]
push eax
push edi
call fcn.00403b70
add esp, 8
cmp si, ax
jle 0x402bf2
inc ebx
cmp bx, 2
jle 0x402bd1
mov ecx, dword [esp + 0x70]
pop edi
pop esi
mov word [ecx], bx
pop ebx
add esp, 0x58
ret