Function at 0x100638940
Capabilities:
Open clipboard
Write clipboard data

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x88
lea rbp, [rsp + 0x80]
mov dword [rcx + 4], 1
mov rsi, rcx
mov qword [rbp - 0x10], 0
call sym.vim.exe_clip_get_selection
lea rdx, [rbp - 8]
lea rcx, [rbp - 0x10]
mov r8, rsi
mov dword [rsi + 4], 0
call sym.vim.exe_clip_convert_selection
mov r15d, eax
test eax, eax
js 0x100638c69
mov r12, qword [rbp - 8]
mov rax, r12
mov ebx, r12d
shl rax, 0x20
or r15, rax
mov rax, qword [sym.vim.exe_p_enc]
mov qword [rbp - 0x38], r15
mov rcx, qword [rax]
call sub.msys_2.0.dll_strlen
mov ecx, 0x2002
mov r14, qword [sym.imp.KERNEL32.dll_GlobalAlloc]
add eax, r12d
lea edx, [rax + 1]
add eax, 2
shl rdx, 0x20
mov qword [rbp - 0x28], rdx
movsxd rdx, eax
call r14
mov rdi, qword [sym.imp.KERNEL32.dll_GlobalLock]
mov r13, rax
mov rcx, rax
call rdi
mov r8, rax
test rax, rax
je 0x100638c80
mov rax, qword [sym.vim.exe_p_enc]
mov rcx, r8
mov qword [rbp - 0x30], r8
mov rdx, qword [rax]
call sub.msys_2.0.dll_strcpy
mov rax, qword [sym.vim.exe_p_enc]
mov rcx, qword [rax]
call sub.msys_2.0.dll_strlen
mov r8, qword [rbp - 0x30]
mov rdx, qword [rbp - 0x10]
lea rcx, [r8 + rax + 1]
mov rax, qword [rbp - 8]
lea r8, [rax + 1]
call sub.msys_2.0.dll_memcpy
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov rcx, qword [rbp - 0x10]
lea rdx, [rbp - 0x14]
mov dword [rbp - 0x14], r12d
call sym.vim.exe_enc_to_utf16
mov r12, rax
test rax, rax
je 0x100638c90
mov r10, qword [sym.imp.KERNEL32.dll_GetACP]
mov ebx, dword [rbp - 0x14]
mov r15d, r15d
mov qword [rbp - 0x30], r10
call r10
mov r9d, ebx
xor edx, edx
mov r8, r12
mov ecx, eax
mov rax, qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov qword [rbp - 0x40], rax
call rax
mov rcx, qword [rbp - 0x10]
movsxd rbx, eax
mov rax, rbx
shl rax, 0x20
or r15, rax
mov qword [rbp - 0x38], r15
call sym.vim.exe_vim_free
test ebx, ebx
mov ecx, 1
cmovne rcx, rbx
call sym.vim.exe_alloc
mov r10, qword [rbp - 0x30]
test rax, rax
mov qword [rbp - 0x10], rax
mov r15, rax
je 0x100638cb8
mov r9d, dword [rbp - 0x14]
mov dword [rbp - 0x30], r9d
call r10
mov r9d, dword [rbp - 0x30]
mov r8, r12
mov qword [rsp + 0x20], r15
mov ecx, eax
xor edx, edx
mov qword [rsp + 0x38], 0
mov rax, qword [rbp - 0x40]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], ebx
call rax
mov eax, dword [rbp - 0x14]
mov ecx, 0x2002
lea edx, [rax + 1]
movsxd rdx, edx
add rdx, rdx
call r14
mov rcx, rax
mov r15, rax
call rdi
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov qword [rbp - 0x30], rax
test rcx, rcx
je 0x100638b72
movsxd r8, dword [rbp - 0x14]
mov rdx, r12
add r8, r8
call sub.msys_2.0.dll_memcpy
xor edx, edx
mov rcx, rax
movsxd rax, dword [rbp - 0x14]
mov word [rcx + rax*2], dx
mov rax, qword [rbp - 0x30]
mov rcx, r15
call rax
mov rcx, r12
mov r12, r15
call sym.vim.exe_vim_free
mov edx, dword [rbp - 0x14]
movabs rax, 0xffffffff00000000
and rax, qword [rbp - 0x28]
or rax, rdx
mov qword [rbp - 0x28], rax
lea edx, [rbx + 1]
mov ecx, 0x2002
movsxd rdx, edx
call r14
mov rcx, rax
mov r15, rax
call rdi
mov rcx, rax
test rax, rax
je 0x100638bc8
mov rdx, qword [rbp - 0x10]
movsxd r8, ebx
call sub.msys_2.0.dll_memmove
mov rax, qword [rbp - 0x30]
mov rcx, r15
call rax
mov edx, 0x10
mov ecx, 0x2002
call r14
mov r14, rax
mov rcx, rax
call rdi
mov rdi, qword [rbp - 0x38]
mov rbx, qword [rbp - 0x28]
mov rcx, r14
mov qword [rax], rdi
mov edi, 0xa
mov qword [rax + 8], rbx
mov rax, qword [rbp - 0x30]
mov ebx, 7
call rax
jmp 0x100638c12
mov ecx, edi
add edi, edi
call qword [sym.imp.KERNEL32.dll_Sleep]
xor ecx, ecx
call qword [sym.imp.USER32.dll_OpenClipboard]
test eax, eax
jne 0x100638ca0
sub ebx, 1
jne 0x100638c08
mov rcx, qword [rbp - 0x10]
call sym.vim.exe_vim_free
test r13, r13
je 0x100638c3e
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_GlobalFree]
test r15, r15
je 0x100638c4c
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_GlobalFree]
test r12, r12
je 0x100638c5a
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GlobalFree]
test r14, r14
je 0x100638c69
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GlobalFree]
nop
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov eax, dword [rbp - 0x28]
mov qword [rbp - 0x28], rax
jmp 0x100638a3e
mov rax, qword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov qword [rbp - 0x30], rax
jmp 0x100638b95
call qword [sym.imp.USER32.dll_EmptyClipboard]
test eax, eax
jne 0x100638cc8
call qword [sym.imp.USER32.dll_CloseClipboard]
jmp 0x100638c27
mov rcx, r12
call sym.vim.exe_vim_free
jmp 0x100638c69
mov ecx, dword [rsi + 0x54]
mov rbx, qword [sym.imp.USER32.dll_SetClipboardData]
mov rdx, r14
call rbx
test r12, r12
je 0x100638ceb
mov rdx, r12
mov ecx, 0xd
call rbx
test rax, rax
je 0x100638cee
xor r12d, r12d
mov rdx, r15
mov ecx, 1
xor r14d, r14d
xor r15d, r15d
call rbx
jmp 0x100638caa