Function at 0x140004750
Capabilities:
Allocate thread local storage
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
mov eax, 0x1580
call fcn.140006c50
sub rsp, rax
mov rax, qword [0x140040010]
xor rax, rsp
mov qword [rsp + 0x1570], rax
xor ebp, ebp
mov rsi, rcx
mov dword [rsp + 0x20], ebp
mov edi, ebp
mov ecx, dword [0x140040048]
cmp ecx, 0xffffffff
jne 0x140009090
mov ebx, dword [0x140040048]
cmp ebx, 0xffffffff
jne 0x1400047dd
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, ebx
je 0x1400090a4
mov ebx, eax
test dil, 1
jne 0x1400090c5
cmp ebx, 0xffffffff
je 0x1400090d8
mov eax, 0xffffffff
lock cmpxchg dword [0x140040048], ebx
cmp eax, 0xffffffff
jne 0x14000912b
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
jne 0x14000913e
test dil, 4
jne 0x140009161
xor edx, edx
lea rcx, [rsp + 0x570]
mov r8d, 0x1000
call sub.VCRUNTIME140.dll_memset
lea rdx, [rsp + 0x570]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, 0x1000
call qword [sym.imp.mozglue.dll_moz_xmalloc]
mov r8d, 0x1000
lea rdx, [rsp + 0x570]
mov rcx, rax
mov rdi, rax
call sub.VCRUNTIME140.dll_memcpy
mov rdx, rdi
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov rax, qword gs:[0x58]
mov edx, 4
mov dword [rsi + 4], 0xffffffff
mov dword [rsi + 8], ebp
mov rcx, qword [rax]
mov eax, dword [rdx + rcx]
cmp dword [0x1400421e0], eax
jle 0x1400048b8
lea rcx, [0x1400421e0]
call fcn.140005f28
cmp dword [0x1400421e0], 0xffffffff
jne 0x1400048b8
mov ecx, 8
call qword [sym.imp.mozglue.dll_moz_xmalloc]
test rax, rax
je 0x140009174
xor ecx, ecx
mov qword [rsp + 0x40], rcx
mov qword [rax], rcx
lea rcx, [0x1400421e0]
mov qword [0x1400421e8], rax
call fcn.140005ec8
mov rbx, qword [0x1400421e8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov r9, qword [0x1400409a8]
lea r10, [0x1400409b0]
mov r8d, ebp
mov eax, r8d
lea rcx, [r9 + 1]
add rcx, rax
movzx edx, cl
lea rax, [rdx + rdx*2]
cmp dword [r10 + rax*8], ebp
jne 0x14000917c
lea rax, [rdx + rdx*2]
mov qword [0x1400409a8], rdx
mov dword [r10 + rax*8], 1
mov qword [r10 + rax*8 + 8], rbp
mov dword [rsi + 4], edx
mov eax, dword [r10 + rax*8 + 0x10]
mov dword [rsi + 8], eax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov eax, dword [rsi + 4]
mov dword [rsp + 0x28], 0xffffffff
mov dword [rsp + 0x30], eax
cmp eax, 0xffffffff
je 0x140009191
mov eax, dword [rsi + 4]
mov dword [rsp + 0x38], 0x100
mov dword [rsp + 0x20], eax
cmp eax, 0x100
jge 0x1400091e0
mov dword [rsi], 1
mov rcx, qword [rsp + 0x1570]
xor rcx, rsp
call fcn.140005a70
lea r11, [rsp + 0x1580]
mov rbx, qword [r11 + 0x18]
mov rbp, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rsp, r11
pop rdi
ret
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
jne 0x14000484c
jmp 0x140004799
mov r8d, 0x73
lea rdx, str.z:_build_build_src_security_sandbox_chromium_base_threading_thread_local_storage.cc
lea rcx, [rsp + 0x48]
call fcn.14000eab4
mov edi, 1
jmp 0x1400047b4
and edi, 0xfffffffe
lea rcx, [rsp + 0x48]
call fcn.14000ed00
nop
jmp 0x1400047be
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x1400090e7
mov ebx, eax
jmp 0x140009104
or edi, 2
lea rdx, str.z:_build_build_src_security_sandbox_chromium_base_threading_thread_local_storage.cc
mov r8d, 0x7d
lea rcx, [rsp + 0x150]
call fcn.14000eab4
test dil, 2
je 0x14000911a
and edi, 0xfffffffd
lea rcx, [rsp + 0x150]
call fcn.14000ed00
mov ecx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_TlsFree]
nop
jmp 0x1400047c7
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsFree]
mov ebx, dword [0x140040048]
jmp 0x1400047dd
or edi, 4
lea rdx, str.z:_build_build_src_security_sandbox_chromium_base_threading_thread_local_storage.cc
mov r8d, 0x8f
lea rcx, [rsp + 0x258]
call fcn.14000eab4
nop
jmp 0x1400047ee
lea rcx, [rsp + 0x258]
call fcn.14000ed00
nop
jmp 0x1400047f8
mov rax, rbp
jmp 0x1400048a5
inc r8d
cmp r8d, 0x100
jl 0x1400048d9
jmp 0x140004917
lea r8, str.slot____kInvalidSlotValue
lea rdx, [rsp + 0x28]
lea rcx, [rsp + 0x30]
call fcn.14000e594
test rax, rax
je 0x140004938
mov r9, rax
lea rdx, str.z:_build_build_src_security_sandbox_chromium_base_threading_thread_local_storage.cc
mov r8d, 0x11d
lea rcx, [rsp + 0x360]
call fcn.14000eb54
lea rcx, [rsp + 0x360]
call fcn.14000ed00
nop
jmp 0x140004938
lea r8, str.slot____kThreadLocalStorageSize
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x20]
call fcn.14000e594
test rax, rax
je 0x140004952
mov r9, rax
lea rdx, str.z:_build_build_src_security_sandbox_chromium_base_threading_thread_local_storage.cc
mov r8d, 0x11e
lea rcx, [rsp + 0x468]
call fcn.14000eb54
lea rcx, [rsp + 0x468]
call fcn.14000ed00
nop
jmp 0x140004952