Function at 0x65902590
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
push esi
mov esi, eax
push ebx
sub esp, 0x3dc
mov dword [ebp - 0x3bc], edx
call sym._MCICDA_GetOpenDrv
mov ebx, eax
test byte [0x65906018], 8
jne 0x65902a08
test edi, edi
je 0x65902a46
test ebx, ebx
je 0x65902a58
mov eax, dword [ebx + 0x18]
lea ecx, [ebp - 0x3ac]
lea edx, [ebp - 0x33c]
call sym._MCICDA_ReadTOC.isra.0
test eax, eax
je 0x659029f8
test byte [ebp - 0x3bc], 4
je 0x65902910
mov edx, dword [edi + 4]
mov eax, ebx
call sym._MCICDA_CalcFrame
lea edx, [ebp - 0x3b4]
mov dword [ebp - 0x3b4], eax
mov eax, dword [ebx + 0x18]
call sym._MCICDA_SkipDataTracks.isra.0
test eax, eax
jne 0x65902907
test byte [0x65906018], 8
jne 0x65902d90
test byte [ebp - 0x3bc], 8
jne 0x659029a0
movzx eax, byte [ebp - 0x339]
movzx edx, byte [ebp - 0x33a]
inc eax
sub eax, edx
movzx edx, byte [ebp + eax*8 - 0x333]
movzx ecx, byte [ebp + eax*8 - 0x331]
movzx eax, byte [ebp + eax*8 - 0x332]
imul edx, edx, 0x1194
imul eax, eax, 0x4b
lea edx, [edx + ecx - 1]
add eax, edx
mov dword [ebp - 0x3b0], eax
mov edx, dword [ebp - 0x3b4]
cmp edx, eax
ja 0x659029e8
test byte [0x65906018], 8
je 0x659026b4
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.Playing_from__lu_to__lu_n
mov dword [esp + 8], str.MCICDA_Play
mov dword [esp + 4], 0x65906018
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
xor eax, eax
and dword [ebp - 0x3bc], 1
je 0x659026c2
movzx eax, word [edi]
lea edi, [ebx + 0x10]
mov dword [ebp - 0x3c0], edi
xchg dword [edi], eax
test eax, eax
jne 0x65902ab0
mov ecx, dword [ebp - 0x3b4]
cmp ecx, dword [ebp - 0x3b0]
je 0x65902a68
movzx eax, byte [ebp - 0x339]
movzx edx, byte [ebp - 0x33a]
inc eax
sub eax, edx
movzx edx, byte [ebp + eax*8 - 0x333]
imul edi, edx, 0x1194
movzx edx, byte [ebp + eax*8 - 0x331]
movzx eax, byte [ebp + eax*8 - 0x332]
imul eax, eax, 0x4b
lea edx, [edi + edx - 1]
add eax, edx
cmp eax, ecx
je 0x65902a68
mov edx, dword [ebx + 0x1c]
test edx, edx
je 0x659027ba
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
sub esp, 4
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebx + 0x1c]
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 8
mov dword [esp], eax
call esi
mov eax, dword [ebx + 0x20]
mov dword [ebx + 0x1c], 0
sub esp, 4
mov dword [esp], eax
call esi
mov eax, dword [ebx + 0x30]
mov dword [ebx + 0x20], 0
sub esp, 4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 0x48]
mov eax, dword [ebx + 0x30]
sub esp, 4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov eax, dword [ebx + 0x2c]
mov dword [ebx + 0x30], 0
sub esp, 4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov dword [ebx + 0x2c], 0
sub esp, 4
mov eax, dword [0x6590a004]
lea esi, [ebp - 0x360]
test eax, eax
je 0x6590283e
lea edx, [ebx + 0x2c]
mov dword [esp + 8], 0
lea esi, [ebp - 0x360]
mov dword [esp + 4], edx
mov dword [esp], 0
call eax
sub esp, 0xc
test eax, eax
jns 0x65902ad0
mov eax, dword [ebx + 0x20]
test eax, eax
je 0x6590280c
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [ebx + 0x20], 0
sub esp, 4
mov eax, dword [ebx + 0x30]
test eax, eax
je 0x65902825
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov dword [ebx + 0x30], 0
sub esp, 4
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x6590283e
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov dword [ebx + 0x2c], 0
sub esp, 4
mov edi, 0xe90452d5
mov eax, edi
mul dword [ebp - 0x3b4]
mov eax, 0x1b4e81b5
shr edx, 0xc
mov byte [ebp - 0x360], dl
mul dword [ebp - 0x3b4]
mov eax, 0x88888889
mov ecx, edx
shr ecx, 3
mul ecx
mov eax, ecx
imul ecx, ecx, 0x4b
shr edx, 5
imul edx, edx, 0x3c
sub eax, edx
mov byte [ebp - 0x35f], al
mov eax, dword [ebp - 0x3b4]
sub eax, ecx
mov ecx, dword [ebp - 0x3b0]
mov byte [ebp - 0x35e], al
mov eax, ecx
mul edi
mov eax, 0x1b4e81b5
shr edx, 0xc
mov byte [ebp - 0x35d], dl
mul ecx
mov eax, 0x88888889
mov edi, edx
shr edi, 3
mul edi
mov eax, edi
imul edi, edi, 0x4b
shr edx, 5
imul edx, edx, 0x3c
sub ecx, edi
lea edi, [ebp - 0x3ac]
mov byte [ebp - 0x35b], cl
mov ecx, esi
sub eax, edx
mov edx, 0x24018
mov byte [ebp - 0x35c], al
mov eax, dword [ebx + 0x18]
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 6
call sym._device_io.constprop.0
test eax, eax
je 0x65902dd0
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea ecx, [ebp - 0x3ac]
lea edx, [ebp - 0x378]
mov eax, dword [ebx + 0x18]
mov dword [esp + 8], 0x18
mov dword [esp + 0xc], ecx
lea ecx, [ebp - 0x3b6]
mov dword [esp + 4], edx
mov edx, 0x2402c
mov dword [esp], 2
mov byte [ebp - 0x3b6], 1
call sym._device_io.constprop.0
test eax, eax
je 0x659029f8
movzx eax, byte [ebp - 0x36f]
movzx edx, byte [ebp - 0x36e]
imul eax, eax, 0x1194
imul edx, edx, 0x4b
add eax, edx
movzx edx, byte [ebp - 0x36d]
add eax, edx
lea edx, [ebp - 0x3b4]
mov dword [ebp - 0x3b4], eax
mov eax, dword [ebx + 0x18]
call sym._MCICDA_SkipDataTracks.isra.0
test eax, eax
jne 0x65902907
test byte [ebp - 0x3bc], 8
je 0x65902633
mov edx, dword [edi + 8]
mov eax, ebx
call sym._MCICDA_CalcFrame
lea edx, [ebp - 0x3b0]
mov dword [ebp - 0x3b0], eax
mov eax, dword [ebx + 0x18]
call sym._MCICDA_SkipDataTracks.isra.0
test eax, eax
jne 0x65902907
mov eax, dword [ebp - 0x3b0]
test byte [0x65906018], 8
jne 0x65902de8
cmp eax, dword [ebp - 0x3b4]
jae 0x659026b4
lea esi, [esi]
mov eax, 0x11a
jmp 0x65902907
call sym._MCICDA_GetError.constprop.0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x3bc]
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], str.__04X___08lX___p___n
mov dword [esp + 8], str.MCICDA_Play
mov dword [esp + 4], 0x65906018
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
test edi, edi
jne 0x659025c2
lea esp, [ebp - 0xc]
mov eax, 0x129
pop ebx
pop esi
pop edi
pop ebp
ret
lea esp, [ebp - 0xc]
mov eax, 0x101
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [ebp - 0x3bc]
test ecx, ecx
je 0x65902905
mov edi, dword [ebp - 0x3c0]
xor eax, eax
xchg dword [edi], eax
test eax, eax
je 0x65902905
mov dword [esp + 8], 1
mov dword [esp + 4], esi
mov dword [esp], eax
call sym._mciDriverNotify_12
xor eax, eax
sub esp, 0xc
jmp 0x65902907
mov dword [esp + 8], 4
mov edx, dword [ebx + 0xc]
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._mciDriverNotify_12
sub esp, 0xc
jmp 0x659026d5
mov eax, dword [ebx + 0x2c]
mov eax, dword [eax]
mov esi, dword [eax + 0x18]
call dword [sym.imp.user32.dll_GetDesktopWindow]
mov dword [esp + 8], 2
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x2c]
mov dword [esp], eax
call esi
movzx eax, byte [ebp - 0x333]
movzx edx, byte [ebp - 0x332]
mov dword [ebp - 0x38a], 0x20001
mov dword [ebp - 0x386], 0xac44
sub esp, 0xc
mov dword [ebp - 0x382], 0x2b110
imul edx, edx, 0x4b
mov dword [ebp - 0x37e], 0x100004
imul eax, eax, 0x1194
add eax, edx
movzx edx, byte [ebp - 0x331]
add eax, edx
mov edx, dword [ebp - 0x3b4]
sub edx, eax
mov dword [ebx + 0x24], edx
mov edx, dword [ebp - 0x3b0]
sub edx, eax
xor eax, eax
mov dword [ebx + 0x28], edx
xor edx, edx
mov word [ebp - 0x37a], ax
xor eax, eax
mov dword [ebp + eax - 0x354], edx
add eax, 4
cmp eax, 0x18
jb 0x65902b62
lea eax, [ebp - 0x38a]
lea ecx, [ebx + 0x30]
mov dword [ebp - 0x360], 0x24
mov dword [ebp - 0x35c], 0x18000
lea esi, [ebp - 0x360]
mov dword [ebp - 0x358], 0x16650
mov dword [ebp - 0x350], eax
mov eax, dword [ebx + 0x2c]
mov edx, dword [eax]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ecx
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [edx + 0xc]
sub esp, 0x10
test eax, eax
js 0x659027f2
mov eax, dword [ebx + 0x30]
lea ecx, [ebp - 0x3a8]
mov edx, dword [eax]
mov dword [esp + 0x10], ecx
lea ecx, [ebp - 0x3a4]
mov dword [esp + 0x1c], 2
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [edx + 0x2c]
sub esp, 0x20
test eax, eax
js 0x659027f2
mov eax, dword [ebx + 0x24]
mov ecx, dword [ebx + 0x28]
lea edi, [ebp - 0x3ac]
mov dword [ebp - 0x39c], 0
mov dword [ebp - 0x394], 2
mov edx, eax
sub ecx, eax
shl edx, 0xb
mov dword [ebp - 0x3a0], edx
mov edx, 0xdee95c4d
mov eax, edx
mul dword [ebp - 0x358]
mov eax, dword [ebx + 0x18]
mov dword [esp + 0xc], edi
mov dword [esp], 0x10
shr edx, 0xb
cmp ecx, edx
cmovbe edx, ecx
lea ecx, [ebp - 0x3a0]
mov dword [ebp - 0x398], edx
mov edx, dword [ebp - 0x3a8]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x3a4]
mov dword [esp + 4], edx
mov edx, 0x2403e
call sym._device_io.constprop.0
mov ecx, dword [ebp - 0x3a8]
mov edi, eax
mov eax, dword [ebx + 0x30]
mov edx, dword [eax]
mov dword [esp + 8], ecx
mov ecx, dword [ebp - 0x3a4]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [edx + 0x4c]
sub esp, 0x14
test edi, edi
jne 0x65902e30
mov eax, dword [ebx + 0x20]
test eax, eax
je 0x65902e28
lea eax, [ebp - 0x3ac]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], sym._MCICDA_playLoop_4
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateThread]
mov dword [ebx + 0x1c], eax
sub esp, 0x18
test eax, eax
je 0x659027f2
mov eax, dword [ebx + 0x30]
mov edx, dword [eax]
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [edx + 0x30]
sub esp, 0x10
test eax, eax
jns 0x65902905
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
sub esp, 4
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebx + 0x1c]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [ebx + 0x1c], 0
sub esp, 4
jmp 0x659027f2
mov eax, dword [ebp - 0x3b4]
mov dword [esp + 0x14], eax
mov eax, dword [edi + 4]
mov dword [esp + 0xc], str.MCI_FROM_08lX_____lu_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.MCICDA_Play
mov dword [esp + 4], 0x65906018
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x65902626
mov dword [ebx + 0x10], 0
mov eax, 0x106
jmp 0x65902907
mov dword [esp + 0x14], eax
mov eax, dword [edi + 8]
mov dword [esp + 0xc], str.MCI_TO_08lX_____lu_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.MCICDA_Play
mov dword [esp + 4], 0x65906018
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
mov eax, dword [ebp - 0x3b0]
jmp 0x65902671
mov eax, dword [ebx + 0x1c]
jmp 0x65902d16
mov eax, dword [ebp - 0x398]
add dword [ebx + 0x24], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventA]
mov dword [ebx + 0x20], eax
sub esp, 0x10
jmp 0x65902cd5