Function at 0x50a870
Capabilities:
Create thread

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x70
lea rsi, [rcx + 0x60]
mov rbx, rcx
mov rdi, rdx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [rbx + 0x88]
mov qword [rdi + 8], rax
cmp qword [rbx + 0x50], 0
mov qword [rbx + 0x88], rdi
je 0x50a9d1
cmp qword [rbx + 0x48], 0
je 0x50a8d0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop
add rsp, 0x70
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov ecx, 0x10
call fcn.007da0a0
mov qword [rax], 0
mov ecx, 0x20
mov rbp, rax
mov qword [rax + 8], 0
call fcn.007da0a0
mov rdi, rax
xor r9d, r9d
xor ecx, ecx
mov r13, qword [sym.imp.KERNEL32.dll_CreateEventW]
lea rax, [0x00845a40]
mov qword [rdi + 0x18], rbx
xor r8d, r8d
mov edx, 1
mov qword [rdi], rax
call r13
test rax, rax
mov r12, rax
mov qword [rdi + 8], rax
je 0x50aa70
xor r9d, r9d
xor r8d, r8d
mov edx, 1
xor ecx, ecx
call r13
test rax, rax
mov qword [rbp + 8], rax
mov qword [rdi + 0x10], rax
je 0x50aa30
lea rax, [rsp + 0x3c]
mov dword [rsp + 0x3c], 0
mov r9, rdi
xor ecx, ecx
mov qword [rsp + 0x28], rax
lea r8, [0x004fc4c0]
mov edx, 0x10000
mov dword [rsp + 0x20], 0
call qword [sym.imp.msvcrt.dll__beginthreadex]
test rax, rax
mov qword [rbp], rax
je 0x50aad0
test r12, r12
je 0x50a9a9
mov edx, 0xffffffff
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdi, qword [rbx + 0x48]
test rdi, rdi
je 0x50a9c8
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, 0x10
mov rcx, rdi
call fcn.007da070
mov qword [rbx + 0x48], rbp
jmp 0x50a8b5
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateWaitableTimerW]
test rax, rax
mov qword [rbx + 0x50], rax
je 0x50ab30
movabs rdx, 0xffffffff4d2fa200
mov dword [rsp + 0x28], 0
xor r9d, r9d
mov r8d, 0x493e0
mov qword [rsp + 0x60], rdx
lea rdx, [rsp + 0x60]
mov rcx, rax
mov qword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_SetWaitableTimer]
jmp 0x50a8ae
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r13d, eax
mov edx, 0x20
mov rcx, rdi
call fcn.007da070
call fcn.004d6fb0
test r13d, r13d
mov dword [rsp + 0x50], r13d
mov qword [rsp + 0x58], rax
je 0x50a94f
lea rcx, [rsp + 0x50]
lea rdx, str.thread.exit_event
call fcn.00508150
nop
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r14d, eax
mov edx, 0x20
mov rcx, rdi
call fcn.007da070
call fcn.004d6fb0
test r14d, r14d
mov dword [rsp + 0x40], r14d
mov qword [rsp + 0x48], rax
je 0x50a92e
lea rcx, [rsp + 0x40]
lea rdx, str.thread.entry_event
call fcn.00508150
mov edx, 0x10
mov rcx, rbp
mov rbx, rax
call fcn.007da070
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, rbx
call fcn.0067d310
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, 0x20
mov rcx, rdi
mov r13d, eax
call fcn.007da070
test r12, r12
je 0x50aaf4
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 8]
test rcx, rcx
je 0x50ab03
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.004d6fb0
test r13d, r13d
mov dword [rsp + 0x60], r13d
mov qword [rsp + 0x68], rax
je 0x50a98d
lea rcx, [rsp + 0x60]
lea rdx, str.thread
call fcn.00508150
nop dword [rax]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call fcn.004d6fb0
test edi, edi
mov dword [rsp + 0x60], edi
mov qword [rsp + 0x68], rax
je 0x50ab63
lea rcx, [rsp + 0x60]
lea rdx, str.timer
call fcn.00508150
mov rbx, rax
jmp 0x50aabf
mov rax, qword [rbx + 0x50]
jmp 0x50a9eb