Function at 0x140015040
Capabilities:
Get socket status
Get thread local storage value
Set thread local storage value

Disassembly:
test rcx, rcx
je 0x1400154f7
mov r11, rsp
push rdi
sub rsp, 0x280
mov rax, qword [0x140067008]
xor rax, rsp
mov qword [rsp + 0x260], rax
mov qword [r11 + 0x10], rbx
mov rdi, rcx
mov qword [r11 + 0x18], rbp
lea rcx, str.master
mov qword [r11 - 0x10], r14
call fcn.140007690
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
mov edx, 1
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov ecx, dword [0x14006aeb8]
lea rdx, [rsp + 0x38]
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x38], 1
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov rax, qword [rdi + 0x188]
test rax, rax
je 0x1400150d6
xor edx, edx
mov rcx, rdi
call rax
xor ecx, ecx
mov qword [rsp + 0x2a8], rsi
call fcn.1400315f0
mov ecx, dword [rdi + 0x1b8]
mov edx, reloc.WS2_32.dll_recv
mov qword [rdi + 0x650], rax
call fcn.140031998
xor r14d, r14d
mov rbp, rax
test rax, rax
je 0x140015285
mov qword [rsp + 0x270], r15
mov r15d, 0x300
nop dword [rax]
mov ecx, dword [rdi]
test ecx, ecx
jne 0x14001527d
mov esi, dword [rdi + 0x1b8]
mov r8d, r14d
test esi, esi
je 0x140015174
nop word [rax + rax]
mov eax, r8d
mov edx, r8d
inc r8d
add rdx, rdx
lea rcx, [rax + rax*2]
mov rax, qword [rdi + 0x1a8]
add rcx, rcx
mov rcx, qword [rax + rcx*8]
mov qword [rbp + rdx*8], rcx
mov word [rbp + rdx*8 + 8], r15w
mov esi, dword [rdi + 0x1b8]
cmp r8d, esi
jb 0x140015140
mov dword [rsp + 0x48], r14d
mov edx, r14d
mov dword [rsp + 0x50], edx
mov r10, r14
mov dword [rsp + 0x4c], 0x30d40
test esi, esi
je 0x1400151e4
mov r9, rbp
mov r11d, esi
mov ecx, r14d
test edx, edx
je 0x1400151ad
mov r8, qword [r9]
nop
cmp qword [rsp + rcx*8 + 0x58], r8
je 0x1400151ad
inc ecx
cmp ecx, edx
jb 0x1400151a0
cmp ecx, edx
jne 0x1400151c8
cmp edx, 0x40
jae 0x1400151c8
mov rax, qword [r9]
mov qword [rsp + rcx*8 + 0x58], rax
mov edx, dword [rsp + 0x50]
inc edx
mov dword [rsp + 0x50], edx
mov rax, qword [r9]
cmp rax, r10
mov word [r9 + 0xa], r14w
cmovbe rax, r10
add r9, 0x10
mov r10, rax
sub r11, 1
jne 0x140015195
lea rax, [rsp + 0x48]
xor r9d, r9d
lea ecx, [r10 + 1]
mov qword [rsp + 0x20], rax
xor r8d, r8d
lea rdx, [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x140015120
test esi, esi
je 0x140015233
mov rbx, rbp
mov rcx, qword [rbx]
lea rdx, [rsp + 0x50]
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x140015229
mov word [rbx + 0xa], r15w
add rbx, 0x10
sub rsi, 1
jne 0x140015212
mov ebx, r14d
cmp dword [rdi + 0x1b8], ebx
jbe 0x140015120
mov eax, dword [rdi]
test eax, eax
jne 0x14001526e
mov eax, ebx
add rax, rax
mov ecx, ebx
test word [rbp + rax*8 + 0xa], r15w
je 0x14001526e
lea rcx, [rcx + rcx*2]
mov rdx, rdi
shl rcx, 4
add rcx, qword [rdi + 0x1a8]
call fcn.140014c20
inc ebx
cmp ebx, dword [rdi + 0x1b8]
jb 0x140015242
jmp 0x140015120
mov r15, qword [rsp + 0x270]
mov rcx, rbp
call fcn.14002da28
mov rcx, rdi
call fcn.140012350
lea rbx, [rdi + 0x5c8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rbx + 0x28], r14d
je 0x140015311
nop dword [rax + rax]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rbx + 0x28], r14d
je 0x140015302
mov rcx, qword [rbx + 0x30]
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [rbx + 0x28]
mov r8d, 1
cmp eax, r8d
jle 0x1400152fd
mov edx, 8
nop
mov rcx, qword [rbx + 0x30]
lea rdx, [rdx + 8]
inc r8d
mov rax, qword [rcx + rdx - 8]
mov qword [rcx + rdx - 0x10], rax
mov eax, dword [rbx + 0x28]
cmp r8d, eax
jl 0x1400152e0
dec eax
mov dword [rbx + 0x28], eax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [rbx + 0x28], r14d
jne 0x1400152b0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rdi + 0x1c0]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [rdi + 0x1bc]
test eax, eax
jle 0x1400153ac
lea rsi, [rdi + 0x1c8]
nop dword [rax]
mov ecx, dword [0x14006aeb8]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rcx, rsi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rcx, qword [rbx + 8]
movsxd r8, dword [rsi + 0x28]
mov rdx, qword [rsi + 0x30]
mov qword [rdx + r8*8], rcx
mov rcx, rsi
inc dword [rsi + 0x28]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rdi + 0x1c0]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov rcx, qword [rbx + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rdi + 0x1c0]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [rdi + 0x1bc]
test eax, eax
jg 0x140015340
mov rcx, qword [rdi + 0x1c0]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [rdi + 0x640]
test eax, eax
je 0x140015405
mov rsi, r14
mov ebp, eax
nop dword [rax + rax]
mov rax, qword [rdi + 0x648]
mov rbx, qword [rsi + rax]
test rbx, rbx
je 0x1400153fb
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x1400153fb
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
add rsi, 8
sub rbp, 1
jne 0x1400153d0
mov rbp, qword [rsp + 0x2a0]
cmp qword [rdi + 8], r14
je 0x1400154a8
mov eax, 0xffffffff
lock xadd dword [0x14006a90c], eax
cmp eax, 1
jne 0x1400154a8
xor ecx, ecx
call qword [0x140067f38]
xor ecx, ecx
call qword [0x140067f48]
call qword [0x140067f98]
mov ecx, 1
call qword [0x140067fa8]
call qword [0x140067f88]
call qword [0x140067fc8]
call qword [0x140067fb8]
xor ecx, ecx
call qword [0x140067f78]
mov esi, r14d
call qword [0x140067f28]
test eax, eax
jle 0x140015495
mov rbx, r14
mov rcx, qword [0x14006a8f0]
mov rcx, qword [rbx + rcx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
inc esi
lea rbx, [rbx + 8]
call qword [0x140067f28]
cmp esi, eax
jl 0x140015474
mov rcx, qword [0x14006a8f0]
call fcn.14002da28
mov qword [0x14006a8f0], r14
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x14006aeb8]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov r14, qword [rsp + 0x278]
mov rsi, qword [rsp + 0x2a8]
mov rbx, qword [rsp + 0x298]
mov dword [rdi], 2
mov rcx, qword [rsp + 0x260]
xor rcx, rsp
call fcn.14002b5c0
add rsp, 0x280
pop rdi
ret