Function at 0x40bfb0
Capabilities:
Create thread
Resume thread

Disassembly:
sub esp, 4
cmp dword [0x445b18], 0
push ebx
push esi
push edi
push ebp
mov edi, ecx
jne 0x40bfcc
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov edx, 0x600
mov ecx, edi
mov word [esp + 0x12], 0
call fcn.0040b7e0
test eax, eax
jne 0x40bfed
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
push 0xffffffffffffffff
mov eax, dword [0x45c024]
push eax
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call ebx
push 0xffffffffffffffff
mov ecx, dword [0x45c034]
push ecx
call ebx
mov edx, edi
mov ecx, dword [0x43caf0]
call fcn.0040ba00
test eax, eax
jne 0x40c20b
mov eax, 1
mov ecx, 0x43cb2c
cmp dword [ecx], 0
jne 0x40c038
add ecx, 0x24
inc eax
cmp ecx, 0x445b08
jb 0x40c027
cmp eax, 0x400
jb 0x40c044
mov eax, 0x3ff
shl eax, 2
cmp dword [eax + eax*8 + 0x43cb08], 0
jne 0x40c1d4
mov eax, dword [0x45c010]
mov ebp, 0x43caf4
mov dword [0x445b10], 0
push eax
call dword [sym.imp.WINMM.dll_waveOutReset]
mov esi, dword [sym.imp.WINMM.dll_waveOutUnprepareHeader]
mov eax, dword [ebp]
push 0x20
push eax
mov ecx, dword [0x45c010]
push ecx
add ebp, 0xc
call esi
cmp ebp, 0x43cb0c
jb 0x40c076
mov eax, dword [0x45c010]
push eax
call dword [sym.imp.WINMM.dll_waveOutReset]
mov eax, dword [0x45c010]
mov ebp, dword [sym.imp.WINMM.dll_waveOutClose]
push eax
call ebp
mov ecx, dword [0x45c02c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [0x45c034]
mov esi, dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov dword [0x45c01c], 1
push ecx
call esi
mov eax, dword [0x445b1c]
test eax, eax
je 0x40c0f8
push 0xffffffffffffffff
push eax
call ebx
mov eax, dword [0x445b1c]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call ebp
mov dword [0x445b1c], 0
jmp 0x40c0fe
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x45c02c]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, dword [0x45c02c]
push ecx
call ebp
xor eax, eax
mov ebp, 1
mov dword [0x45c02c], eax
mov dword [0x45c014], eax
cmp dword [0x45c020], ebp
jbe 0x40c13c
mov ecx, ebp
inc ebp
call fcn.0040c4e0
cmp ebp, dword [0x45c020]
jb 0x40c12c
push 0xffffffffffffffff
mov eax, dword [0x45c034]
push eax
call ebx
call fcn.0040ba40
xor eax, eax
mov edx, 0x600
mov ecx, edi
mov dword [0x45c020], eax
mov dword [0x45c01c], eax
call fcn.0040ba70
test eax, eax
jne 0x40c181
mov eax, dword [0x45c034]
push eax
call esi
mov eax, dword [0x45c024]
push eax
call esi
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
push 0x445b20
push 4
push 0
push 0x40c5a0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x445b1c], eax
test eax, eax
jne 0x40c1bc
mov eax, dword [0x45c034]
push eax
call esi
mov eax, dword [0x45c024]
push eax
call esi
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
push eax
mov dword [0x445b1c], eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov dword [0x45c014], 1
jmp 0x40c211
lea eax, [esp + 0x12]
mov edx, edi
push eax
mov ecx, dword [0x43caf0]
call fcn.0040d490
test eax, eax
jne 0x40c20b
mov eax, dword [0x45c034]
mov esi, dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push eax
call esi
mov ecx, dword [0x45c024]
push ecx
call esi
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov esi, dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edi, 1
mov eax, 0x43cb2c
cmp dword [eax], 0
je 0x40c22b
add eax, 0x24
inc edi
cmp eax, 0x445b08
jb 0x40c21b
cmp edi, 0x400
jbe 0x40c250
mov eax, dword [0x45c034]
push eax
call esi
mov eax, dword [0x45c024]
push eax
call esi
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
lea eax, [edi*4]
lea ecx, [eax + eax*8]
xor eax, eax
mov dword [ecx + 0x43cb0c], eax
mov dx, word [esp + 0x12]
mov dword [ecx + 0x43cb28], eax
mov dword [ecx + 0x43cb14], eax
cmp edi, dword [0x45c020]
mov dword [ecx + 0x43cb18], eax
mov dword [ecx + 0x43cb1c], eax
mov dword [ecx + 0x43cb20], eax
mov byte [ecx + 0x43cb24], 0x64
mov word [ecx + 0x43cb26], dx
mov dword [ecx + 0x43cb08], 1
jb 0x40c2ab
mov dword [0x45c020], edi
mov eax, dword [0x45c034]
push eax
call esi
mov eax, dword [0x45c024]
push eax
call esi
mov eax, edi
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret