Function at 0x140039820
Capabilities:
Get socket status

Disassembly:
push rbp
push rbx
push rsi
push r13
push r14
lea rbp, [rsp - 0x590]
sub rsp, 0x690
mov rax, qword [0x14008e700]
xor rax, rsp
mov qword [rbp + 0x570], rax
xor r14d, r14d
mov esi, edx
mov qword [rsp + 0x30], rcx
mov r13, r8
test rcx, rcx
je 0x140039874
mov edx, r14d
test esi, esi
je 0x140039874
mov rax, rcx
cmp qword [rax], 0xffffffffffffffff
jne 0x14003989d
inc edx
add rax, 0x10
cmp edx, esi
jb 0x140039864
test r13, r13
je 0x140039c15
jns 0x140039bfe
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
mov r14, 0xffffffffffffffff
mov eax, r14d
jmp 0x140039a6c
mov qword [rsp + 0x6c8], rdi
mov rbx, 0xffffffffffffffff
mov qword [rsp + 0x688], r12
lea rdi, [rcx + 8]
mov qword [rsp + 0x680], r15
mov r9d, r14d
mov r15d, r14d
mov dword [rsp + 0x40], r14d
mov r10d, r14d
mov dword [rbp + 0x150], r14d
mov r8d, r14d
mov dword [rbp + 0x360], r14d
mov r12, rbx
mov eax, 0x710
mov ecx, 0x600
nop dword [rax]
mov rdx, qword [rdi - 8]
mov word [rdi + 2], r14w
cmp rdx, rbx
je 0x140039a13
jae 0x140039a47
movzx r11d, word [rdi]
test ax, r11w
je 0x140039a13
cmp rdx, r12
mov rax, rdx
cmovbe rax, r12
mov r12, rax
mov eax, 0x300
test ax, r11w
je 0x14003996a
mov ecx, r14d
test r9d, r9d
je 0x140039946
mov eax, ecx
cmp qword [rsp + rax*8 + 0x48], rdx
je 0x140039946
inc ecx
cmp ecx, r9d
jb 0x140039936
cmp ecx, r9d
jne 0x140039965
cmp r9d, 0x40
jae 0x140039965
mov eax, ecx
mov qword [rsp + rax*8 + 0x48], rdx
mov r9d, dword [rsp + 0x40]
inc r9d
mov dword [rsp + 0x40], r9d
mov ecx, 0x600
test r11b, 0x10
je 0x1400399be
mov ecx, r14d
test r10d, r10d
je 0x140039993
nop dword [rax + rax]
mov eax, ecx
cmp qword [rbp + rax*8 + 0x158], rdx
je 0x140039993
inc ecx
cmp ecx, r10d
jb 0x140039980
cmp ecx, r10d
jne 0x1400399b9
cmp r10d, 0x40
jae 0x1400399b9
mov eax, ecx
mov qword [rbp + rax*8 + 0x158], rdx
mov r10d, dword [rbp + 0x150]
inc r10d
mov dword [rbp + 0x150], r10d
mov ecx, 0x600
test cx, r11w
je 0x140039a0e
mov ecx, r14d
test r8d, r8d
je 0x1400399e3
nop dword [rax]
mov eax, ecx
cmp qword [rbp + rax*8 + 0x368], rdx
je 0x1400399e3
inc ecx
cmp ecx, r8d
jb 0x1400399d0
cmp ecx, r8d
jne 0x140039a09
cmp r8d, 0x40
jae 0x140039a09
mov eax, ecx
mov qword [rbp + rax*8 + 0x368], rdx
mov r8d, dword [rbp + 0x360]
inc r8d
mov dword [rbp + 0x360], r8d
mov ecx, 0x600
mov eax, 0x710
inc r15d
add rdi, 0x10
cmp r15d, esi
jb 0x1400398f0
test r9d, r9d
jne 0x140039ab5
test r10d, r10d
jne 0x140039ab5
test r8d, r8d
jne 0x140039ab5
test r13, r13
jne 0x140039a8a
mov ebx, r14d
jmp 0x140039b06
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
mov eax, ebx
mov r12, qword [rsp + 0x688]
mov rdi, qword [rsp + 0x6c8]
mov r15, qword [rsp + 0x680]
mov rcx, qword [rbp + 0x570]
xor rcx, rsp
call fcn.14006f710
add rsp, 0x690
pop r14
pop r13
pop rsi
pop rbx
pop rbp
ret
jns 0x140039a99
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
jmp 0x140039b06
mov eax, 0xffffffff
mov ecx, 0xfffffffe
cmp r13, rax
cmovl ecx, r13d
call qword [sym.imp.KERNEL32.dll_Sleep]
mov ebx, r14d
jmp 0x140039b06
mov rdx, r13
lea rcx, [rsp + 0x38]
call fcn.140065450
cmp dword [rbp + 0x360], r14d
lea r9, [rbp + 0x360]
lea r8, [rbp + 0x150]
mov qword [rsp + 0x20], rax
cmove r9, r14
lea rdx, [rsp + 0x40]
cmp dword [rbp + 0x150], r14d
lea ecx, [r12 + 1]
cmove r8, r14
cmp dword [rsp + 0x40], r14d
cmove rdx, r14
call qword [sym.imp.WS2_32.dll_select]
mov ebx, eax
test ebx, ebx
jg 0x140039b27
cmp ebx, 0xffffffff
jne 0x140039a52
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
cmove ebx, r14d
jmp 0x140039a52
mov rbx, qword [rsp + 0x30]
mov edi, r14d
add rbx, 0xa
mov r13d, 0x100
mov r15d, 0x200
mov r12d, 0x400
nop word [rax + rax]
mov rcx, qword [rbx - 0xa]
mov word [rbx], r14w
cmp rcx, 0xffffffffffffffff
je 0x140039be9
lea rdx, [rsp + 0x40]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140039b91
movzx ecx, word [rbx - 2]
test r13w, cx
je 0x140039b7e
or word [rbx], r13w
movzx eax, word [rbx]
mov edx, 0x300
test dx, cx
je 0x140039b91
or ax, dx
mov word [rbx], ax
mov rcx, qword [rbx - 0xa]
lea rdx, [rbp + 0x150]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140039baf
test byte [rbx - 2], 0x10
je 0x140039baf
or word [rbx], 0x10
mov rcx, qword [rbx - 0xa]
lea rdx, [rbp + 0x360]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140039be1
movzx ecx, word [rbx - 2]
test r15w, cx
je 0x140039bd1
or word [rbx], r15w
movzx eax, word [rbx]
test r12w, cx
je 0x140039be1
or ax, r12w
mov word [rbx], ax
cmp word [rbx], r14w
je 0x140039be9
inc edi
add rbx, 0x10
sub rsi, 1
jne 0x140039b50
mov eax, edi
jmp 0x140039a54
mov eax, 0xffffffff
mov ecx, 0xfffffffe
cmp r13, rax
cmovl ecx, r13d
call qword [sym.imp.KERNEL32.dll_Sleep]
mov eax, r14d
jmp 0x140039a6c