Function at 0x140089bb0
Capabilities:
Create thread

Disassembly:
sub rsp, 0x58
mov rax, qword [0x140672360]
xor rax, rsp
mov qword [rsp + 0x48], rax
cmp qword [0x140687990], 0
jne 0x140089be1
xor al, al
mov rcx, qword [rsp + 0x48]
xor rcx, rsp
call fcn.140359070
add rsp, 0x58
ret
movzx eax, byte [0x1406869ee]
test al, al
jne 0x140089ec3
mov edx, 0xfa0
mov qword [rsp + 0x68], rsi
lea rcx, [0x140686a78]
call fcn.1401d2870
mov edx, 0xfa0
lea rcx, [0x140686aa0]
call fcn.1401d2870
mov edx, 0xfa0
lea rcx, [0x140686a30]
call fcn.1401d2870
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
lea edx, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateEventW]
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov qword [0x140686ad0], rax
lea edx, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateEventW]
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov qword [0x140686a68], rax
lea edx, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [0x140686a60], rax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
xor esi, esi
mov dword [0x140686a58], eax
xor eax, eax
lock cmpxchg dword [0x1406878ec], esi
jne 0x140089ca9
mov edx, 0xfa0
lea rcx, [0x1406869b8]
call fcn.1401d2870
mov eax, 1
xchg dword [0x1406878ec], eax
lea rax, [rsp + 0x30]
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea r8, [0x14008a630]
xor edx, edx
mov dword [rsp + 0x20], esi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov qword [0x140686ac8], rax
xor r9d, r9d
lea r8, [0x14008ba80]
xor edx, edx
lea rax, [rsp + 0x30]
xor ecx, ecx
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], esi
call qword [sym.imp.KERNEL32.dll_CreateThread]
cmp qword [0x140686ac8], rsi
mov qword [0x140686a70], rax
je 0x140089eb7
test rax, rax
je 0x140089eb7
mov qword [rsp + 0x60], rbx
mov qword [rsp + 0x50], rdi
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea rcx, [0x140686aa0]
mov rdi, rsi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rdx, qword [0x140687948]
mov rcx, rdx
mov rax, qword [rdx + 8]
cmp byte [rax + 0x19], sil
jne 0x140089d5e
cmp dword [rax + 0x20], esi
jge 0x140089d52
mov rax, qword [rax + 0x10]
jmp 0x140089d58
mov rcx, rax
mov rax, qword [rax]
cmp byte [rax + 0x19], sil
je 0x140089d47
cmp byte [rcx + 0x19], sil
jne 0x140089dd5
cmp dword [rcx + 0x20], esi
jg 0x140089dd5
cmp rcx, rdx
je 0x140089dc1
mov r8, qword [rcx + 0x28]
test r8, r8
je 0x140089dc1
mov r10, qword [r8 + 0x20]
test r10, r10
je 0x140089dc1
mov r9, qword [r8 + 0x18]
mov rax, qword [r8 + 0x10]
mov rcx, r9
dec rax
and ecx, 1
mov rdx, r9
shr rdx, 1
and rdx, rax
mov rax, qword [r8 + 8]
mov rax, qword [rax + rdx*8]
mov rdi, qword [rax + rcx*8]
lea rax, [r10 - 1]
mov qword [r8 + 0x20], rax
test rax, rax
jne 0x140089db9
mov qword [r8 + 0x18], rsi
jmp 0x140089dc1
lea rax, [r9 + 1]
mov qword [r8 + 0x18], rax
lea rcx, [0x140686aa0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test rdi, rdi
jne 0x140089dfc
jmp 0x140089de2
lea rcx, [0x140686aa0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor ecx, ecx
call fcn.14008bf20
mov rdi, rax
mov rcx, qword [rax]
mov rax, qword [rcx + 8]
mov rcx, rdi
call qword [case.0x1401cd220.0]
lea rcx, [rdi + 0x10]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov dword [rdi + 0x28], 1
mov dword [rdi + 0x18], ebx
test ebx, ebx
je 0x140089e84
xorps xmm0, xmm0
lea rcx, [rsp + 0x38]
mov edx, ebx
movups xmmword [rsp + 0x38], xmm0
call fcn.14009bfc0
mov rax, qword [rsp + 0x38]
test rax, rax
je 0x140089e39
mov rax, qword [rax]
mov qword [rdi + 0x20], rax
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x140089e84
mov esi, 0xffffffff
mov eax, esi
lock xadd dword [rcx + 8], eax
cmp eax, 1
jne 0x140089e84
mov rbx, qword [rsp + 0x40]
mov rcx, rbx
mov rax, qword [rbx]
mov rax, qword [rax]
call qword [case.0x1401cd220.0]
lock xadd dword [rbx + 0xc], esi
cmp esi, 1
jne 0x140089e84
mov rcx, qword [rsp + 0x40]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
call qword [case.0x1401cd220.0]
mov rcx, rdi
call fcn.14008c6b0
mov rcx, qword [0x140686a60]
mov rdi, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x60]
test rcx, rcx
je 0x140089ead
mov edx, 0x1388
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov al, 1
mov byte [0x1406869ee], al
jmp 0x140089ebe
movzx eax, byte [0x1406869ee]
mov rsi, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x48]
xor rcx, rsp
call fcn.140359070
add rsp, 0x58
ret