Function at 0x10004af64
Capabilities:
Create thread

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x148
mov rax, qword [0x100165138]
xor rax, rsp
mov qword [rsp + 0x130], rax
mov r13, qword [rsp + 0x1b0]
xor esi, esi
xor r12b, r12b
and qword [rsp + 0x38], rsi
mov r14, r9
mov rbp, r8
xor r15d, r15d
mov rbx, rdx
mov rdi, rcx
mov byte [rsp + 0x31], r12b
mov qword [rsp + 0x40], rsi
mov rcx, qword [0x1001653b8]
lea rax, [0x1001653b8]
cmp rcx, rax
je 0x10004aff0
test byte [rcx + 0x1c], 1
je 0x10004aff0
cmp byte [rcx + 0x19], 4
jb 0x10004aff0
mov rcx, qword [rcx + 0x10]
lea r8, [0x100003cf8]
mov edx, 0xe1
call fcn.10001c7b8
mov rcx, qword [0x1001653b8]
test r13, r13
jne 0x10004afff
mov ebx, 0x80004003
jmp 0x10004b2c6
and qword [r13], rsi
lea rcx, [0x1001665a0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r12b, 1
mov byte [rsp + 0x30], r12b
cmp qword [rdi + 0x10], rsi
jne 0x10004b028
mov ebx, 0x8078000a
jmp 0x10004b2bf
test rbp, rbp
cmove rbp, qword [rdi + 0x10]
cmp byte [rdi + 0x18], sil
je 0x10004b086
mov rcx, qword [0x1001653b8]
lea r13, [0x1001653b8]
cmp rcx, r13
je 0x10004b07c
test byte [rcx + 0x1c], 1
je 0x10004b07c
cmp byte [rcx + 0x19], 2
jb 0x10004b07c
mov eax, dword [rdi + 8]
mov r9d, dword [rdi + 0x38]
mov rcx, qword [rcx + 0x10]
lea r8, [0x100003cf8]
mov edx, 0xe2
mov dword [rsp + 0x20], eax
call fcn.10001e8b4
mov rcx, qword [0x1001653b8]
mov ebx, 0x80780017
jmp 0x10004b2cd
lea rcx, [rsp + 0x60]
xor edx, edx
mov r8d, 0xd0
call sub.msvcrt.dll_memset
mov rax, qword [rbp]
lea r8, [rsp + 0x60]
movdqu xmm5, xmmword [rbx]
movdqu xmmword [rsp + 0x50], xmm5
lea rdx, [rsp + 0x50]
mov rcx, rbp
call qword [rax + 0x58]
mov ebx, eax
test eax, eax
js 0x10004b2bf
lea rcx, [rsp + 0x40]
mov byte [rsp + 0x31], 1
call fcn.10005767c
mov ebx, eax
test eax, eax
jns 0x10004b127
mov rcx, qword [0x1001653b8]
lea r13, [0x1001653b8]
cmp rcx, r13
je 0x10004b11d
test byte [rcx + 0x1c], 1
je 0x10004b11d
cmp byte [rcx + 0x19], 2
jb 0x10004b11d
mov rcx, qword [rcx + 0x10]
lea r8, [0x100003cf8]
mov edx, 0xe3
mov r9d, eax
call fcn.10001c7dc
mov rsi, qword [rsp + 0x40]
mov rcx, qword [0x1001653b8]
jmp 0x10004b2cd
mov rsi, qword [rsp + 0x40]
jmp 0x10004b2cd
mov rsi, qword [rsp + 0x40]
mov rcx, rsi
mov rax, qword [rsi]
call qword [rax + 8]
lea r12, [rsi + 8]
mov rdx, rbp
mov rcx, r12
call fcn.10001d55c
mov rdx, r14
mov rcx, r12
call fcn.10001d10c
xor ebp, ebp
cmp eax, ebp
mov ebx, eax
jl 0x10004b2ba
mov rax, qword [rsi]
lea r8, [rsp + 0x38]
lea rdx, [0x100002c70]
mov rcx, rsi
call qword [rax]
cmp eax, ebp
mov ebx, eax
jge 0x10004b1bd
mov rcx, qword [0x1001653b8]
lea r13, [0x1001653b8]
cmp rcx, r13
je 0x10004b1b3
test byte [rcx + 0x1c], 1
je 0x10004b1b3
cmp byte [rcx + 0x19], 2
jb 0x10004b1b3
mov rcx, qword [rcx + 0x10]
lea r8, [0x100003cf8]
mov edx, 0xe4
mov r9d, eax
call fcn.10001c7dc
mov rcx, qword [0x1001653b8]
mov r12b, byte [rsp + 0x30]
jmp 0x10004b2cd
lea r8, [rsp + 0x60]
mov rdx, rdi
mov rcx, rsi
call fcn.10006301c
cmp eax, ebp
mov ebx, eax
jl 0x10004b2ba
lea r8, [0x1000642f4]
mov r9, rsi
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x28], rbp
mov dword [rsp + 0x20], ebp
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov r15, rax
cmp rax, rbp
jne 0x10004b255
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [0x1001653b8]
lea r13, [0x1001653b8]
cmp rcx, r13
je 0x10004b242
test byte [rcx + 0x1c], 1
je 0x10004b242
cmp byte [rcx + 0x19], 2
jb 0x10004b242
mov rcx, qword [rcx + 0x10]
lea r8, [0x100003cf8]
mov edx, 0xe5
mov r9d, eax
call fcn.10001c7dc
mov rcx, qword [0x1001653b8]
movzx ebx, di
or ebx, 0x80070000
cmp edi, ebp
cmovle ebx, edi
jmp 0x10004b1b3
mov byte [rdi + 0x18], 1
cmp qword [rdi + 0x28], rbp
jne 0x10004b265
cmp qword [rdi + 0x30], rbp
je 0x10004b27d
lea r8, [0x100005fe8]
lea rcx, [0x100005eb0]
mov edx, 0x12fe
call fcn.100099ad8
mov rcx, qword [rsp + 0x38]
mov qword [rdi + 0x28], r12
mov rsi, rbp
mov qword [rdi + 0x30], rcx
mov rax, qword [rcx]
call qword [rax + 8]
mov rax, qword [rsp + 0x38]
mov dword [rdi + 0x38], 3
lea rcx, [0x1001665a0]
mov qword [r13], rax
mov qword [rsp + 0x38], rbp
mov r12b, bpl
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x10004b2bf
mov r12b, byte [rsp + 0x30]
mov rcx, qword [0x1001653b8]
lea r13, [0x1001653b8]
mov rdx, qword [rsp + 0x38]
test rdx, rdx
je 0x10004b2e7
mov rax, qword [rdx]
mov rcx, rdx
call qword [rax + 0x10]
mov rcx, qword [0x1001653b8]
test r15, r15
je 0x10004b2fc
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [0x1001653b8]
test rsi, rsi
je 0x10004b311
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x10]
mov rcx, qword [0x1001653b8]
cmp byte [rsp + 0x31], 0
je 0x10004b329
lea rcx, [rsp + 0x60]
call fcn.1000a9128
mov rcx, qword [0x1001653b8]
test ebx, ebx
jns 0x10004b35d
cmp rcx, r13
je 0x10004b383
test byte [rcx + 0x1c], 1
je 0x10004b35d
cmp byte [rcx + 0x19], 2
jb 0x10004b35d
mov rcx, qword [rcx + 0x10]
lea r8, [0x100003cf8]
mov edx, 0xe6
mov r9d, ebx
call fcn.10001c7dc
mov rcx, qword [0x1001653b8]
cmp rcx, r13
je 0x10004b383
test byte [rcx + 0x1c], 1
je 0x10004b383
cmp byte [rcx + 0x19], 4
jb 0x10004b383
mov rcx, qword [rcx + 0x10]
lea r8, [0x100003cf8]
mov edx, 0xe7
call fcn.10001c7b8
test r12b, r12b
je 0x10004b395
lea rcx, [0x1001665a0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, ebx
mov rcx, qword [rsp + 0x130]
xor rcx, rsp
call fcn.10014e480
add rsp, 0x148
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret