Function at 0x398117260
Capabilities:
Receive data
Receive data on socket
Set socket configuration

Disassembly:
push rbp
mov rbp, rsp
push r13
mov r13, rdx
push r12
push rdi
push rsi
mov esi, r8d
push rbx
mov rbx, rcx
and rsp, 0xfffffffffffffff0
sub rsp, 0xd0
mov rdx, qword [rcx + 0x30]
test rdx, rdx
je 0x398117688
xor ecx, ecx
call fcn.3981220a0
test byte [rbx + 0x38], 4
jne 0x398117728
lea rdi, [rsp + 0x90]
mov edx, 0x4004667f
mov rcx, r13
mov dword [rsp + 0x90], 0x1000
mov r8, rdi
call qword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
js 0x39811773b
mov edx, dword [rsp + 0x90]
lea eax, [rdx - 1]
cmp eax, 0xfff
mov eax, 0x1000
cmovbe eax, edx
mov edx, eax
cmp esi, edx
cmovbe eax, esi
cmp qword [rbx + 0x30], 0
mov rsi, qword [rbx + 8]
movsxd r12, eax
je 0x3981172fa
call fcn.398122050
test rsi, rsi
je 0x3981175c0
test byte [rsi + 0x20], 8
jne 0x3981175c0
mov r8d, 4
mov rdx, r12
mov rcx, rbx
call fcn.398115880
cmp eax, 0xffffffff
je 0x398117728
lea rax, [rsp + 0x48]
mov r8, rdi
mov rdx, r12
mov rcx, rbx
mov dword [rsp + 0x28], 1
mov r9d, 2
mov qword [rsp + 0x20], rax
call fcn.398117750
mov esi, eax
test eax, eax
jle 0x3981173cc
mov rax, qword [rsp + 0x90]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0x98]
mov dword [rsp + 0x50], eax
cmp esi, 1
je 0x3981173cc
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0xa8]
mov dword [rsp + 0x60], eax
cmp esi, 2
je 0x3981173cc
mov rax, qword [rsp + 0xb0]
mov qword [rsp + 0x78], rax
mov rax, qword [rsp + 0xb8]
mov dword [rsp + 0x70], eax
cmp esi, 3
je 0x3981173cc
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x88], rax
mov rax, qword [rsp + 0xc8]
mov dword [rsp + 0x80], eax
lea rax, [rsp + 0x44]
lea rdx, [rsp + 0x50]
mov r8d, esi
mov rcx, r13
mov dword [rsp + 0x44], 0
lea r9, [rsp + 0x40]
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_WSARecv]
test eax, eax
jne 0x3981176a0
mov r12d, dword [rsp + 0x40]
cmp r12d, 0xffffffff
je 0x398117728
test r12d, r12d
je 0x398117663
test esi, esi
jle 0x398117733
mov rcx, qword [rsp + 0x48]
mov rax, qword [rcx]
mov rdx, qword [rax + 0x18]
test byte [rax + 0x20], 8
jne 0x3981176c0
movabs r8, 0x7fffffffffffffff
mov r9, qword [rax + 8]
sub r9, rdx
sub r9, qword [rax + 0x10]
cmp r9, r8
cmova r9, r8
mov r8, r9
movsxd r11, r12d
cmp r11, r8
jle 0x398117637
add rdx, r9
mov r8d, r12d
mov qword [rax + 0x18], rdx
mov rcx, qword [rcx]
sub r8d, r9d
mov qword [rsp + 0x48], rcx
cmp esi, 1
je 0x398117645
mov rax, qword [rcx]
mov rdx, qword [rax + 0x18]
test byte [rax + 0x20], 8
jne 0x3981176d0
movabs r9, 0x7fffffffffffffff
mov r10, qword [rax + 8]
sub r10, rdx
sub r10, qword [rax + 0x10]
cmp r10, r9
cmova r10, r9
mov rdi, r10
movsxd r9, r8d
cmp r9, rdi
jle 0x39811763a
add rdx, r10
sub r8d, r10d
mov qword [rax + 0x18], rdx
mov rcx, qword [rcx]
mov qword [rsp + 0x48], rcx
cmp esi, 2
je 0x398117645
mov rax, qword [rcx]
mov rdx, qword [rax + 0x18]
test byte [rax + 0x20], 8
jne 0x3981176e0
movabs r9, 0x7fffffffffffffff
mov r10, qword [rax + 8]
sub r10, rdx
sub r10, qword [rax + 0x10]
cmp r10, r9
cmova r10, r9
mov rdi, r10
movsxd r9, r8d
cmp rdi, r9
jge 0x39811763a
add rdx, r10
sub r8d, r10d
mov qword [rax + 0x18], rdx
mov rcx, qword [rcx]
mov qword [rsp + 0x48], rcx
cmp esi, 3
je 0x398117645
mov rax, qword [rcx]
mov rdx, qword [rax + 0x18]
test byte [rax + 0x20], 8
je 0x3981176f0
xor edi, edi
xor r10d, r10d
movsxd r9, r8d
cmp rdi, r9
jge 0x39811763a
add rdx, r10
sub r8d, r10d
mov qword [rax + 0x18], rdx
mov rcx, qword [rcx]
mov qword [rsp + 0x48], rcx
cmp esi, 4
je 0x398117645
mov rax, qword [rcx]
mov rdx, qword [rax + 0x18]
test byte [rax + 0x20], 8
jne 0x398117718
movabs r9, 0x7fffffffffffffff
mov r10, qword [rax + 8]
sub r10, rdx
sub r10, qword [rax + 0x10]
cmp r10, r9
cmova r10, r9
mov rsi, r10
movsxd r9, r8d
cmp r9, rsi
jle 0x39811763a
add r10, rdx
mov qword [rax + 0x18], r10
nop dword [rax + rax]
lea rax, [r12 + 0x30]
mov esi, 0x400
cmp rax, 0x400
jbe 0x3981175e0
nop word [rax + rax]
add rsi, rsi
cmp rax, rsi
ja 0x3981175d8
mov rcx, rsi
call fcn.39811f120
mov rdx, rax
test rax, rax
je 0x398117728
sub rsi, 0x30
lea rax, [rdx + 0x30]
mov qword [rdx + 0x20], 0
mov rcx, rbx
mov qword [rdx], 0
mov qword [rdx + 0x10], 0
mov qword [rdx + 0x18], 0
mov qword [rdx + 8], rsi
mov qword [rdx + 0x28], rax
mov dword [rdx + 0x24], 1
call fcn.3981135b0
jmp 0x398117327
mov r9, r11
add r9, rdx
mov qword [rax + 0x18], r9
mov qword [rbx + 0x10], rcx
movdqu xmm1, xmmword [rbx + 0x18]
movq xmm0, r11
mov rcx, rbx
punpcklqdq xmm0, xmm0
paddq xmm0, xmm1
movups xmmword [rbx + 0x18], xmm0
call fcn.3981169e0
mov rdx, qword [rbx + 0x30]
test rdx, rdx
je 0x398117673
xor ecx, ecx
call fcn.3981220c0
lea rsp, [rbp - 0x28]
mov eax, r12d
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop rbp
ret
test byte [rcx + 0x38], 4
je 0x39811729d
mov r12d, 0xffffffff
jmp 0x398117673
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
xor r12d, r12d
cmp eax, 0x2745
sete r12b
sub r12d, 1
jmp 0x398117663
xor r8d, r8d
xor r9d, r9d
jmp 0x398117463
xor edi, edi
xor r10d, r10d
jmp 0x3981174bd
xor edi, edi
xor r10d, r10d
jmp 0x398117514
movabs r9, 0x7fffffffffffffff
mov r10, qword [rax + 8]
sub r10, rdx
sub r10, qword [rax + 0x10]
cmp r10, r9
cmova r10, r9
mov rdi, r10
jmp 0x398117551
xor esi, esi
xor r10d, r10d
jmp 0x3981175a8
mov r12d, 0xffffffff
jmp 0x398117663
movsxd r11, r12d
jmp 0x398117645
mov edx, 0x1000
mov eax, 0x1000
jmp 0x3981172e2