Function at 0x180061b60
Capabilities:
Resume thread

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r15
sub rsp, 0x30
xor r15d, r15d
mov rdi, rcx
mov ebp, r15d
mov ebx, r15d
xor eax, eax
mov esi, 1
lock cmpxchg dword [0x18022ba98], esi
je 0x180061ba9
cmp rbx, 0x20
jae 0x180061b92
xor ecx, ecx
jmp 0x180061b94
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_Sleep]
inc rbx
xor eax, eax
lock cmpxchg dword [0x18022ba98], esi
jne 0x180061b88
cmp qword [0x18022baa0], rbp
mov qword [rsp + 0x60], r12
mov qword [rsp + 0x70], r13
je 0x180061dae
mov edx, dword [0x180231d8c]
mov ebx, r15d
test edx, edx
je 0x180061be6
mov r10, qword [0x180231d80]
mov rax, r10
cmp rdi, qword [rax]
je 0x180061bf0
inc ebx
add rax, 0x38
cmp ebx, edx
jb 0x180061bd7
mov ebp, 4
jmp 0x180061db3
cmp ebx, 0xffffffff
je 0x180061be6
mov eax, ebx
mov r12d, ebx
imul r13, rax, 0x38
test byte [r10 + r13 + 0x20], 2
je 0x180061cad
xor r8d, r8d
lea rcx, [rsp + 0x20]
mov edx, ebx
call fcn.180061400
mov ebp, eax
test eax, eax
jne 0x180061db3
xor edx, edx
mov ecx, ebx
call fcn.1800615e0
mov ebp, eax
cmp qword [rsp + 0x20], r15
je 0x180061c98
mov eax, dword [rsp + 0x2c]
test eax, eax
je 0x180061c84
mov rdi, qword [rsp + 0x20]
mov esi, eax
nop dword [rax]
nop dword [rax + rax]
mov r8d, dword [rdi]
xor edx, edx
mov ecx, 0x5a
call qword [sym.imp.KERNEL32.dll_OpenThread]
mov rbx, rax
test rax, rax
je 0x180061c7a
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
add rdi, 4
sub rsi, 1
jne 0x180061c50
mov r8, qword [rsp + 0x20]
xor edx, edx
mov rcx, qword [0x18022baa0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
test ebp, ebp
jne 0x180061db3
mov edx, dword [0x180231d8c]
mov r10, qword [0x180231d80]
mov r9, qword [r10 + r13 + 0x10]
mov r8, r15
mov rcx, qword [0x180231d90]
mov rax, r9
and rax, 0xfffffffffffff000
test rcx, rcx
je 0x180061d22
nop word [rax + rax]
cmp rcx, rax
je 0x180061ce2
mov r8, rcx
mov rcx, qword [rcx]
test rcx, rcx
jne 0x180061cd0
jmp 0x180061d22
mov rax, qword [rcx + 8]
mov qword [r9], rax
add dword [rcx + 0x10], 0xffffffff
mov qword [rcx + 8], r9
jne 0x180061d22
mov rax, qword [rcx]
test r8, r8
je 0x180061d00
mov qword [r8], rax
jmp 0x180061d07
mov qword [0x180231d90], rax
xor edx, edx
mov r8d, 0x8000
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov edx, dword [0x180231d8c]
mov r10, qword [0x180231d80]
dec edx
cmp r12d, edx
jae 0x180061d66
mov eax, edx
imul rcx, rax, 0x38
movups xmm0, xmmword [rcx + r10]
movups xmmword [r10 + r13], xmm0
movups xmm1, xmmword [rcx + r10 + 0x10]
movups xmmword [r10 + r13 + 0x10], xmm1
movups xmm0, xmmword [rcx + r10 + 0x20]
movups xmmword [r10 + r13 + 0x20], xmm0
movsd xmm1, qword [rcx + r10 + 0x30]
movsd qword [r10 + r13 + 0x30], xmm1
mov r10, qword [0x180231d80]
mov ecx, dword [0x180231d88]
mov eax, ecx
mov dword [0x180231d8c], edx
shr eax, 1
cmp eax, 0x20
jb 0x180061db3
cmp eax, edx
jb 0x180061db3
mov eax, ecx
mov r8, r10
mov rcx, qword [0x18022baa0]
xor edx, edx
shr rax, 1
imul r9, rax, 0x38
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
test rax, rax
je 0x180061db3
shr dword [0x180231d88], 1
mov qword [0x180231d80], rax
jmp 0x180061db3
mov ebp, 2
xchg dword [0x18022ba98], r15d
mov r13, qword [rsp + 0x70]
mov eax, ebp
mov r12, qword [rsp + 0x60]
add rsp, 0x30
pop r15
pop rdi
pop rsi
pop rbp
pop rbx
ret