Function at 0xc42260
Capabilities:
Create thread

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx + 0x1e908]
mov dword [ebx + 0x2c5b0], 0
mov dword [ebx + 0x2c5b4], 0
cmp eax, 1
jle 0xc4250d
mov edx, dword [ebx + 0x1f75c]
cmp edx, 1
jle 0xc4250d
lea ecx, [edx - 1]
cmp eax, edx
mov dword [esp + 0x2c], ecx
lea ecx, [eax - 1]
mov eax, dword [ebx + 0x1ce1c]
cmovge ecx, dword [esp + 0x2c]
mov edx, eax
sar edx, 0x1f
idiv dword [ebx + 0x2c5ac]
mov dword [esp + 0x2c], ecx
cmp ecx, eax
jge 0xc42515
mov esi, dword [esp + 0x2c]
shl esi, 2
mov dword [esp], esi
call fcn.00c2e700
test eax, eax
mov dword [ebx + 0x2c5b8], eax
je 0xc4252a
mov dword [esp], esi
call fcn.00c2e700
test eax, eax
mov dword [ebx + 0x2c5d0], eax
je 0xc4254d
imul esi, dword [esp + 0x2c], 0x93e0
mov dword [esp], 0x20
mov dword [esp + 4], esi
call fcn.00c2e6c0
test eax, eax
mov dword [ebx + 0x2c5c0], eax
je 0xc42570
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov ecx, dword [esp + 0x2c]
lea eax, [ecx + ecx*2]
shl eax, 2
mov dword [esp], eax
call fcn.00c2e700
test eax, eax
mov dword [ebx + 0x2c5c4], eax
je 0xc42599
mov eax, dword [ebx + 0x1ce18]
shl eax, 2
mov dword [esp], eax
call fcn.00c2e700
test eax, eax
mov dword [ebx + 0x2c5a8], eax
je 0xc425bc
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateSemaphoreA
mov dword [ebx + 0x2c5b0], 1
sub esp, 0x10
mov ecx, dword [esp + 0x2c]
mov dword [ebx + 0x2c5d4], eax
test ecx, ecx
mov dword [ebx + 0x2c5b4], ecx
jle 0xc42471
xor ecx, ecx
xor esi, esi
mov edx, dword [ebx + 0x2c5d0]
lea ebp, [esi*4]
mov edi, dword [ebx + 0x2c5c4]
mov dword [esp + 0x24], ecx
mov dword [esp + 0xc], 0
add edx, ebp
add edi, ecx
mov dword [esp + 0x28], edx
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateSemaphoreA
sub esp, 0x10
mov edx, dword [esp + 0x28]
mov dword [edx], eax
imul eax, esi, 0x93e0
add eax, dword [ebx + 0x2c5c0]
mov dword [edi], esi
add esi, 1
mov dword [edi + 4], ebx
mov dword [edi + 8], eax
add ebp, dword [ebx + 0x2c5b8]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0xc412b0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.msvcrt.dll__beginthreadex
mov ecx, dword [esp + 0x24]
add ecx, 0xc
cmp esi, dword [esp + 0x2c]
mov dword [ebp], eax
jne 0xc423c4
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateSemaphoreA
sub esp, 0x10
mov dword [ebx + 0x2c5d8], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateSemaphoreA
mov dword [ebx + 0x2c5cc], ebx
mov dword [ebx + 0x2c5dc], eax
sub esp, 0x10
lea eax, [ebx + 0x2c5c8]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xc41230
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.msvcrt.dll__beginthreadex
mov dword [ebx + 0x2c5bc], eax
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
sub eax, 1
mov dword [esp + 0x2c], eax
jne 0xc422cb
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebx + 0x19bc0]
mov dword [esp + 8], str.Failed_to_allocate_cpi__h_encoding_thread
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.00c411c0
jmp 0xc422e8
lea eax, [ebx + 0x19bc0]
mov dword [esp + 8], str.Failed_to_allocate_cpi__h_event_start_encoding
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.00c411c0
jmp 0xc422fe
lea eax, [ebx + 0x19bc0]
mov dword [esp], eax
mov dword [esp + 8], str.Failed_to_allocate_cpi__mb_row_ei
mov dword [esp + 4], 2
call fcn.00c411c0
mov eax, dword [ebx + 0x2c5c0]
jmp 0xc42324
lea eax, [ebx + 0x19bc0]
mov dword [esp + 8], str.Failed_to_allocate_cpi__en_thread_data
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.00c411c0
jmp 0xc42358
lea eax, [ebx + 0x19bc0]
mov dword [esp + 8], str.Failed_to_allocate_cpi__mt_current_mb_col
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.00c411c0
jmp 0xc42377