Function at 0x100170b0
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x60
push ebx
push esi
push edi
mov dword [ebp - 4], ecx
mov eax, dword [ebp - 4]
mov dword [eax], 0x100218d0
mov ecx, dword [ebp - 4]
xor edx, edx
mov dl, byte [ecx + 0x44]
test edx, edx
je 0x1001713b
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x18]
push ecx
call dword [sym.imp.WINMM.dll_waveInStop]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x18]
push eax
call dword [sym.imp.WINMM.dll_waveInReset]
mov dword [ebp - 8], 0
jmp 0x100170fd
mov ecx, dword [ebp - 8]
add ecx, 1
mov dword [ebp - 8], ecx
cmp dword [ebp - 8], 2
jge 0x1001711f
push 0x20
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov ecx, dword [eax + edx*4 + 0x30]
push ecx
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x18]
push eax
call dword [sym.imp.WINMM.dll_waveInUnprepareHeader]
jmp 0x100170f4
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x18]
push edx
call dword [sym.imp.WINMM.dll_waveInClose]
push 0xffffffffffffffff
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov edx, dword [ebp - 4]
xor eax, eax
mov al, byte [edx + 0x45]
test eax, eax
je 0x10017195
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x40]
push edx
call dword [sym.imp.WINMM.dll_waveOutReset]
mov dword [ebp - 0xc], 0
jmp 0x10017166
mov eax, dword [ebp - 0xc]
add eax, 1
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 2
jge 0x10017188
push 0x20
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 4]
mov eax, dword [edx + ecx*4 + 0x30]
push eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x40]
push edx
call dword [sym.imp.WINMM.dll_waveOutUnprepareHeader]
jmp 0x1001715d
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x40]
push ecx
call dword [sym.imp.WINMM.dll_waveOutClose]
mov dword [ebp - 0x10], 0
jmp 0x100171a7
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
cmp dword [ebp - 0x10], 2
jge 0x10017213
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + eax*4 + 8]
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 4]
mov eax, dword [edx + ecx*4 + 0x30]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x18]
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
mov ecx, dword [eax + edx*4 + 0x10]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x1c]
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + eax*4 + 0x38]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x20]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
jmp 0x1001719e
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret