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 [0x410b74], 0
je 0x401264
cmp dword [0x410b78], 0
je 0x401264
cmp dword [0x410b7c], 0
je 0x401264
cmp dword [0x410b80], 0
je 0x401264
cmp dword [0x410b84], 0
jne 0x40126b
xor al, al
jmp 0x4015ec
fild dword [0x409020]
fdivr dword [0x4082b8]
fstp dword [0x417c10]
mov eax, dword [0x409020]
imul eax, eax, 0x14
cdq
mov ecx, 0x3e8
idiv ecx
add eax, 3
and al, 0xfc
mov dword [0x4164c4], eax
mov eax, dword [0x409024]
cdq
mov ecx, 0x14
idiv ecx
mov edx, dword [0x4164c4]
imul edx, eax
mov dword [0x4164c8], edx
mov eax, dword [0x4164c8]
shl eax, 1
mov dword [0x4164c8], eax
mov eax, dword [0x409020]
shl eax, 7
cdq
mov ecx, 0xac44
idiv ecx
mov dword [0x410b6c], eax
mov edx, dword [0x410b6c]
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x34], 0
fild qword [ebp - 0x38]
fdivr dword [0x4082b8]
fstp dword [0x410b70]
mov eax, dword [0x4164c8]
cdq
idiv dword [0x4164c4]
mov dword [ebp - 8], eax
push 0x5800
push 0
push 0x410c80
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 + 0x410c80], edx
mov eax, dword [ebp - 4]
imul eax, eax, 0x58
mov dword [eax + 0x410cb4], 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 0x4164e0
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, 0x4164e0
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 4]
imul eax, eax, 0x58
add eax, 0x410c80
mov ecx, dword [ebp - 0xc]
mov dword [ecx + 4], eax
jmp 0x401415
mov edx, dword [ebp + 8]
mov dword [0x410b08], 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 [0x417bd8], 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 0x417bdc
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], 0x4164a0
mov eax, dword [0x4164c8]
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 [0x4164c0], eax
mov eax, dword [ebp - 0x2c]
mov dword [eax + 0x10], 0xc
mov ecx, dword [ebp - 0x2c]
mov edx, dword [0x4164c0]
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 [0x417bdc]
push eax
call dword [sym.imp.WINMM.dll_waveOutPrepareHeader]
push 1
mov ecx, dword [0x4164c8]
lea edx, [ecx*8 + 0x100]
push edx
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov dword [0x417a60], eax
mov eax, dword [0x417a60]
add eax, 0xf
and al, 0xf0
mov dword [0x416480], eax
call fcn.00401790
cmp dword [0x410b14], 0
jne 0x401597
push 0x20
push 0x4164a0
mov ecx, dword [0x417bdc]
push ecx
call dword [sym.imp.WINMM.dll_waveOutWrite]
mov byte [0x410b0c], 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 [0x410b10], eax
push 0xf
mov eax, dword [0x410b10]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov al, 1
mov esp, ebp
pop ebp
ret