Function at 0x21124b20
Capabilities:
Check mutex on windows

Disassembly:
push ebx
push esi
push edi
push 0x1e4
mov edi, eax
call sym.mss32.dll__AIL_mem_alloc_lock_4
mov esi, eax
xor ebx, ebx
cmp esi, ebx
jne 0x21124b4c
push str.Could_not_allocate_memory_for_driver_descriptor.
call sym.mss32.dll__AIL_set_error_4
pop edi
pop esi
mov eax, 1
pop ebx
ret 8
cmp edi, 0xfffffffe
mov eax, dword [esp + 0x10]
mov dword [esi], 0x49444d48
mov dword [eax], esi
push ebp
mov dword [esi + 0x1c8], edi
jne 0x21124b77
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x21124c02
mov dword [eax], ebx
jmp 0x21124c02
cmp dword [0x211566c0], ebx
je 0x21124b8c
mov ecx, dword [0x211592a0]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [esi + 0x1c8]
push ebx
push ebx
push ebx
push edx
lea ebp, [esi + 0x1e0]
push ebp
call dword [sym.imp.WINMM.dll_midiOutOpen]
mov edi, eax
cmp dword [0x211566c0], ebx
mov dword [esp + 0x14], edi
je 0x21124bdb
mov eax, dword [0x211592a0]
cmp eax, ebx
jne 0x21124bd2
mov edi, dword [sym.imp.KERNEL32.dll_CreateMutexA]
push ebx
push ebx
push ebx
call edi
cmp eax, ebx
mov dword [0x211592a0], eax
je 0x21124bc0
mov edi, dword [esp + 0x14]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp edi, ebx
je 0x21124bf8
push str.midiOutOpen___failed.
call sym.mss32.dll__AIL_set_error_4
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
pop ebp
mov eax, edi
pop edi
pop esi
pop ebx
ret 8
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x21124c02
mov dword [eax], ebp
mov eax, dword [0x21156620]
mov ecx, eax
imul ecx, ecx, 0x81c
push ecx
mov dword [esi + 0x14], eax
call sym.mss32.dll__AIL_mem_alloc_lock_4
cmp eax, ebx
mov dword [esi + 0x10], eax
jne 0x21124c51
push str.Could_not_allocate_SEQUENCE_structures.
call sym.mss32.dll__AIL_set_error_4
cmp dword [esi + 0x1c8], 0xfffffffe
je 0x21124c3f
mov edx, dword [esi + 0x1e0]
push edx
call dword [sym.imp.WINMM.dll_midiOutClose]
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
pop ebp
pop edi
pop esi
mov eax, 1
pop ebx
ret 8
mov eax, dword [esi + 0x14]
xor ecx, ecx
cmp eax, ebx
mov ebp, 1
jle 0x21124c86
xor eax, eax
mov edx, dword [esi + 0x10]
mov dword [eax + edx], 0x51455348
mov edx, dword [esi + 0x10]
mov dword [eax + edx + 8], ebp
mov edx, dword [esi + 0x10]
mov dword [eax + edx + 4], esi
mov edx, dword [esi + 0x14]
inc ecx
add eax, 0x81c
cmp ecx, edx
jl 0x21124c61
mov eax, 0xf4240
cdq
mov dword [esi + 0x198], ebx
mov dword [esi + 0x19c], ebx
idiv dword [0x2115661c]
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]
lea esp, [esp]
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 0x21124cc0
push 0x21123ab0
call sym.mss32.dll__AIL_register_timer_4
cmp eax, 0xffffffff
mov dword [esi + 4], eax
jne 0x21124d2a
push str.Out_of_timer_handles.
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 0x21124d1b
mov ecx, dword [esi + 0x1e0]
push ecx
call dword [sym.imp.WINMM.dll_midiOutClose]
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
mov eax, ebp
pop ebp
pop edi
pop esi
pop ebx
ret 8
push esi
push eax
call sym.mss32.dll__AIL_set_timer_user_8
push pe_nt_image_headers32
call sym.mss32.dll__AIL_mem_alloc_lock_4
mov edi, eax
cmp edi, ebx
mov dword [esi + 0x1d0], edi
jne 0x21124d59
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
jmp 0x21124cfc
xor eax, eax
mov ecx, 0x10
rep stosd dword es:[edi], eax
mov edx, dword [0x21156638]
push edx
call sym.mss32.dll__AIL_mem_alloc_lock_4
mov edi, eax
cmp edi, ebx
mov dword [esi + 0x1cc], edi
jne 0x21124dbb
push str.Could_not_allocate_system_exclusive_buffer.
call sym.mss32.dll__AIL_set_error_4
mov eax, dword [esi + 0x1d0]
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 0x21124d1b
mov eax, dword [esi + 0x1e0]
push eax
jmp 0x21124d15
mov ecx, dword [0x21156638]
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 + 0x1d0]
mov ecx, dword [esi + 0x1cc]
mov dword [eax], ecx
mov eax, dword [0x21156638]
mov edx, dword [esi + 0x1d0]
mov dword [edx + 4], eax
cmp dword [esi + 0x1c8], 0xfffffffe
je 0x21124e79
mov ecx, dword [esi + 0x1d0]
mov edx, dword [esi + 0x1e0]
push pe_nt_image_headers32
push ecx
push edx
call dword [sym.imp.WINMM.dll_midiOutPrepareHeader]
mov edi, eax
cmp edi, ebx
je 0x21124e79
push edi
push str.midiOutPrepareHeader___failed__code___X_n
push 0x21158b70
call sym.mss32.dll_AIL_sprintf
add esp, 0xc
push 0x21158b70
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 + 0x1d0]
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 + 0x1e0]
push ecx
call dword [sym.imp.WINMM.dll_midiOutClose]
push esi
call sym.mss32.dll__AIL_mem_free_lock_4
pop ebp
mov eax, edi
pop edi
pop esi
pop ebx
ret 8
mov eax, esi
call fcn.211240f0
mov edx, dword [0x2115661c]
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 edx, dword [0x21159310]
pop ebp
pop edi
mov dword [esi + 0x1d4], edx
mov dword [0x21159310], esi
pop esi
xor eax, eax
pop ebx
ret 8