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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0xc58
mov eax, dword [0x40a004]
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 0x4056c1
mov esi, dword [edi + 0x20]
cmp esi, 1
je 0x405355
cmp esi, 2
jne 0x40534a
cmp dword [esp + 0x40], 0
jne 0x40534a
cmp byte [esp + 0x48], 2
jb 0x405355
xor ecx, ecx
mov dword [esp + 0x38], ecx
jmp 0x4053ed
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 0x405457
test al, al
jne 0x405457
mov esi, 2
mov dword [esp + 0x18], esi
test ecx, ecx
je 0x405457
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.00403d90
lea eax, [esp + 0x460]
push 0
push eax
mov edx, eax
lea ecx, [esp + 0x868]
call fcn.00403d90
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 0x40548a
add edx, ecx
mov dword [esp + 0x28], edx
cmp esi, dword [edi + 0x10]
jae 0x4056c1
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 0x4054d4
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 0x4054d8
mov edx, dword [esp + 0x20]
cmp dword [esp + 0x38], 0
je 0x40554e
mov eax, esi
and eax, 0x7f
mov dword [esp + 0x14], eax
jne 0x40553a
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.00403d90
lea eax, [esp + 0x460]
push 0
push eax
mov edx, eax
lea ecx, [esp + 0x868]
call fcn.00403d90
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 0x405563
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.00406d90
cmp dword [esp + 0x40], 0
mov cl, byte [esp + 0x48]
mov dword [esp + 0x14], eax
jne 0x40559a
test cl, cl
jne 0x40559a
mov eax, dword [esp + 0x44]
mov edx, 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x34], 0
jmp 0x4055ad
cmp eax, dword [esp + 0x44]
jne 0x4055ab
test edx, edx
jne 0x4055ab
mov edx, 1
jmp 0x4055ad
xor edx, edx
cmp dword [esp + 0x40], 0
jne 0x4055e1
mov eax, dword [edi + 0x10]
mov dword [esp + 0x30], eax
test cl, cl
jne 0x4055c2
dec esi
jmp 0x405612
mov ecx, eax
imul ecx, dword [esp + 0x3c]
test edx, edx
je 0x4055d2
dec esi
add esi, ecx
jmp 0x405612
neg esi
mov dword [esp + 0x30], eax
sbb esi, esi
neg esi
dec esi
add esi, ecx
jmp 0x405612
mov ecx, dword [edi + 0x10]
mov dword [esp + 0x30], ecx
test edx, edx
je 0x4055f8
mov eax, dword [edi + 0x14]
mov dword [esp + 0x10], eax
sub eax, ecx
dec eax
jmp 0x405610
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.00406d30
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 0x405649
cmp byte [esp + 0x48], 3
je 0x405649
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.00406d90
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 0x405682
cmp dword [esp + 0x40], eax
setne al
add ecx, dword [esp + 0x20]
push eax
push edx
mov edx, esi
call fcn.00403d90
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 0x4054a7
mov ecx, dword [esp + 0xc5c]
pop edi
pop esi
xor ecx, esp
call fcn.0040608f
mov esp, ebp
pop ebp
ret