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

Disassembly:
push 0xffffffffffffffff
push 0x1015f466
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x420
mov eax, dword [0x101b9578]
push ebp
mov dword [esp + 0x420], eax
call dword [sym.imp.WINMM.dll_mixerGetNumDevs]
mov ebp, eax
cmp ebp, 1
mov dword [esp + 0xc], ebp
jae 0x100168b3
mov eax, 1
jmp 0x10016eb5
push ebx
push esi
push edi
xor ebx, ebx
xor edi, edi
cmp ebp, ebx
mov dword [esp + 0x20], edi
jbe 0x10016ead
push 0x10000
push ebx
push ebx
push edi
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.WINMM.dll_mixerOpen]
test eax, eax
je 0x100168ed
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.WINMM.dll_mixerClose]
jmp 0x10016ac7
mov eax, dword [esp + 0x10]
push reloc.WS2_32.dll_closesocket
lea edx, [esp + 0x1cc]
push edx
push eax
mov dword [esp + 0x1d4], 0xa8
mov dword [esp + 0x1ec], 7
call dword [sym.imp.WINMM.dll_mixerGetLineInfoA]
test eax, eax
je 0x1001692f
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.WINMM.dll_mixerClose]
jmp 0x10016ac7
mov esi, dword [esp + 0x1e8]
push fcn.10041ee0
push fcn.100162f0
push 8
push 0xc
lea edx, [esp + 0xb0]
push edx
mov dword [esp + 0x50], esi
call fcn.10102f79
cmp esi, ebx
mov dword [esp + 0x438], ebx
mov dword [esp + 0x14], ebx
jbe 0x10016a9b
lea ebp, [esp + 0xa4]
lea edi, [esp + 0xa8]
lea esi, [esp + 0xa0]
lea ecx, [ecx]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x1cc]
push SysReAllocString
lea ecx, [esp + 0x124]
push ecx
push edx
mov dword [esp + 0x12c], 0xa8
mov dword [esp + 0x134], ebx
mov dword [esp + 0x130], eax
call dword [sym.imp.WINMM.dll_mixerGetLineInfoA]
test eax, eax
jne 0x10016a7b
mov eax, dword [esp + 0x138]
cmp eax, 0x100a
jne 0x10016a1d
mov eax, dword [esp + 0x440]
test eax, eax
jne 0x10016a7b
mov eax, dword [esp + 0x12c]
mov edx, dword [esp + 0x14]
inc edx
mov dword [edi], eax
lea eax, [esp + 0x158]
mov dword [esp + 0x14], edx
mov dword [esi], ebx
lea edx, [eax + 1]
mov ecx, ebp
add esi, 0xc
add edi, 0xc
add ebp, 0xc
mov dword [esp + 0x1c], edx
lea ebx, [ebx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x10016a10
mov edx, dword [esp + 0x1c]
jmp 0x10016a6b
cmp eax, 0x1003
jne 0x10016a7b
cmp dword [esp + 0x440], 1
jne 0x10016a7b
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x12c]
inc edx
lea eax, [esp + 0x158]
mov dword [edi], ecx
mov dword [esp + 0x14], edx
mov dword [esi], ebx
lea edx, [eax + 1]
mov ecx, ebp
add esi, 0xc
add edi, 0xc
add ebp, 0xc
mov dword [esp + 0x1c], edx
jmp 0x10016a60
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x10016a60
mov edx, dword [esp + 0x1c]
sub eax, edx
push eax
lea eax, [esp + 0x15c]
push eax
call fcn.100025e0
mov eax, dword [esp + 0x3c]
inc ebx
cmp ebx, eax
jb 0x10016980
mov ebp, dword [esp + 0x14]
xor ebx, ebx
cmp ebp, 1
jge 0x10016ad9
mov edi, dword [esp + 0x20]
mov ebp, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.WINMM.dll_mixerClose]
push fcn.10041ee0
push 8
push 0xc
lea edx, [esp + 0xac]
push edx
mov dword [esp + 0x448], 0xffffffff
call fcn.10102f19
inc edi
cmp edi, ebp
mov dword [esp + 0x20], edi
jb 0x100168c6
jmp 0x10016ead
test ebp, ebp
jle 0x10016b78
lea esi, [esp + 0xa4]
mov eax, dword [esi]
mov edx, dword [eax - 4]
mov edi, dword [eax - 0xc]
mov eax, dword [eax - 8]
mov ecx, 1
sub ecx, edx
sub eax, edi
or eax, ecx
jge 0x10016b08
push edi
mov ecx, esi
call fcn.10001240
mov eax, dword [esi]
push eax
call fcn.10102e36
add esp, 4
test edi, edi
jl 0x10016d6c
mov eax, dword [esi]
cmp edi, dword [eax - 8]
jg 0x10016d6c
mov dword [eax - 0xc], edi
mov eax, dword [esi]
mov byte [edi + eax], 0
mov eax, dword [esi]
mov ecx, dword [eax - 0xc]
test ecx, ecx
jl 0x10016b51
push str.STEREO
push eax
call fcn.101016fe
add esp, 8
test eax, eax
je 0x10016b51
sub eax, dword [esi]
cmp eax, 0xffffffff
jne 0x10016b5b
inc ebx
add esi, 0xc
cmp ebx, ebp
jl 0x10016ae8
jmp 0x10016b78
lea eax, [ebx + ebx*2]
shl eax, 2
mov ebx, dword [esp + eax + 0xa0]
cmp ebx, 0xffffffff
mov esi, dword [esp + eax + 0xa8]
jne 0x10016c35
xor ebx, ebx
test ebp, ebp
jle 0x10016c1c
lea esi, [esp + 0xa4]
lea esp, [esp]
mov eax, dword [esi]
mov edx, dword [eax - 4]
mov edi, dword [eax - 0xc]
mov eax, dword [eax - 8]
mov ecx, 1
sub ecx, edx
sub eax, edi
or eax, ecx
jge 0x10016bb0
push edi
mov ecx, esi
call fcn.10001240
mov eax, dword [esi]
push eax
call fcn.10102e36
add esp, 4
test edi, edi
jl 0x10016d6c
mov eax, dword [esi]
cmp edi, dword [eax - 8]
jg 0x10016d6c
mov dword [eax - 0xc], edi
mov ecx, dword [esi]
mov byte [edi + ecx], 0
mov eax, dword [esi]
mov ecx, dword [eax - 0xc]
test ecx, ecx
jl 0x10016bf9
push str.MONO
push eax
call fcn.101016fe
add esp, 8
test eax, eax
je 0x10016bf9
sub eax, dword [esi]
cmp eax, 0xffffffff
jne 0x10016c03
inc ebx
add esi, 0xc
cmp ebx, ebp
jl 0x10016b90
jmp 0x10016c1c
lea eax, [ebx + ebx*2]
shl eax, 2
mov ebx, dword [esp + eax + 0xa0]
cmp ebx, 0xffffffff
mov esi, dword [esp + eax + 0xa8]
jne 0x10016c35
mov eax, dword [esp + 0xa0]
cmp eax, 0xffffffff
mov esi, dword [esp + 0xa8]
mov ebx, eax
je 0x10016d76
mov ecx, dword [esp + 0x10]
push reloc.OLEAUT32.dll_SysReAllocString
lea eax, [esp + 0x8c]
push eax
lea edx, [esp + 0x3a0]
mov edi, 0x18
mov ebp, 1
push ecx
mov dword [esp + 0x94], edi
mov dword [esp + 0x98], esi
mov dword [esp + 0x9c], 0x20010002
mov dword [esp + 0xa0], ebp
mov dword [esp + 0xa4], 0x94
mov dword [esp + 0xa8], edx
call dword [sym.imp.WINMM.dll_mixerGetLineControlsA]
test eax, eax
jne 0x10016cdf
mov edx, dword [esp + 0x39c]
mov eax, dword [esp + 0x3a8]
mov dword [esp + 0x28], edx
push SysReAllocString
lea edx, [esp + 0x28]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x14]
push edx
lea ecx, [esp + 0x20]
push eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x38], ebp
mov dword [esp + 0x40], 4
mov dword [esp + 0x44], ecx
mov dword [esp + 0x24], 0
call dword [sym.imp.WINMM.dll_mixerSetControlDetails]
mov eax, dword [esp + 0x10]
push reloc.OLEAUT32.dll_SysReAllocString
lea edx, [esp + 0x5c]
push edx
lea ecx, [esp + 0x30c]
push eax
mov dword [esp + 0x64], edi
mov dword [esp + 0x68], esi
mov dword [esp + 0x6c], 0x50030001
mov dword [esp + 0x70], ebp
mov dword [esp + 0x74], 0x94
mov dword [esp + 0x78], ecx
call dword [sym.imp.WINMM.dll_mixerGetLineControlsA]
test eax, eax
jne 0x10016d80
mov ecx, dword [esp + 0x308]
mov edx, dword [esp + 0x314]
mov dword [esp + 0x28], ecx
push SysReAllocString
lea ecx, [esp + 0x28]
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0x14]
push ecx
lea eax, [esp + 0x20]
push edx
mov dword [esp + 0x30], edi
mov dword [esp + 0x38], ebp
mov dword [esp + 0x40], 4
mov dword [esp + 0x44], eax
mov dword [esp + 0x24], 0xffff
call dword [sym.imp.WINMM.dll_mixerSetControlDetails]
jmp 0x10016d80
push 0x80070057
call fcn.10001050
mov edi, 0x18
mov ebp, 1
mov eax, dword [esp + 0x1d4]
push reloc.OLEAUT32.dll_SysReAllocString
lea edx, [esp + 0x74]
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x14]
push edx
lea ecx, [esp + 0x278]
push eax
mov dword [esp + 0x7c], edi
mov dword [esp + 0x84], 0x70010001
mov dword [esp + 0x88], ebp
mov dword [esp + 0x8c], 0x94
mov dword [esp + 0x90], ecx
call dword [sym.imp.WINMM.dll_mixerGetLineControlsA]
test eax, eax
je 0x10016dfb
push fcn.10041ee0
push 8
push 0xc
lea ecx, [esp + 0xac]
push ecx
mov dword [esp + 0x448], 0xffffffff
call fcn.10102f19
xor eax, eax
jmp 0x10016eb2
mov edx, dword [esp + 0x274]
mov eax, dword [esp + 0x280]
mov dword [esp + 0x44], edx
push SysReAllocString
lea edx, [esp + 0x44]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x14]
push edx
lea ecx, [esp + 0x108]
push eax
mov dword [esp + 0x4c], edi
mov dword [esp + 0x54], ebp
mov dword [esp + 0x5c], 4
mov dword [esp + 0x60], ecx
call dword [sym.imp.WINMM.dll_mixerGetControlDetailsA]
test eax, eax
jne 0x10016dd3
mov edx, dword [esp + 0x280]
test edx, edx
jbe 0x10016e5b
mov ecx, edx
lea edi, [esp + 0x100]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x10]
sub edx, ebx
mov dword [esp + edx*4 + 0xfc], ebp
push SysReAllocString
lea edx, [esp + 0x44]
push edx
push eax
call dword [sym.imp.WINMM.dll_mixerSetControlDetails]
test eax, eax
jne 0x10016dd3
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.WINMM.dll_mixerClose]
push fcn.10041ee0
push 8
push 0xc
lea eax, [esp + 0xac]
push eax
mov dword [esp + 0x448], 0xffffffff
call fcn.10102f19
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x424]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x420]
pop ebp
call fcn.1010122d
add esp, 0x42c
ret