Function at 0x21111c10
Capabilities:
Check mutex on windows

Disassembly:
mov eax, dword [0x2114e828]
sub esp, 0x1c
push ebx
push ebp
push esi
xor ebx, ebx
cmp eax, ebx
push edi
mov edi, edx
mov esi, ecx
je 0x21111c96
cmp dword [0x2114e89c], ebx
je 0x21111c3a
mov eax, dword [0x2114fa38]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
push ecx
mov ecx, dword [esp + 0x38]
push edx
mov edx, dword [esp + 0x38]
push eax
push ecx
push edx
push edi
call dword [sym.imp.WINMM.dll_waveOutOpen]
mov edi, eax
cmp dword [0x2114e89c], ebx
je 0x21111c8a
mov eax, dword [0x2114fa38]
cmp eax, ebx
jne 0x21111c81
mov esi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
push ebx
push ebx
push ebx
call esi
cmp eax, ebx
mov dword [0x2114fa38], eax
je 0x21111c73
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0x14
cmp dword [esi + 0xd8], ebx
je 0x21111cb7
push str.DirectSound_already_initialized.
call sym.mss32.dll__AIL_set_error_4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret 0x14
call fcn.21111a70
lea ebp, [esi + 0xdc]
mov dword [ebp], ebx
mov dword [esi + 0xe0], ebx
mov dword [esi + 0xac], ebx
mov dword [esi + 0xa0], ebx
call fcn.21111050
test al, al
jne 0x21111cfe
push str.The_DirectSound_DLL_could_not_be_loaded.
call sym.mss32.dll__AIL_set_error_4
call fcn.21111a80
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret 0x14
mov eax, dword [esp + 0x30]
cmp eax, 0xffffffff
je 0x21111d0e
cmp eax, 0xffff
jne 0x21111d10
xor eax, eax
mov ecx, esi
mov dword [esi + 0x9c], eax
call fcn.211111d0
test eax, eax
jne 0x21111d3c
mov ecx, esi
call fcn.21111a90
call fcn.21111a80
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret 0x14
cmp dword [0x2114e87c], ebx
je 0x21111e40
cmp dword [esi + 0xa8], ebx
jne 0x21111e40
mov eax, dword [esi + 0xac]
xor ecx, ecx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x18]
push ecx
mov dword [esi + 0xe0], eax
mov dword [esp + 0x1c], 0x14
mov edx, dword [eax]
push eax
call dword [edx + 0xc]
mov edi, dword [esp + 0x20]
mov edx, dword [esi + 0x94]
mov dword [esi + 0xe4], edi
imul edx, dword [0x2114e874]
mov eax, 0x10624dd3
mul edx
mov ecx, edx
mov eax, edi
shr ecx, 6
cdq
idiv ecx
mov ebx, 2
mov dword [esi + 0xec], ecx
cmp eax, ebx
mov dword [esi + 0xe8], eax
jl 0x21111e18
xor eax, eax
mov ax, word [esi + 0x98]
lea edi, [eax - 1]
mov eax, dword [esi + 0xe4]
cdq
idiv dword [esi + 0xe8]
test eax, edi
mov dword [esi + 0xec], eax
je 0x21111df8
mov eax, dword [esi + 0xe8]
dec eax
mov dword [esi + 0xe8], eax
jmp 0x21111e14
mov ecx, dword [esi + 0xe8]
mov edx, dword [esi + 0xe4]
imul eax, ecx
cmp eax, edx
je 0x21111e18
lea eax, [ecx - 1]
mov dword [esi + 0xe8], eax
cmp eax, ebx
jge 0x21111dd2
cmp dword [esi + 0xe8], ebx
jge 0x21111fa1
mov eax, dword [esi + 0xe4]
cdq
sub eax, edx
sar eax, 1
mov dword [esi + 0xe8], ebx
mov dword [esi + 0xec], eax
jmp 0x21111fa1
mov eax, dword [0x2114e878]
mov dword [esi + 0xe8], eax
mov eax, dword [0x2114e894]
mov ecx, dword [esi + 0xe8]
lea eax, [eax + eax*2]
cmp ecx, eax
jge 0x21111e63
mov dword [esi + 0xe8], eax
mov ecx, dword [esi + 0x94]
imul ecx, dword [0x2114e874]
mov eax, 0x10624dd3
mul ecx
mov eax, dword [esi + 0xa8]
shr edx, 6
cmp eax, ebx
mov dword [esi + 0xec], edx
je 0x21111e92
add edx, edx
mov dword [esi + 0xec], edx
mov eax, dword [esi + 0xec]
mov ecx, dword [esi + 0xe8]
add eax, 0xf
and eax, 0xfffffff0
imul ecx, eax
mov dword [esi + 0xec], eax
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esi + 0xe4], ecx
mov dword [esp + 0x28], eax
cmp dword [0x2114e89c], ebx
mov dword [esp + 0x20], ecx
lea ecx, [esi + 0x8c]
mov dword [esp + 0x18], 0x14
mov dword [esp + 0x1c], 0x180e0
mov dword [esp + 0x28], ecx
je 0x21111efc
mov edx, dword [0x2114fa38]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [esi + 0xa0]
mov ecx, dword [eax]
push ebx
push ebp
lea edx, [esp + 0x20]
push edx
push eax
call dword [ecx + 0xc]
test eax, eax
mov eax, dword [0x2114e89c]
jge 0x21111f67
cmp eax, ebx
je 0x21111f42
mov eax, dword [0x2114fa38]
cmp eax, ebx
jne 0x21111f39
mov edi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
push ebx
push ebx
push ebx
call edi
cmp eax, ebx
mov dword [0x2114fa38], eax
je 0x21111f2b
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, esi
call fcn.21111a90
push str.Could_not_create_secondary_buffer
call sym.mss32.dll__AIL_set_error_4
call fcn.21111a80
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret 0x14
cmp eax, ebx
je 0x21111f91
mov eax, dword [0x2114fa38]
cmp eax, ebx
jne 0x21111f88
mov edi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
push ebx
push ebx
push ebx
call edi
cmp eax, ebx
mov dword [0x2114fa38], eax
je 0x21111f7a
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp]
mov ecx, esi
mov dword [esi + 0xe0], eax
call fcn.211124d0
mov eax, dword [esi + 0xe0]
mov ecx, dword [eax]
lea edx, [esp + 0x10]
push edx
lea edx, [esp + 0x18]
push edx
push eax
call dword [ecx + 0x10]
test eax, eax
jge 0x21111fe0
mov ecx, esi
call fcn.21111a90
push str.Could_not_get_buffer_position
call sym.mss32.dll__AIL_set_error_4
call fcn.21111a80
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret 0x14
mov eax, dword [esp + 0x10]
xor edx, edx
div dword [esi + 0xec]
inc eax
mov dword [esi + 0xf0], eax
mov dword [esi + 0xf4], eax
mov eax, dword [0x2114e874]
imul eax, dword [0x2114e878]
mov dword [esi + 0xfc], eax
mov dword [esi + 0xd8], 1
call fcn.21111a80
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret 0x14