Function at 0x662017c8
Capabilities:
Query environment variable
Set environment variable

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x630]
mov eax, 0x730
call fcn.6620e8b0
sub rsp, rax
mov qword [rbp], 0xfffffffffffffffe
mov qword [rsp + 0x778], rbx
mov rsi, rdx
mov r12, rcx
mov r8d, 0x104
lea rdx, [rbp + 0x420]
lea rcx, str.TS_SBCLEANUP
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
xor edi, edi
test eax, eax
jne 0x66201e36
or r13, 0xffffffffffffffff
mov r8, r13
lea rdx, str.TS_PARENT_HANDLE
lea rcx, [rbp + 0x350]
call fcn.66203540
nop
lea rcx, [rbp + 0x280]
call fcn.662035e0
nop
xor edx, edx
mov rcx, rsi
call fcn.662041f0
xor r8d, r8d
lea rdx, [rbp + 0x280]
mov rcx, qword [rbp + 0x350]
call fcn.66204270
test eax, eax
js 0x6620189a
mov rcx, qword [rbp + 0x280]
call fcn.6620ec08
movsxd rcx, eax
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor edx, edx
mov rcx, qword [rbp + 0x350]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
xor edx, edx
lea rcx, [rbp + 0x280]
call fcn.662041f0
mov r8, r13
lea rdx, str.TS_UPDATE_COMPLETE
lea rcx, [rbp + 0x350]
call fcn.662046d0
xor r8d, r8d
lea rdx, [rbp + 0x280]
mov rcx, qword [rbp + 0x350]
call fcn.66204270
test eax, eax
js 0x66201a0b
lea rdx, [rbp + 0x280]
lea rcx, [rsp + 0x30]
call fcn.66203360
nop
lea rax, [rbp + 0x10]
mov qword [rbp + 0x680], rax
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, [0x6621e9c4]
mov dl, 1
lea rcx, [rsp + 0x30]
call fcn.66203710
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, str..ase
mov dl, 1
lea rcx, [rsp + 0x30]
call fcn.66203710
lea rdx, [rsp + 0x30]
lea rcx, [rbp + 0x10]
call fcn.66203360
mov rbx, rax
lea rdx, [rbp + 0x280]
lea rcx, [rbp + 0xe0]
call fcn.66203360
nop
mov rdx, rbx
mov rcx, rax
call fcn.6620211c
lea rdx, [rbp + 0x280]
lea rcx, [rsp + 0x30]
call fcn.66204670
lea rax, [rbp + 0x10]
mov qword [rbp + 0x680], rax
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, [0x6621e9c4]
mov dl, 1
lea rcx, [rsp + 0x30]
call fcn.66203710
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, str..asd
mov dl, 1
lea rcx, [rsp + 0x30]
call fcn.66203710
lea rdx, [rsp + 0x30]
lea rcx, [rbp + 0x10]
call fcn.66203360
mov rbx, rax
lea rdx, [rbp + 0x280]
lea rcx, [rbp + 0xe0]
call fcn.66203360
nop
mov rdx, rbx
mov rcx, rax
call fcn.6620211c
xor edx, edx
mov rcx, qword [rbp + 0x350]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
nop
lea rcx, [rsp + 0x30]
call fcn.66203630
mov r15d, edi
mov r14b, dil
lea rcx, [rsp + 0x30]
call fcn.662035e0
nop
xor r8d, r8d
lea rdx, str.TS_UPDATE__u
lea rcx, [rsp + 0x30]
call fcn.66204d20
lea rcx, [rbp + 0x1b0]
call fcn.662035e0
jmp 0x66201b7f
mov edx, 0x3b
xor r8d, r8d
lea rcx, [rbp + 0x1b0]
call fcn.66204870
mov rbx, rax
mov rdx, qword [rbp + 0x1b0]
add rdx, 2
lea rdx, [rdx + rax*2]
mov r8, r13
lea rcx, [rbp + 0xe0]
call fcn.66203540
nop
cmp qword [rsi + 8], rdi
jne 0x66201ab0
lea rdx, [rbp + 0xe0]
mov rcx, rsi
call fcn.66204670
mov rcx, rsi
call fcn.66203c70
mov rdx, rax
mov r9, r13
xor r8d, r8d
mov rcx, rsi
call fcn.662047c0
mov rdx, rax
mov rcx, rsi
call fcn.662041f0
mov rdx, rbx
lea rcx, [rbp + 0x1b0]
call fcn.662041f0
lea rdx, [rbp + 0xe0]
lea rcx, [rbp + 0x10]
call fcn.66203360
nop
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], 3
mov r9, r13
lea r8, str..old
mov dl, 1
lea rcx, [rbp + 0x10]
call fcn.66203710
lea r8, [rbp + 0x10]
lea rdx, [rbp + 0xe0]
lea rcx, [rbp + 0x1b0]
call fcn.662027b4
test eax, eax
je 0x66201b9d
mov r14b, 1
xor edx, edx
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
nop
lea rcx, [rbp + 0x10]
call fcn.66203630
nop
lea rcx, [rbp + 0xe0]
call fcn.66203630
nop
lea rcx, [rbp + 0x1b0]
call fcn.66203630
nop
lea rcx, [rsp + 0x30]
call fcn.66203630
inc r15d
lea rcx, [rsp + 0x30]
call fcn.662035e0
nop
mov r8d, r15d
lea rdx, str.TS_UPDATE__u
lea rcx, [rsp + 0x30]
call fcn.66204d20
lea rcx, [rbp + 0x1b0]
call fcn.662035e0
nop
xor r8d, r8d
lea rdx, [rbp + 0x1b0]
mov rcx, qword [rsp + 0x30]
call fcn.66204270
test eax, eax
jns 0x66201a41
jmp 0x66201bbb
mov bl, dil
mov r14b, dil
lea rcx, [rbp + 0x10]
call fcn.66203630
nop
lea rcx, [rbp + 0xe0]
call fcn.66203630
jmp 0x66201bbd
mov bl, 1
lea rcx, [rbp + 0x1b0]
call fcn.66203630
nop
lea rcx, [rsp + 0x30]
call fcn.66203630
test r14b, r14b
je 0x66201c9b
test bl, bl
je 0x66201ca3
mov rdx, rsi
lea rcx, [rbp + 0x10]
call fcn.66203360
nop
lea rax, [rbp + 0xe0]
mov qword [rbp + 0x680], rax
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, [0x6621e9c4]
mov dl, 1
lea rcx, [rbp + 0x10]
call fcn.66203710
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, [0x6621e938]
mov dl, 1
lea rcx, [rbp + 0x10]
call fcn.66203710
lea rdx, [rbp + 0x10]
lea rcx, [rbp + 0xe0]
call fcn.66203360
mov rbx, rax
mov rdx, rsi
lea rcx, [rsp + 0x30]
call fcn.66203360
nop
mov rdx, rbx
mov rcx, rax
call fcn.6620211c
mov rcx, rsi
call fcn.66201ef0
call fcn.66201e5c
mov rdx, r12
lea rcx, [rbp + 0xe0]
call fcn.66203360
mov rcx, rax
call fcn.6620254c
nop
lea rcx, [rbp + 0x10]
call fcn.66203630
jmp 0x66201e1a
test bl, bl
jne 0x66201e1a
cmp qword [rsi + 8], rdi
je 0x66201e05
mov rdx, rsi
lea rcx, [rbp + 0x10]
call fcn.66203360
nop
lea rax, [rbp + 0xe0]
mov qword [rbp + 0x680], rax
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, [0x6621e9c4]
mov dl, 1
lea rcx, [rbp + 0x10]
call fcn.66203710
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
mov r9, r13
lea r8, [0x6621e938]
mov dl, 1
lea rcx, [rbp + 0x10]
call fcn.66203710
lea rdx, [rbp + 0x10]
lea rcx, [rbp + 0xe0]
call fcn.66203360
mov rbx, rax
mov rdx, rsi
lea rcx, [rsp + 0x30]
call fcn.66203360
nop
mov rdx, rbx
mov rcx, rax
call fcn.662021f8
lea rcx, [rsp + 0x30]
call fcn.662035e0
nop
mov r8d, r15d
lea rdx, str.TS_UPDATE__u
lea rcx, [rsp + 0x30]
call fcn.66204d20
lea rcx, [rbp + 0xe0]
call fcn.662035e0
jmp 0x66201db1
xor edx, edx
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
nop
lea rcx, [rbp + 0xe0]
call fcn.66203630
nop
lea rcx, [rsp + 0x30]
call fcn.66203630
inc r15d
lea rcx, [rsp + 0x30]
call fcn.662035e0
nop
mov r8d, r15d
lea rdx, str.TS_UPDATE__u
lea rcx, [rsp + 0x30]
call fcn.66204d20
lea rcx, [rbp + 0xe0]
call fcn.662035e0
nop
xor r8d, r8d
lea rdx, [rbp + 0xe0]
mov rcx, qword [rsp + 0x30]
call fcn.66204270
test eax, eax
jns 0x66201d5d
lea rcx, [rbp + 0xe0]
call fcn.66203630
nop
lea rcx, [rsp + 0x30]
call fcn.66203630
xor r9d, r9d
lea r8, [0x6621e848]
lea rdx, str.Appsync_failed_to_upgrade_older_package.___________________________Older_package_is_locked_by_some_process.___________________________Please_close_all_the_applications_using___________________________older_package_and_restart_the_upgrade.
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxW]
mov r14b, 1
lea rcx, [rbp + 0x10]
call fcn.66203630
mov rdx, r12
lea rcx, [rbp + 0x10]
call fcn.66203360
mov rcx, rax
call fcn.6620254c
nop
lea rcx, [rbp + 0x280]
call fcn.66203630
nop
lea rcx, [rbp + 0x350]
call fcn.66203630
mov dil, r14b
mov rcx, r12
call fcn.66203630
mov al, dil
mov rbx, qword [rsp + 0x778]
add rsp, 0x730
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret