Function at 0x582240
Capabilities:
Create thread

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [esp + 0x70]
test ebx, ebx
js 0x5824e9
je 0x582471
mov ecx, dword [esp + 0x6c]
test ecx, ecx
je 0x582494
mov dword [esp], 0x34
call fcn.0056e410
mov edx, dword [esp + 0x60]
test eax, eax
mov dword [esp + 0x30], eax
mov dword [edx], eax
je 0x58241d
mov eax, dword [esp + 0x70]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], 0x20
mov dword [esp], eax
call fcn.0056e490
mov edx, dword [esp + 0x30]
test eax, eax
mov dword [edx], eax
je 0x5824d0
mov edi, dword [esp + 0x30]
mov eax, dword [esp + 0x64]
mov dword [edi + 0x28], eax
mov eax, dword [esp + 0x68]
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [edi + 0x24], 0
mov dword [edi + 0x2c], eax
mov eax, dword [esp + 0x6c]
mov dword [edi + 0x30], eax
mov eax, dword [esp + 0x70]
mov dword [edi + 4], eax
lea eax, [edi + 0x18]
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 0
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_InitializeSRWLock]
mov dword [esp + 0x38], eax
call eax
lea eax, [edi + 0x1c]
sub esp, 4
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
mov dword [esp + 0x3c], eax
call eax
sub esp, 4
mov dword [edi + 0x20], 0
mov edx, dword [esp + 0x34]
test edx, edx
je 0x582411
mov ebp, dword [sym.imp.KERNEL32.dll_SleepConditionVariableSRW]
mov dword [esp + 0x2c], 0
lea esi, [esi]
mov eax, dword [esp + 0x30]
mov ebx, dword [esp + 0x2c]
shl ebx, 5
add ebx, dword [eax]
lea esi, [ebx + 4]
lea edi, [ebx + 8]
mov dword [ebx], eax
mov eax, dword [esp + 0x38]
mov dword [esp], esi
call eax
sub esp, 4
mov eax, dword [esp + 0x3c]
mov dword [esp], edi
call eax
sub esp, 4
mov dword [esp], esi
call sub.KERNEL32.dll_AcquireSRWLockExclusive
lea eax, [ebx + 0xc]
sub esp, 4
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x10], 0x581e30
mov dword [ebx + 0x14], ebx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x581e00
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__beginthreadex]
test eax, eax
mov dword [ebx + 0xc], eax
jne 0x5823ec
jmp 0x582431
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], esi
mov dword [esp], edi
call ebp
sub esp, 0x10
mov eax, dword [ebx + 0x1c]
test eax, eax
je 0x5823d0
mov dword [esp], esi
call sub.KERNEL32.dll_ReleaseSRWLockExclusive
sub esp, 4
add dword [esp + 0x2c], 1
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x34]
jne 0x582340
mov eax, dword [esp + 0x70]
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x70], 0xfffffff4
mov eax, dword [esp + 0x70]
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [esp + 0x6c], 1
mov edx, dword [esp + 0x30]
adc dword [esp + 0x2c], 0
mov eax, dword [esp + 0x2c]
mov dword [edx + 4], eax
mov dword [esp], esi
call sub.KERNEL32.dll_ReleaseSRWLockExclusive
sub esp, 4
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call fcn.00582150
mov dword [esp + 0x70], 0xffffffff
mov eax, dword [esp + 0x70]
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.0055c250
mov ecx, dword [esp + 0x6c]
lea edx, [eax + 1]
cmp eax, 1
mov eax, 1
cmovg eax, edx
test ecx, ecx
mov dword [esp + 0x70], eax
jne 0x582265
mov eax, dword [esp + 0x70]
mov dword [esp], 0x34
lea edi, [eax - 1]
mov dword [esp + 0x34], edi
call fcn.0056e410
mov edx, dword [esp + 0x60]
test eax, eax
mov dword [esp + 0x30], eax
mov dword [edx], eax
je 0x58241d
test edi, edi
je 0x5822ad
jmp 0x58228b
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call fcn.0056e3f0
mov dword [esp + 0x70], 0xfffffff4
jmp 0x582411
mov dword [esp + 0x14], 0x66
mov dword [esp + 0x10], str.libavutil_slicethread.c
mov dword [esp + 0xc], str.nb_threads___0
mov dword [esp + 8], 0x70ea4c
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.0056b9c0
call sub.msvcrt.dll_abort
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop