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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r13
push r14
sub rsp, 0x30
mov rbp, rcx
mov ecx, dword [0x14003d17c]
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsGetValue]
or ebx, 0xffffffff
mov rsi, rax
test rax, rax
jne 0x140016df6
mov ebx, dword [0x14003d17c]
lea rdx, [rsp + 0x50]
and dword [rsp + 0x50], eax
lea rsi, [rsp + 0x50]
mov ecx, ebx
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsSetValue]
inc dword [rsi]
mov r10, qword [0x14003d048]
lea r13, [0x14003d048]
lea rdx, [0x140035650]
mov r14d, 0x1df
cmp r10, r13
je 0x140016e56
test byte [r10 + 0x1c], 1
je 0x140016e56
mov eax, dword [rsi]
lea ecx, [rax + rax*4]
cmp ecx, 0x1e1
ja 0x140016e36
mov eax, ecx
mov ecx, r14d
sub rcx, rax
jmp 0x140016e38
xor ecx, ecx
lea r9, [rcx + rdx]
mov qword [rsp + 0x20], rbp
mov rcx, qword [r10 + 0x10]
lea r8, [0x1400367b8]
mov edx, 0x28
call fcn.140001370
mov rcx, qword [rbp + 0xe0]
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_ResetEvent]
test eax, eax
jne 0x140016e8d
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
movzx edi, ax
or edi, 0x80070000
test eax, eax
cmovle edi, eax
mov eax, 0x80004005
test edi, edi
cmovns edi, eax
test edi, edi
js 0x140016f5f
mov rcx, qword [rbp + 0x80]
lea r9, [0x140016b20]
xor r8d, r8d
mov qword [rsp + 0x20], rbp
xor edx, edx
call qword [sym.imp.deviceassociation.dll_DafStartEnumCeremonies]
mov edi, eax
test eax, eax
jns 0x140016f09
mov r10, qword [0x14003d048]
cmp r10, r13
je 0x140016fb1
test byte [r10 + 0x1c], 0x10
je 0x140016f66
mov ecx, dword [rsi]
inc ecx
lea eax, [rcx + rcx*4]
cmp eax, 0x1e1
ja 0x140016ee2
mov rcx, r14
sub rcx, rax
jmp 0x140016ee4
xor ecx, ecx
lea r9, [0x140035650]
mov dword [rsp + 0x20], edi
add r9, rcx
lea r8, [0x1400367b8]
mov rcx, qword [r10 + 0x10]
mov edx, 0x29
call fcn.140001304
jmp 0x140016f5f
mov rcx, qword [rbp + 0xe0]
or edx, 0xffffffff
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_WaitForSingleObject]
test eax, eax
jne 0x140016f25
mov edi, dword [rbp + 0x100]
jmp 0x140016f43
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
movzx edi, ax
or edi, 0x80070000
test eax, eax
cmovle edi, eax
mov eax, 0x80004005
test edi, edi
cmovns edi, eax
test edi, edi
js 0x140016f5f
cmp byte [rbp + 0x106], 0
jne 0x140016f5f
cmp byte [rbp + 0x107], 0
mov eax, 0x80070032
cmove edi, eax
mov r10, qword [0x14003d048]
cmp r10, r13
je 0x140016fb1
test byte [r10 + 0x1c], 1
je 0x140016fb1
mov eax, dword [rsi]
lea ecx, [rax + rax*4]
cmp ecx, 0x1e1
ja 0x140016f86
mov eax, ecx
sub r14, rax
jmp 0x140016f89
xor r14d, r14d
mov rcx, qword [r10 + 0x10]
lea r9, [0x140035650]
add r9, r14
mov dword [rsp + 0x28], edi
mov edx, 0x2a
mov qword [rsp + 0x20], rbp
lea r8, [0x1400367b8]
call fcn.140001730
dec dword [rsi]
cmp ebx, 0xffffffff
je 0x140016fcf
mov ecx, ebx
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsGetValue]
test rax, rax
je 0x140016fcf
xor edx, edx
mov ecx, ebx
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsSetValue]
mov rbx, qword [rsp + 0x58]
mov eax, edi
mov rbp, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
add rsp, 0x30
pop r14
pop r13
pop rdi
ret