Function at 0x2112d8f0
Capabilities:
Check mutex on windows

Disassembly:
sub esp, 0x2c
push esi
mov esi, eax
mov eax, dword [0x2115664c]
test eax, eax
push edi
je 0x2112d972
mov eax, dword [0x211566c0]
test eax, eax
je 0x2112d915
mov eax, dword [0x211592a0]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x40]
push ecx
mov ecx, dword [esp + 0x40]
push edx
mov edx, dword [esp + 0x40]
push eax
push ecx
push esi
push edx
call dword [sym.imp.WINMM.dll_waveOutOpen]
mov edi, eax
mov eax, dword [0x211566c0]
test eax, eax
je 0x2112d96a
mov eax, dword [0x211592a0]
test eax, eax
jne 0x2112d961
mov esi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
nop
push 0
push 0
push 0
call esi
test eax, eax
mov dword [0x211592a0], eax
je 0x2112d950
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, edi
pop edi
pop esi
add esp, 0x2c
ret
mov eax, dword [ebx + 0xd8]
test eax, eax
je 0x2112d991
push str.DirectSound_already_initialized.
call sym.mss32.dll__AIL_set_error_4
pop edi
mov eax, 1
pop esi
add esp, 0x2c
ret
mov eax, dword [0x21156658]
test eax, eax
je 0x2112d9a1
lock inc dword [0x21159318]
xor edi, edi
push ebp
lea ebp, [ebx + 0xdc]
mov dword [ebp], edi
mov dword [ebx + 0xe0], edi
mov dword [ebx + 0xac], edi
mov dword [ebx + 0xa0], edi
call fcn.2112cd80
test al, al
jne 0x2112d9ed
push str.The_DirectSound_DLL_could_not_be_loaded.
call sym.mss32.dll__AIL_set_error_4
cmp dword [0x21156658], edi
je 0x2112d9e1
lock dec dword [0x21159318]
pop ebp
pop edi
mov eax, 1
pop esi
add esp, 0x2c
ret
cmp esi, 0xffffffff
je 0x2112d9fa
cmp esi, 0xffff
jne 0x2112d9fc
xor esi, esi
mov eax, ebx
mov dword [ebx + 0x9c], esi
call fcn.2112d010
test eax, eax
jne 0x2112da2f
mov esi, ebx
call fcn.2112d780
cmp dword [0x21156658], edi
je 0x2112da23
lock dec dword [0x21159318]
pop ebp
pop edi
mov eax, 1
pop esi
add esp, 0x2c
ret
cmp dword [0x211566a0], edi
je 0x2112db2c
cmp dword [ebx + 0xa8], edi
jne 0x2112db2c
mov eax, dword [ebx + 0xac]
xor ecx, ecx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x14]
push ecx
mov dword [ebx + 0xe0], eax
mov dword [esp + 0x18], 0x14
mov edx, dword [eax]
push eax
call dword [edx + 0xc]
mov esi, dword [esp + 0x1c]
mov edx, dword [ebx + 0x94]
mov dword [ebx + 0xe4], esi
imul edx, dword [0x21156698]
mov eax, 0x10624dd3
mul edx
mov ecx, edx
mov eax, esi
shr ecx, 6
cdq
idiv ecx
mov ebp, 2
mov dword [ebx + 0xec], ecx
cmp eax, ebp
mov dword [ebx + 0xe8], eax
jl 0x2112db04
movzx eax, word [ebx + 0x98]
lea esi, [eax - 1]
mov eax, dword [ebx + 0xe4]
cdq
idiv dword [ebx + 0xe8]
test eax, esi
mov dword [ebx + 0xec], eax
je 0x2112dae2
dec dword [ebx + 0xe8]
jmp 0x2112dafc
mov ecx, dword [ebx + 0xe8]
mov edx, dword [ebx + 0xe4]
imul eax, ecx
cmp eax, edx
je 0x2112db04
dec ecx
mov dword [ebx + 0xe8], ecx
cmp dword [ebx + 0xe8], ebp
jge 0x2112dac3
cmp dword [ebx + 0xe8], ebp
jge 0x2112dc8c
mov eax, dword [ebx + 0xe4]
cdq
sub eax, edx
sar eax, 1
mov dword [ebx + 0xe8], ebp
mov dword [ebx + 0xec], eax
jmp 0x2112dc8c
mov eax, dword [0x2115669c]
mov dword [ebx + 0xe8], eax
mov eax, dword [0x211566b8]
mov ecx, dword [ebx + 0xe8]
lea eax, [eax + eax*2]
cmp ecx, eax
jge 0x2112db4f
mov dword [ebx + 0xe8], eax
mov ecx, dword [ebx + 0x94]
imul ecx, dword [0x21156698]
mov eax, 0x10624dd3
mul ecx
mov eax, dword [ebx + 0xa8]
shr edx, 6
cmp eax, edi
mov dword [ebx + 0xec], edx
je 0x2112db7e
add edx, edx
mov dword [ebx + 0xec], edx
mov eax, dword [ebx + 0xec]
mov edx, dword [ebx + 0xe8]
add eax, 0xf
and eax, 0xfffffff0
imul edx, eax
mov dword [ebx + 0xec], eax
xor eax, eax
mov ecx, 9
lea edi, [esp + 0x14]
rep stosd dword es:[edi], eax
lea eax, [ebx + 0x8c]
mov dword [ebx + 0xe4], edx
mov dword [esp + 0x24], eax
mov eax, dword [0x211566c0]
test eax, eax
mov dword [esp + 0x14], 0x24
mov dword [esp + 0x18], 0x18000
mov dword [esp + 0x1c], edx
je 0x2112dbe0
mov ecx, dword [0x211592a0]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebx + 0xa0]
mov edx, dword [eax]
push 0
push ebp
lea ecx, [esp + 0x1c]
push ecx
push eax
call dword [edx + 0xc]
test eax, eax
mov eax, dword [0x211566c0]
jge 0x2112dc4c
test eax, eax
je 0x2112dc2a
mov eax, dword [0x211592a0]
test eax, eax
jne 0x2112dc21
mov esi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
push 0
push 0
push 0
call esi
test eax, eax
mov dword [0x211592a0], eax
je 0x2112dc10
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, ebx
call fcn.2112d780
push str.Could_not_create_secondary_buffer
call sym.mss32.dll__AIL_set_error_4
call fcn.2112d760
pop ebp
pop edi
mov eax, 1
pop esi
add esp, 0x2c
ret
test eax, eax
je 0x2112dc7a
mov eax, dword [0x211592a0]
test eax, eax
jne 0x2112dc71
mov esi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
nop
push 0
push 0
push 0
call esi
test eax, eax
mov dword [0x211592a0], eax
je 0x2112dc60
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [ebp]
mov edi, ebx
mov dword [ebx + 0xe0], edx
call fcn.2112de30
xor edi, edi
mov esi, dword [ebx + 0xe0]
lea eax, [esp + 0xc]
push eax
lea ecx, [esp + 0x14]
push ecx
call fcn.2112d860
add esp, 8
test eax, eax
jne 0x2112dcd4
mov esi, ebx
call fcn.2112d780
push str.Could_not_get_buffer_position
call sym.mss32.dll__AIL_set_error_4
cmp dword [0x21156658], edi
je 0x2112dcc8
lock dec dword [0x21159318]
pop ebp
pop edi
mov eax, 1
pop esi
add esp, 0x2c
ret
mov eax, dword [esp + 0xc]
xor edx, edx
div dword [ebx + 0xec]
inc eax
mov dword [ebx + 0xf0], eax
mov dword [ebx + 0xf4], eax
mov edx, dword [0x21156698]
imul edx, dword [0x2115669c]
mov dword [ebx + 0xfc], edx
mov dword [ebx + 0xd8], 1
cmp dword [0x21156658], edi
je 0x2112dd19
lock dec dword [0x21159318]
pop ebp
pop edi
xor eax, eax
pop esi
add esp, 0x2c
ret