Function at 0x1004ce50
Capabilities:
Create thread

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov esi, dword [esp + 0x70]
test esi, esi
js 0x1004d0c8
je 0x1004d070
mov ebx, dword [esp + 0x6c]
test ebx, ebx
je 0x1004d09c
mov dword [esp], 0x34
call sym.avutil_lav_57.dll_mv_mallocz
mov ecx, eax
mov eax, dword [esp + 0x60]
test ecx, ecx
mov dword [eax], ecx
je 0x1004d107
mov dword [esp + 0x30], esi
mov dword [esp + 0x2c], ecx
mov eax, dword [esp + 0x30]
mov ecx, 0x20
mov dword [esp + 4], ecx
mov dword [esp], eax
call sym.avutil_lav_57.dll_mv_calloc
mov ecx, dword [esp + 0x2c]
mov dword [ecx], eax
test eax, eax
je 0x1004d0fb
mov dword [ecx + 4], esi
mov eax, dword [esp + 0x64]
mov dword [ecx + 8], 0
mov dword [ecx + 0xc], 0
mov dword [ecx + 0x24], 0
mov dword [ecx + 0x28], eax
mov eax, dword [esp + 0x68]
mov dword [ecx + 0x2c], eax
mov eax, dword [esp + 0x6c]
mov dword [ecx + 0x30], eax
lea eax, [ecx + 0x18]
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 0
mov dword [esp], eax
mov dword [esp + 0x2c], ecx
mov eax, dword [sym.imp.KERNEL32.dll_InitializeSRWLock]
mov dword [esp + 0x3c], eax
call eax
sub esp, 4
mov ecx, dword [esp + 0x2c]
lea eax, [ecx + 0x1c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
mov dword [esp + 0x38], eax
call eax
sub esp, 4
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
test edx, edx
mov dword [ecx + 0x20], 0
je 0x1004d02d
mov dword [esp + 0x34], ecx
mov edi, dword [sym.imp.KERNEL32.dll_SleepConditionVariableSRW]
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x70], esi
lea esi, [esi]
lea esi, [esi]
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x2c]
mov ebx, dword [eax]
shl edx, 5
add edx, ebx
mov dword [edx], eax
lea ebx, [edx + 4]
mov eax, dword [esp + 0x3c]
mov dword [esp], ebx
mov ebp, edx
call eax
lea esi, [ebp + 8]
sub esp, 4
mov dword [esp], esi
mov eax, dword [esp + 0x38]
call eax
sub esp, 4
mov dword [esp], ebx
call sub.KERNEL32.dll_AcquireSRWLockExclusive
xor eax, eax
mov dword [ebp + 0x1c], 0
mov dword [ebp + 0x10], 0x1004ca00
mov dword [ebp + 0x14], ebp
sub esp, 4
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x10], eax
lea eax, [ebp + 0xc]
mov dword [esp + 0xc], eax
mov eax, 0x1004c9d0
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__beginthreadex]
mov dword [ebp + 0xc], eax
test eax, eax
jne 0x1004d003
jmp 0x1004d037
mov dword [esp + 4], ebx
xor edx, edx
mov ecx, 0xffffffff
mov dword [esp + 0xc], edx
mov dword [esp + 8], ecx
mov dword [esp], esi
call edi
sub esp, 0x10
mov eax, dword [ebp + 0x1c]
test eax, eax
je 0x1004cfe8
mov dword [esp], ebx
call sub.KERNEL32.dll_ReleaseSRWLockExclusive
sub esp, 4
inc dword [esp + 0x2c]
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
cmp eax, ecx
jne 0x1004cf60
mov esi, dword [esp + 0x70]
mov eax, esi
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [esp + 0x6c], 1
mov ecx, dword [esp + 0x34]
adc dword [esp + 0x2c], 0
mov eax, dword [esp + 0x2c]
mov dword [ecx + 4], eax
mov dword [esp], ebx
call sub.KERNEL32.dll_ReleaseSRWLockExclusive
sub esp, 4
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call sym.avutil_lav_57.dll_mvpriv_slicethread_free
add esp, 0x4c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
call sym.avutil_lav_57.dll_mv_cpu_count
mov esi, 1
cmp eax, 1
jle 0x1004ce69
mov ebx, dword [esp + 0x6c]
mov edx, 0xf
cmp eax, edx
cmovg eax, edx
lea esi, [eax + 1]
test ebx, ebx
jne 0x1004ce75
mov dword [esp], 0x34
lea edi, [esi - 1]
mov dword [esp + 0x30], edi
call sym.avutil_lav_57.dll_mv_mallocz
mov ecx, eax
mov eax, dword [esp + 0x60]
test ecx, ecx
mov dword [eax], ecx
je 0x1004d107
test edi, edi
je 0x1004cebc
jmp 0x1004ce95
mov dword [esp + 0x14], 0x6a
xor esi, esi
mov dword [esp + 0x10], str.libavutil_slicethread.c
mov dword [esp + 0xc], str.nb_threads___0
mov dword [esp + 8], 0x100bfb14
mov dword [esp + 4], esi
mov dword [esp], esi
call sym.avutil_lav_57.dll_mv_log
call sub.msvcrt.dll_abort
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call sym.avutil_lav_57.dll_mv_freep
mov eax, 0xfffffff4
jmp 0x1004d02f