Function at 0x140007588
Capabilities:
Set thread local storage value

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x80
mov qword [rbp - 0x50], 0xfffffffffffffffe
mov rbx, rcx
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_GetCurrentThreadId]
mov dword [rbx + 0x58], eax
xor eax, eax
mov qword [rbp - 0x48], rax
mov qword [rbp - 0x40], rax
mov dword [rbp - 0x48], 0x7fffffff
or dword [rbp + 0x40], 0xffffffff
lea rcx, [rbp + 0x40]
call fcn.140006dfc
mov edi, eax
mov r13d, 1
test eax, eax
js 0x140007814
lea rdx, [rbp - 0x48]
mov esi, dword [rbp + 0x40]
mov ecx, esi
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsSetValue]
mov eax, dword [rbx + 0x50]
neg eax
sbb edx, edx
and edx, 2
xor ecx, ecx
call qword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoInitializeEx]
mov edi, eax
test eax, eax
js 0x140007814
and qword [rbp + 0x50], 0
and qword [rbp + 0x48], 0
lea rcx, [rbp + 0x50]
call fcn.1400070d0
lea r8, [rbp + 0x50]
lea rdx, [rbp - 0x44]
mov rcx, rbx
call fcn.14000787c
mov edi, eax
test eax, eax
js 0x1400077f6
mov rax, qword [rbp + 0x50]
mov qword [rbp - 0x40], rax
lea rcx, [rbp + 0x48]
call fcn.1400070d0
lea r14, [rbx + 0x5c]
lea r8, [rbp + 0x48]
mov rdx, r14
mov rcx, rbx
call fcn.14000787c
mov edi, eax
test eax, eax
js 0x1400077f6
mov rcx, qword [rbp + 0x48]
call qword [sym.imp.api_ms_win_shcore_thread_l1_1_0.dll_SHSetThreadRef]
mov edi, eax
test eax, eax
js 0x1400077f6
mov eax, dword [rbx + 0x50]
shl eax, 0x18
or eax, dword [rbx + 0x54]
add eax, r13d
mov dword [rbp - 0x48], eax
and dword [rbx + 0x34], 0
mov rcx, qword [rbx + 0x38]
test rcx, rcx
je 0x14000769b
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_SetEvent]
mov rcx, qword [rbx + 0x40]
test rcx, rcx
je 0x1400076a9
call fcn.14001d200
and qword [rbx + 0x40], 0
mov byte [rbx + 0x60], 0
lock dec dword [0x1400cb668]
mov r15b, r13b
lea rsi, [rbx + 0x90]
jmp 0x14000773a
lea rdx, [rbp - 0x38]
mov rcx, rbx
call fcn.140048ef4
mov dword [rsp + 0x20], r13d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, [rbp - 0x38]
call qword [sym.imp.ext_ms_win_rtcore_ntuser_window_ext_l1_1_0.dll_PeekMessageW]
test eax, eax
jne 0x1400076c5
mov eax, dword [rbx + 0x50]
shl eax, 0x18
or eax, dword [rbx + 0x54]
bts eax, 0x17
add eax, r13d
mov dword [rbp - 0x48], eax
mov rcx, qword [rsi]
mov rax, qword [rcx]
mov rax, qword [rax + 0x18]
call qword [case.0x140006f84.0]
mov eax, dword [rbx + 0x50]
shl eax, 0x18
or eax, dword [rbx + 0x54]
add eax, r13d
mov dword [rbp - 0x48], eax
mov rcx, qword [rbx + 0x28]
test rcx, rcx
je 0x140007732
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_SetEvent]
and qword [rbx + 0x28], 0
mov rcx, rbx
call fcn.140007cbc
mov rcx, rsi
call fcn.140007cac
cmp eax, 0xffffffff
jne 0x1400076d1
mov eax, dword [r14]
cmp eax, r13d
jle 0x140007760
or edx, 0xffffffff
mov rcx, rbx
call fcn.140007940
mov eax, dword [r14]
cmp eax, r13d
jne 0x1400077aa
mov r15b, r13b
cmp byte [rbx + 0x30], 0
jne 0x140007771
cmp dword [rbp - 0x44], r13d
jle 0x14000777b
mov rcx, rbx
call fcn.14002f5e0
jmp 0x1400077aa
mov al, byte [reloc.SHCORE.dll_Ordinal_1]
test al, al
je 0x1400077aa
mov eax, r13d
lock xadd dword [0x1400cb5a4], eax
add eax, r13d
cmp eax, 0xa
ja 0x1400077a3
mov rcx, rbx
call fcn.14002f5e0
xor r15b, r15b
lock dec dword [0x1400cb5a4]
mov rcx, rsi
call fcn.140007cac
cmp eax, 0xffffffff
jne 0x14000773a
cmp dword [r14], r13d
jg 0x14000773a
cmp dword [rbp - 0x44], r13d
jg 0x14000773a
mov r8b, r15b
xor edx, edx
mov rcx, rbx
call fcn.14002f628
test al, al
je 0x14000773a
xor ecx, ecx
call qword [sym.imp.api_ms_win_shcore_thread_l1_1_0.dll_SHSetThreadRef]
and qword [rbp - 0x40], 0
mov dword [rbp - 0x48], 0x7fffffff
mov esi, dword [rbp + 0x40]
call qword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoUninitialize]
nop
lea rcx, [rbp + 0x48]
call fcn.1400070d0
nop
lea rcx, [rbp + 0x50]
call fcn.1400070d0
test edi, edi
jns 0x14000785a
mov dword [rbx + 0x34], edi
mov rcx, qword [rbx + 0x38]
test rcx, rcx
je 0x140007826
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_SetEvent]
mov rcx, qword [rbx + 0x40]
test rcx, rcx
je 0x140007839
call fcn.14001cf70
and qword [rbx + 0x40], 0
lock dec dword [0x1400cb668]
xor r8d, r8d
mov dl, r13b
mov rcx, rbx
call fcn.14002f628
lea rcx, [rbx + 0x18]
call fcn.140044de0
mov esi, dword [rbp + 0x40]
cmp esi, 0xffffffff
je 0x140007869
xor edx, edx
mov ecx, esi
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_TlsSetValue]
add rsp, 0x80
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret