Function at 0x100645990
Capabilities:
Connect socket
Get socket status
Resolve dns

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x118
lea rbp, [rsp + 0x80]
mov qword [rbp + 0xe0], rcx
mov esi, r8d
mov dword [rbp + 0xe8], edx
mov qword [rbp + 0xf8], r9
mov qword [rbp - 0x38], 0
call sym.vim.exe_add_channel
mov r13, rax
test rax, rax
je 0x100645ed9
mov rcx, qword [rbp + 0xe0]
xor edx, edx
lea r9, [rbp - 0x38]
lea r8, [rbp + 0x10]
mov qword [rbp + 0x10], 0
mov qword [rbp + 0x18], 0
mov qword [rbp + 0x20], 0
mov qword [rbp + 0x28], 0
mov qword [rbp + 0x30], 0
mov qword [rbp + 0x38], 0
mov dword [rbp + 0x18], 1
mov dword [rbp + 0x10], 0xc00
call sub.msys_2.0.dll_getaddrinfo
test eax, eax
jne 0x100645f7e
mov r15, qword [rbp - 0x38]
test r15, r15
je 0x100645e64
movzx eax, word [rbp + 0xe8]
xchg ah, al
mov word [rbp - 0x4a], ax
jmp 0x100645af3
mov r8d, 0x4000
mov edx, 4
mov ecx, eax
call sub.msys_2.0.dll_fcntl
test eax, eax
js 0x100645ea0
lea rdx, str.Connecting...
mov rcx, r13
call sym.vim.exe_ch_log
mov r8d, edi
mov rdx, r14
mov ecx, r12d
call sub.msys_2.0.dll_connect
test eax, eax
je 0x100645ec4
call sub.msys_2.0.dll___errno
cmp dword [rax], 0xb
je 0x100645ac1
call sub.msys_2.0.dll___errno
cmp dword [rax], 0x6f
je 0x100645ac1
call sub.msys_2.0.dll___errno
cmp dword [rax], 0x77
jne 0x100645eec
call sub.msys_2.0.dll___errno
cmp dword [rax], 0x6f
jne 0x100645c00
mov rcx, r13
lea rdx, str.channel_connect:_Connection_refused
call fcn.100641940
mov ecx, r12d
call sub.msys_2.0.dll_close
mov r15, qword [r15 + 0x28]
test r15, r15
je 0x100645e60
mov ecx, dword [r15 + 4]
cmp ecx, 0x17
je 0x100645de0
cmp ecx, 2
je 0x100645e48
mov rbx, qword [rbp + 0xe0]
mov r9d, dword [rbp + 0xe8]
mov r8, rbx
lea rdx, str.Trying_to_connect_to__s_port__d
mov rcx, r13
call sym.vim.exe_ch_log
test esi, esi
mov eax, 1
mov edi, dword [r15 + 0x10]
cmove esi, eax
mov r14, qword [r15 + 0x20]
movzx ecx, word [r14]
xor r8d, r8d
mov edx, 1
call sub.msys_2.0.dll_socket
mov r12d, eax
cmp eax, 0xffffffff
je 0x100645f3d
test esi, esi
jns 0x100645a60
lea rdx, str.Connecting...
mov rcx, r13
call sym.vim.exe_ch_log
mov r8d, edi
mov rdx, r14
mov ecx, r12d
call sub.msys_2.0.dll_connect
test eax, eax
jne 0x100645eec
test r12d, r12d
js 0x100645ae6
mov rcx, qword [rbp - 0x38]
call sub.msys_2.0.dll_freeaddrinfo
lea rdx, str.Connection_made
mov rcx, r13
call sym.vim.exe_ch_log
mov rax, qword [rbp + 0xf8]
mov dword [r13 + 0x18], r12d
mov rcx, qword [rbp + 0xe0]
mov qword [r13 + 0x4d8], rax
call sym.vim.exe_vim_strsave
or dword [r13 + 0x4cc], 1
mov qword [r13 + 0x4c0], rax
mov eax, dword [rbp + 0xe8]
mov dword [r13 + 0x4c8], eax
mov rax, r13
add rsp, 0x118
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
cmp esi, 0x32
mov edx, 0x32
lea r10d, [r12 + 0x3f]
mov eax, r12d
cmovle edx, esi
test r12d, r12d
mov dword [rbp - 0x40], 0
cmovns r10d, r12d
sar eax, 0x1f
mov dword [rbp - 0x3c], 4
shr eax, 0x1a
mov dword [rbp - 0x44], edx
lea ebx, [r12 + rax]
sar r10d, 6
mov qword [rbp - 0x20], 0
and ebx, 0x3f
sub ebx, eax
mov eax, 1
mov ecx, ebx
mov dword [rbp - 0x48], ebx
movsxd rbx, r10d
shl rax, cl
lea rcx, [rbp - 0x10]
mov qword [rbp + rbx*8 - 0x30], rax
mov qword [rbp + rbx*8 - 0x28], rax
imul eax, edx, 0x3e8
xor edx, edx
cdqe
mov qword [rbp - 0x18], rax
call fcn.10065e740
mov r8d, dword [rbp - 0x44]
lea rdx, str.Waiting_for_connection__waiting__d_msec_...
mov rcx, r13
call sym.vim.exe_ch_log
lea rax, [rbp - 0x20]
xor r9d, r9d
lea rdx, [rbp - 0x30]
mov qword [rsp + 0x20], rax
lea ecx, [r12 + 1]
lea r8, [rbp - 0x28]
call sub.msys_2.0.dll_select
test eax, eax
js 0x100645eec
mov rax, qword [rbp + rbx*8 - 0x30]
mov edx, dword [rbp - 0x48]
bt rax, rdx
jb 0x100645cc9
mov rax, qword [rbp + rbx*8 - 0x28]
bt rax, rdx
jae 0x100645d3a
lea rax, [rbp - 0x3c]
lea r9, [rbp - 0x40]
mov edx, 0xffff
mov ecx, r12d
mov qword [rsp + 0x20], rax
mov r8d, 0x1007
call sub.msys_2.0.dll_getsockopt
mov r8d, dword [rbp - 0x40]
test eax, eax
js 0x100645ef4
test r8d, r8d
setne dl
cmp r8d, 0xb
setne al
test dl, al
je 0x100645d13
lea eax, [r8 - 0x6f]
and eax, 0xfffffff7
jne 0x100645ef4
call sub.msys_2.0.dll___errno
cmp dword [rax], 0x6f
je 0x100645acf
mov rax, qword [rbp + rbx*8 - 0x28]
mov ebx, dword [rbp - 0x48]
bt rax, rbx
jae 0x100645d3a
mov eax, dword [rbp - 0x40]
test eax, eax
je 0x100645ec4
mov rcx, rbp
xor edx, edx
call fcn.10065e740
mov rcx, qword [rbp + 8]
sub rcx, qword [rbp - 8]
movabs rax, 0x20c49ba5e353f7cf
imul rcx
mov r8, qword [rbp]
sub r8, qword [rbp - 0x10]
sar rcx, 0x3f
imul r8, r8, 0x3e8
sar rdx, 7
sub rdx, rcx
add rdx, r8
cmp esi, 1
je 0x100645e80
movsxd rax, esi
cmp rdx, rax
jge 0x100645e80
mov ebx, dword [rbp - 0x44]
sub esi, edx
sub ebx, edx
test ebx, ebx
jle 0x100645daa
movsxd rcx, ebx
mov edx, 1
sub esi, ebx
call sym.vim.exe_mch_delay
call sym.vim.exe_ui_breakcheck
mov rax, qword [sym.vim.exe_got_int]
mov eax, dword [rax]
test eax, eax
jne 0x100645e80
test esi, esi
mov eax, 1
cmovle esi, eax
test r12d, r12d
js 0x100645b3b
mov ecx, r12d
call sub.msys_2.0.dll_close
jmp 0x100645b3b
mov rdx, qword [r15 + 0x20]
movzx eax, word [rbp + 0xe8]
xchg ah, al
add rdx, 8
mov word [rdx - 6], ax
mov r9d, 0x41
lea r8, [rbp + 0x40]
call sub.msys_2.0.dll_inet_ntop
mov rbx, rax
test rax, rax
je 0x100645b09
mov rcx, qword [rbp + 0xe0]
mov rdx, rax
call sub.msys_2.0.dll_strcmp
test eax, eax
je 0x100645b10
mov r8, qword [rbp + 0xe0]
mov r9, rbx
lea rdx, str.Resolved__s_to__s
mov rcx, r13
call sym.vim.exe_ch_log
jmp 0x100645b10
mov rdx, qword [r15 + 0x20]
movzx eax, word [rbp - 0x4a]
add rdx, 4
mov word [rdx - 2], ax
jmp 0x100645df5
mov r15, qword [rbp - 0x38]
mov rcx, r15
call sub.msys_2.0.dll_freeaddrinfo
mov rcx, r13
xor r13d, r13d
call fcn.1006458a0
jmp 0x100645be0
mov rcx, r13
lea rdx, str.Connection_timed_out
call fcn.100641940
mov ecx, r12d
call sub.msys_2.0.dll_close
jmp 0x100645ae6
call sub.msys_2.0.dll___errno
mov rcx, r13
lea rdx, str.channel_connect:_Connect_failed_with_errno__d
mov r8d, dword [rax]
call fcn.100641940
mov ecx, r12d
call sub.msys_2.0.dll_close
jmp 0x100645ae6
xor r8d, r8d
mov edx, 4
mov ecx, r12d
call sub.msys_2.0.dll_fcntl
jmp 0x100645b85
lea rdx, str.Cannot_allocate_channel.
xor ecx, ecx
call fcn.100641940
jmp 0x100645be0
call sub.msys_2.0.dll___errno
mov r8d, dword [rax]
lea rdx, str.channel_connect:_Connect_failed_with_errno__d
mov rcx, r13
call fcn.100641940
call sub.msys_2.0.dll___errno
mov ecx, dword [rax]
call sub.msys_2.0.dll_strerror
lea rcx, str.E902:_Cannot_connect_to_port
mov rbx, rax
call sub.msys_intl_8.dll_libintl_gettext
mov r8, rbx
lea rcx, [0x1006d1d94]
mov rdx, rax
call sym.vim.exe_semsg
mov ecx, r12d
call sub.msys_2.0.dll_close
jmp 0x100645ae6
lea rdx, str.in_socket___in_channel_connect__.
mov rcx, r13
call fcn.100641940
call sub.msys_2.0.dll___errno
mov ecx, dword [rax]
call sub.msys_2.0.dll_strerror
lea rcx, str.E898:_socket___in_channel_connect__
mov rbx, rax
call sub.msys_intl_8.dll_libintl_gettext
mov r8, rbx
lea rcx, [0x1006d1d94]
mov rdx, rax
call sym.vim.exe_semsg
jmp 0x100645ae6
lea rdx, str.in_getaddrinfo___in_channel_open__
mov rcx, r13
mov dword [rbp - 0x44], eax
call fcn.100641940
mov eax, dword [rbp - 0x44]
mov ecx, eax
call sub.msys_2.0.dll_gai_strerror
lea rcx, str.E901:_getaddrinfo___in_channel_open__:__s
mov r12, rax
call sub.msys_intl_8.dll_libintl_gettext
mov rdx, r12
mov rcx, rax
call sym.vim.exe_semsg
mov rcx, r13
xor r13d, r13d
call fcn.1006458a0
jmp 0x100645be0