Function at 0x405f70
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40776d
mov eax, dword fs:[0]
push eax
sub esp, 0x24
mov eax, dword [0x40b008]
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 [0x40bcd8]
sub eax, edx
sar eax, 3
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40bcdc]
sub eax, edx
sar eax, 3
cmp eax, 0x1fffffff
je 0x406209
mov ecx, dword [0x40bce0]
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 0x406204
lea eax, [edx + ecx]
mov edi, ebx
cmp eax, ebx
cmovae edi, eax
cmp edi, 0x1fffffff
ja 0x406204
lea ecx, [edi*8]
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x2c], ecx
cmp ecx, 0x1000
jb 0x40603c
lea eax, [ecx + 0x23]
cmp eax, ecx
jbe 0x406204
push eax
call fcn.00406582
add esp, 4
test eax, eax
je 0x4061f0
lea ebx, [eax + 0x23]
and ebx, 0xffffffe0
mov dword [ebx - 4], eax
jmp 0x406052
test ecx, ecx
je 0x40604d
push ecx
call fcn.00406582
add esp, 4
mov ebx, eax
jmp 0x40604f
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.00406582
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 0x406250
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 0x4061f6
mov edi, dword [0x40bcdc]
mov edx, dword [0x40bcd8]
cmp esi, edi
jne 0x4060e7
mov esi, ebx
cmp edx, edi
je 0x406160
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 0x4060c3
jmp 0x406150
cmp edx, esi
je 0x406121
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 0x4060f0
mov edi, dword [0x40bcdc]
mov edx, dword [0x40bcd8]
mov ecx, dword [ebp - 0x1c]
cmp esi, edi
je 0x406160
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 0x406130
mov edx, dword [0x40bcd8]
mov edi, dword [0x40bcdc]
nop dword [eax]
test edx, edx
je 0x4061ac
mov eax, edx
cmp eax, edi
je 0x40617d
nop word [eax + eax]
cmp dword [eax + 4], 0
jne 0x4061ea
add eax, 8
cmp eax, edi
jne 0x406170
mov ecx, dword [0x40bce0]
sub ecx, edx
and ecx, 0xfffffff8
cmp ecx, 0x1000
jb 0x4061a2
mov esi, dword [edx - 4]
add ecx, 0x23
sub edx, esi
lea eax, [edx - 4]
cmp eax, 0x1f
ja 0x4061f0
mov edx, esi
push ecx
push edx
call fcn.00406803
add esp, 8
mov eax, dword [ebp - 0x28]
mov dword [0x40bcd8], ebx
lea ecx, [ebx + eax*8]
mov eax, dword [ebp - 0x1c]
mov dword [0x40bcdc], ecx
mov ecx, dword [ebp - 0x2c]
add ecx, ebx
mov dword [0x40bce0], 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.00406574
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.00405ef0
push dword [ebp - 0x20]
push dword [ebp - 0x24]
call fcn.00405f20
push 0
push 0
call sub.VCRUNTIME140.dll__CxxThrowException
int3