Function at 0x513520
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x40
mov eax, dword [0x570400]
xor eax, esp
mov dword [esp + 0x3c], eax
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x54]
xor ebp, ebp
test byte [edi + 0xd8], 0x10
lea ebx, [edi + 0x88]
mov dword [esp + 0x14], ebp
mov esi, dword [edi + 0x18]
mov dword [esp + 0x10], esi
jne 0x51357d
push edi
call fcn.004f3370
add esp, 4
test al, al
je 0x51357d
push ebp
push edi
call fcn.00505790
push edi
call fcn.004f3380
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x51391e
mov esi, dword [esp + 0x10]
mov al, byte [edi + 0xce7]
test al, al
je 0x5135d7
movzx eax, al
mov dword [esp + 0x10], eax
test al, 1
je 0x51359b
test byte [edi + 0xd8], 0x10
je 0x5135ce
test al, 2
je 0x5135a8
test byte [edi + 0xd8], 0x20
je 0x5135ce
mov eax, dword [edi + 0xd8]
and eax, 0x30
je 0x5135ca
xor esi, esi
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3c]
xor ecx, esp
call fcn.0054507b
add esp, 0x40
ret
mov eax, dword [esp + 0x10]
mov byte [edi + 0xce7], 0
jmp 0x513614
mov ecx, dword [ebx + 0x50]
mov eax, ecx
and al, 0x15
cmp al, 1
jne 0x5135ea
mov edx, dword [esi + 0x278]
jmp 0x5135ed
or edx, 0xffffffff
and cl, 0x2a
cmp cl, 2
jne 0x5135fd
mov eax, dword [esi + 0x27c]
jmp 0x513600
or eax, 0xffffffff
push 0
push 0
push eax
push 0xffffffffffffffff
push edx
call fcn.0051c010
add esp, 0x14
mov dword [esp + 0x10], eax
cmp eax, 4
jne 0x513641
push str.select_poll_returned_error
push edi
call fcn.004f54f0
mov esi, 0x37
add esp, 8
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3c]
xor ecx, esp
call fcn.0054507b
add esp, 0x40
ret
and eax, dword [ebx + 0x50]
test al, 1
je 0x513671
lea eax, [esp + 0x14]
push eax
push ebx
push edi
call fcn.00513d10
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x51391e
cmp byte [edi + 0x12e], al
jne 0x51391e
mov ebp, dword [esp + 0x14]
mov ecx, dword [ebx + 0x50]
mov eax, ecx
and eax, dword [esp + 0x10]
test al, 2
jne 0x513687
test cl, 0x40
je 0x513755
test byte [edi + 0xd8], 0x20
jne 0x513755
push edi
call fcn.004fc640
add esp, 4
test al, al
jne 0x513755
push edi
or ebp, 2
call fcn.004fc9c0
mov esi, eax
add esp, 4
test esi, esi
jne 0x51391e
lea eax, [esp + 0x2c]
push eax
call fcn.004fb620
mov edx, dword [edi + 0x18]
mov esi, eax
sub esp, 0xc
mov ecx, esp
sub esp, 0x10
mov eax, esp
movups xmm0, xmmword [esi]
movups xmmword [esp + 0x3c], xmm0
movups xmm0, xmmword [edx + 0x2c8]
movups xmmword [ecx], xmm0
movups xmm0, xmmword [esi]
movups xmmword [eax], xmm0
call fcn.004fb6d0
add esp, 0x20
test edx, edx
jl 0x513755
jg 0x513701
cmp eax, 0x3e8
jbe 0x513755
mov eax, dword [edi + 0x18]
push 0
push 0
mov esi, dword [eax + 0x27c]
lea eax, [esp + 0x20]
push eax
push 4
lea eax, [esp + 0x24]
push eax
push 0
push 0
push 0x4004747b
push esi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x513746
push 4
lea eax, [esp + 0x18]
push eax
push 0x1001
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
mov eax, dword [edi + 0x18]
movups xmm0, xmmword [esp + 0x1c]
movups xmmword [eax + 0x2c8], xmm0
lea eax, [esp + 0x2c]
push eax
call fcn.004fb620
add esp, 4
movups xmm0, xmmword [eax]
movups xmmword [esp + 0x3c], xmm0
test ebp, ebp
jne 0x513781
push edi
call fcn.00505730
mov esi, eax
add esp, 4
test esi, esi
jne 0x51391e
push edi
call fcn.0050b150
add esp, 4
test eax, eax
jne 0x5138f4
movups xmm0, xmmword [esp + 0x3c]
sub esp, 0x10
mov eax, esp
push edi
movups xmmword [eax], xmm0
call fcn.0051c1a0
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x51391e
cmp dword [ebx + 0x50], eax
je 0x51388b
push eax
lea eax, [esp + 0x40]
push eax
push edi
call fcn.00506780
add esp, 0xc
test edx, edx
jg 0x51390e
jl 0x5137dc
test eax, eax
jae 0x51390e
mov ebp, dword [ebx]
mov eax, ebp
mov esi, dword [ebx + 4]
and eax, esi
mov edx, dword [ebx + 0x10]
mov ecx, dword [ebx + 0x14]
movups xmm0, xmmword [edi + 0x750]
cmp eax, 0xffffffff
je 0x513842
push esi
push ebp
push ecx
push edx
sub esp, 0x10
mov eax, esp
sub esp, 0x10
movups xmmword [eax], xmm0
mov eax, esp
movups xmm0, xmmword [esp + 0x6c]
movups xmmword [eax], xmm0
call fcn.004fb6d0
add esp, 0x20
push edx
push eax
push str.Operation_timed_out_after__lld_milliseconds_with__lld_out_of__lld_bytes_received
push edi
call fcn.004f54f0
mov esi, 0x1c
add esp, 0x20
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3c]
xor ecx, esp
call fcn.0054507b
add esp, 0x40
ret
push ecx
push edx
sub esp, 0x10
mov eax, esp
sub esp, 0x10
movups xmmword [eax], xmm0
mov eax, esp
movups xmm0, xmmword [esp + 0x64]
movups xmmword [eax], xmm0
call fcn.004fb6d0
add esp, 0x20
push edx
push eax
push str.Operation_timed_out_after__lld_milliseconds_with__lld_bytes_received
push edi
call fcn.004f54f0
mov esi, 0x1c
add esp, 0x18
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3c]
xor ecx, esp
call fcn.0054507b
add esp, 0x40
ret
cmp byte [edi + 0x13c], 0
jne 0x5138e7
mov edx, dword [ebx]
mov eax, edx
mov ecx, dword [ebx + 4]
and eax, ecx
cmp eax, 0xffffffff
je 0x5138e7
mov ebp, dword [ebx + 0x10]
mov eax, dword [ebx + 0x14]
cmp ebp, edx
jne 0x5138b0
cmp eax, ecx
je 0x5138e7
cmp dword [ebx + 0x98], 0
jne 0x5138e7
sub edx, ebp
sbb ecx, eax
push ecx
push edx
push str.transfer_closed_with__lld_bytes_remaining_to_read
push edi
call fcn.004f54f0
mov esi, 0x12
add esp, 0x10
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3c]
xor ecx, esp
call fcn.0054507b
add esp, 0x40
ret
push edi
call fcn.0050b150
add esp, 4
test eax, eax
je 0x51390e
mov esi, 0x2a
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3c]
xor ecx, esp
call fcn.0054507b
add esp, 0x40
ret
test dword [ebx + 0x50], 0x3f
jne 0x51391e
mov byte [edi + 0x12e], 1
mov ecx, dword [esp + 0x4c]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0054507b
add esp, 0x40
ret