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

Disassembly:
sub esp, 0x18c
mov eax, dword [esp + reloc.WINMM.dll_midiStreamOut]
test eax, eax
mov dword [esp + 0x50], ecx
jne 0x4cd5a8
lea eax, [esp + 0x4c]
and dword [eax], 0
test ecx, ecx
push ebx
push ebp
push esi
mov ebx, ecx
mov dword [esp + 0x3c], eax
push edi
mov dword [esp + 0x14], ebx
je 0x4cd7ff
mov esi, dword [esp + 0x60]
cmp dword [0x466198], 0
mov ebp, 0x4585d8
je 0x4cd5df
push 0
mov ecx, 0x466180
call fcn.0050dccb
call dword [fcn.0045826c]
mov edi, eax
sub eax, dword [0x466154]
cmp eax, dword [0x4651e4]
jbe 0x4cd626
xor eax, eax
push eax
push eax
push eax
push eax
lea eax, [esp + 0x8c]
push eax
call dword [0x4584c8]
test eax, eax
je 0x4cd618
push 1
push 0xffffffffffffffff
call fcn.004d681b
pop ecx
pop ecx
call dword [fcn.0045826c]
mov edi, eax
mov dword [0x466154], edi
cmp byte [0x4651f0], 0
jne 0x4cd67b
cmp byte [0x4651f2], 0
jne 0x4cd67b
mov eax, dword [0x466148]
cmp eax, reloc.WINMM.dll_midiStreamOut
jle 0x4cd67b
cmp dword [0x465160], eax
jle 0x4cd675
cmp byte [0x465351], 0
mov byte [0x4651f0], 1
je 0x4cd67b
push 0xa
push dword [0x465208]
call dword [fcn.0045853c]
test eax, eax
je 0x4cd67b
mov byte [0x465351], 0
jmp 0x4cd67b
inc dword [0x465160]
mov ecx, dword [0x46513c]
cmp ecx, reloc.WINMM.dll_midiStreamOut
jl 0x4cd6a8
mov eax, dword [0x465138]
jg 0x4cd692
cmp eax, reloc.WINMM.dll_midiStreamOut
jbe 0x4cd6a8
mov edx, dword [0x466144]
cmp edx, ecx
jg 0x4cd6bc
jl 0x4cd6a8
mov ecx, dword [0x466140]
cmp ecx, eax
jae 0x4cd6bc
mov eax, dword [0x46515c]
cmp eax, reloc.WINMM.dll_midiStreamOut
jle 0x4cd6d0
sub edi, dword [0x466150]
cmp edi, eax
jb 0x4cd6d0
push 1
push 0xa
jmp 0x4cd6c9
push 1
push 0x8000012f
call fcn.004d681b
pop ecx
pop ecx
cmp byte [0x4651fa], 0
jne 0x4cd6c2
mov eax, dword [0x468688]
mov dword [0x465ec4], ebx
mov dword [eax*4 + 0x468048], ebx
call dword [fcn.0045826c]
mov ecx, dword [0x468688]
mov dword [ecx*4 + 0x467960], eax
inc ecx
cmp ecx, 0x190
mov dword [0x468688], ecx
jl 0x4cd714
and dword [0x468688], 0
xor edx, edx
cmp byte [ebx], 1
je 0x4cd7d8
push edx
push 0xffffffffffffffff
mov ecx, ebx
call fcn.004cd2a9
xor edi, edi
mov esi, eax
inc edi
cmp esi, edi
jne 0x4cd942
xor edx, edx
mov al, byte [ebx]
cmp al, 0xa
jb 0x4cd88d
cmp al, 0x21
ja 0x4cd88d
add dword [0x466140], edi
mov ecx, ebx
adc dword [0x466144], 0
call fcn.004d0bd9
test eax, eax
je 0x4d0820
push 3
pop ebp
cmp eax, ebp
jne 0x4cd80f
mov ecx, dword [ebx + 0x14]
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x1a8]
push ebp
call fcn.004cd58f
mov ecx, dword [esp + 0x18]
cmp ecx, ebx
mov esi, eax
je 0x4cd7f7
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], ebp
je 0x4d0760
test esi, esi
je 0x4cd942
cmp esi, 7
je 0x4cd942
cmp esi, 8
je 0x4cd942
cmp esi, 5
je 0x4cd942
cmp esi, 6
je 0x4cd942
test ecx, ecx
je 0x4cd7e0
mov eax, dword [ecx + 0x1c]
cmp eax, dword [ebx + 0x1c]
jmp 0x4d0748
xor edi, edi
inc edi
jmp 0x4cd738
mov ebx, dword [ebx + 0x18]
test ebx, ebx
mov dword [esp + 0x14], ebx
je 0x4cd828
cmp byte [ebx], 9
jne 0x4cd7f7
mov ebx, dword [ebx + 0x18]
mov dword [esp + 0x14], ebx
test ebx, ebx
jne 0x4cd5c5
xor eax, eax
inc eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18c
ret 0xc
mov ebx, dword [ebx + 0x18]
test ebx, ebx
mov dword [esp + 0x14], ebx
je 0x4cd828
cmp byte [ebx], 9
je 0x4cd82c
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], ebp
jne 0x4cd7f7
mov eax, edi
jmp 0x4cd802
mov ecx, dword [ebx + 0x14]
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x1a8]
push ebp
call fcn.004cd58f
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], ebp
mov esi, eax
je 0x4d0758
test esi, esi
je 0x4cd942
cmp esi, 7
je 0x4cd942
cmp esi, 8
je 0x4cd942
cmp esi, 5
je 0x4cd942
cmp esi, 6
je 0x4cd942
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x4cd7f0
jmp 0x4cd7cd
movzx eax, al
cmp eax, 0x69
jg 0x4cdcda
je 0x4d07fc
sub eax, 8
je 0x4cd8c7
sub eax, 0x57
je 0x4cd949
dec eax
je 0x4cd8ec
sub eax, 6
je 0x4d079e
dec eax
je 0x4d076b
dec eax
jne 0x4cdd03
mov edi, dword [ebx + 0xc]
xor ebp, ebp
cmp edi, 4
jne 0x4cd9a0
push ebp
push dword [0x467fa0]
call fcn.004e299d
pop ecx
pop ecx
mov dword [esp + 0x50], eax
jmp 0x4cda43
add dword [0x466140], edi
adc dword [0x466144], edx
mov eax, dword [ebx + 0x18]
cmp eax, edx
mov dword [esp + 0x34], eax
jne 0x4cd917
push edi
mov ecx, ebx
call fcn.004f01a3
test eax, eax
mov dword [esp + 0x34], eax
je 0x4d0820
mov ecx, eax
call fcn.004d0bb6
mov esi, eax
test esi, esi
je 0x4cd942
cmp esi, 8
je 0x4cd942
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], 3
jne 0x4d06cf
cmp esi, 7
mov eax, edi
je 0x4cd802
mov eax, esi
jmp 0x4cd802
add dword [0x466140], edi
adc dword [0x466144], edx
mov eax, dword [ebx + 0x18]
cmp eax, edx
mov dword [esp + 0x34], eax
jne 0x4cd974
push edi
mov ecx, ebx
call fcn.004f01a3
test eax, eax
mov dword [esp + 0x34], eax
je 0x4d0820
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], 3
mov dword [0x4651d0], eax
je 0x4cd992
mov ecx, dword [eax + 4]
mov edx, dword [ebx + 0x1c]
cmp edx, dword [ecx + 0x1c]
je 0x4d074a
mov eax, dword [eax + 4]
mov ecx, dword [esp + 0x40]
mov dword [ecx], eax
jmp 0x4cd828
xor ecx, ecx
inc ecx
cmp edi, ecx
ja 0x4cda0a
movzx eax, byte [ebx + 1]
sub eax, ebp
je 0x4cda07
dec eax
je 0x4cd9ec
push 0x45b05c
push dword [0x467fa0]
call fcn.0050ca68
test eax, eax
pop ecx
pop ecx
jne 0x4cd9cc
push 5
jmp 0x4cda04
push ebp
push dword [0x467fa0]
call fcn.004e299d
pop ecx
pop ecx
xor ecx, ecx
cmp eax, ebp
setne cl
mov dword [esp + 0x50], eax
add ecx, 3
mov edi, ecx
jmp 0x4cda0a
push ebp
push ecx
push ecx
push ecx
push dword [0x467fa0]
call fcn.004ccd74
add esp, 0x14
test eax, eax
je 0x4cd9cc
push 2
pop edi
jmp 0x4cda85
push 2
pop edi
cmp edi, 3
jne 0x4cda3e
cmp byte [ebx + 1], 1
ja 0x4cda1f
mov dword [esp + 0x44], 1
jmp 0x4cda37
push dword [0x467fa4]
call fcn.004df500
cmp eax, ebp
pop ecx
mov dword [esp + 0x44], eax
je 0x4d07c6
mov eax, dword [0x467fa8]
jmp 0x4cda70
cmp edi, 4
jne 0x4cda85
cmp byte [ebx + 1], 2
ja 0x4cda53
mov dword [esp + 0x44], 1
jmp 0x4cda6b
push dword [0x467fa8]
call fcn.004df500
cmp eax, ebp
pop ecx
mov dword [esp + 0x44], eax
je 0x4d07d4
mov eax, dword [0x467fac]
cmp byte [eax], 0x31
jne 0x4cda80
cmp byte [eax + 1], 0
mov byte [esp + 0x48], 1
je 0x4cda85
mov byte [esp + 0x48], 0
mov eax, dword [0x465144]
mov ebp, dword [0x465140]
mov dword [esp + 0x78], eax
mov eax, dword [0x465148]
mov dword [esp + 0x28], eax
mov eax, dword [0x46514c]
mov dword [esp + 0x24], eax
mov eax, dword [0x465150]
mov dword [esp + 0x38], eax
mov eax, dword [0x465154]
mov dword [esp + 0x1c], eax
xor edx, edx
mov eax, edi
dec eax
dec eax
mov byte [esp + 0x12], 0
mov dword [esp + 0x18], edx
mov dword [0x465140], 1
mov dword [0x465144], edx
je 0x4cdc0a
dec eax
je 0x4cdbe2
dec eax
je 0x4cdb84
dec eax
je 0x4cdb32
dec eax
jne 0x4cdc55
push 0x45b058
push dword [0x467fa8]
call fcn.0050ca68
pop ecx
pop ecx
test eax, eax
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x16]
push eax
push dword [esp + 0x1ac]
mov ecx, ebx
je 0x4cdb28
call fcn.004d3d17
jmp 0x4cdc53
call fcn.004d3f09
jmp 0x4cdc53
mov eax, dword [0x467fa4]
cmp byte [eax], 0
je 0x4cdbdd
push 0x45b054
push eax
call fcn.00509189
mov edi, eax
test edi, edi
pop ecx
pop ecx
je 0x4cdbdd
push dword [0x467fa8]
lea eax, [esp + 0x1c]
push edi
push eax
lea eax, [esp + 0x1e]
push eax
push dword [esp + 0x1b4]
mov ecx, ebx
call fcn.004e2397
push edi
mov esi, eax
call fcn.00509011
pop ecx
jmp 0x4cdc55
lea eax, [esp + 0x33]
push eax
push dword [0x467fa0]
call fcn.004e299d
mov edi, eax
test edi, edi
pop ecx
pop ecx
je 0x4cdbdd
push dword [0x467fa4]
lea eax, [esp + 0x1c]
push edi
push dword [esp + 0x58]
mov ecx, ebx
push dword [esp + 0x54]
push dword [esp + 0x54]
push eax
lea eax, [esp + 0x2a]
push eax
push dword [esp + 0x1c0]
call fcn.004e2638
cmp byte [esp + 0x33], 0
mov esi, eax
je 0x4cdc55
push edi
call dword [0x458044]
jmp 0x4cdc55
xor esi, esi
inc esi
jmp 0x4cdc55
push dword [0x467fa0]
lea eax, [esp + 0x1c]
push dword [esp + 0x4c]
mov ecx, ebx
push dword [esp + 0x4c]
push eax
lea eax, [esp + 0x22]
push eax
push dword [esp + 0x1b8]
call fcn.004d4100
jmp 0x4cdc53
cmp byte [ebx + 1], 0
jbe 0x4cdc2e
push dword [0x467fa0]
call fcn.004cccd3
cmp byte [ebx], 8
pop ecx
jne 0x4cdc27
mov ecx, eax
or ecx, edx
je 0x4cdc30
mov byte [esp + 0x4c], 0
jmp 0x4cdc35
xor eax, eax
mov byte [esp + 0x4c], 1
push dword [esp + 0x4c]
mov ecx, ebx
push edx
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x22]
push eax
push dword [esp + 0x1b8]
call fcn.004cc4ae
mov esi, eax
test esi, esi
mov eax, dword [esp + 0x78]
mov dword [0x465144], eax
mov eax, dword [esp + 0x28]
mov dword [0x465148], eax
mov eax, dword [esp + 0x24]
mov dword [0x46514c], eax
mov eax, dword [esp + 0x38]
mov dword [0x465150], eax
mov eax, dword [esp + 0x1c]
mov dword [0x465140], ebp
mov dword [0x465154], eax
je 0x4cd942
cmp esi, 7
je 0x4cd942
cmp esi, 8
je 0x4cd942
cmp byte [esp + 0x12], 0
jne 0x4cd7f7
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], 3
je 0x4d07e2
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4cd7f0
mov ecx, dword [eax + 0x1c]
cmp ecx, dword [ebx + 0x1c]
jne 0x4d07f1
mov ebx, eax
jmp 0x4cd7f3
sub eax, 0x6a
je 0x4d0857
dec eax
je 0x4d06d7
dec eax
je 0x4d0835
sub eax, 0x21
je 0x4d0629
sub eax, 0x48
je 0x4d0800
add dword [0x466140], edi
mov esi, dword [0x467ff0]
adc dword [0x466144], edx
mov al, byte [ebx]
movzx ecx, al
dec ecx
cmp ecx, 0xd5
ja 0x4d060c
jmp dword [ecx*4 + 0x405607]
xor esi, esi
test esi, esi
je 0x4cd942
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], 3
je 0x4cd942
jmp 0x4d06cf
mov eax, dword [esp + 0x60]
xor esi, esi
inc esi
add dword [0x466140], esi
push 0
pop ebp
adc dword [0x466144], ebp
mov edi, dword [eax + 0xc]
cmp edi, ebp
jne 0x4d065d
push ebp
push dword [0x467fa0]
mov ecx, 0x465c88
call fcn.00518e1a
mov edi, eax
cmp edi, ebp
je 0x4d06c1
mov eax, dword [0x467fa4]
cmp byte [eax], 0
je 0x4d067c
push 0x459f50
push eax
call fcn.0050ca68
test eax, eax
pop ecx
pop ecx
jne 0x4d067c
mov al, 1
jmp 0x4d067e
xor al, al
lea ecx, [esp + 0x34]
push ecx
push ebp
push eax
mov ecx, edi
call fcn.00518f9e
cmp dword [esp + 0x34], ebp
je 0x4d06c1
push dword [esp + 0x34]
mov ecx, ebx
call fcn.004f2683
test eax, eax
je 0x4d0820
mov ecx, dword [esp + 0x34]
call fcn.004d0bb6
mov esi, eax
cmp esi, ebp
je 0x4cd942
cmp esi, 8
je 0x4cd942
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], 3
je 0x4d0827
mov ebx, dword [ebx + 0x14]
jmp 0x4cd7f3
cmp dword [ebx + 0xc], edx
jne 0x4cd7f0
mov ecx, dword [ebx + 0x14]
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x1a8]
push 2
call fcn.004cd58f
mov ecx, dword [esp + 0x18]
cmp ecx, ebx
mov esi, eax
je 0x4cd7f7
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], 3
je 0x4d0760
test esi, esi
je 0x4cd942
cmp esi, 7
je 0x4cd942
cmp esi, 8
je 0x4cd942
cmp esi, 5
je 0x4cd942
cmp esi, 6
je 0x4cd942
test ecx, ecx
je 0x4cd7f0
mov eax, dword [ebx + 0x1c]
cmp eax, dword [ecx + 0x1c]
jne 0x4d075e
mov ebx, ecx
jmp 0x4cd7f3
mov ecx, dword [esp + 0x18]
jmp 0x4d0760
mov esi, edi
mov eax, dword [esp + 0x40]
mov dword [eax], ecx
jmp 0x4cd942
mov eax, dword [0x4641d0]
cmp word [eax], dx
jne 0x4d0796
cmp dword [0x466edc], edx
jne 0x4d0796
cmp dword [0x465338], edx
jne 0x4d0796
cmp dword [0x46533c], edx
jne 0x4d0796
cmp byte [0x46534c], 0
je 0x4d0800
push 8
pop eax
jmp 0x4cd802
mov eax, dword [esp + reloc.WINMM.dll_midiStreamOut]
cmp eax, edx
je 0x4d07b1
mov ecx, dword [0x467fa0]
mov dword [eax], ecx
mov eax, dword [esp + reloc.WINMM.dll_midiStreamOut]
dec eax
neg eax
sbb eax, eax
and eax, 6
inc eax
jmp 0x4cd802
push dword [0x467fa4]
push ebp
push 0x45b020
jmp 0x4d084b
push dword [0x467fa8]
push ebp
push 0x45afec
jmp 0x4d084b
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x18]
mov dword [eax], ecx
jmp 0x4cd7ff
mov ecx, dword [esp + 0x40]
mov dword [ecx], eax
jmp 0x4cd7ff
push 5
jmp 0x4d0798
push dword [0x467fa0]
call fcn.004ccc51
pop ecx
push eax
push 0
push 9
mov ecx, 0x465c88
call fcn.004e051a
jmp 0x4cd802
xor eax, eax
jmp 0x4cd802
cmp esi, 7
jne 0x4cd942
jmp 0x4cd7ff
cmp dword [esp + reloc.WINMM.dll_midiStreamOut], 2
je 0x4cd828
push ebp
push 0
push 0x45af98
mov ecx, ebx
call fcn.00515863
jmp 0x4cd802
push 6
jmp 0x4d0798