Function at 0x140036990
Capabilities:
Create thread

Disassembly:
push rdi
sub rsp, 0x40
mov qword [rsp + 0x30], 0xfffffffffffffffe
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x58], rbp
mov qword [rsp + 0x68], rsi
mov rdi, rdx
mov rbx, rcx
lea rbp, [0x1419951e0]
mov rcx, rbp
call fcn.140069150
mov rax, rbp
or rax, 1
mov qword [rsp + 0x60], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x1419951e8]
jne 0x1400369eb
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140036c37
mov rax, qword [0x141990008]
mov edx, dword [rax + 8]
btr edx, 0x1f
mov r8d, dword [rax + 4]
inc r8d
mov ecx, dword [rax]
cmp ecx, 1
ja 0x140036a0e
cmp edx, r8d
jb 0x140036a11
jmp 0x140036a45
cmp edx, r8d
sbb r9d, r9d
and r9d, 8
mov rax, qword [0x141990008]
cmp r8d, edx
jbe 0x140036a2d
mov r8d, dword [rax + 4]
inc r8d
jmp 0x140036a36
mov r8d, dword [rax + 8]
btr r8d, 0x1f
mov edx, dword [rax + 4]
lea rcx, [0x141990008]
call fcn.140036c60
mov rax, qword [0x141990008]
movsxd rdx, dword [rax + 4]
mov rcx, qword [rax + 0x10]
lea rdx, [rcx + rdx*8]
mov qword [rdx + rax], rbx
mov rax, qword [0x141990008]
inc dword [rax + 4]
mov rax, qword [0x141990010]
mov edx, dword [rax + 8]
btr edx, 0x1f
mov r8d, dword [rax + 4]
inc r8d
mov ecx, dword [rax]
cmp ecx, 1
ja 0x140036a89
cmp edx, r8d
jb 0x140036a8c
jmp 0x140036ac0
cmp edx, r8d
sbb r9d, r9d
and r9d, 8
mov rax, qword [0x141990010]
cmp r8d, edx
jbe 0x140036aa8
mov r8d, dword [rax + 4]
inc r8d
jmp 0x140036ab1
mov r8d, dword [rax + 8]
btr r8d, 0x1f
mov edx, dword [rax + 4]
lea rcx, [0x141990010]
call fcn.140036c60
mov rax, qword [0x141990010]
movsxd rdx, dword [rax + 4]
mov rcx, qword [rax + 0x10]
lea rdx, [rcx + rdx*8]
mov qword [rdx + rax], rdi
mov rax, qword [0x141990010]
inc dword [rax + 4]
cmp dword [0x1419951e8], 0
jne 0x140036c29
cmp qword [0x1419951f0], 0
jne 0x140036bf6
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [0x1419951f0], rax
mov rax, qword [0x141990008]
mov ecx, dword [rax]
cmp ecx, 1
jbe 0x140036b63
mov rax, qword [0x141990008]
mov r8d, dword [rax + 8]
and r8d, 0x7fffffff
jne 0x140036b51
lea r9d, [r8 + 2]
xor r8d, r8d
mov edx, 8
mov ecx, edx
call fcn.140049ae0
mov qword [0x141990008], rax
jmp 0x140036b63
xor r9d, r9d
mov edx, dword [rax + 4]
lea rcx, [0x141990008]
call fcn.140036c60
mov rsi, qword [0x1419951f0]
mov rax, qword [0x141990008]
mov ecx, dword [rax]
mov rax, qword [0x141990008]
cmp ecx, 1
ja 0x140036b92
mov r8d, dword [rax + 8]
btr r8d, 0x1f
mov edx, dword [rax + 4]
inc edx
cmp edx, r8d
jle 0x140036bb2
mov edx, dword [rax + 4]
lea r8d, [rdx + 1]
mov r9d, 8
lea rcx, [0x141990008]
call fcn.140036c60
mov rax, qword [0x141990008]
mov rdi, qword [rax + 0x10]
add rdi, rax
lea rbx, [rdi + 8]
movsxd r8, dword [rax + 4]
shl r8, 3
mov rdx, rdi
mov rcx, rbx
call fcn.140123ea0
cmp rbx, rdi
je 0x140036bec
nop word [rax + rax]
sub rbx, 8
mov qword [rbx], rsi
cmp rbx, rdi
jne 0x140036be0
mov rax, qword [0x141990008]
inc dword [rax + 4]
lea rax, [0x1419951e8]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
xor r9d, r9d
lea r8, [0x1400364b0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140036c37
mov rcx, qword [0x1419951f0]
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
and rbp, 0xfffffffffffffffe
mov rcx, rbp
mov rbx, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x68]
add rsp, 0x40
pop rdi
jmp fcn.140069660