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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0xc58
mov eax, dword [0x409004]
xor eax, esp
mov dword [esp + 0xc54], eax
movups xmm0, xmmword [ebp + 8]
push esi
push edi
mov edi, ecx
movups xmmword [esp + 0x40], xmm0
test edi, edi
je 0x405931
mov esi, dword [edi + 0x20]
cmp esi, 1
je 0x4055c5
cmp esi, 2
jne 0x4055ba
cmp dword [esp + 0x40], 0
jne 0x4055ba
cmp byte [esp + 0x48], 2
jb 0x4055c5
xor ecx, ecx
mov dword [esp + 0x38], ecx
jmp 0x40565d
push 0x400
lea eax, [esp + 0x85c]
mov dword [esp + 0x3c], 1
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [esp + 0x88]
push 0x3d0
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov eax, dword [esp + 0x4c]
add esp, 0xc
mov ecx, dword [edi + 0xc]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x44]
mov dword [esp + 0x60], eax
movzx eax, byte [esp + 0x48]
cdq
mov dword [esp + 0x68], eax
mov eax, esi
mov dword [esp + 0x70], ecx
mov ecx, dword [edi + 8]
mov dword [esp + 0x6c], edx
cdq
mov dword [esp + 0x78], ecx
mov ecx, 1
mov dword [esp + 0x5c], 0
mov dword [esp + 0x64], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], edx
mov al, byte [esp + 0x48]
xor esi, esi
mov dword [esp + 0x18], esi
cmp dword [esp + 0x40], esi
jne 0x4056c7
test al, al
jne 0x4056c7
mov esi, 2
mov dword [esp + 0x18], esi
test ecx, ecx
je 0x4056c7
add dword [esp + 0x88], 1
lea eax, [esp + 0x458]
push 0
adc dword [esp + 0x90], 0
lea edx, [esp + 0x5c]
push eax
lea ecx, [esp + 0x860]
call fcn.00404000
lea eax, [esp + 0x460]
push 0
push eax
mov edx, eax
lea ecx, [esp + 0x868]
call fcn.00404000
mov al, byte [esp + 0x58]
add esp, 0x10
mov ecx, dword [edi + 0x10]
movzx edx, al
mov eax, dword [edi + 0x14]
imul eax, dword [esp + 0x44]
imul ecx, edx
mov dword [esp + 0x3c], edx
xor edx, edx
add eax, esi
add ecx, eax
mov dword [esp + 0x1c], ecx
mov eax, ecx
mov ecx, dword [edi + 0x14]
div ecx
mov eax, dword [esp + 0x1c]
test edx, edx
lea edx, [eax - 1]
jne 0x4056fa
add edx, ecx
mov dword [esp + 0x28], edx
cmp esi, dword [edi + 0x10]
jae 0x405931
shl edx, 0xa
mov ecx, eax
shl ecx, 0xa
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ecx
mov ecx, dword [edi + 0x14]
xor edx, edx
div ecx
mov dword [esp + 0x10], ecx
cmp edx, 1
jne 0x405744
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
dec eax
add edx, 0xfffffc00
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], edx
mov dword [esp + 0x10], ecx
jmp 0x405748
mov edx, dword [esp + 0x20]
cmp dword [esp + 0x38], 0
je 0x4057be
mov eax, esi
and eax, 0x7f
mov dword [esp + 0x14], eax
jne 0x4057aa
add dword [esp + 0x88], 1
lea eax, [esp + 0x458]
push 0
adc dword [esp + 0x90], 0
lea edx, [esp + 0x5c]
push eax
lea ecx, [esp + 0x860]
call fcn.00404000
lea eax, [esp + 0x460]
push 0
push eax
mov edx, eax
lea ecx, [esp + 0x868]
call fcn.00404000
mov eax, dword [edi + 0x14]
add esp, 0x10
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + eax*8 + 0x458]
mov eax, dword [esp + eax*8 + 0x45c]
mov dword [esp + 0x2c], ecx
jmp 0x4057d3
mov eax, dword [edi]
mov dword [esp + 0x10], ecx
mov esi, dword [edx + eax]
mov eax, dword [edx + eax + 4]
mov dword [esp + 0x2c], esi
mov esi, dword [esp + 0x18]
push 0
push dword [edi + 0x18]
push 0
push eax
call fcn.004066b0
cmp dword [esp + 0x40], 0
mov cl, byte [esp + 0x48]
mov dword [esp + 0x14], eax
jne 0x40580a
test cl, cl
jne 0x40580a
mov eax, dword [esp + 0x44]
mov edx, 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x34], 0
jmp 0x40581d
cmp eax, dword [esp + 0x44]
jne 0x40581b
test edx, edx
jne 0x40581b
mov edx, 1
jmp 0x40581d
xor edx, edx
cmp dword [esp + 0x40], 0
jne 0x405851
mov eax, dword [edi + 0x10]
mov dword [esp + 0x30], eax
test cl, cl
jne 0x405832
dec esi
jmp 0x405882
mov ecx, eax
imul ecx, dword [esp + 0x3c]
test edx, edx
je 0x405842
dec esi
add esi, ecx
jmp 0x405882
neg esi
mov dword [esp + 0x30], eax
sbb esi, esi
neg esi
dec esi
add esi, ecx
jmp 0x405882
mov ecx, dword [edi + 0x10]
mov dword [esp + 0x30], ecx
test edx, edx
je 0x405868
mov eax, dword [edi + 0x14]
mov dword [esp + 0x10], eax
sub eax, ecx
dec eax
jmp 0x405880
mov esi, ecx
mov eax, ecx
neg esi
not eax
cmp dword [esp + 0x18], 0
cmove esi, eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
add esi, eax
mov eax, dword [esp + 0x2c]
push 0
push eax
push 0
push eax
call fcn.004065e0
mov eax, edx
mul esi
dec esi
xor eax, eax
sub esi, edx
sbb eax, eax
xor ecx, ecx
mov dword [esp + 0x2c], eax
cmp dword [esp + 0x40], ecx
je 0x4058b9
cmp byte [esp + 0x48], 3
je 0x4058b9
mov ecx, dword [esp + 0x3c]
inc ecx
imul ecx, dword [esp + 0x30]
xor eax, eax
add ecx, esi
mov esi, dword [esp + 0x10]
adc eax, dword [esp + 0x2c]
push 0
push esi
push eax
push ecx
call fcn.004066b0
imul esi, dword [esp + 0x14]
mov ecx, dword [edi]
mov edx, dword [esp + 0x24]
add edx, ecx
add esi, eax
xor eax, eax
shl esi, 0xa
add esi, ecx
cmp dword [edi + 4], 0x10
je 0x4058f2
cmp dword [esp + 0x40], eax
setne al
add ecx, dword [esp + 0x20]
push eax
push edx
mov edx, esi
call fcn.00404000
mov esi, dword [esp + 0x20]
add esp, 8
mov eax, dword [esp + 0x1c]
inc esi
add dword [esp + 0x24], 0x400
inc eax
inc dword [esp + 0x28]
add dword [esp + 0x20], 0x400
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], eax
cmp esi, dword [edi + 0x10]
jb 0x405717
mov ecx, dword [esp + 0xc5c]
pop edi
pop esi
xor ecx, esp
call fcn.00405945
mov esp, ebp
pop ebp
ret