Function at 0x40a120
Capabilities:
Get socket status

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
mov ebx, dword [esp + 0x70]
mov eax, dword [ebx + 0x3c]
cmp eax, 0xffffffff
je 0x40a147
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00405490
test eax, eax
jne 0x40a3fc
mov eax, dword [ebx + 0x84]
test eax, eax
jne 0x40a510
mov eax, dword [ebx + 0x80]
test eax, eax
jne 0x40a4b0
mov dword [esp], ebx
call fcn.00409ab0
test eax, eax
js 0x40a3fc
mov dword [esp], 0
lea esi, [esp + 0x48]
call fcn.0040cea0
movzx eax, byte [ebx + 0x10]
mov dword [esp + 0x2c], 1
nop
cmp al, 0x10
je 0x40a265
mov eax, dword [ebx + 0xa8]
mov edx, dword [ebx + 0xac]
lea ebp, [esp + 0x38]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
mov eax, dword [ebx + 0xb0]
mov edx, dword [ebx + 0xb4]
mov dword [esp + 4], 0
mov dword [esp], esi
mov dword [esp + 0x44], edx
mov dword [esp + 0x40], eax
call sub.cygwin1.dll_gettimeofday
mov dword [esp], esi
call fcn.0040dcf0
mov dword [esp + 0x10], eax
lea eax, [esp + 0x40]
mov dword [esp + 0xc], 0
mov dword [esp + 4], ebp
mov dword [esp + 8], eax
mov eax, dword [ebx + 0xa4]
add eax, 1
mov dword [esp], eax
call sub.cygwin1.dll_select
test eax, eax
js 0x40a410
je 0x40a22a
mov ecx, dword [ebx + 0x60]
mov edi, 1
mov edx, edi
mov eax, ecx
shl edx, cl
shr eax, 5
test dword [esp + eax*4 + 0x38], edx
jne 0x40a3c3
movzx eax, byte [ebx + 0x10]
cmp al, 2
je 0x40a2b0
mov edx, dword [ebx + 0x7c]
test edx, edx
je 0x40a190
cmp al, 4
jne 0x40a190
mov dword [esp + 4], ebp
mov dword [esp], ebx
call fcn.00403200
test eax, eax
js 0x40a3fc
movzx eax, byte [ebx + 0x10]
cmp al, 0x10
jne 0x40a198
mov eax, dword [ebx + 0x84]
test eax, eax
jne 0x40a491
mov dword [esp + 4], 0x4147d9
mov dword [esp], ebx
call fcn.004054b0
mov dword [esp + 8], str.iperf_Done._n
mov dword [esp + 4], 0x4146e0
mov dword [esp], ebx
call fcn.004054b0
mov dword [esp], ebx
call fcn.00407b40
add esp, 0x5c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40a2ed
mov eax, dword [ebx + 0xc]
cmp dword [eax], 2
je 0x40a2ed
mov edi, dword [ebx + 0x160]
test edi, edi
je 0x40a2ed
lea esi, [esi]
mov dword [esp + 4], 1
mov eax, dword [edi + 0xc]
mov dword [esp], eax
call fcn.0040d9a0
mov edi, dword [edi + 0x170]
test edi, edi
jne 0x40a2d0
mov eax, dword [ebx + 0x7c]
test eax, eax
je 0x40a3e4
mov dword [esp + 4], ebp
mov dword [esp], ebx
call fcn.00403200
test eax, eax
js 0x40a3fc
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.cygwin1.dll_gettimeofday
mov dword [esp], esi
call fcn.0040ddd0
mov ebp, dword [ebx + 0xb8]
test ebp, ebp
jne 0x40a3b2
mov edi, dword [ebx + 0x34]
test edi, edi
je 0x40a430
mov ecx, dword [ebx + 0xe0]
test ecx, ecx
je 0x40a430
mov eax, dword [ebx + 0xc]
cmp dword [eax], 2
je 0x40a37d
mov edi, dword [ebx + 0x160]
test edi, edi
je 0x40a37d
lea esi, [esi]
mov dword [esp + 4], 0
mov eax, dword [edi + 0xc]
mov dword [esp], eax
call fcn.0040d9a0
mov edi, dword [edi + 0x170]
test edi, edi
jne 0x40a360
lea eax, [ebx + 0xf0]
mov dword [ebx + 0xe0], 1
mov dword [esp], eax
call fcn.0040cea0
mov dword [esp], ebx
call dword [ebx + 0xd0]
mov dword [esp + 4], 4
mov dword [esp], ebx
call fcn.00402ea0
test eax, eax
jne 0x40a3fc
movzx eax, byte [ebx + 0x10]
mov dword [esp + 0x2c], 0
jmp 0x40a190
mov dword [esp], ebx
call fcn.00409d10
test eax, eax
js 0x40a3fc
mov ecx, dword [ebx + 0x60]
mov eax, ecx
shl edi, cl
shr eax, 5
not edi
and dword [esp + eax*4 + 0x38], edi
jmp 0x40a22a
lea eax, [esp + 0x40]
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.00402f30
test eax, eax
jns 0x40a30c
add esp, 0x5c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.cygwin1.dll___errno
cmp dword [eax], 4
je 0x40a22a
mov dword [0x41cb64], 0x76
jmp 0x40a3fc
mov eax, dword [ebx + 0x164]
mov edx, dword [eax + 0x3c]
mov ecx, dword [eax + 0x38]
mov edi, edx
or edi, ecx
je 0x40a450
cmp edx, dword [ebx + 0x12c]
jb 0x40a34b
jbe 0x40a483
mov edx, dword [eax + 0x40]
mov eax, dword [eax + 0x44]
mov ecx, eax
or ecx, edx
je 0x40a3b2
cmp eax, dword [ebx + 0x134]
ja 0x40a3b2
jb 0x40a34b
cmp edx, dword [ebx + 0x130]
ja 0x40a3b2
jmp 0x40a34b
cmp ecx, dword [ebx + 0x128]
jbe 0x40a34b
jmp 0x40a450
mov dword [esp], ebx
call fcn.00405370
test eax, eax
jns 0x40a29b
jmp 0x40a3fc
mov dword [esp + 8], str.iperf_3.1.5
mov dword [esp + 4], 0x4147d4
mov dword [esp], ebx
call fcn.004054b0
mov dword [esp + 8], 0x4147d8
mov dword [esp + 4], 0x4146e0
mov dword [esp], ebx
call fcn.004054b0
call fcn.0040cfc0
mov dword [esp + 4], 0x4147d4
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.004054b0
mov dword [esp], ebx
call fcn.00407b40
jmp 0x40a163
mov dword [esp], ebx
call fcn.00405290
test eax, eax
js 0x40a3fc
mov eax, dword [ebx + 0x84]
test eax, eax
je 0x40a155
mov dword [esp], str.iperf_3.1.5
call fcn.004109e0
mov dword [esp + 4], 0x4147c0
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x180]
mov dword [esp], eax
call fcn.00410540
call fcn.0040cfc0
mov dword [esp], eax
call fcn.004109e0
mov dword [esp + 4], 0x4147c8
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x180]
mov dword [esp], eax
call fcn.00410540
jmp 0x40a163