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

Disassembly:
push 1
call dword [0x5821d0]
mov ebx, dword [esp + 0x10]
lea edx, [edi + 0xc]
xor ecx, ecx
xor eax, eax
lock cmpxchg dword [edx], ecx
mov ecx, dword [edi + 4]
cmp eax, 2
jne 0x4d467f
sub ecx, 1
je 0x4d42ba
sub ecx, 1
je 0x4d4155
sub ecx, 1
jne 0x4d45f9
mov eax, dword [edi + 0xb50]
lea edx, [esp + 0x8c]
push edx
lea edx, [esp + 0xa8]
push edx
mov ecx, dword [eax]
push eax
mov eax, dword [ecx + 0x10]
call eax
test eax, eax
js 0x4d45e6
mov edx, dword [esp + 0x8c]
cmp edx, esi
jne 0x4d3ae9
push 1
call dword [0x5821d0]
jmp 0x4d3a7c
jbe 0x4d3af3
mov dword [esp + 0x48], esi
sub edx, esi
jmp 0x4d3b1b
mov eax, dword [edi + 0xa30]
imul eax, dword [edi + 0xa2c]
imul eax, dword [esp + 0x3c]
cmp esi, eax
jae 0x4d3b13
mov edx, eax
mov dword [esp + 0x48], esi
sub edx, esi
jmp 0x4d3b1b
mov dword [esp + 0x48], 0
test edx, edx
jne 0x4d3b2c
push 1
call dword [0x5821d0]
jmp 0x4d3a7c
mov eax, dword [edi + 0xb50]
lea esi, [esp + 0x20]
push 0
push 0
push 0
mov ecx, dword [eax]
push esi
lea esi, [esp + 0x48]
push esi
push edx
push dword [esp + 0x60]
push eax
mov eax, dword [ecx + 0x20]
call eax
mov esi, eax
test esi, esi
js 0x4d45bc
mov eax, dword [edi + 0x818]
xor edx, edx
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 1
mov dword [esp + 0x58], 2
mov dword [esp + 0x5c], 3
mov dword [esp + 0x60], 4
mov dword [esp + 0x64], 4
mov ecx, dword [esp + eax*4 + 0x50]
mov eax, 0x1000
imul ecx, dword [edi + 0x81c]
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 1
mov dword [esp + 0x58], 2
mov dword [esp + 0x5c], 3
div ecx
mov dword [esp + 0x60], 4
xor edx, edx
mov esi, eax
mov dword [esp + 0x64], 4
mov eax, dword [edi + 0x2d0]
mov dword [esp + 0x28], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x88], 0
mov ecx, dword [esp + eax*4 + 0x50]
mov eax, 0x1000
imul ecx, dword [edi + 0x2d4]
div ecx
lea ecx, [esp + 0x74]
cmp esi, eax
push ecx
cmovb eax, esi
lea ecx, [esp + 0xb4]
mov dword [esp + 0x78], eax
xor edx, edx
mov eax, dword [esp + 0x24]
div dword [esp + 0x40]
push ecx
lea ecx, [esp + 0x8c]
mov dword [esp + 0x8c], eax
push ecx
push dword [esp + 0x44]
lea eax, [edi + 0xa40]
push eax
call 0x594225
mov ebx, eax
add esp, 0x14
mov dword [esp + 0x14], ebx
test ebx, ebx
jne 0x4d4124
nop word [eax + eax]
mov eax, dword [esp + 0x74]
mov ebx, dword [esp + 0x28]
add ebx, dword [esp + 0x84]
push eax
mov dword [esp + 0x80], eax
lea eax, [esp + 0xb4]
push eax
lea eax, [esp + 0x10b8]
mov dword [esp + 0x30], ebx
push eax
push edi
call 0x59e26d
mov eax, dword [edi + 0xb48]
lea edx, [esp + 0xa0]
add esp, 0x10
mov ecx, dword [eax]
push edx
lea edx, [esp + 0x50]
push edx
push eax
mov eax, dword [ecx + 0x10]
call eax
test eax, eax
js 0x4d400b
mov dword [esp + 0x34], 0
nop
mov esi, dword [esp + 0x4c]
cmp esi, dword [esp + 0x44]
jae 0x4d3cd7
xor eax, eax
cmp dword [esp + 0x18], eax
sete al
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x24]
mov eax, esi
mov dword [esp + 0x44], eax
cmp dword [esp + 0x18], ecx
jne 0x4d3d1e
cmp eax, ebp
ja 0x4d3d03
mov ebx, dword [edi + 0x4e8]
imul ebx, dword [esp + 0x10]
imul ebx, dword [edi + 0x4e4]
sub ebx, ebp
add ebx, eax
jmp 0x4d3d26
mov eax, dword [edi]
test eax, eax
jne 0x4d3d12
push ebp
push esi
push str._DirectSound___Duplex_Playback_:_Play_cursor_has_moved_in_front_of_the_write_cursor__same_loop_iteration_._physicalPlayCursorInBytes_ld__virtualWriteCursorInBytes_ld._n
jmp 0x4d3d3c
mov eax, dword [eax + 0x38]
push ebp
push esi
push str._DirectSound___Duplex_Playback_:_Play_cursor_has_moved_in_front_of_the_write_cursor__same_loop_iteration_._physicalPlayCursorInBytes_ld__virtualWriteCursorInBytes_ld._n
jmp 0x4d3d3c
cmp eax, ebp
jb 0x4d3d2c
mov ebx, eax
sub ebx, ebp
test ebx, ebx
jne 0x4d3d7e
jmp 0x4d3d49
mov eax, dword [edi]
test eax, eax
je 0x4d3d35
mov eax, dword [eax + 0x38]
push ebp
push esi
push str._DirectSound___Duplex_Playback_:_Write_cursor_has_moved_behind_the_play_cursor__different_loop_iterations_._physicalPlayCursorInBytes_ld__virtualWriteCursorInBytes_ld._n
push 2
push eax
call 0x58fb30
add esp, 0x14
xor ebx, ebx
cmp dword [esp + 0x1c], 0
push 1
jne 0x4d3f9f
mov eax, dword [edi + 0xb48]
push 0
push 0
push eax
mov ecx, dword [eax]
mov eax, dword [ecx + 0x30]
call eax
mov esi, eax
test esi, esi
js 0x4d454c
mov esi, dword [esp + 0x4c]
mov dword [esp + 0x1c], 1
mov eax, dword [esp + 0x24]
cmp dword [esp + 0x18], eax
jne 0x4d3d9a
mov esi, dword [edi + 0x4e8]
imul esi, dword [esp + 0x10]
imul esi, dword [edi + 0x4e4]
mov eax, dword [edi + 0xb48]
lea edx, [esp + 0x2c]
push 0
push 0
push 0
mov ecx, dword [eax]
sub esi, ebp
push edx
lea edx, [esp + 0x50]
push edx
push esi
push ebp
push eax
mov eax, dword [ecx + 0x2c]
call eax
mov dword [esp + 0x68], eax
test eax, eax
js 0x4d3fe1
cmp dword [esp + 0x1c], 0
je 0x4d3e63
mov eax, dword [edi + 0x4e4]
mov ecx, eax
imul ecx, dword [esp + 0x10]
imul eax, dword [esp + 0x10]
imul ecx, dword [edi + 0x4e8]
sub ecx, ebx
cmp ecx, eax
jae 0x4d3e63
add eax, eax
sub eax, ecx
sar dword [ebx], 0xc6
cmovbe esi, eax
mov eax, dword [edi]
test eax, eax
je 0x4d3e04
mov eax, dword [eax + 0x38]
push esi
push ebx
push str._DirectSound___Duplex_Playback__Playback_buffer_starved._availableBytesPlayback_ld__silentPaddingInBytes_ld_n
push 2
push eax
call 0x58fbff
add esp, 0x14
test esi, esi
je 0x4d3e63
mov eax, dword [esp + 0x40]
test eax, eax
jne 0x4d3e48
push 0x2fbb
push str.C:PureBasicSvn_v6.10LibrariesSoundMiniAudiominiaudiominiaudio.h
push str.sz__0
call 0x5e66fb
mov eax, esi
xor edx, edx
add esp, 0xc
div dword [esp + 0x10]
mov esi, eax
jmp 0x4d3ee8
push esi
push 0
push eax
call 0x5651dd
mov eax, esi
xor edx, edx
add esp, 0xc
div dword [esp + 0x10]
mov esi, eax
jmp 0x4d3ee8
mov eax, dword [esp + 0x7c]
lea ecx, [esp + 0x10b0]
sub eax, dword [esp + 0x34]
xor edx, edx
mov dword [esp + 0x9c], eax
mov eax, dword [esp + 0x2c]
div dword [esp + 0x10]
mov dword [esp + 0xa0], 0
mov dword [esp + 0x94], eax
lea eax, [esp + 0x94]
push eax
push dword [esp + 0x44]
lea eax, [esp + 0xa4]
mov dword [esp + 0xa0], 0
push eax
mov eax, dword [esp + 0x40]
imul eax, dword [esp + 0x1c]
mov ecx, dword [edi + 0xb48]
mov ebx, esi
imul ebx, dword [esp + 0x10]
push 0
push 0
mov eax, dword [ecx]
push ebx
push dword [esp + 0x4c]
and al, 0x4c
mov eax, dword [eax + 0x4c]
push ecx
call eax
mov dword [esp + 0x68], eax
test eax, eax
js 0x4d3fca
add byte [eax], al
add ebp, ebx
mov ecx, dword [edi + 0x4e4]
xor edx, edx
mov ebx, dword [edi + 0x4e8]
mov eax, ebp
imul ebx, ecx
div dword [esp + 0x10]
cmp eax, ebx
jne 0x4d3f42
xor ecx, ecx
cmp dword [esp + 0x24], ecx
sete cl
mov dword [esp + 0x24], ecx
mov ecx, dword [edi + 0x4e4]
xor edx, edx
cmp eax, ebx
cmovne edx, ebp
mov dword [esp + 0x30], edx
mov edx, dword [esp + 0x70]
add edx, esi
cmp dword [esp + 0x1c], 0
mov dword [esp + 0x70], edx
jne 0x4d3f8b
lea eax, [ecx + ecx]
cmp edx, eax
jb 0x4d3f8b
mov eax, dword [edi + 0xb48]
push 1
push 0
push 0
mov ecx, dword [eax]
push eax
mov eax, dword [ecx + 0x30]
call eax
ror byte [ebx + 0xfdb85d8], 1
invalid
sahf
invalid
add byte [eax], al
mov dword [esp + 0x1c], 1
mov eax, dword [esp + 0x2c]
xor edx, edx
div dword [esp + 0x10]
cmp esi, eax
jb 0x4d4007
mov ebp, dword [esp + 0x30]
jmp 0x4d3fa5
call dword [0x5821d0]
mov eax, dword [edi + 0xb48]
lea edx, [esp + 0x90]
push edx
lea edx, [esp + 0x50]
push edx
mov ecx, dword [eax]
push eax
mov eax, dword [ecx + 0x10]
call eax
test eax, eax
jns 0x4d3cc0
jmp 0x4d4007
mov eax, dword [edi]
test eax, eax
jne 0x4d3fd7
push str._DirectSound__Failed_to_unlock_internal_buffer_from_playback_device_after_writing_to_the_device.
jmp 0x4d3fef
mov eax, dword [eax + 0x38]
push str._DirectSound__Failed_to_unlock_internal_buffer_from_playback_device_after_writing_to_the_device.
jmp 0x4d3fef
mov eax, dword [edi]
test eax, eax
je 0x4d3fea
mov eax, dword [eax + 0x38]
push str._DirectSound__Failed_to_map_buffer_from_playback_device_in_preparation_for_writing_to_the_device.
push 1
push eax
call 0x58fb43
add bh, bh
je 0x4d401e
je 0x4d3fe4
insb byte es:[edi], dx
sahf
or al, 0
mov dword [esp + 0x24], eax
add esp, 0x10
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x74]
or eax, dword [esp + 0x78]
je 0x4d4120
mov eax, dword [edi + 0x818]
xor edx, edx
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 1
mov dword [esp + 0x58], 2
mov dword [esp + 0x5c], 3
add byte [eax], al
add bh, al
inc esp
and al, 0x60
add al, 0
add byte [eax], al
mov dword [esp + 0x64], 4
mov ecx, dword [esp + eax*4 + 0x50]
test byte [eax - 0x48], dl
add byte [eax], dl
add byte [eax], al
imul ecx, dword [edi + 0x81c]
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 1
mov dword [esp + 0x58], 2
mov dword [esp + 0x5c], 3
div ecx
mov ecx, dword [edi + 0x2d0]
xor edx, edx
mov esi, eax
mov dword [esp + 0x60], 4
pushal
add al, 0
add byte [eax], al
mov dword [esp + 0x64], 4
mov eax, 0x1000
mov dword [esp + 0x78], 0
and al, 0x78
add byte [eax], al
add byte [eax], al
mov ecx, dword [esp + ecx*4 + 0x50]
imul ecx, dword [edi + 0x2d4]
mov dword [esp + 0x88], 0
div ecx
lea ecx, [esp + 0x74]
cmp esi, eax
push ecx
cmovb eax, esi
mov ebp, dword [esp + 0x30]
mov eax, dword [edi + 0xb50]
push 0
push 0
push dword [esp + 0x28]
mov ecx, dword [eax]
push dword [esp + 0x44]
push eax
mov eax, dword [ecx + 0x2c]
call eax
mov esi, eax
test esi, esi
js 0x4d4571
mov esi, dword [esp + 0x20]
add esi, dword [esp + 0x48]
jmp 0x4d4506
mov eax, dword [edi + 0xb50]
lea edx, [esp + 0x80]
push edx
lea edx, [esp + 0xac]
push edx
mov ecx, dword [eax]
push eax
mov eax, dword [ecx + 0x10]
call eax
test eax, eax
js 0x4d4626
mov ebx, dword [esp + 0x80]
cmp esi, ebx
je 0x4d3a70
jae 0x4d4194
mov dword [esp + 0x34], esi
sub ebx, esi
jmp 0x4d41bc
mov eax, dword [edi + 0xa30]
imul eax, dword [edi + 0xa2c]
imul eax, dword [esp + 0x3c]
cmp esi, eax
jae 0x4d41b4
mov ebx, eax
mov dword [esp + 0x34], esi
sub ebx, esi
jmp 0x4d41bc
mov dword [esp + 0x34], 0
mov eax, edi
mov edx, edi
mov edi, 0xa2c
sub al, 0xa
add byte [eax], al
mov ecx, 0xa30
add edx, edi
add eax, ecx
mov edi, dword [esp + 0x20b4]
mov dword [esp + 0x7c], edx
mov dword [esp + 0x48], eax
cmp ebx, dword [edx]
jb 0x4d3a70
clc
invalid
invalid
mov eax, dword [edi + 0xb50]
lea edx, [esp + 0x20]
mov esi, dword [esp + 0x34]
push 0
push 0
mov ecx, dword [eax]
push 0
push edx
lea edx, [esp + 0x48]
push edx
push ebx
push esi
push eax
mov eax, dword [ecx + 0x20]
call eax
mov dword [esp + 0x68], eax
test eax, eax
jns 0x4d4237
mov ecx, dword [edi]
test ecx, ecx
je 0x4d421a
mov ecx, dword [ecx + 0x38]
push str._DirectSound__Failed_to_map_buffer_from_capture_device_in_preparation_for_writing_to_the_device.
push 1
push ecx
call 0x58fd73
push dword [esp + 0x74]
call 0x59e09c
add esp, 0x10
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x20]
cmp ebx, eax
je 0x4d425e
mov ecx, dword [edi]
test ecx, ecx
je 0x4d4248
mov ecx, dword [ecx + 0x38]
push eax
push ebx
push str._DirectSound___Capture__lockSizeInBytesCapture_ld___mappedSizeInBytesCapture_ld_n
push 4
push ecx
call 0x590043
mov eax, dword [esp + 0x34]
add esp, 0x14
xor edx, edx
div dword [esp + 0x3c]
push dword [esp + 0x38]
push eax
push edi
call 0x59efbb
mov eax, dword [edi + 0xb50]
add esp, 0xc
mov ecx, dword [eax]
push 0
push 0
push dword [esp + 0x28]
push dword [esp + 0x44]
push eax
mov eax, dword [ecx + 0x2c]
call eax
mov ebx, eax
test ebx, ebx
js 0x4d4609
mov eax, dword [esp + 0x7c]
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x20]
add ecx, esi
xor esi, esi
mov eax, dword [eax]
imul eax, dword [esp + 0x3c]
imul eax, dword [edx]
cmp ecx, eax
cmovne esi, ecx
jmp 0x4d4506
mov eax, dword [edi + 0xb48]
lea edx, [esp + 0xac]
push edx
lea edx, [esp + 0x70]
push edx
mov ecx, dword [eax]
push eax
mov eax, dword [ecx + 0x10]
call eax
rol byte [ebp + 0x29880fc0], 1
add al, byte [eax]
invalid
mov edx, dword [esp + 0x6c]
cmp edx, dword [esp + 0x44]
jae 0x4d42f6
xor eax, eax
cmp dword [esp + 0x18], eax
sete al
mov dword [esp + 0x18], eax
jmp 0x4d42fa
mov eax, dword [esp + 0x18]
mov ecx, edx
mov dword [esp + 0x44], ecx
cmp eax, dword [esp + 0x24]
jne 0x4d433b
cmp ecx, ebp
ja 0x4d4320
mov eax, dword [edi + 0x4e8]
imul eax, dword [edi + 0x4e4]
mov eax, dword [edi]
test eax, eax
jne 0x4d432f
push ebp
push edx
push str._DirectSound___Playback_:_Play_cursor_has_moved_in_front_of_the_write_cursor__same_loop_iterations_._physicalPlayCursorInBytes_ld__virtualWriteCursorInBytes_ld._n
push edi
add bl, ch
invalid
mov eax, dword [eax + 0x38]
push ebp
push edx
push str._DirectSound___Playback_:_Play_cursor_has_moved_in_front_of_the_write_cursor__same_loop_iterations_._physicalPlayCursorInBytes_ld__virtualWriteCursorInBytes_ld._n
jmp 0x4d4355
cmp ecx, ebp
jb 0x4d4345
mov eax, ecx
sub eax, ebp
jmp 0x4d4369
mov eax, dword [edi]
test eax, eax
je 0x4d434e
mov eax, dword [eax + 0x38]
push ebp
push edx
push str._DirectSound___Playback_:_Write_cursor_has_moved_behind_the_play_cursor__different_loop_iterations_._physicalPlayCursorInBytes_ld__virtualWriteCursorInBytes_ld._n
push 2
push eax
call 0x590149
mov edx, dword [esp + 0x80]
add esp, 0x14
xor eax, eax
cmp eax, dword [edi + 0x4e4]
jae 0x4d43ad
test eax, eax
jne 0x4d3adf
cmp dword [esp + 0x1c], eax
jne 0x4d3adf
mov eax, dword [edi + 0xb48]
push 1
push 0
push 0
add byte [ebx + 0x418b5008], cl
xor bh, bh
ror byte [ebx + 0xfdb85d8], 1
invalid
mov es, word [ecx]
add byte [eax], al
invalid
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x24]
cmp dword [esp + 0x18], eax
jne 0x4d43c9
mov edx, dword [edi + 0x4e8]
imul edx, dword [edi + 0x4e4]
imul edx, dword [esp + 0x10]
mov eax, dword [edi + 0xb48]
lea ebx, [esp + 0x2c]
push 0
push 0
push 0
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4d3a78
invalid
inc esp