Function at 0x21117e70
Capabilities:
Check mutex on windows

Disassembly:
push ebx
push ebp
push esi
push edi
push 0x1ec
call sym.mss32.dll__AIL_mem_alloc_lock_4
mov esi, eax
xor ebx, ebx
cmp esi, ebx
jne 0x21117e9c
push str.Could_not_allocate_memory_for_driver_descriptor.
call sym.mss32.dll__AIL_set_error_4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
ret 0xc
mov eax, dword [str.HMDI]
mov ecx, dword [esp + 0x14]
mov dword [esi], eax
mov eax, dword [esp + 0x1c]
cmp eax, 0xfffffffe
mov dword [ecx], esi
mov dword [esi + 0x1c8], eax
jne 0x21117ecb
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x21117f56
mov dword [eax], ebx
jmp 0x21117f56
cmp dword [0x2114e89c], ebx
je 0x21117ee0
mov edx, dword [0x2114fa38]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [esi + 0x1c8]
push ebx
push ebx
push ebx
push eax
lea ebp, [esi + 0x1e8]
push ebp
call dword [sym.imp.WINMM.dll_midiOutOpen]
mov edi, eax
cmp dword [0x2114e89c], ebx
mov dword [esp + 0x14], edi
je 0x21117f2f
mov eax, dword [0x2114fa38]
cmp eax, ebx
jne 0x21117f26
mov edi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
push ebx
push ebx
push ebx
call edi
cmp eax, ebx
mov dword [0x2114fa38], eax
je 0x21117f14
mov edi, dword [esp + 0x14]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp edi, ebx
je 0x21117f4c
push str.midiOutOpen___failed.
call sym.mss32.dll__AIL_set_error_4
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret 0xc
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x21117f56
mov dword [eax], ebp
mov ecx, dword [0x2114e7fc]
mov eax, ecx
mov edx, eax
shl edx, 6
add edx, eax
mov dword [esi + 0x14], ecx
lea ecx, [eax + edx*4]
lea edx, [eax + ecx*2]
shl edx, 2
push edx
call sym.mss32.dll__AIL_mem_alloc_lock_4
cmp eax, ebx
mov dword [esi + 0x10], eax
jne 0x21117fb0
push str.Could_not_allocate_SEQUENCE_structures.
call sym.mss32.dll__AIL_set_error_4
cmp dword [esi + 0x1c8], 0xfffffffe
je 0x21117f9e
mov eax, dword [esi + 0x1e8]
push eax
call dword [sym.imp.WINMM.dll_midiOutClose]
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
ret 0xc
mov eax, dword [esi + 0x14]
xor ecx, ecx
cmp eax, ebx
mov ebp, 1
jle 0x21117fe7
xor eax, eax
mov edx, dword [esi + 0x10]
mov edi, dword [str.HSEQ]
mov dword [edx + eax], edi
mov edx, dword [esi + 0x10]
mov dword [edx + eax + 8], ebp
mov edx, dword [esi + 0x10]
mov dword [edx + eax + 4], esi
mov edx, dword [esi + 0x14]
inc ecx
add eax, 0x82c
cmp ecx, edx
jl 0x21117fc0
mov eax, 0xf4240
cdq
mov dword [esi + 0x198], ebx
mov dword [esi + 0x19c], ebx
idiv dword [0x2114e7f8]
mov dword [esi + 0xc], ebx
mov dword [esi + 0x1c4], ebx
mov dword [esi + 0x1a0], 0x7f
mov ecx, 0x10
mov dword [esi + 8], eax
lea eax, [esi + 0x58]
mov dword [eax - 0x40], ebx
mov dword [eax], ebx
mov dword [eax + 0x40], ebx
mov dword [eax + 0x80], ebx
mov dword [eax + 0xc0], ebx
mov dword [eax + 0x100], ebx
add eax, 4
dec ecx
jne 0x2111801d
push 0x21116a20
call sym.mss32.dll__AIL_register_timer_4
cmp eax, 0xffffffff
mov dword [esi + 4], eax
jne 0x2111806d
push 0x2114136c
call sym.mss32.dll__AIL_set_error_4
mov eax, dword [esi + 0x10]
push eax
call sym.mss32.dll__AIL_mem_free_lock_4
cmp dword [esi + 0x1c8], 0xfffffffe
je 0x211180b9
jmp 0x211180ac
push esi
push eax
call sym.mss32.dll__AIL_set_timer_user_8
push 0x40
call sym.mss32.dll__AIL_mem_alloc_lock_4
mov edi, eax
cmp edi, ebx
mov dword [esi + 0x1d8], edi
jne 0x211180c8
push str.Could_not_allocate_MIDIHDR_structure.
call sym.mss32.dll__AIL_set_error_4
mov edx, dword [esi + 4]
push edx
call sym.mss32.dll__AIL_release_timer_handle_4
mov eax, dword [esi + 0x10]
push eax
call sym.mss32.dll__AIL_mem_free_lock_4
cmp dword [esi + 0x1c8], 0xfffffffe
je 0x211180b9
mov ecx, dword [esi + 0x1e8]
push ecx
call dword [sym.imp.WINMM.dll_midiOutClose]
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
ret 0xc
xor eax, eax
mov ecx, 0x10
rep stosd dword es:[edi], eax
mov edx, dword [0x2114e814]
push edx
call sym.mss32.dll__AIL_mem_alloc_lock_4
mov edi, eax
cmp edi, ebx
mov dword [esi + 0x1cc], edi
jne 0x21118136
push str.Could_not_allocate_system_exclusive_buffer.
call sym.mss32.dll__AIL_set_error_4
mov eax, dword [esi + 0x1d8]
push eax
call sym.mss32.dll__AIL_mem_free_lock_4
mov ecx, dword [esi + 4]
push ecx
call sym.mss32.dll__AIL_release_timer_handle_4
mov edx, dword [esi + 0x10]
push edx
call sym.mss32.dll__AIL_mem_free_lock_4
cmp dword [esi + 0x1c8], 0xfffffffe
je 0x21118127
mov eax, dword [esi + 0x1e8]
push eax
call dword [sym.imp.WINMM.dll_midiOutClose]
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
ret 0xc
mov ecx, dword [0x2114e814]
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esi + 0x1d8]
mov ecx, dword [esi + 0x1cc]
mov dword [eax], ecx
mov eax, dword [0x2114e814]
mov edx, dword [esi + 0x1d8]
mov dword [edx + 4], eax
cmp dword [esi + 0x1c8], 0xfffffffe
je 0x211181f0
mov ecx, dword [esi + 0x1d8]
mov edx, dword [esi + 0x1e8]
push 0x40
push ecx
push edx
call dword [sym.imp.WINMM.dll_midiOutPrepareHeader]
mov edi, eax
cmp edi, ebx
je 0x211181f0
push edi
push str.midiOutPrepareHeader___failed__code___X_n
push 0x211501cc
call sym.mss32.dll_AIL_sprintf
add esp, 0xc
push 0x211501cc
call sym.mss32.dll__AIL_set_error_4
mov eax, dword [esi + 0x1cc]
push eax
call sym.mss32.dll__AIL_mem_free_lock_4
mov ecx, dword [esi + 0x1d8]
push ecx
call sym.mss32.dll__AIL_mem_free_lock_4
mov edx, dword [esi + 4]
push edx
call sym.mss32.dll__AIL_release_timer_handle_4
mov eax, dword [esi + 0x10]
push eax
call sym.mss32.dll__AIL_mem_free_lock_4
mov ecx, dword [esi + 0x1e8]
push ecx
call dword [sym.imp.WINMM.dll_midiOutClose]
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret 0xc
mov ecx, esi
call fcn.21117a20
mov edx, dword [0x2114e7f8]
mov eax, dword [esi + 4]
push edx
push eax
call sym.mss32.dll__AIL_set_timer_frequency_8
mov ecx, dword [esi + 4]
push ecx
call sym.mss32.dll__AIL_start_timer_4
mov eax, dword [0x2114e8b8]
cmp eax, ebx
je 0x2111822e
mov dword [esi + 0x1dc], eax
pop edi
mov dword [0x2114e8b8], esi
pop esi
pop ebp
xor eax, eax
pop ebx
ret 0xc
mov dword [esi + 0x1dc], ebx
pop edi
mov dword [0x2114e8b8], esi
pop esi
pop ebp
xor eax, eax
pop ebx
ret 0xc