Function at 0x40ffb0
Capabilities:
Check for time delay via gettickcount

Disassembly:
sub esp, 0x14
mov eax, dword [esp + 0x1c]
push ebx
push ebp
mov ebp, dword [esp + 0x20]
mov ecx, dword [ebp + eax*4 + 0x130]
mov ebx, dword [ebp]
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x28]
mov dword [ecx], 0
cmp dword [ebp + eax*4 + 0x1c4], 0
mov dword [esp + 0x10], ebx
mov dword [esp + 8], 0
je 0x40fff9
pop ebp
mov dword [ecx], 1
xor eax, eax
pop ebx
add esp, 0x14
ret
push esi
push edi
call fcn.004130d0
mov esi, eax
mov eax, dword [ebx + 0x1d4]
mov edi, edx
xor ecx, ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], 0x493e0
test eax, eax
jle 0x410021
mov ecx, 1
mov edx, dword [ebx + 0x1d8]
test edx, edx
jle 0x41002e
or ecx, 2
dec ecx
je 0x410041
dec ecx
je 0x41003b
dec ecx
jne 0x410045
cmp eax, edx
jl 0x410041
mov dword [esp + 0x28], edx
jmp 0x410045
mov dword [esp + 0x28], eax
mov edx, dword [ebx + 0x504]
mov eax, dword [ebx + 0x500]
push edx
push eax
push edi
push esi
call fcn.00413100
add esp, 0x10
sub dword [esp + 0x28], eax
je 0x41006a
cmp dword [esp + 0x28], 0
jge 0x410085
push str.Connection_time_out
push ebx
call fcn.0040e9d0
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0x1c
pop ebx
add esp, 0x14
ret
mov edi, dword [esp + 0x14]
push ebp
xor eax, eax
call fcn.0040f060
add esp, 4
cmp eax, 1
jne 0x4100d3
mov ecx, dword [ebp + 0x208]
mov edx, dword [ebp + 0x204]
mov eax, dword [esp + 0x20]
mov edi, dword [ebp + 0x210]
push ecx
push edx
push eax
push esi
call fcn.00413100
add esp, 0x10
cmp eax, edi
jl 0x410135
push edi
push str.After__ldms_connect_time__move_on__n
push ebx
call fcn.0040e940
add esp, 0xc
jmp 0x410191
test eax, eax
jne 0x41013f
push edi
lea esi, [esp + 0x14]
call fcn.0040f4a0
add esp, 4
test eax, eax
je 0x41017c
push ebp
call fcn.00404ba0
add esp, 4
test eax, eax
jne 0x4101f4
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x30]
mov dword [ebp + eax*4 + 0x1c4], 1
mov dword [ecx], 1
test eax, eax
jne 0x410125
push 2
push ebx
call fcn.00426580
add esp, 8
push ebp
call fcn.00404cd0
push edi
push ebp
call fcn.0040f5b0
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret
cmp eax, 2
jne 0x41016c
mov edx, edi
push edx
lea esi, [esp + 0x14]
call fcn.0040f4a0
mov esi, dword [esp + 0x14]
push esi
push ebp
call fcn.00412440
push eax
push 0x449514
push ebx
call fcn.0040e940
add esp, 0x18
jmp 0x410180
push str.Connection_failed_n
push ebx
call fcn.0040e940
add esp, 8
jmp 0x410191
mov esi, dword [esp + 0x10]
test esi, esi
je 0x410191
push esi
mov dword [ebx + 0x85c4], esi
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov eax, dword [ebp + 0x3c]
cmp dword [eax + 0x1c], 0
mov eax, dword [esp + 0x28]
je 0x4101a3
cdq
sub eax, edx
sar eax, 1
mov ebx, dword [esp + 0x30]
mov dword [ebp + 0x210], eax
mov eax, dword [esp + 0x2c]
mov esi, ebp
call fcn.0040fee0
mov esi, eax
test esi, esi
je 0x4101f2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [esp + 0x18]
push eax
push ebp
mov dword [edi + 0x85c4], eax
call fcn.00412440
mov ecx, dword [ebp + 0x98]
mov edx, dword [ebp + 0x80]
push eax
push ecx
push edx
push str.Failed_connect_to__s:_ld___s
push edi
call fcn.0040e9d0
add esp, 0x1c
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret