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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x134
mov eax, dword [0x47ea94]
xor eax, esp
mov dword [esp + 0x130], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], ecx
test edi, edi
je 0x40cbc0
mov edi, dword [edi + 4]
test edi, edi
je 0x40cbc0
mov edi, dword [edi]
lea esi, [eax + 0xc]
push esi
mov dword [esp + 0x2c], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, eax
mov eax, dword [esp + 0xc]
add eax, 4
mov dword [esp + 0xc], eax
mov eax, dword [eax]
mov edx, eax
mov ecx, dword [edx + 4]
cmp byte [ecx + 0xd], 0
jne 0x40cb39
cmp dword [ecx + 0x10], edi
jae 0x40cb2f
mov ecx, dword [ecx + 8]
jmp 0x40cb33
mov edx, ecx
mov ecx, dword [ecx]
cmp byte [ecx + 0xd], 0
je 0x40cb25
mov dword [esp + 0x2c], eax
cmp edx, eax
je 0x40cb4c
cmp edi, dword [edx + 0x10]
jb 0x40cb4c
mov dword [esp + 0x30], edx
jmp 0x40cb52
mov dword [esp + 0x34], eax
mov edx, eax
mov dword [esp + 0x18], eax
cmp edx, eax
jne 0x40cb98
push dword [esp + 0x18]
lea eax, [esp + 0x3c]
mov dword [esp + 0x20], edi
push eax
push ecx
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x54]
mov dword [esp + 0x2c], 1
movq xmm0, qword [esp + 0x28]
push eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x48], edi
movq qword [esp + 0x4c], xmm0
mov dword [esp + 0x54], ebx
call fcn.0040e520
jmp 0x40cbe3
mov eax, dword [edx + 0x18]
cmp eax, 0xa
jae 0x40cba6
inc eax
mov dword [edx + 0x18], eax
jmp 0x40cbe0
mov ecx, ebx
sub ecx, dword [edx + 0x1c]
cmp dword [edx + 0x1c], ebx
jbe 0x40cbb1
dec ecx
cmp ecx, 0x5265c00
jae 0x40cbd9
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x130]
xor ecx, esp
call fcn.0045be1b
mov esp, ebp
pop ebp
ret 0xc
mov dword [edx + 0x18], 1
mov dword [edx + 0x1c], ebx
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
push 0x470b98
lea ecx, [esp + 0x64]
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0xf
mov byte [esp + 0x64], 0
call fcn.00406100
push 0
push 0x470b98
lea ecx, [esp + 0x7c]
mov dword [esp + 0x8c], 0
mov dword [esp + 0x90], 0xf
mov byte [esp + 0x7c], 0
call fcn.00406100
push 0
push 0x470b98
lea ecx, [esp + 0x94]
mov dword [esp + 0xa4], 0
mov dword [esp + 0xa8], 0xf
mov byte [esp + 0x94], 0
call fcn.00406100
mov ebx, dword [esp + 0x10]
lea ecx, [esp + 0xac]
mov eax, dword [ebx + 4]
push dword [ebx + 0x10]
mov eax, dword [eax]
mov dword [esp + 0x54], eax
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x58], eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x5c], eax
call fcn.00405bb0
push 0xfde9
lea edx, [esp + 0xb0]
lea ecx, [esp + 0xf8]
call fcn.00408900
add esp, 4
lea ecx, [esp + 0x5c]
push eax
call fcn.00405cc0
mov edx, dword [esp + 0x108]
cmp edx, 0x10
jb 0x40cd0a
mov ecx, dword [esp + 0xf4]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40cd00
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cd5c
push edx
push ecx
call fcn.0045be8d
add esp, 8
mov edx, dword [esp + 0xc0]
mov dword [esp + 0x104], 0
mov dword [esp + 0x108], 0xf
mov byte [esp + 0xf4], 0
cmp edx, 8
jb 0x40cd6c
mov ecx, dword [esp + 0xac]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cd62
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40cd62
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0045be8d
add esp, 8
push dword [ebx + 0x14]
xor eax, eax
mov dword [esp + 0xc0], 0
lea ecx, [esp + 0xc8]
mov dword [esp + 0xc4], 7
mov word [esp + 0xb0], ax
call fcn.00405bb0
push 0xfde9
lea edx, [esp + 0xc8]
lea ecx, [esp + 0x110]
call fcn.00408900
add esp, 4
lea ecx, [esp + 0x74]
push eax
call fcn.00405cc0
mov edx, dword [esp + 0x120]
cmp edx, 0x10
jb 0x40cdf8
mov ecx, dword [esp + 0x10c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40cdee
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ce4a
push edx
push ecx
call fcn.0045be8d
add esp, 8
mov edx, dword [esp + 0xd8]
mov dword [esp + 0x11c], 0
mov dword [esp + 0x120], 0xf
mov byte [esp + 0x10c], 0
cmp edx, 8
jb 0x40ce5a
mov ecx, dword [esp + 0xc4]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40ce50
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40ce50
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0045be8d
add esp, 8
push dword [esp + 0x14]
xor eax, eax
mov dword [esp + 0xd8], 0
lea ecx, [esp + 0xe0]
mov dword [esp + 0xdc], 7
mov word [esp + 0xc8], ax
call fcn.00405bb0
push 0xfde9
lea edx, [esp + 0xe0]
lea ecx, [esp + 0x128]
call fcn.00408900
add esp, 4
lea ecx, [esp + 0x8c]
push eax
call fcn.00405cc0
mov edx, dword [esp + 0x138]
cmp edx, 0x10
jb 0x40ceea
mov ecx, dword [esp + 0x124]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40cee0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cf3c
push edx
push ecx
call fcn.0045be8d
add esp, 8
mov edx, dword [esp + 0xf0]
mov dword [esp + 0x134], 0
mov dword [esp + 0x138], 0xf
mov byte [esp + 0x124], 0
cmp edx, 8
jb 0x40cf4c
mov ecx, dword [esp + 0xdc]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cf42
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40cf42
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0045be8d
add esp, 8
xor eax, eax
mov dword [esp + 0xec], 0
mov dword [esp + 0xf0], 7
mov word [esp + 0xdc], ax
cmp dword [0x480954], eax
je 0x40cf81
cmp dword [0x480954], 1
jne 0x40d0c4
push 0
push 1
push 0x480954
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
test eax, eax
jne 0x40d0a8
mov eax, dword [0x480cbc]
test al, 1
jne 0x40d096
or eax, 1
mov dword [0x480cc0], 0x471b6c
mov dword [0x480cbc], eax
xorps xmm0, xmm0
xor eax, eax
movlpd qword [0x480cc8], xmm0
sub esp, 8
movlpd qword [0x480cd0], xmm0
mov dword [0x480cd8], 0
mov word [0x480cdc], ax
mov dword [0x480ce0], eax
mov dword [0x480ce4], eax
mov dword [0x480ce8], eax
call fcn.004063e0
mov dword [0x480ce4], eax
mov dword [0x480cec], 0
mov dword [0x480cf0], 0
call fcn.004063c0
movaps xmm0, xmmword [0x473ca0]
mov dword [0x480cec], eax
mov dword [0x480cf4], 0
mov dword [0x480cf8], 0
mov dword [0x480cfc], 0
movaps xmmword [0x480d00], xmm0
mov dword [0x480d10], 0
mov dword [0x480d14], 0
push 0x480d1c
mov dword [0x480d18], 0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x461f90
mov dword [0x480d34], 0
mov dword [0x480d38], 0
mov dword [0x480d3c], 0
call fcn.0045c2a6
add esp, 4
push 0x480cc0
push 0x480954
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
jmp 0x40d0c4
cmp dword [0x480954], 1
jne 0x40d0c4
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0
call esi
cmp dword [0x480954], 1
je 0x40d0b7
mov ecx, dword [0x480954]
lea eax, [esp + 0x50]
sub esp, 8
push eax
call fcn.0040df90
mov edx, dword [esp + 0xa0]
cmp edx, 0x10
jb 0x40d10f
mov ecx, dword [esp + 0x8c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d105
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d16c
push edx
push ecx
call fcn.0045be8d
add esp, 8
mov edx, dword [esp + 0x88]
cmp edx, 0x10
jb 0x40d144
mov ecx, dword [esp + 0x74]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d13a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d16c
push edx
push ecx
call fcn.0045be8d
add esp, 8
mov edx, dword [esp + 0x70]
cmp edx, 0x10
jb 0x40d17c
mov ecx, dword [esp + 0x5c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d172
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d172
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0045be8d
add esp, 8
mov ecx, dword [esp + 0x13c]
mov eax, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0045be1b
mov esp, ebp
pop ebp
ret 0xc