Function at 0x461170
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x28
mov eax, dword [0x570f20]
xor eax, esp
mov dword [esp + 0x24], eax
push esi
push edi
mov edi, dword [esp + 0x34]
mov eax, dword [edi + 0x24]
mov esi, dword [edi + 0x3c]
push eax
call fcn.004608b0
add esp, 4
test eax, eax
jne 0x4611ad
pop edi
mov eax, 0xffffd8fd
pop esi
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.004a7314
add esp, 0x28
ret
mov eax, dword [eax + 0x18]
dec eax
push ebx
je 0x4611c1
sub eax, 3
je 0x4611c1
mov ebx, dword [edi + 0x1c]
lea ecx, [ebx + ebx]
jmp 0x4611cb
mov ebx, dword [edi + 0x1c]
lea ecx, [ebx*4]
mov ax, word [edi + 0x1c]
fld qword [edi + 0x10]
mov word [esp + 0x1e], ax
fnstcw word [esp + 0xe]
movzx eax, word [esp + 0xe]
fld st(0)
or eax, 0xc00
mov dword [esp + 0x10], eax
mov edx, 1
mov word [esp + 0x1c], dx
fldcw word [esp + 0x10]
mov dword [esp + 0x18], ecx
mov word [esp + 0x28], cx
fistp qword [esp + 0x10]
mov edx, dword [esp + 0x10]
mov dword [esp + 0x20], edx
fldcw word [esp + 0xe]
fimul dword [esp + 0x18]
fnstcw word [esp + 0xe]
movzx eax, word [esp + 0xe]
or eax, 0xc00
mov dword [esp + 0x10], eax
fldcw word [esp + 0x10]
fistp qword [esp + 0x10]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x24], eax
mov eax, ecx
cdq
fldcw word [esp + 0xe]
idiv ebx
xor ecx, ecx
mov word [esp + 0x2c], cx
mov ecx, dword [0x6bbfac]
add eax, eax
add eax, eax
add eax, eax
mov word [esp + 0x2a], ax
mov eax, dword [edi + 0x24]
cmp eax, ecx
jl 0x461262
sub eax, ecx
push ebp
push 0
push 0
push 1
push 0
lea ebx, [eax - 1]
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esi + 0x70], eax
test eax, eax
jne 0x4612a0
mov esi, 0xffffd8f0
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop ebp
pop ebx
mov dword [0x6bbfbc], eax
pop edi
mov eax, esi
pop esi
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.004a7314
add esp, 0x28
ret
mov edx, dword [esi + 0x78]
push 0x50000
push edi
push edx
lea eax, [esp + 0x2c]
push eax
push ebx
lea ebp, [esi + 0x14]
push ebp
mov dword [esi + 0x74], 1
call dword [sym.imp.WINMM.dll_waveOutOpen]
mov edi, eax
test edi, edi
je 0x461302
push str.PortAudio:_PaHost_OpenOutputStream___failed__n
call fcn.004a7323
call fcn.004a90b4
add eax, 0x20
push eax
call fcn.004a93f3
add esp, 8
pop ebp
pop ebx
mov esi, 0xffffd8f0
mov dword [0x6bbfbc], edi
pop edi
mov eax, esi
pop esi
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.004a7314
add esp, 0x28
ret
mov eax, dword [esi + 0x48]
shl eax, 5
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [esi + 0x18], eax
test eax, eax
jne 0x461332
pop ebp
pop ebx
mov esi, 0xffffd8f7
pop edi
mov eax, esi
pop esi
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.004a7314
add esp, 0x28
ret
xor ebx, ebx
cmp dword [esi + 0x48], ebx
jle 0x461388
xor edi, edi
jmp 0x461340
mov eax, dword [esi + 0x20]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ecx, dword [esi + 0x18]
mov dword [edi + ecx], eax
mov eax, dword [esi + 0x18]
cmp dword [eax + edi], 0
je 0x461318
mov ecx, dword [esi + 0x20]
mov dword [eax + edi + 4], ecx
mov edx, dword [esi + 0x18]
mov dword [edx + edi + 0xc], ebx
mov eax, dword [esi + 0x18]
mov ecx, dword [ebp]
push 0x20
add eax, edi
push eax
push ecx
call dword [sym.imp.WINMM.dll_waveOutPrepareHeader]
test eax, eax
jne 0x46139d
inc ebx
add edi, 0x20
cmp ebx, dword [esi + 0x48]
jl 0x461340
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.004a7314
add esp, 0x28
ret
mov ecx, dword [esp + 0x34]
pop ebp
pop ebx
mov esi, 0xffffd8f0
mov dword [0x6bbfbc], eax
pop edi
mov eax, esi
pop esi
xor ecx, esp
call fcn.004a7314
add esp, 0x28
ret