Function at 0x40605e
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
cmp esi, edi
je 0x406313
push esi
call fcn.0040631a
cmp dword [0x420684], edi
pop ecx
je 0x406313
cmp dword [0x420688], edi
je 0x406313
cmp dword [0x42068c], edi
je 0x406313
cmp dword [0x420690], edi
je 0x406313
cmp dword [0x420694], edi
je 0x406313
mov ebx, dword [0x41d614]
mov ecx, 0x3e8
push 0x14
lea eax, [ebx + ebx*4]
shl eax, 2
cdq
fld dword [0x416bf0]
idiv ecx
fild dword [0x41d614]
fdivr st(1)
pop ecx
push 0x5800
fstp dword [0x427f10]
mov edi, eax
mov eax, dword [0x41d618]
cdq
idiv ecx
add edi, 3
and edi, 0xfffffffc
mov dword [0x4267c4], edi
mov ecx, eax
mov eax, ebx
shl eax, 7
imul ecx, edi
cdq
mov ebx, 0xac44
add ecx, ecx
idiv ebx
xor ebx, ebx
mov dword [0x4267c8], ecx
mov dword [ebp - 4], ebx
push ebx
mov dword [0x420c58], eax
mov dword [ebp - 8], eax
fild qword [ebp - 8]
mov eax, ecx
cdq
fdivr st(1)
idiv edi
mov edi, 0x420f80
push edi
fstp dword [0x420c5c]
fstp st(0)
mov dword [ebp + 8], eax
call fcn.00409930
add esp, 0xc
xor ecx, ecx
mov eax, 0x420fb4
mov dword [eax - 0x34], ecx
mov dword [eax], 1
add eax, 0x58
inc ecx
cmp eax, 0x4267b4
jl 0x40614f
movzx eax, byte [esi + 0x128]
mov dword [esi + 0x12c], eax
or dword [esi + 0x150], 0xffffffff
movsx eax, word [esi + 0x24]
or dword [esi + 0x14c], 0xffffffff
mov dword [esi + 0x138], eax
movsx eax, word [esi + 0x26]
push eax
push esi
mov dword [esi + 0x140], ebx
mov dword [esi + 0x144], ebx
mov dword [esi + 8], ebx
mov dword [esi + 0x134], ebx
mov dword [esi + 0x148], ebx
mov dword [esi + 0x154], ebx
call fcn.00405f00
movsx eax, word [esi + 0x14]
imul eax, eax, 0xac
push eax
push ebx
push 0x4267e0
call fcn.00409930
add esp, 0x14
xor ecx, ecx
cmp word [esi + 0x14], bx
jle 0x4061ed
mov eax, 0x4267e4
mov dword [eax], edi
inc ecx
movsx edx, word [esi + 0x14]
add edi, 0x58
add eax, 0xac
cmp ecx, edx
jl 0x4061da
mov eax, dword [ebp + 8]
mov dword [0x420680], esi
mov esi, dword [fcn.00408d4d]
push 1
lea eax, [eax + eax*2]
add eax, eax
push eax
call esi
mov dword [0x427ed8], eax
mov eax, dword [0x41d614]
pop ecx
mov dword [ebp - 0x18], eax
pop ecx
mov word [ebp - 0x1c], 1
shl eax, 2
mov dword [ebp - 0x14], eax
push ebx
push ebx
lea eax, [ebp - 0x1c]
push ebx
push eax
push 0xffffffffffffffff
push 0x427edc
mov word [ebp - 0x1a], 2
mov word [ebp - 0xe], 0x10
mov word [ebp - 0x10], 4
mov word [ebp - 0xc], bx
call dword [sym.imp.WINMM.dll_waveOutOpen]
test eax, eax
jne 0x406313
mov eax, dword [0x4267c8]
push 1
mov edi, eax
shl edi, 2
push edi
call esi
pop ecx
or dword [0x4267b4], 0xffffffff
pop ecx
mov dword [0x4267a4], edi
mov edi, 0x4267a0
push 0x20
push edi
mov dword [0x4267c0], eax
push dword [0x427edc]
mov dword [0x4267b0], 0xc
mov dword [0x4267a0], eax
mov dword [0x4267a8], ebx
mov dword [0x4267ac], ebx
call dword [sym.imp.WINMM.dll_waveOutPrepareHeader]
mov eax, dword [0x4267c8]
push 1
lea eax, [eax*8 + 0x100]
push eax
call esi
mov dword [0x427d60], eax
add eax, 0xf
pop ecx
and al, 0xf0
pop ecx
mov dword [0x426780], eax
call fcn.004082f0
cmp dword [0x420c04], ebx
jne 0x4062c7
push 0x20
push edi
push dword [0x427edc]
call dword [sym.imp.WINMM.dll_waveOutWrite]
lea eax, [ebp + 8]
mov byte [0x420800], bl
push eax
push ebx
push ebx
push 0x408468
push ebx
push ebx
call dword [sym.imp.KERNEL32.DLL_CreateThread]
push 0xf
mov dword [0x420c00], eax
push dword [0x420c00]
call dword [sym.imp.KERNEL32.DLL_SetThreadPriority]
mov al, 1
jmp 0x406315
xor al, al
pop edi
pop esi
pop ebx
leave
ret