Function at 0x140009640
Capabilities:
Get socket status
Receive data
Receive data on socket

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x3d8]
sub rsp, 0x4d8
mov rax, qword [0x1402698e0]
xor rax, rsp
mov qword [rbp + 0x3c0], rax
movsxd rsi, r8d
mov r12, rcx
xor r14d, r14d
xor ecx, ecx
mov qword [rsp + 0x68], r9
mov rdi, rdx
mov dword [rsp + 0x44], esi
mov ebx, r14d
mov dword [rsp + 0x3c], r14d
mov qword [rsp + 0x60], rdx
call fcn.140199f14
or r13, 0xffffffffffffffff
lea r15, [rax + rsi]
mov esi, dword [rsp + 0x40]
mov dword [rsp + 0x30], r13d
mov qword [rsp + 0x50], r14
mov byte [rsp + 0x38], 1
mov qword [rdi], r14
nop dword [rax]
nop dword [rax + rax]
xor eax, eax
lea rdx, [rbp + 0x1a0]
mov rcx, r12
lea r9d, [rax + 2]
lea r8d, [rax + 0xe]
mov dword [rsp + 0x40], reloc.WS2_32.dll_recv
mov qword [rbp + 0x1a0], rax
mov dword [rbp + 0x1a8], eax
mov word [rbp + 0x1ac], ax
call qword [sym.imp.WS2_32.dll_recv]
inc ebx
mov edi, eax
mov dword [rsp + 0x58], ebx
cmp ebx, 0x3e8
jg 0x140009e7b
cmp eax, 0xffffffff
jne 0x14000972a
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
sub eax, 0x2728
je 0x14000972a
sub eax, 0xb
je 0x14000972a
cmp eax, 0x14
jne 0x140009adf
movsx r14d, byte [rbp + 0x1ac]
cmp edi, 0xffffffff
je 0x140009a70
test edi, edi
je 0x140009d4d
xor cl, cl
lea eax, [r14 - 1]
cmp eax, 0xb
mov eax, 1
movzx ecx, cl
cmovbe ecx, eax
test cl, cl
je 0x140009ccb
movzx eax, byte [rbp + 0x1a0]
mov byte [rsp + 0x34], al
movzx eax, byte [rbp + 0x1a1]
mov byte [rsp + 0x35], al
movzx eax, byte [rbp + 0x1a2]
mov byte [rsp + 0x36], al
movzx eax, byte [rbp + 0x1a3]
mov byte [rsp + 0x37], al
mov ecx, dword [rsp + 0x34]
call qword [sym.imp.WS2_32.dll_ntohl]
cmp dword [0x14027d0e0], 0
movsxd rbx, eax
mov dword [rsp + 0x30], ebx
je 0x1400097c7
lea rdx, str.Msg_Receive__ld_bytes_pending
lea rcx, [rbp + 0x1b0]
mov r8d, ebx
call fcn.140197bf8
lea rcx, [rbp + 0x1b0]
call fcn.14000c360
mov r14, qword [rsp + 0x50]
test r14, r14
jne 0x1400097ea
mov rcx, rbx
call fcn.140198304
mov r14, rax
mov qword [rsp + 0x50], rax
test rax, rax
je 0x140009b0c
mov r8, rbx
mov edx, 0x20
mov rcx, r14
call fcn.14019ab30
mov rax, qword [rsp + 0x60]
mov edi, ebx
mov qword [rax], r14
xor r9d, r9d
mov r8d, edi
mov rdx, r14
mov rcx, r12
call qword [sym.imp.WS2_32.dll_recv]
movsxd rbx, eax
mov eax, dword [rsp + 0x3c]
inc eax
mov dword [rsp + 0x3c], eax
cmp eax, 0x186a0
jg 0x140009cbf
cmp ebx, 0xffffffff
jne 0x14000985c
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
sub eax, 0x2728
je 0x14000989f
sub eax, 0xb
je 0x14000989f
cmp eax, 0x14
je 0x14000989f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.Msg_Receive_recv_returns__d
jmp 0x140009aec
cmp dword [0x14027d0e0], 0
je 0x140009895
movzx r9d, byte [rsp + 0x38]
mov rcx, qword [rsp + 0x68]
mov r8d, ebx
mov rdx, r14
mov qword [rsp + 0x20], r12
call fcn.14000bda0
mov eax, dword [rsp + 0x38]
test ebx, ebx
movzx eax, al
mov ecx, 0
cmovg eax, ecx
mov dword [rsp + 0x38], eax
add r14, rbx
sub edi, ebx
mov qword [rsp + 0x50], r14
test edi, edi
jle 0x14000991b
xor ecx, ecx
call fcn.140199f14
cmp r15, rax
js 0x140009b28
xor ecx, ecx
call fcn.140199f14
mov ecx, r15d
lea rdx, [rbp - 0x70]
sub ecx, eax
xor eax, eax
xor r9d, r9d
mov dword [rsp + 0x48], ecx
lea ecx, [rax + 0x40]
xor r8d, r8d
mov dword [rsp + 0x4c], eax
mov qword [rbp - 0x68], r12
mov dword [rbp - 0x70], 1
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
mov esi, eax
cmp eax, 0xffffffff
jne 0x140009902
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
je 0x1400098a3
jmp 0x14000991b
test eax, eax
jle 0x14000991b
lea rdx, [rbp - 0x70]
mov rcx, r12
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
jne 0x140009804
mov eax, dword [rsp + 0x30]
cmp eax, 0xffffffff
jne 0x140009bc9
mov ebx, dword [rsp + 0x58]
test esi, esi
jle 0x140009945
lea rdx, [rbp - 0x70]
mov rcx, r12
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
jne 0x1400096c0
mov ecx, 0x274c
call qword [sym.imp.WS2_32.dll_WSASetLastError]
mov rcx, qword [0x14027d328]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp byte [0x14027d200], 0
je 0x140009a5a
call fcn.140009400
lea rcx, [0x140227d9c]
lea rdx, [0x140227da0]
test al, al
cmovne rdx, rcx
lea rcx, [0x14027d200]
call fcn.140197bc8
mov rdi, rax
test rax, rax
je 0x140009a5a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebx, eax
call sub.KERNEL32.dll_GetCurrentProcessId
lea rdx, str.Process_ID:__d___Thread_ID:__ld
lea rcx, [rbp + 0x250]
mov r9d, ebx
mov r8d, eax
call fcn.140197bf8
lea rcx, [rsp + 0x78]
call fcn.14019d5ac
lea rcx, [rsp + 0x78]
call fcn.14019d748
lea rdx, [rbp + 0x250]
mov rcx, r13
inc rcx
cmp byte [rdx + rcx], 0
jne 0x1400099e2
lea rdx, [rbp + 0x250]
lea r8, str.__m__d__Y__H:_M:_S
mov r9, rax
add rcx, rdx
mov edx, 0x3c
call fcn.140199be0
movzx r8d, word [rbp - 0x80]
lea rax, [rbp + 0x250]
inc r13
cmp byte [rax + r13], 0
jne 0x140009a15
lea rcx, [rbp + 0x250]
lea rdx, str.._3.3hu
add rcx, r13
call fcn.140197bf8
lea r9, str.Msg_Receive_recv_timed_out
lea r8, [rbp + 0x250]
lea rdx, str._n_s__s_n
mov rcx, rdi
call fcn.14019c0ec
mov rcx, rdi
call fcn.14019be84
mov rcx, qword [0x14027d328]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [rsp + 0x30]
jmp 0x140009ea1
xor r14d, r14d
xor ecx, ecx
call fcn.140199f14
cmp r15, rax
js 0x140009d54
xor ecx, ecx
call fcn.140199f14
mov ecx, r15d
xor r9d, r9d
sub ecx, eax
mov eax, 1
lea rdx, [rbp - 0x70]
mov dword [rbp - 0x70], eax
lea rax, [rsp + 0x48]
mov dword [rsp + 0x48], ecx
lea ecx, [r9 + 0x40]
xor r8d, r8d
mov dword [rsp + 0x4c], r14d
mov qword [rsp + 0x20], rax
mov qword [rbp - 0x68], r12
call qword [sym.imp.WS2_32.dll_select]
mov esi, eax
cmp eax, 0xffffffff
jne 0x14000992c
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
je 0x140009a73
jmp 0x140009945
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.Msg_Receive_peek_recv_returns__d
lea rcx, [rbp + 0x1b0]
mov r8d, eax
call fcn.140197bf8
lea rcx, [rbp + 0x1b0]
call fcn.14000c360
jmp 0x140009e9e
mov ecx, reloc.WS2_32.dll_ntohl
call qword [sym.imp.WS2_32.dll_WSASetLastError]
lea rcx, str.Msg_Receive_out_of_memory
call fcn.14000c360
jmp 0x140009e9e
mov r8d, dword [rsp + 0x44]
lea rdx, str.Msg_Receive_nWaitSecs_timeout_exceeded__d
lea rcx, [rbp + 0x1b0]
call fcn.140197bf8
mov rcx, qword [0x14027d328]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp byte [0x14027d200], 0
je 0x140009bb7
call fcn.140009400
lea rcx, [0x140227d9c]
lea rdx, [0x140227da0]
test al, al
cmovne rdx, rcx
lea rcx, [0x14027d200]
call fcn.140197bc8
mov rbx, rax
test rax, rax
je 0x140009bb7
lea rcx, [rbp + 0x250]
call fcn.14000c430
lea r9, [rbp + 0x1b0]
lea r8, [rbp + 0x250]
lea rdx, str._n_s__s_n
mov rcx, rbx
call fcn.14019c0ec
mov rcx, rbx
call fcn.14019be84
mov rcx, qword [0x14027d328]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x140009e9e
test edi, edi
jle 0x140009ea1
mov ecx, 0x274c
call qword [sym.imp.WS2_32.dll_WSASetLastError]
mov rcx, qword [0x14027d328]
or edx, 0xffffffff
mov dword [rsp + 0x30], r13d
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp byte [0x14027d200], 0
je 0x140009a5a
call fcn.140009400
lea rcx, [0x140227d9c]
lea rdx, [0x140227da0]
test al, al
cmovne rdx, rcx
lea rcx, [0x14027d200]
call fcn.140197bc8
mov rdi, rax
test rax, rax
je 0x140009a5a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebx, eax
call sub.KERNEL32.dll_GetCurrentProcessId
lea rdx, str.Process_ID:__d___Thread_ID:__ld
lea rcx, [rbp + 0x250]
mov r9d, ebx
mov r8d, eax
call fcn.140197bf8
lea rcx, [rsp + 0x68]
call fcn.14019d5ac
lea rcx, [rsp + 0x68]
call fcn.14019d748
lea rdx, [rbp + 0x250]
mov rcx, r13
inc rcx
cmp byte [rdx + rcx], 0
jne 0x140009c73
lea rdx, [rbp + 0x250]
lea r8, str.__m__d__Y__H:_M:_S
mov r9, rax
add rcx, rdx
mov edx, 0x3c
call fcn.140199be0
movzx r8d, word [rsp + 0x70]
lea rax, [rbp + 0x250]
nop word [rax + rax]
inc r13
cmp byte [rax + r13], 0
jne 0x140009cb0
jmp 0x140009a1f
lea rcx, str.TrillNetIO::Msg_Receive::doloop::2_possible_corrupt_message
jmp 0x140009e82
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x78]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x140009d28
movzx ecx, word [rsp + 0x7a]
call qword [sym.imp.WS2_32.dll_ntohs]
mov ecx, dword [rsp + 0x7c]
movzx ebx, ax
call qword [sym.imp.WS2_32.dll_inet_ntoa]
lea rdx, str._d_is_not_a_valid_trillium_message__Message_length__d_IP_Address__s_Port__d
lea rcx, [rbp + 0x1b0]
mov r9d, edi
mov r8d, r14d
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rax
call fcn.140197bf8
lea rcx, [rbp + 0x1b0]
jmp 0x140009e82
lea rdx, str._d_is_not_a_valid_trillium_message__Message_length__d
lea rcx, [rbp + 0x1b0]
mov r9d, edi
mov r8d, r14d
call fcn.140197bf8
lea rcx, [rbp + 0x1b0]
jmp 0x140009e82
xor eax, eax
jmp 0x140009ea1
mov r8d, dword [rsp + 0x44]
lea rdx, str.Msg_Receive_nWaitSecs_timeout_exceeded__d
lea rcx, [rbp + 0x1b0]
call fcn.140197bf8
mov rcx, qword [0x14027d328]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp byte [0x14027d200], r14b
je 0x140009bb7
call fcn.140009400
lea rcx, [0x140227d9c]
lea rdx, [0x140227da0]
test al, al
cmovne rdx, rcx
lea rcx, [0x14027d200]
call fcn.140197bc8
mov rdi, rax
test rax, rax
je 0x140009bb7
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebx, eax
call sub.KERNEL32.dll_GetCurrentProcessId
lea rdx, str.Process_ID:__d___Thread_ID:__ld
lea rcx, [rbp + 0x250]
mov r9d, ebx
mov r8d, eax
call fcn.140197bf8
lea rcx, [rsp + 0x68]
call fcn.14019d5ac
lea rcx, [rsp + 0x68]
call fcn.14019d748
lea rdx, [rbp + 0x250]
mov rcx, r13
nop
inc rcx
cmp byte [rdx + rcx], r14b
jne 0x140009e00
lea rdx, [rbp + 0x250]
lea r8, str.__m__d__Y__H:_M:_S
mov r9, rax
add rcx, rdx
mov edx, 0x3c
call fcn.140199be0
movzx r8d, word [rsp + 0x70]
lea rcx, [rbp + 0x250]
mov rax, r13
inc rax
cmp byte [rcx + rax], r14b
jne 0x140009e37
lea rcx, [rbp + 0x250]
lea rdx, str.._3.3hu
add rcx, rax
call fcn.140197bf8
lea r9, [rbp + 0x1b0]
lea r8, [rbp + 0x250]
lea rdx, str._n_s__s_n
mov rcx, rdi
call fcn.14019c0ec
mov rcx, rdi
jmp 0x140009bb2
lea rcx, str.TrillNetIO::Msg_Receive::doloop::1_possible_corrupt_message
call fcn.14000c360
xor r9d, r9d
lea rdx, [rbp + 0x350]
lea r8d, [r9 + 0x64]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_recv]
mov eax, r13d
mov rcx, qword [rbp + 0x3c0]
xor rcx, rsp
call fcn.14019aa20
add rsp, 0x4d8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret