Function at 0x140020228
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x70
mov rax, qword [0x14003d0d8]
xor rax, rsp
mov qword [rbp - 8], rax
mov r13, rcx
mov rbx, rdx
mov ecx, dword [0x14003d17c]
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsGetValue]
or esi, 0xffffffff
mov r15, rax
test rax, rax
jne 0x140020283
mov esi, dword [0x14003d17c]
lea rdx, [rbp - 0x20]
and dword [rbp - 0x20], eax
lea r15, [rbp - 0x20]
mov ecx, esi
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsSetValue]
inc dword [r15]
mov rcx, qword [0x14003d048]
lea rax, [0x14003d048]
lea r12, [0x140035650]
mov edi, 0x1df
cmp rcx, rax
je 0x1400202e9
test byte [rcx + 0x1c], 1
je 0x1400202e9
mov eax, dword [r15]
lea edx, [rax + rax*4]
cmp edx, 0x1e1
ja 0x1400202c2
mov eax, edx
mov edx, edi
sub rdx, rax
jmp 0x1400202c4
xor edx, edx
mov rcx, qword [rcx + 0x10]
lea r9, [rdx + r12]
mov edx, 0x58
mov qword [rsp + 0x20], r13
lea r8, [0x140036cb8]
call fcn.140001370
mov rcx, qword [0x14003d048]
mov rax, qword [r13 + 0x150]
test rax, rax
je 0x14002032c
mov edx, 0x493e0
mov rcx, rax
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_WaitForSingleObject]
mov ecx, eax
neg ecx
sbb r14d, r14d
and r14d, 0x8000ffff
test eax, eax
jne 0x14002031c
mov r14d, dword [r13 + 0x158]
mov rcx, qword [0x14003d048]
test r14d, r14d
js 0x14002074b
mov rax, qword [r13 + 0x80]
mov edx, 0xfa0a1eff
cmp rdx, rax
sbb r14d, r14d
and r14d, 0x80004004
cmp rax, rdx
ja 0x14002074b
mov rax, qword [rbx]
lea rdx, [rbp - 0x28]
and qword [rbp - 0x28], 0
mov rcx, rbx
mov rax, qword [rax + 0x30]
call qword [0x140034e68]
mov r14d, eax
test eax, eax
js 0x140020691
mov r10, qword [r13 + 0x80]
mov r8d, 0xa
mov word [rbp - 0x18], r8w
mov qword [rbp - 0x16], r10
mov rdx, qword [0x14003d048]
lea r12, [0x14003d048]
cmp rdx, r12
je 0x1400203e3
test byte [rdx + 0x1c], 4
je 0x1400203e3
mov eax, dword [r15]
inc eax
lea ecx, [rax + rax*4]
cmp ecx, 0x1e1
ja 0x1400203bb
mov eax, ecx
mov rcx, rdi
sub rcx, rax
jmp 0x1400203bd
xor ecx, ecx
movzx eax, r8w
lea r8, [0x140035650]
lea r9, [rcx + r8]
mov qword [rsp + 0x28], r10
mov rcx, qword [rdx + 0x10]
mov dword [rsp + 0x20], eax
call fcn.14001aa84
movzx r8d, word [rbp - 0x18]
mov rcx, qword [r13 + 0x128]
movzx edx, r8w
lea r8, [rbp - 0x18]
mov rax, qword [rcx]
mov rax, qword [rax + 0x50]
call qword [0x140034e68]
mov r14d, eax
test eax, eax
js 0x140020691
mov rcx, qword [r13 + 0x128]
lea r8, [rbp - 0x40]
xor eax, eax
mov ebx, 2
mov word [rbp - 0x40], ax
mov edx, ebx
mov rax, qword [rcx]
mov rax, qword [rax + 0x60]
call qword [0x140034e68]
mov r14d, eax
test eax, eax
js 0x140020691
mov rcx, qword [0x14003d048]
cmp rcx, r12
je 0x140020496
test byte [rcx + 0x1c], 4
je 0x140020496
mov eax, dword [r15]
inc eax
lea edx, [rax + rax*4]
cmp edx, 0x1e1
ja 0x140020466
mov eax, edx
mov rdx, rdi
sub rdx, rax
jmp 0x140020468
xor edx, edx
movzx eax, word [rbp - 0x40]
lea r9, [0x140035650]
mov rcx, qword [rcx + 0x10]
lea r8, [0x140036cb8]
add r9, rdx
mov dword [rsp + 0x20], eax
mov edx, 0x5a
call fcn.140001304
mov rcx, qword [0x14003d048]
movzx edi, word [rbp - 0x40]
cmp di, bx
jbe 0x140020504
sub di, bx
xor ebx, ebx
movzx ecx, di
mov qword [rbp - 0x38], rbx
lea eax, [rbx + 1]
mul rcx
test rdx, rdx
je 0x1400204be
mov r14d, 0x80070216
jmp 0x1400204f4
lea r9, [rbp - 0x38]
mov r8, rax
mov edx, 1
call fcn.140004940
mov rbx, qword [rbp - 0x38]
mov r14d, eax
test eax, eax
js 0x1400204f4
mov rcx, qword [r13 + 0x128]
mov r8, rbx
movzx edx, di
mov rax, qword [rcx]
mov rax, qword [rax + 0x60]
call qword [0x140034e68]
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoTaskMemFree]
mov rcx, qword [0x14003d048]
test r14d, r14d
js 0x140020698
mov rdx, qword [r13 + 0x128]
lea r8, [rbp - 0x38]
and qword [rbp - 0x38], 0
lea rcx, [r13 + 0x78]
call fcn.14002cce4
mov rdi, qword [rbp - 0x38]
mov r14d, eax
test eax, eax
js 0x14002067c
and qword [rbp - 0x38], 0
lea rcx, [rbp - 0x30]
and qword [rbp - 0x30], 0
call qword [sym.imp.OpcServices.DLL_Ordinal_7]
mov r14d, eax
test eax, eax
js 0x14002062b
mov rcx, qword [rbp - 0x30]
lea rdx, [0x140036c68]
mov r8d, 1
mov rax, qword [rcx]
mov rax, qword [rax + 0x18]
call qword [0x140034e68]
mov r14d, eax
test eax, eax
js 0x14002062b
mov rcx, qword [rbp - 0x30]
lea rdx, [0x140036c58]
mov r8d, 1
mov rax, qword [rcx]
mov rax, qword [rax + 0x18]
call qword [0x140034e68]
mov r14d, eax
test eax, eax
js 0x14002062b
mov rcx, qword [rbp - 0x38]
mov rbx, qword [rbp - 0x30]
test rcx, rcx
je 0x1400205c5
and qword [rbp - 0x38], 0
mov rax, qword [rcx]
mov rax, qword [rax + 0x10]
call qword [0x140034e68]
mov rax, qword [rbx]
lea rdx, [rbp - 0x38]
mov rcx, rbx
mov rax, qword [rax + 0x20]
call qword [0x140034e68]
mov r14d, eax
test eax, eax
js 0x14002062b
mov rcx, qword [rbp - 0x28]
lea r8, [rbp - 0x18]
and qword [rbp - 0x18], 0
lea rdx, [r13 + 0x78]
call fcn.14002ed08
mov rbx, qword [rbp - 0x18]
mov r14d, eax
test eax, eax
js 0x140020616
mov r8, qword [rbp - 0x38]
mov r9, rbx
xor edx, edx
mov rcx, rdi
call qword [sym.imp.OpcServices.DLL_Ordinal_4]
mov r14d, eax
test rbx, rbx
je 0x14002062b
mov rax, qword [rbx]
mov rcx, rbx
mov rax, qword [rax + 0x10]
call qword [0x140034e68]
mov rcx, qword [rbp - 0x30]
test rcx, rcx
je 0x140020646
and qword [rbp - 0x30], 0
mov rax, qword [rcx]
mov rax, qword [rax + 0x10]
call qword [0x140034e68]
mov rcx, qword [rbp - 0x38]
test rcx, rcx
je 0x140020661
and qword [rbp - 0x38], 0
mov rax, qword [rcx]
mov rax, qword [rax + 0x10]
call qword [0x140034e68]
test r14d, r14d
js 0x14002067c
mov rax, qword [rdi]
or edx, 0xffffffff
mov rcx, rdi
mov rax, qword [rax + 0x40]
call qword [0x140034e68]
mov r14d, eax
test rdi, rdi
je 0x140020691
mov rax, qword [rdi]
mov rcx, rdi
mov rax, qword [rax + 0x10]
call qword [0x140034e68]
mov rcx, qword [0x14003d048]
mov rdx, qword [rbp - 0x28]
test rdx, rdx
je 0x1400206bd
and qword [rbp - 0x28], 0
mov rcx, rdx
mov rax, qword [rdx]
mov rax, qword [rax + 0x10]
call qword [0x140034e68]
mov rcx, qword [0x14003d048]
test r14d, r14d
js 0x14002073f
mov rax, qword [r13 + 0x80]
cmp qword [r13 + 0x88], rax
jae 0x14002073f
mov qword [r13 + 0x88], rax
mov rcx, qword [0x14003d048]
lea rbx, [0x14003d048]
cmp rcx, rbx
je 0x1400207a0
test byte [rcx + 0x1c], 4
mov edi, 0x1df
je 0x140020772
mov eax, dword [r15]
inc eax
lea edx, [rax + rax*4]
cmp edx, 0x1e1
ja 0x140020714
mov eax, edx
mov edx, edi
sub rdx, rax
jmp 0x140020716
xor edx, edx
mov rcx, qword [rcx + 0x10]
lea r12, [0x140035650]
lea r9, [rdx + r12]
mov edx, 0x5b
lea r8, [0x140036cb8]
call fcn.1400012b0
mov rcx, qword [0x14003d048]
jmp 0x140020752
mov edi, 0x1df
lea r12, [0x140035650]
lea rbx, [0x14003d048]
cmp rcx, rbx
je 0x1400207a0
test byte [rcx + 0x1c], 1
je 0x1400207a0
mov eax, dword [r15]
lea edx, [rax + rax*4]
cmp edx, 0x1e1
ja 0x14002077b
mov eax, edx
sub rdi, rax
jmp 0x14002077d
lea r12, [0x140035650]
jmp 0x140020752
xor edi, edi
mov rcx, qword [rcx + 0x10]
lea r9, [rdi + r12]
mov edx, 0x5c
mov dword [rsp + 0x28], r14d
lea r8, [0x140036cb8]
mov qword [rsp + 0x20], r13
call fcn.140001730
dec dword [r15]
cmp esi, 0xffffffff
je 0x1400207bf
mov ecx, esi
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsGetValue]
test rax, rax
je 0x1400207bf
xor edx, edx
mov ecx, esi
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsSetValue]
mov eax, r14d
mov rcx, qword [rbp - 8]
xor rcx, rsp
call fcn.1400304d0
mov rbx, qword [rsp + 0xc0]
add rsp, 0x70
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret