Function at 0x4039a0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
mov esi, ecx
mov eax, 8
mov ecx, dword [esi + 0x3d58]
cmp ecx, eax
cmovg ecx, eax
mov eax, dword [esi + 0x2f90]
cmp ecx, eax
cmovg ecx, eax
mov dword [esi + 0x3d54], 0
mov dword [esi + 0x3d64], 0
cmp ecx, 1
jle 0x403c10
lea eax, [ecx - 1]
push ebx
lea ebx, [eax*4]
mov dword [esi + 0x3d60], eax
push edi
lea eax, [ebx + 0xb]
push eax
mov dword [esi + 0x3d54], 1
xor edi, edi
call fcn.005ca1dc
add esp, 4
test eax, eax
je 0x403a22
lea edi, [eax + 0xb]
push ebx
and edi, 0xfffffff8
push 0
push edi
mov dword [edi - 4], eax
call fcn.005c8040
add esp, 0xc
mov dword [esi + 0x3da0], edi
test edi, edi
jne 0x403a42
push str.Failed_to_allocate__pbi__h_decoding_thread_
lea eax, [esi + 0xf50]
push 2
push eax
call fcn.00401060
add esp, 0xc
mov eax, dword [esi + 0x3d60]
xor edi, edi
lea ebx, [eax*4]
lea eax, [ebx + 0xb]
push eax
call fcn.005ca1dc
add esp, 4
test eax, eax
je 0x403a76
lea edi, [eax + 0xb]
push ebx
and edi, 0xfffffff8
push 0
push edi
mov dword [edi - 4], eax
call fcn.005c8040
add esp, 0xc
mov dword [esi + 0x3da4], edi
test edi, edi
jne 0x403a96
push str.Failed_to_allocate__pbi__h_event_start_decoding_
lea eax, [esi + 0xf50]
push 2
push eax
call fcn.00401060
add esp, 0xc
mov eax, dword [esi + 0x3d60]
imul eax, eax, 0xf40
add eax, 0x23
push eax
xor edi, edi
call fcn.005ca1dc
add esp, 4
test eax, eax
je 0x403abd
lea edi, [eax + 0x23]
and edi, 0xffffffe0
mov dword [edi - 4], eax
mov dword [esi + 0x3d98], edi
test edi, edi
jne 0x403add
push str.Failed_to_allocate__pbi__mb_row_di_
lea eax, [esi + 0xf50]
push 2
push eax
call fcn.00401060
add esp, 0xc
mov eax, dword [esi + 0x3d60]
imul eax, eax, 0xf40
push eax
push 0
push dword [esi + 0x3d98]
call fcn.005c8040
mov eax, dword [esi + 0x3d60]
xor edi, edi
lea ebx, [eax + eax*2]
shl ebx, 2
lea eax, [ebx + 0xb]
push eax
call fcn.005ca1dc
add esp, 0x10
test eax, eax
je 0x403b2a
lea edi, [eax + 0xb]
push ebx
and edi, 0xfffffff8
push 0
push edi
mov dword [edi - 4], eax
call fcn.005c8040
add esp, 0xc
mov dword [esi + 0x3d9c], edi
test edi, edi
jne 0x403b4a
push str.Failed_to_allocate__pbi__de_thread_data_
lea eax, [esi + 0xf50]
push 2
push eax
call fcn.00401060
add esp, 0xc
mov eax, dword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
xor ebx, ebx
cmp dword [esi + 0x3d60], ebx
jbe 0x403bef
xor edi, edi
mov dword [ebp - 4], ebx
push 0
push 0x8000
push 0
push 0
call eax
mov ecx, dword [esi + 0x3da4]
mov dword [ecx + ebx*4], eax
mov ecx, dword [esi + 0x3d98]
add ecx, dword [ebp - 4]
call fcn.00405930
mov eax, dword [esi + 0x3d9c]
push 0
mov dword [edi + eax], ebx
mov eax, dword [esi + 0x3d9c]
push 0
mov dword [edi + eax + 4], esi
mov ecx, dword [esi + 0x3d98]
mov eax, dword [esi + 0x3d9c]
add ecx, dword [ebp - 4]
mov dword [edi + eax + 8], ecx
mov eax, dword [esi + 0x3d9c]
add eax, edi
push eax
push 0x403910
push 0
push 0
call fcn.005caa5d
mov ecx, dword [esi + 0x3da0]
add dword [ebp - 4], 0xf40
mov dword [ecx + ebx*4], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
inc ebx
add esp, 0x18
add edi, 0xc
cmp ebx, dword [esi + 0x3d60]
jb 0x403b62
push 0
push 0x8000
push 0
push 0
call eax
mov dword [esi + 0x3da8], eax
mov eax, dword [esi + 0x3d60]
pop edi
mov dword [esi + 0x3d64], eax
pop ebx
pop esi
mov esp, ebp
pop ebp
ret