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

Disassembly:
sub esp, 0x64
push esi
push edi
mov edi, dword [esp + 0x70]
xor eax, eax
xor ecx, ecx
mov al, byte [edi + 0x37c]
mov cl, byte [edi + 0x37d]
cmp eax, 0xf
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], ecx
je case.0x405b03.7
push ebx
lea edx, [esp + 0x40]
push ebp
lea eax, [edi + 0x120]
push edx
push eax
call fcn.0042eea0
lea ecx, [esp + 0x4c]
push ecx
call fcn.0043d0e0
lea esi, [edi + 0x270]
xor ebx, ebx
xor ecx, ecx
xor ebp, ebp
add esp, 0xc
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x78], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x1c], ebp
add esi, 0xffffffe4
mov edx, dword [esp + 0x34]
mov eax, 1
shl eax, cl
test edx, eax
mov dword [esp + 0x38], eax
jne 0x405a01
movsx ebx, word [esi - 0x44]
movsx ebp, word [esi - 0x40]
lea ecx, [esp + 0x3c]
lea eax, [esi - 4]
push ecx
push eax
call fcn.0042eab0
movsx eax, word [esp + 0x46]
imul eax, dword [0x466250]
cdq
and edx, 0xfff
mov ecx, dword [esp + 0x2c]
add eax, edx
add esp, 8
sar eax, 0xc
mov edx, eax
imul eax, ebx
imul edx, ebp
add ecx, edx
mov edx, dword [esp + 0x28]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x18]
sub ecx, eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x38]
inc edx
test eax, ecx
mov dword [esp + 0x28], edx
je 0x4059f9
movsx eax, word [esi + 0x1e]
movsx ecx, word [esi - 2]
movsx edx, word [esi + 0x20]
imul eax, ecx
movsx ecx, word [esi]
imul edx, ecx
add eax, edx
mov edx, dword [esp + 0x20]
movsx ecx, word [edx]
movsx edx, word [esi - 4]
imul ecx, edx
add eax, ecx
cdq
and edx, 0xfff
add eax, edx
mov edx, dword [esp + 0x10]
mov ecx, eax
sar ecx, 0xc
mov eax, ecx
imul eax, ebp
neg eax
shl eax, 8
add edx, eax
mov eax, ecx
imul ecx, ebx
mov ebp, dword [esp + 0x78]
mov dword [esp + 0x10], edx
cdq
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
add ebp, eax
mov eax, dword [esp + 0x1c]
shl ecx, 8
add edx, ecx
inc eax
mov dword [esp + 0x78], ebp
mov dword [esp + 0x14], edx
mov dword [esp + 0x1c], eax
mov ebx, dword [esp + 0x78]
mov ebp, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x20]
inc ecx
add eax, 8
add esi, 8
cmp ecx, 4
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x20], eax
jl 0x40590d
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
cdq
idiv ecx
mov esi, eax
mov eax, dword [esp + 0x18]
cdq
idiv ecx
test ebp, ebp
mov dword [esp + 0x18], eax
jle 0x405a60
mov eax, dword [esp + 0x10]
cdq
idiv ebp
mov dword [esp + 0x10], eax
mov eax, ebx
cdq
idiv ebp
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x14]
cdq
idiv ebp
mov ebx, dword [esp + 0x78]
mov dword [esp + 0x14], eax
cmp ebx, 0x14
jle 0x405a86
lea eax, [ebx + ebx*4]
lea ecx, [edi + 0x1fc]
push 4
push ecx
lea edx, [eax + eax*4]
push 0x5622
shl edx, 1
push edx
push 0x17
call fcn.00441080
add esp, 0x14
mov ecx, dword [0x466250]
mov eax, dword [esp + 0x10]
add ebx, ecx
lea ecx, [eax + esi]
mov eax, 0x1b4e81b5
imul ecx
mov esi, dword [edi + 0x1c0]
mov eax, dword [esp + 0x18]
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
add esi, edx
mov edx, dword [esp + 0x14]
mov dword [edi + 0x1c0], esi
lea ecx, [edx + eax]
mov eax, 0x77280773
imul ecx
mov eax, dword [edi + 0x1c8]
sar edx, 8
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
add eax, edx
mov edx, dword [edi + 0x1d0]
add edx, ebx
mov dword [edi + 0x1c8], eax
test ebp, ebp
pop ebp
mov dword [edi + 0x1d0], edx
pop ebx
jle case.0x405b03.7
mov ecx, dword [esp + 0x28]
cmp ecx, 0xc
ja case.0x405b03.7
jmp dword [ecx*4 + 0x405ba0]
mov edx, 0xfa0
cmp esi, edx
jle 0x405b19
mov dword [edi + 0x1c0], edx
mov esi, dword [edi + 0x1c0]
mov ecx, 0xfffff060
cmp esi, ecx
jge 0x405b2e
mov dword [edi + 0x1c0], ecx
cmp eax, edx
jle 0x405b38
mov dword [edi + 0x1c8], edx
cmp dword [edi + 0x1c8], ecx
jge case.0x405b03.7
mov dword [edi + 0x1c8], ecx
pop edi
pop esi
add esp, 0x64
ret
mov edx, 0xfa0
cmp esi, edx
jle 0x405b5b
mov dword [edi + 0x1c0], edx
mov eax, dword [edi + 0x1c0]
mov ecx, 0xfffff060
cmp eax, ecx
jge case.0x405b03.7
mov dword [edi + 0x1c0], ecx
pop edi
pop esi
add esp, 0x64
ret
mov edx, 0xfa0
cmp eax, edx
jle 0x405b85
mov dword [edi + 0x1c8], edx
mov eax, dword [edi + 0x1c8]
mov ecx, 0xfffff060
cmp eax, ecx
jge case.0x405b03.7
mov dword [edi + 0x1c8], ecx
pop edi
pop esi
add esp, 0x64
ret