Function at 0x140006330
Capabilities:
Terminate thread

Disassembly:
push rdi
sub rsp, 0x150
mov rax, qword [0x140116008]
xor rax, rsp
mov qword [rsp + 0x130], rax
call fcn.140009a00
cmp qword [0x140118680], 0
lea rdi, [rax + 0xf4240]
je 0x14000677b
mov qword [rsp + 0x160], rbx
mov qword [rsp + 0x168], rbp
mov qword [rsp + 0x170], rsi
mov qword [rsp + 0x178], r12
mov qword [rsp + 0x140], r15
call fcn.140009a00
mov r15d, 0x5060
cmp rax, rdi
jae 0x14000645d
lea rsi, str.yapi
call fcn.14000ec00
test eax, eax
jne 0x1400063e8
mov rbx, r15
nop dword [rax]
nop dword [rax + rax]
mov rax, qword [0x140118680]
mov rcx, qword [rbx + rax]
test rcx, rcx
je 0x1400063d9
call fcn.14001d430
test eax, eax
jne 0x1400063e8
add rbx, 8
cmp rbx, 0x5160
jl 0x1400063c0
jmp 0x14000645d
mov rcx, qword [0x140118680]
test rcx, rcx
jne 0x140006420
mov dword [rsp + 0x28], 0x112c
lea r9, str.API_not_initialized
lea r8, str._s___s:_d_
mov qword [rsp + 0x20], rsi
mov edx, 0x100
lea rcx, [rsp + 0x30]
call fcn.1400217a0
jmp 0x140006444
mov rcx, qword [rcx + 8]
call qword [sym.imp.KERNEL32.dll_TryEnterCriticalSection]
test eax, eax
je 0x140006444
call fcn.14000e430
mov rcx, qword [0x140118680]
mov rcx, qword [rcx + 8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, 0x32
call qword [sym.imp.KERNEL32.dll_Sleep]
call fcn.140009a00
cmp rax, rdi
jb 0x1400063a8
mov rcx, qword [0x140118680]
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rcx, qword [0x140118680]
mov rcx, qword [rcx + 8]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rcx, qword [0x140118680]
mov rcx, qword [rcx + 0x5028]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rsi, qword [0x140118680]
test byte [rsi + 0x5030], 1
je 0x1400064ae
call fcn.14000e260
mov rsi, qword [0x140118680]
mov ecx, dword [rsi + 0x5a28]
xor r12d, r12d
lea eax, [rcx - 1]
cmp eax, 1
ja 0x140006561
cmp ecx, 1
jne 0x1400064d2
mov dword [rsi + 0x5a28], 2
call fcn.140009a00
mov rbx, rax
nop word [rax + rax]
mov eax, dword [rsi + 0x5a28]
lea ecx, [rax - 1]
cmp ecx, 1
ja 0x140006511
call fcn.140009a00
sub rax, rbx
cmp rax, 0x3e8
jae 0x14000650b
mov ecx, 0xa
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1400064e0
mov eax, dword [rsi + 0x5a28]
mov rcx, qword [rsi + 0x5a30]
dec eax
cmp eax, 1
mov r8d, r12d
setbe r8b
test r8d, r8d
je 0x140006549
mov edx, 0x3e8
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140006561
mov rcx, qword [rsi + 0x5a30]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TerminateThread]
jmp 0x140006561
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsi + 0x5a30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rdi, [rsi + 0x5a38]
mov qword [rsp + 0x148], r14
mov ebp, 0x40
mov rbx, qword [rdi]
test rbx, rbx
je 0x1400065b5
cmp qword [rbx + 0x80], r12
je 0x1400065ad
lea rcx, [rbx + 0x44]
call fcn.140009670
mov qword [rbx + 0x80], r12
mov rax, qword [rsi + 0x5990]
test rax, rax
je 0x1400065ad
lea r8, [rbx + 0x44]
xor edx, edx
mov rcx, rbx
call rax
mov rcx, rbx
call fcn.140052f7c
add rdi, 8
sub rbp, 1
jne 0x140006575
cmp dword [0x140158b90], r12d
mov edi, r12d
mov r14, qword [rsp + 0x148]
mov rbp, qword [rsp + 0x168]
jle 0x14000661e
lea rbx, [rsi + 0x59d8]
mov rcx, qword [rbx - 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1400065fa
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rbx - 0x40], 0xffffffffffffffff
mov rcx, qword [rbx]
cmp rcx, 0xffffffffffffffff
je 0x140006610
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rbx], 0xffffffffffffffff
inc edi
add rbx, 8
cmp edi, dword [0x140158b90]
jl 0x1400065e2
mov dword [rsi + 0x5988], r12d
mov rsi, qword [rsp + 0x170]
nop dword [rax]
mov rax, qword [0x140118680]
mov rcx, qword [r15 + rax]
test rcx, rcx
je 0x140006645
call fcn.140005a60
add r15, 8
cmp r15, 0x5160
jl 0x140006630
mov rcx, qword [0x140991548]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [0x140991548]
call fcn.140052f7c
mov rcx, qword [0x140991540]
mov qword [0x140991548], r12
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [0x140991540]
call fcn.140052f7c
mov rcx, qword [0x140991550]
mov qword [0x140991540], r12
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [0x140991550]
call fcn.140052f7c
mov rcx, qword [0x140991558]
mov qword [0x140991550], r12
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [0x140991558]
call fcn.140052f7c
mov r15, qword [rsp + 0x140]
lea rbx, [0x140991240]
mov qword [0x140991558], r12
mov edi, 0x20
mov rcx, qword [rbx]
test rcx, rcx
je 0x1400066f6
call fcn.140052f7c
mov qword [rbx], r12
add rbx, 0x18
sub rdi, 1
jne 0x1400066e6
call qword [sym.imp.WS2_32.dll_WSACleanup]
mov rcx, qword [0x140118680]
mov rcx, qword [rcx + 0x10]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [0x140118680]
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [0x140118680]
mov rcx, qword [rcx + 8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [0x140118680]
mov rcx, qword [rcx + 0x5028]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [0x140118680]
call fcn.140005ea0
mov rcx, qword [0x140118680]
call fcn.140052f7c
mov rbx, qword [rsp + 0x160]
mov qword [0x140118680], r12
mov r12, qword [rsp + 0x178]
mov rcx, qword [rsp + 0x130]
xor rcx, rsp
call fcn.14004ee60
add rsp, 0x150
pop rdi
ret