Function at 0x14004e490
Capabilities:
Create thread

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov qword [rax + 0x10], rdx
push rbp
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x70
mov r12d, dword [rbp + 0x50]
xor eax, eax
mov r15, qword [rbp + 0x58]
mov r13, rdx
xor edx, edx
mov dword [rbp - 0x40], eax
mov rcx, r15
mov qword [rbp - 0x30], rax
lea rdi, [r12*8]
mov qword [rbp - 0x24], rax
mov r8, rdi
mov dword [rbp - 0x1c], eax
mov ebx, eax
mov esi, eax
mov r14d, r12d
call sub.msvcrt.dll_memset
xor r9d, r9d
mov dword [rbp - 0x40], r12d
xor r8d, r8d
mov dword [rbp - 0x3c], r12d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
nop dword [rax + rax]
xor r9d, r9d
lea edx, [rsi + 1]
xor r8d, r8d
mov qword [rbp - 0x38], rax
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
nop dword [rax + rax]
lea rcx, [fcn.14004d990]
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x18], rcx
lea rcx, [0x14004da60]
mov qword [rbp - 0x10], rcx
mov dword [rbp - 0x28], 1
mov qword [rbp - 8], r13
cmp qword [rbp - 0x38], rbx
je 0x14004e740
test rax, rax
je 0x14004e740
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8, rdi
lea edx, [rsi + 8]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
nop dword [rax + rax]
mov rsi, rax
test rax, rax
jne 0x14004e5af
and qword [rsp + 0x20], rax
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmain_sync_x.c
mov ebx, 0x8007000e
lea rcx, str.WimCreateWorkerThreads
mov r9d, ebx
mov r8d, 0x2a0
call fcn.140046874
jmp 0x14004e7a7
mov qword [rbp - 0x20], rsi
xor edi, edi
mov r14d, 0x80070000
cmp edi, r12d
jae 0x14004e6fa
mov rcx, qword [rbp + 0x38]
lea rdx, [rsi + rdi*8]
call fcn.14004d83c
mov ebx, eax
test eax, eax
js 0x14004e693
and qword [rsp + 0x28], 0
lea r9, [rbp - 0x40]
and dword [rsp + 0x20], 0
lea r8, [0x14004e3a0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
nop dword [rax + rax]
mov qword [r15 + rdi*8], rax
test rax, rax
je 0x14004e61f
mov edx, edi
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetThreadIdealProcessor]
nop dword [rax + rax]
inc edi
jmp 0x14004e5bb
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ecx, ax
or ecx, r14d
test eax, eax
cmovle ecx, eax
test ecx, ecx
jns 0x14004e657
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ebx, ax
or ebx, r14d
test eax, eax
cmovle ebx, eax
test ebx, ebx
jns 0x14004e67e
jmp 0x14004e65c
mov ebx, 0x80004005
and qword [rsp + 0x20], 0
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmain_sync_x.c
mov r9d, ebx
lea rcx, str.WimCreateWorkerThreads
mov r8d, 0x2c4
call fcn.140046874
mov rcx, qword [rsi + rdi*8]
call fcn.14004d990
inc edi
test ebx, ebx
jns 0x14004e5bb
jmp 0x14004e6b5
and qword [rsp + 0x20], 0
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmain_sync_x.c
mov r9d, eax
lea rcx, str.WimCreateWorkerThreads
mov r8d, 0x2af
call fcn.140046874
and dword [rbp - 0x28], 0
test edi, edi
je 0x14004e7a4
mov ecx, r12d
sub ecx, edi
mov eax, ecx
not eax
inc eax
lock xadd dword [rbp - 0x40], eax
cmp ecx, eax
jne 0x14004e6e5
mov rcx, qword [rbp - 0x38]
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop dword [rax + rax]
mov rcx, qword [rbp - 0x38]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
nop dword [rax + rax]
jmp 0x14004e713
mov rcx, qword [rbp - 0x38]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
nop dword [rax + rax]
mov eax, r12d
xchg dword [rbp - 0x40], eax
mov rcx, qword [rbp - 0x30]
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop dword [rax + rax]
mov rcx, qword [rbp - 0x38]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
nop dword [rax + rax]
test ebx, ebx
jns 0x14004e7ce
jmp 0x14004e7a4
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ecx, ax
mov r14d, 0x80070000
or ecx, r14d
test eax, eax
cmovle ecx, eax
test ecx, ecx
jns 0x14004e77e
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ebx, ax
or ebx, r14d
test eax, eax
cmovle ebx, eax
test ebx, ebx
jns 0x14004e7ce
jmp 0x14004e783
mov ebx, 0x80004005
and qword [rsp + 0x20], rsi
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmain_sync_x.c
mov r9d, ebx
lea rcx, str.WimCreateWorkerThreads
mov r8d, 0x292
call fcn.140046874
mov r14, r12
test r12d, r12d
je 0x14004e7ce
mov rcx, qword [r15]
test rcx, rcx
je 0x14004e7c4
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
and qword [r15], 0
add r15, 8
sub r14, 1
jne 0x14004e7ac
mov rcx, qword [rbp - 0x38]
test rcx, rcx
je 0x14004e7e3
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
mov rcx, qword [rbp - 0x30]
test rcx, rcx
je 0x14004e7f8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
test rsi, rsi
je 0x14004e81d
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8, rsi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop dword [rax + rax]
lea r11, [rsp + 0x70]
mov eax, ebx
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret