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

Disassembly:
sub esp, 0x14
push ebx
push esi
push edi
mov esi, ecx
call fcn.004172d0
lea ecx, [esi + 0x200]
call fcn.0041b990
mov edi, eax
test edi, edi
je 0x417d6b
nop
push edi
mov ecx, esi
call fcn.0041aa80
test al, al
je 0x417d5a
push dword [edi + 0x218]
lea eax, [edi + 0x10]
mov ecx, esi
push eax
call fcn.004187f0
cmp byte [esi + 0x12e0], 0
jne 0x417f40
lea ecx, [esi + 0x200]
call fcn.0041b990
mov edi, eax
test edi, edi
jne 0x417d30
push ebp
call fcn.00401210
mov ebp, eax
sub eax, dword [esi + 0x12e4]
mov dword [esp + 0x1c], ebp
cmp eax, 0x32
jb 0x417d9c
lea ecx, [eax + eax*4]
add ecx, ecx
push ecx
push str.Slow_iteration_warning:__ims
push esi
call fcn.00418fa0
add esp, 0xc
mov dword [esi + 0xc80], ebp
mov eax, ebp
mov dword [esi + 0x12e4], ebp
sub eax, dword [esi + 0xc80]
cmp eax, 0xfa0
jbe 0x417dde
push str.Automatically_reconnecting_on_timeout...
push esi
call fcn.00418fa0
add esp, 8
mov ecx, esi
call fcn.00419f80
mov ecx, esi
call fcn.00419e60
push 0
mov ecx, esi
call fcn.00417ab0
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x14
ret
cmp byte [esi + 0xc87], 0
je 0x417e13
mov eax, dword [esi + 0x149c]
mov ecx, ebp
sub ecx, dword [esi + 0xc88]
shl eax, 4
cmp ecx, eax
jbe 0x417e13
push str.Retrying_connection...
push esi
call fcn.00418fa0
add esp, 8
mov ecx, esi
push 1
call fcn.00417ab0
cmp byte [esi + 0x41ae7], 0
je 0x417e53
cmp byte [esi + 0xc8c], 0
je 0x417e3a
mov ecx, dword [esi + 0x149c]
mov eax, ebp
sub eax, dword [esi + 0xc90]
add ecx, 0xa
cmp eax, ecx
jmp 0x417e4a
call fcn.00401210
sub eax, dword [esi + 0xc90]
cmp eax, 0x7d0
jbe 0x417e53
mov ecx, esi
call fcn.0041a940
mov ecx, esi
call fcn.0041a6e0
cmp byte [esi + 0x41aec], 0
je 0x417ed4
mov ecx, dword [esi + 0x41510]
test ecx, ecx
je 0x417ed4
cmp byte [esi + 0x41aed], 0
je 0x417ea2
movzx eax, word [esi + 0x141ff4]
mov ecx, ebp
sub ecx, dword [esi + 0x41afc]
cmp ecx, eax
jbe 0x417ed4
sub esp, 0x28
push esp
call fcn.00415c30
mov ecx, dword [esi + 0x14b8]
add esp, 4
call fcn.004088a0
jmp 0x417ed4
cmp byte [ecx + 0x9d], 8
mov eax, dword [esi + 0x41afc]
movzx edx, word [esi + 0x141ff4]
jne 0x417f47
mov ecx, ebp
sub ecx, eax
cmp ecx, edx
jbe 0x417ed4
mov ecx, esi
call fcn.0041a870
push 0
mov ecx, esi
call fcn.0041a460
mov ecx, esi
call fcn.00417cb0
mov eax, ebp
sub eax, dword [esi + 0x14b4]
cmp eax, 0x64
jb 0x417f05
sub esp, 0x28
mov dword [esi + 0x14b4], ebp
push esp
call fcn.00415d70
mov ecx, dword [esi + 0x14b8]
add esp, 4
call fcn.004088a0
mov ecx, esi
call fcn.00418170
mov ecx, esi
call fcn.00417c60
mov ecx, esi
call fcn.00417c10
cmp byte [esi + 0x13a4], 0
je 0x417f3f
mov eax, ebp
sub eax, dword [esi + 0x13a0]
cmp eax, 0x3e8
jbe 0x417f3f
mov ecx, esi
call fcn.0041aaa0
mov dword [esi + 0x13a0], ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x14
ret
cmp dword [esi + 0x41514], 0
mov edi, edx
je 0x417f6a
mov ecx, ebp
sub ecx, eax
lea eax, [edi*8]
cmp ecx, eax
jbe 0x417ed4
jmp 0x417ecb
mov edx, ebp
sub edx, eax
lea eax, [edi + edi]
cmp edx, eax
jbe 0x417ed4
push edx
call fcn.0041b380
mov eax, dword [esi + 0x41510]
movzx eax, byte [eax + 0x9d]
lea eax, [eax + eax*8]
add eax, eax
test dword [esi + eax*8 + 0x141b8c], 0x300000
jbe 0x417ecb
movzx eax, word [esi + 0x41acc]
xor edx, edx
mov ebx, dword [esi + 0x14fc]
shr eax, 1
mov dword [esp + 0x10], edx
test ebx, ebx
je 0x417ecb
mov ebp, eax
mov edi, dword [ebx]
mov ecx, dword [esi + 0x41510]
mov ebx, dword [ebx + 4]
cmp edi, ecx
je 0x418001
cmp byte [edi + 0x9d], 8
je 0x418001
cmp byte [esi + 0x41aef], 0
movzx eax, word [ecx + 0xd8]
movzx edx, word [edi + 0xd8]
jne 0x4180f3
cmp ax, dx
jne 0x4180fc
mov edx, dword [esp + 0x10]
test ebx, ebx
jne 0x417fc1
mov ebp, dword [esp + 0x1c]
test edx, edx
je 0x417ecb
mov edi, dword [esi + 0x41510]
movzx eax, byte [edi + 0x9d]
lea eax, [eax + eax*8]
add eax, eax
movzx ecx, word [esi + eax*8 + 0x141b2a]
mov eax, 0x10624dd3
mul ecx
lea eax, [edi + 0xc0]
mov edi, dword [esp + 0x10]
shr edx, 6
push edx
push eax
lea eax, [esp + 0x24]
push eax
lea ecx, [edi + 0xc0]
call fcn.00414ec0
mov ecx, dword [esi + 0x41510]
push eax
lea eax, [edi + 0xb8]
add ecx, 0xb8
push eax
lea eax, [esp + 0x20]
push eax
call fcn.00414ec0
push eax
call fcn.00416150
mov ecx, dword [esi + 0x41510]
add esp, 0xc
mov byte [ecx + 0x9e], al
cmp byte [esi + 0x41aef], 1
jne 0x4180af
mov eax, dword [esi + 0x41510]
movzx eax, byte [eax + 0x9e]
push eax
call fcn.00416300
mov ecx, dword [esi + 0x41510]
add esp, 4
mov byte [ecx + 0x9e], al
mov eax, dword [esi + 0x41510]
mov ecx, esi
push 1
push 0
push 0
movzx eax, byte [eax + 0x9d]
push 0
lea eax, [eax + eax*8]
add eax, eax
mov eax, dword [esi + eax*8 + 0x141b8c]
shr eax, 0x14
and al, 3
dec al
movzx eax, al
push eax
push 1
call fcn.004182d0
push eax
push 0
mov ecx, esi
call fcn.0041a490
jmp 0x417ed4
cmp ax, dx
jne 0x417ffd
lea eax, [edi + 0xb0]
add ecx, 0xb0
push eax
call fcn.00415230
cmp eax, ebp
jae 0x417ffd
mov edx, edi
mov ebp, eax
mov dword [esp + 0x10], edx
jmp 0x418001