Function at 0x1800224e8
Capabilities:
Terminate thread

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x50
xor r14d, r14d
xor r12d, r12d
xor esi, esi
cmp qword [rcx], 0xffffffffffffffff
mov rbx, rcx
je 0x1800228f7
lea r13d, [r14 + 1]
mov eax, r13d
lock cmpxchg dword [rcx + 0x18], r13d
je 0x1800228f7
xor eax, eax
lock cmpxchg dword [rcx + 0x18], r13d
cmp qword [rcx], 0xffffffffffffffff
je 0x18002253f
mov rcx, qword [rcx + 0x10]
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea rdx, str.AlertServer_n
mov ecx, 0x66
call fcn.180030818
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r8, qword [rbx + 0x20]
lea rdx, str.begin_wait_hStopEvent_d_n
mov ecx, 0x6a
call fcn.180030818
mov rcx, qword [rbx + 0x20]
mov edx, 0x927c0
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r8, qword [rbx + 0x20]
lea rdx, str.end_wait_hStopEvent_d_n
mov ecx, 0x6d
call fcn.180030818
mov rcx, qword [rbx]
mov eax, 8
mov r8d, eax
mov edx, eax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdx, qword [0x180044088]
cmp qword [rdx + 0x18], 0xffffffffffffffff
mov r15, rax
je 0x1800225cf
mov rcx, qword [rdx + 0x20]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rdx, qword [0x180044088]
cmp qword [rdx + 0x18], 0xffffffffffffffff
jne 0x1800225d3
xor edi, edi
jmp 0x1800225e8
cmp qword [rdx + 0x38], rsi
je 0x1800225cf
mov rax, qword [rdx + 0x30]
mov rcx, qword [rax]
mov qword [rdx + 0x40], rcx
mov rdi, qword [rcx + 0x10]
test rdi, rdi
je 0x18002279b
and qword [rbp + 0x48], rsi
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [rdi + 0x14], eax
jne 0x180022608
mov r12, rdi
jmp 0x180022752
cmp dword [rdi + 0x28], 0
je 0x18002261e
mov rdx, rdi
mov rcx, rbx
call fcn.180024c14
jmp 0x180022752
cmp dword [rdi + 0x24], 0
je 0x180022752
xor edx, edx
lea rcx, [rbp - 0x20]
lea r8d, [rdx + 0x10]
call qword [sym.imp.msvcrt.dll_memset]
lea rcx, [rbp - 0x20]
call qword [sym.imp.KERNEL32.dll_GetSystemTime]
lea rcx, [rbp - 0x20]
call fcn.180021050
mov rcx, qword [rdi + 0xc]
lea rdx, [rbp + 0x40]
mov r13d, eax
call qword [sym.imp.KERNEL32.dll_GetExitCodeThread]
cmp dword [rbp + 0x40], 0x103
je 0x180022691
mov rdx, rdi
mov rcx, rbx
call fcn.180024c14
xor r9d, r9d
xor r8d, r8d
mov rdx, rdi
mov rcx, rbx
mov byte [rsp + 0x20], 2
call fcn.180024c74
mov r13d, 1
jmp 0x180022752
mov ecx, dword [rdi + 0x24]
mov edx, r13d
call fcn.180021118
movzx ecx, word [rdi + 5]
xor edx, edx
cmp eax, ecx
jbe 0x1800226d9
mov rcx, qword [rdi + 0xc]
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rdx, rdi
mov rcx, rbx
call fcn.180024c14
mov r13d, 1
xor r9d, r9d
xor r8d, r8d
mov rdx, rdi
mov rcx, rbx
mov byte [rsp + 0x20], r13b
call fcn.180024c74
jmp 0x180022752
lea rcx, [rbp - 0x10]
mov r8d, 0x10
call qword [sym.imp.msvcrt.dll_memset]
lea rcx, [rbp - 0x10]
call qword [sym.imp.KERNEL32.dll_GetSystemTime]
mov r13, qword [rbp + 0x48]
mov rcx, qword [rbx]
inc r14d
add r13, 8
mov r8, r15
mov r9d, r14d
mov edx, 8
mov qword [rbp + 0x48], r13
shl r9, 3
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
lea rcx, [rbp - 0x10]
mov r15, rax
mov rax, qword [rdi + 0x18]
mov qword [r13 + r15 - 8], rax
call fcn.180021050
mov ecx, dword [rdi + 0x24]
mov edx, eax
call fcn.180021118
movzx ecx, word [rdi + 5]
mov r13d, 1
sub cx, ax
add cx, r13w
cmp cx, si
jbe 0x180022752
movzx esi, cx
mov rdx, qword [0x180044088]
cmp qword [rdx + 0x18], 0xffffffffffffffff
je 0x18002277e
mov rax, qword [rdx + 0x40]
mov rcx, qword [rax]
mov qword [rdx + 0x40], rcx
cmp rcx, qword [rdx + 0x30]
je 0x18002277e
mov rdi, qword [rcx + 0x10]
test rdi, rdi
jne 0x1800225f5
test r12, r12
je 0x18002279b
cmp qword [rdx + 0x18], 0xffffffffffffffff
mov qword [rbp + 0x48], r12
je 0x18002279b
lea rcx, [rdx + 0x28]
lea rdx, [rbp + 0x48]
call fcn.180021bb4
call fcn.18002228c
mov rcx, qword [0x180044088]
cmp qword [rcx + 0x18], 0xffffffffffffffff
je 0x1800227b8
mov rcx, qword [rcx + 0x20]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test r14d, r14d
je 0x1800228b6
imul esi, esi, 0x3e8
mov r8d, r13d
mov rdx, r15
mov r9d, esi
mov ecx, r14d
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov r11, qword [0x180044088]
cmp qword [r11 + 0x18], 0xffffffffffffffff
je 0x1800227ff
mov rcx, qword [r11 + 0x20]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r11, qword [0x180044088]
cmp qword [r11 + 0x18], 0xffffffffffffffff
jne 0x180022806
xor edi, edi
jmp 0x180022894
cmp qword [r11 + 0x38], 0
je 0x1800227ff
mov rax, qword [r11 + 0x30]
mov rcx, qword [rax]
mov qword [r11 + 0x40], rcx
jmp 0x180022890
cmp dword [rdi + 0x24], 0
je 0x180022878
cmp dword [rdi + 0x28], 0
jne 0x180022866
mov rcx, qword [rdi + 0xc]
lea rdx, [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetExitCodeThread]
cmp dword [rbp + 0x40], 0x103
je 0x180022844
mov byte [rsp + 0x20], 2
jmp 0x180022855
mov rcx, qword [rdi + 0xc]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov byte [rsp + 0x20], r13b
xor r9d, r9d
xor r8d, r8d
mov rdx, rdi
mov rcx, rbx
call fcn.180024c74
mov rdx, rdi
mov rcx, rbx
call fcn.180024c14
mov r11, qword [0x180044088]
cmp qword [r11 + 0x18], 0xffffffffffffffff
je 0x180022899
mov rax, qword [r11 + 0x40]
mov rcx, qword [rax]
mov qword [r11 + 0x40], rcx
cmp rcx, qword [r11 + 0x30]
je 0x180022899
mov rdi, qword [rcx + 0x10]
test rdi, rdi
jne 0x18002281a
call fcn.18002228c
mov rcx, qword [0x180044088]
cmp qword [rcx + 0x18], 0xffffffffffffffff
je 0x1800228b6
mov rcx, qword [rcx + 0x20]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test r15, r15
je 0x1800228cb
mov rcx, qword [rbx]
mov r8, r15
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x1800228dc
lea rdx, str._HeapFree__NULL_n
mov ecx, 0xca
call fcn.180030818
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rdx, str.END_n
mov ecx, 0xcd
call fcn.180030818
mov rbx, qword [rsp + 0xa0]
add rsp, 0x50
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret