Function at 0x406490
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x407ced
mov eax, dword fs:[0]
push eax
sub esp, 0x24
mov eax, dword [0x40c008]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, dword [ebp + 8]
mov eax, esi
mov edx, dword [0x40ccd8]
sub eax, edx
sar eax, 3
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40ccdc]
sub eax, edx
sar eax, 3
cmp eax, 0x1fffffff
je 0x406729
mov ecx, dword [0x40cce0]
lea ebx, [eax + 1]
sub ecx, edx
mov dword [ebp - 0x28], ebx
sar ecx, 3
mov eax, 0x1fffffff
mov edx, ecx
shr edx, 1
sub eax, edx
cmp ecx, eax
ja 0x406724
lea eax, [edx + ecx]
mov edi, ebx
cmp eax, ebx
cmovae edi, eax
cmp edi, 0x1fffffff
ja 0x406724
lea ecx, [edi*8]
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x2c], ecx
cmp ecx, 0x1000
jb 0x40655c
lea eax, [ecx + 0x23]
cmp eax, ecx
jbe 0x406724
push eax
call fcn.00406aa2
add esp, 4
test eax, eax
je 0x406710
lea ebx, [eax + 0x23]
and ebx, 0xffffffe0
mov dword [ebx - 4], eax
jmp 0x406572
test ecx, ecx
je 0x40656d
push ecx
call fcn.00406aa2
add esp, 4
mov ebx, eax
jmp 0x40656f
xor ebx, ebx
mov dword [ebp - 0x20], edi
mov eax, dword [ebp - 0x1c]
push 4
mov dword [ebp - 0x24], ebx
mov dword [ebp - 4], 0
lea edi, [ebx + eax*8]
lea eax, [edi + 8]
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x30], eax
call fcn.00406aa2
mov ecx, dword [ebp + 0xc]
add esp, 4
mov dword [ebp - 0x18], eax
mov ecx, dword [ecx]
mov dword [eax], ecx
add edi, 4
mov byte [ebp - 4], 1
push edi
push 0
push eax
push 0x406770
push 0
push 0
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__beginthreadex]
mov ecx, dword [ebp - 0x1c]
add esp, 0x18
mov dword [ecx], eax
test eax, eax
je 0x406716
mov edi, dword [0x40ccdc]
mov edx, dword [0x40ccd8]
cmp esi, edi
jne 0x406607
mov esi, ebx
cmp edx, edi
je 0x406680
mov eax, dword [edx]
lea esi, [esi + 8]
mov ecx, dword [edx + 4]
mov dword [edx], 0
mov dword [edx + 4], 0
add edx, 8
mov dword [esi - 8], eax
mov dword [esi - 4], ecx
cmp edx, edi
jne 0x4065e3
jmp 0x406670
cmp edx, esi
je 0x406641
mov edi, ebx
nop dword [eax]
mov eax, dword [edx]
lea edi, [edi + 8]
mov ecx, dword [edx + 4]
mov dword [edx], 0
mov dword [edx + 4], 0
add edx, 8
mov dword [edi - 8], eax
mov dword [edi - 4], ecx
cmp edx, esi
jne 0x406610
mov edi, dword [0x40ccdc]
mov edx, dword [0x40ccd8]
mov ecx, dword [ebp - 0x1c]
cmp esi, edi
je 0x406680
lea edx, [ecx + 8]
sub edx, esi
nop word [eax + eax]
mov eax, dword [esi]
mov ecx, dword [esi + 4]
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + edx], eax
mov dword [esi + edx + 4], ecx
add esi, 8
cmp esi, edi
jne 0x406650
mov edx, dword [0x40ccd8]
mov edi, dword [0x40ccdc]
nop dword [eax]
test edx, edx
je 0x4066cc
mov eax, edx
cmp eax, edi
je 0x40669d
nop word [eax + eax]
cmp dword [eax + 4], 0
jne 0x40670a
add eax, 8
cmp eax, edi
jne 0x406690
mov ecx, dword [0x40cce0]
sub ecx, edx
and ecx, 0xfffffff8
cmp ecx, 0x1000
jb 0x4066c2
mov esi, dword [edx - 4]
add ecx, 0x23
sub edx, esi
lea eax, [edx - 4]
cmp eax, 0x1f
ja 0x406710
mov edx, esi
push ecx
push edx
call fcn.00406d23
add esp, 8
mov eax, dword [ebp - 0x28]
mov dword [0x40ccd8], ebx
lea ecx, [ebx + eax*8]
mov eax, dword [ebp - 0x1c]
mov dword [0x40ccdc], ecx
mov ecx, dword [ebp - 0x2c]
add ecx, ebx
mov dword [0x40cce0], ecx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00406a94
mov esp, ebp
pop ebp
ret 8
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_terminate]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push 6
mov dword [edi], 0
call dword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_Cpp_error_int_]
call fcn.00401320
call fcn.00402c50
mov eax, dword [ebp - 0x30]
push eax
push eax
call fcn.00406410
push dword [ebp - 0x20]
push dword [ebp - 0x24]
call fcn.00406440
push 0
push 0
call sub.VCRUNTIME140.dll__CxxThrowException
int3