Function at 0x401218
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
cmp dword [ebp + 8], 0
jne 0x40122b
xor al, al
jmp 0x4015ec
mov eax, dword [ebp + 8]
push eax
call fcn.004015f0
add esp, 4
cmp dword [0x40ce04], 0
je 0x401264
cmp dword [0x40ce08], 0
je 0x401264
cmp dword [0x40ce0c], 0
je 0x401264
cmp dword [0x40ce10], 0
je 0x401264
cmp dword [0x40ce14], 0
jne 0x40126b
xor al, al
jmp 0x4015ec
fild dword [0x409020]
fdivr dword [0x408278]
fstp dword [0x413eb0]
mov eax, dword [0x409020]
imul eax, eax, 0x14
cdq
mov ecx, 0x3e8
idiv ecx
add eax, 3
and al, 0xfc
mov dword [0x412764], eax
mov eax, dword [0x409024]
cdq
mov ecx, 0x14
idiv ecx
mov edx, dword [0x412764]
imul edx, eax
mov dword [0x412768], edx
mov eax, dword [0x412768]
shl eax, 1
mov dword [0x412768], eax
mov eax, dword [0x409020]
shl eax, 7
cdq
mov ecx, 0xac44
idiv ecx
mov dword [0x40cdfc], eax
mov edx, dword [0x40cdfc]
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x34], 0
fild qword [ebp - 0x38]
fdivr dword [0x408278]
fstp dword [0x40ce00]
mov eax, dword [0x412768]
cdq
idiv dword [0x412764]
mov dword [ebp - 8], eax
push 0x5800
push 0
push 0x40cf20
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 4], 0
jmp 0x401328
mov eax, dword [ebp - 4]
add eax, 1
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0x100
jge 0x401352
mov ecx, dword [ebp - 4]
imul ecx, ecx, 0x58
mov edx, dword [ebp - 4]
mov dword [ecx + 0x40cf20], edx
mov eax, dword [ebp - 4]
imul eax, eax, 0x58
mov dword [eax + 0x40cf54], 1
jmp 0x40131f
mov ecx, dword [ebp + 8]
xor edx, edx
mov dl, byte [ecx + 0x128]
mov eax, dword [ebp + 8]
mov dword [eax + 0x12c], edx
mov ecx, dword [ebp + 8]
movsx edx, word [ecx + 0x24]
mov eax, dword [ebp + 8]
mov dword [eax + 0x138], edx
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x140], 0
mov edx, dword [ebp + 8]
mov dword [edx + 0x144], 0
mov eax, dword [ebp + 8]
mov dword [eax + 0x150], 0xffffffff
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x14c], 0xffffffff
mov edx, dword [ebp + 8]
mov dword [edx + 8], 0
mov eax, dword [ebp + 8]
mov dword [eax + 0x134], 0
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x148], 0
mov edx, dword [ebp + 8]
mov dword [edx + 0x154], 0
mov eax, dword [ebp + 8]
movsx ecx, word [eax + 0x26]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00401000
add esp, 8
mov eax, dword [ebp + 8]
movsx ecx, word [eax + 0x14]
imul ecx, ecx, 0xac
push ecx
push 0
push 0x412780
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 4], 0
jmp 0x40141e
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
mov eax, dword [ebp + 8]
movsx ecx, word [eax + 0x14]
cmp dword [ebp - 4], ecx
jge 0x40144f
mov edx, dword [ebp - 4]
imul edx, edx, 0xac
add edx, 0x412780
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 4]
imul eax, eax, 0x58
add eax, 0x40cf20
mov ecx, dword [ebp - 0xc]
mov dword [ecx + 4], eax
jmp 0x401415
mov edx, dword [ebp + 8]
mov dword [0x40cd98], edx
push 1
mov eax, dword [ebp - 8]
imul eax, eax, 6
push eax
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov dword [0x413e78], eax
mov word [ebp - 0x24], 1
mov word [ebp - 0x22], 2
mov word [ebp - 0x16], 0x10
mov eax, dword [ebp - 0x22]
and eax, 0xffff
mov ecx, dword [ebp - 0x16]
and ecx, 0xffff
imul eax, ecx
cdq
and edx, 7
add eax, edx
sar eax, 3
mov word [ebp - 0x18], ax
mov edx, dword [0x409020]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x18]
and eax, 0xffff
mov ecx, dword [ebp - 0x20]
imul ecx, eax
mov dword [ebp - 0x1c], ecx
mov word [ebp - 0x14], 0
push 0
push 0
push 0
lea edx, [ebp - 0x24]
push edx
push 0xffffffffffffffff
push 0x413e7c
call dword [sym.imp.WINMM.dll_waveOutOpen]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x4014e9
xor al, al
jmp 0x4015ec
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0x412740
mov eax, dword [0x412768]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
shl ecx, 2
mov dword [ebp - 0x28], ecx
push 1
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov dword [0x412760], eax
mov eax, dword [ebp - 0x2c]
mov dword [eax + 0x10], 0xc
mov ecx, dword [ebp - 0x2c]
mov edx, dword [0x412760]
mov dword [ecx], edx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
mov dword [eax + 4], ecx
mov edx, dword [ebp - 0x2c]
mov dword [edx + 8], 0
mov eax, dword [ebp - 0x2c]
mov dword [eax + 0xc], 0
mov ecx, dword [ebp - 0x2c]
mov dword [ecx + 0x14], 0xffffffff
push 0x20
mov edx, dword [ebp - 0x2c]
push edx
mov eax, dword [0x413e7c]
push eax
call dword [sym.imp.WINMM.dll_waveOutPrepareHeader]
push 1
mov ecx, dword [0x412768]
lea edx, [ecx*8 + 0x100]
push edx
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov dword [0x413d00], eax
mov eax, dword [0x413d00]
add eax, 0xf
and al, 0xf0
mov dword [0x412720], eax
call fcn.00401790
cmp dword [0x40cda4], 0
jne 0x401597
push 0x20
push 0x412740
mov ecx, dword [0x413e7c]
push ecx
call dword [sym.imp.WINMM.dll_waveOutWrite]
mov byte [0x40cd9c], 0
lea edx, [ebp - 0x30]
push edx
push 0
push 0
push 0x40197f
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x40cda0], eax
push 0xf
mov eax, dword [0x40cda0]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov al, 1
mov esp, ebp
pop ebp
ret