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

Disassembly:
sub esp, 0xcc
mov ecx, 0xa
xor eax, eax
mov dword [0x947050], 0x9caca0
push ebx
push esi
push edi
mov edi, 0x9caca0
rep stosd dword es:[edi], eax
mov dword [0x9cacac], 2
mov dword [0x9cacbc], 0x10
mov dword [0x9cacc0], 0x2b11
push 0x4afb94
call fcn.0040d730
xor esi, esi
add esp, 4
cmp eax, esi
je 0x474fbe
mov ecx, dword [0xc375ac]
mov edx, dword [ecx + eax*4 + 4]
push edx
call fcn.0040cc90
mov ecx, dword [0x947050]
add esp, 4
mov dword [ecx + 0x20], eax
push 0x4afb9c
call fcn.0040d730
add esp, 4
cmp eax, esi
je 0x474ff0
mov edx, dword [0xc375ac]
mov eax, dword [edx + eax*4 + 4]
push eax
call fcn.0040cc90
mov dword [esp + 0x3c], eax
add esp, 4
fild dword [esp + 0x38]
fstp dword [0xc3ed7c]
xor ecx, ecx
mov eax, dword [0x947050]
mov dword [esp + 0xc], ecx
mov ebx, 1
mov dword [esp + 0x10], ecx
mov word [esp + 0xc], bx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], ecx
mov word [esp + 0x1c], cx
mov dx, word [eax + 0xc]
mov word [esp + 0xe], dx
mov cx, word [eax + 0x1c]
mov word [esp + 0x1a], cx
mov ecx, dword [eax + 0x20]
mov eax, dword [esp + 0x1a]
mov dword [esp + 0x10], ecx
mov edx, dword [esp + 0xe]
and eax, 0xffff
and edx, 0xffff
mov word [esp + 0x1c], si
imul eax, edx
cdq
and edx, 7
add eax, edx
sar eax, 3
mov word [esp + 0x18], ax
mov eax, dword [esp + 0x18]
and eax, 0xffff
imul eax, ecx
mov dword [esp + 0x14], eax
mov eax, dword [0x9bebac]
cmp eax, esi
jne 0x4750cc
push str.dsound.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp eax, esi
mov dword [0x9bebac], eax
jne 0x47509e
push str.Couldnt_load_dsound.dll_n
call fcn.0040f960
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
add esp, 0xcc
ret
push str.DirectSoundCreate
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, esi
mov dword [0x9bebbc], eax
jne 0x4750d1
push str.Couldnt_get_DS_proc_addr_n
call fcn.0040f960
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
add esp, 0xcc
ret
mov eax, dword [0x9bebbc]
push esi
push 0x9beb84
push esi
call eax
cmp eax, esi
je 0x475113
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 0x8878000a
jne 0x475161
push 0x10035
push 0x4afc1c
push 0x4afc30
push esi
call edi
cmp eax, 4
jne 0x47517a
push esi
push 0x9beb84
push esi
call dword [0x9bebbc]
cmp eax, esi
jne 0x4750e4
mov eax, dword [0x9beb84]
lea edx, [esp + 0x78]
mov dword [esp + 0x78], 0x60
push edx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x47513c
push str.Couldnt_get_DS_caps_n
call fcn.0040f960
add esp, 4
test byte [esp + 0x7c], 0x20
je 0x475196
push str.No_DirectSound_driver_installed_n
call fcn.0040f960
add esp, 4
call fcn.00474e30
pop edi
mov eax, ebx
pop esi
pop ebx
add esp, 0xcc
ret
push str.DirectSound_create_failed_n
call fcn.0040f960
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
add esp, 0xcc
ret
push str.DirectSoundCreate_failure_n__hardware_already_in_use_n
call fcn.0040f960
add esp, 4
mov eax, 2
pop edi
pop esi
pop ebx
add esp, 0xcc
ret
mov eax, dword [0x9beb84]
mov edx, dword [0x948490]
push 3
push edx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x18]
test eax, eax
je 0x4751cc
push 0x4afd24
call fcn.0040f960
add esp, 4
call fcn.00474e30
pop edi
mov eax, ebx
pop esi
pop ebx
add esp, 0xcc
ret
mov ecx, 9
xor eax, eax
lea edi, [esp + 0x50]
push str._snoforceformat
rep stosd dword es:[edi], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x58], ebx
mov dword [esp + 0x2c], eax
mov ebx, 0x14
mov dword [esp + 0x30], eax
mov dword [esp + 0x54], 0x24
mov dword [esp + 0x34], eax
mov dword [esp + 0x5c], esi
mov dword [esp + 0x64], esi
mov dword [esp + 0x38], eax
mov dword [esp + 0x28], ebx
mov dword [0x94707c], esi
call fcn.0040d730
add esp, 4
test eax, eax
jne 0x47528f
mov eax, dword [0x9beb84]
push esi
lea edx, [esp + 0x54]
push 0x9bebb8
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0xc]
test eax, eax
jne 0x47528f
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x40], ecx
mov cx, word [esp + 0x1c]
mov dword [esp + 0x48], eax
mov eax, dword [0x9bebb8]
mov word [esp + 0x4c], cx
lea ecx, [esp + 0x3c]
mov dword [esp + 0x44], edx
mov edx, dword [eax]
push ecx
push eax
call dword [edx + 0x38]
test eax, eax
mov eax, dword [0x4afb90]
je 0x4752d2
cmp eax, esi
je 0x47528f
push str.Set_primary_sound_buffer_format:_no_n
call fcn.0040f960
add esp, 4
cmp dword [0x94707c], esi
je 0x475335
push str._primarysound
call fcn.0040d730
add esp, 4
test eax, eax
je 0x475335
mov eax, dword [0x9beb84]
mov ecx, dword [0x948490]
push 4
push ecx
mov edx, dword [eax]
push eax
call dword [edx + 0x18]
test eax, eax
je 0x4752ef
push str.Set_coop_level_failed_n
jmp 0x475592
cmp eax, esi
je 0x4752e3
push str.Set_primary_sound_buffer_format:_yes_n
call fcn.0040f960
add esp, 4
mov dword [0x94707c], 1
jmp 0x47529b
mov eax, dword [0x9bebb8]
lea ecx, [esp + 0x24]
push ecx
push eax
mov edx, dword [eax]
call dword [edx + 0xc]
test eax, eax
je 0x47531f
push str.DS:GetCaps_failed_n
call fcn.0040f840
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
add esp, 0xcc
ret
mov edx, dword [0x9bebb8]
push str.Using_primary_sound_buffer_n
mov dword [0x9beb80], edx
jmp 0x4753fd
mov ecx, 9
xor eax, eax
lea edi, [esp + 0x50]
push esi
rep stosd dword es:[edi], eax
xor ecx, ecx
lea eax, [esp + 0x10]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x64], eax
mov eax, dword [0x9beb84]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x54], 0x24
mov dword [esp + 0x34], ecx
mov dword [esp + 0x58], 0x28
mov dword [esp + 0x38], ecx
lea ecx, [esp + 0x54]
mov dword [esp + 0x5c], 0x10000
mov dword [esp + 0x28], ebx
mov edx, dword [eax]
push 0x9beb80
push ecx
push eax
call dword [edx + 0xc]
test eax, eax
je 0x4753a0
push str.DS:CreateSoundBuffer_Failed
jmp 0x475592
mov edx, dword [esp + 0xe]
mov eax, dword [0x947050]
and edx, 0xffff
mov dword [eax + 0xc], edx
mov ecx, dword [esp + 0x1a]
mov edx, dword [0x947050]
and ecx, 0xffff
mov dword [edx + 0x1c], ecx
mov ecx, dword [0x947050]
mov eax, dword [esp + 0x10]
mov dword [ecx + 0x20], eax
mov eax, dword [0x9beb80]
lea ecx, [esp + 0x24]
mov edx, dword [eax]
push ecx
push eax
call dword [edx + 0xc]
test eax, eax
je 0x4753f0
push 0x4afdc8
jmp 0x475592
cmp dword [0x4afb90], esi
je 0x475405
push str.Using_secondary_sound_buffer_n
call fcn.0040f960
add esp, 4
mov eax, dword [0x9beb80]
push 1
push esi
push esi
mov edx, dword [eax]
push eax
call dword [edx + 0x30]
cmp dword [0x4afb90], esi
je 0x47543a
mov eax, dword [0x947050]
mov ecx, dword [eax + 0x20]
push ecx
mov edx, dword [eax + 0x1c]
push edx
mov eax, dword [eax + 0xc]
push eax
push str.____d_channel_s__n____d_bits_sample_n____d_bytes_sec_n
call fcn.0040f960
add esp, 0x10
mov eax, dword [esp + 0x2c]
mov ecx, dword [0x9beb80]
push esi
push esi
lea ebx, [esp + 0x28]
push esi
push ebx
push 0x9bebb4
mov dword [0x9bebb0], eax
mov edx, dword [ecx]
push eax
push esi
push ecx
xor edi, edi
call dword [edx + 0x2c]
cmp eax, esi
je 0x4754a0
cmp eax, 0x88780096
jne 0x475586
inc edi
cmp edi, 0x2710
jg 0x47558d
mov eax, dword [0x9beb80]
push esi
push esi
lea edx, [esp + 0x28]
mov ecx, dword [eax]
push esi
push edx
mov edx, dword [0x9bebb0]
push 0x9bebb4
push edx
push esi
push eax
call dword [ecx + 0x2c]
cmp eax, esi
jne 0x475464
mov ecx, dword [esp + 0x20]
mov edi, dword [0x9bebb4]
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push esi
and ecx, 3
push esi
rep stosb byte es:[edi], al
mov edx, dword [esp + 0x28]
mov eax, dword [0x9beb80]
push edx
mov edx, dword [0x9bebb4]
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x9beb80]
mov dword [0x9bebb4], esi
push eax
mov ecx, dword [eax]
call dword [ecx + 0x48]
mov eax, dword [0x9beb80]
lea ecx, [esp + 0x74]
push ecx
push 0x9beba4
mov edx, dword [eax]
push eax
call dword [edx + 0x10]
mov eax, dword [0x9beb80]
mov edi, 1
push edi
push esi
mov edx, dword [eax]
push esi
push eax
call dword [edx + 0x30]
mov eax, dword [0x947050]
mov dword [eax + 4], edi
mov ecx, dword [0x947050]
mov dword [ecx + 8], esi
mov ecx, dword [0x947050]
mov eax, dword [ecx + 0x1c]
cdq
and edx, 7
add eax, edx
xor edx, edx
mov ebx, eax
mov eax, dword [0x9bebb0]
sar ebx, 3
div ebx
mov dword [ecx + 0x10], eax
mov edx, dword [0x947050]
mov dword [edx + 0x18], esi
mov eax, dword [0x947050]
mov dword [eax + 0x14], edi
mov ecx, dword [0x947050]
mov edx, dword [0x9bebb4]
mov dword [ecx + 0x24], edx
mov eax, dword [0x947050]
mov eax, dword [eax + 0x1c]
mov dword [0x947064], edi
cdq
and edx, 7
pop edi
add eax, edx
pop esi
sar eax, 3
dec eax
pop ebx
mov dword [0x94705c], eax
xor eax, eax
add esp, 0xcc
ret
push str.SNDDMA_InitDirect:_DS::Lock_Sound_Buffer_Failed_n
jmp 0x475592
push str.SNDDMA_InitDirect:_DS:_couldnt_restore_buffer_n
call fcn.0040f960
add esp, 4
call fcn.00474e30
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0xcc
ret