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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x40
mov rdi, rdx
mov rsi, rcx
mov rax, qword [0x140284a08]
cmp rax, 2
jne 0x14022e449
lea r14, [0x140284a18]
mov rcx, r14
call sub.kernel32.dll_AcquireSRWLockExclusive
mov rax, qword [0x14036c238]
shl rax, 1
test rax, rax
jne 0x14022e453
xor ebx, ebx
movzx eax, byte [0x140284a20]
test al, al
jne 0x14022e4b4
mov r9, qword [0x140284a38]
test r9, r9
je 0x14022e212
mov r15, r9
mov eax, 1
dec r15
mov qword [0x140284a38], r15
mov rdx, qword [0x140284a28]
mov rcx, qword [rdx + r9*8 - 8]
je 0x14022e21c
mov r14, qword [rdx]
mov qword [rdx], rcx
xor r11d, r11d
mov r8, r15
sub r8, 2
cmovae r11, r8
mov r10d, 1
xor r8d, r8d
cmp r9, 4
jae 0x14022e1d0
cmp r15, 2
je 0x14022e201
jmp 0x14022e265
mov r15, qword [rdx + r10*8]
cmp r15, qword [rdx + r10*8 + 8]
mov r15, r8
mov r8, r10
sbb r8, 0xffffffffffffffff
mov r10, qword [rdx + r8*8]
mov qword [rdx + r15*8], r10
lea r10, [r8*2 + 1]
cmp r10, r11
jbe 0x14022e1d0
add r9, 0xfffffffffffffffe
cmp r10, r9
jne 0x14022e227
lea r9, [rdx + r10*8]
mov r11, qword [rdx + r10*8]
mov qword [rdx + r8*8], r11
mov r8, r10
jmp 0x14022e22b
xor eax, eax
cmp rax, 1
jne 0x14022e26f
jmp 0x14022e289
mov r14, rcx
cmp rax, 1
jne 0x14022e26f
jmp 0x14022e289
lea r9, [rdx + r8*8]
mov qword [r9], rcx
mov r9, r8
nop word cs:[rax + rax]
lea r10, [r9 - 1]
mov r8, r10
shr r8, 1
mov r11, qword [rdx + r8*8]
cmp r11, rcx
jbe 0x14022e262
mov qword [rdx + r9*8], r11
mov r9, r8
cmp r10, 2
jae 0x14022e240
jmp 0x14022e265
mov r8, r9
mov qword [rdx + r8*8], rcx
cmp rax, 1
je 0x14022e289
mov r14, qword [0x140284a40]
mov rax, r14
inc rax
je 0x14022e4e8
mov qword [0x140284a40], rax
mov r15d, 0x40
mov eax, 0x40
test r14, r14
je 0x14022e2a1
bsr rax, r14
xor rax, 0x3f
sub r15, rax
xor ecx, ecx
mov rax, r15
sub rax, 1
cmovae rcx, rax
mov r12d, 1
shl r12, cl
mov r13, r14
btc r13, rcx
test r14, r14
cmove r13, r14
test bl, bl
jne 0x14022e2e6
movabs rax, 0x7fffffffffffffff
mov rcx, qword [0x14036c238]
test rcx, rax
jne 0x14022e488
lea rcx, [0x140284a18]
call fcn.14027f1bc
mov qword [rdi], 1
mov qword [rdi + 8], r14
mov qword [rdi + 0x10], r15
mov qword [rdi + 0x18], r12
mov qword [rdi + 0x20], r13
mov ecx, dword [0x140284a68]
test ecx, ecx
je 0x14022e462
dec ecx
call sub.kernel32.dll_TlsGetValue
cmp rax, 2
jb 0x14022e332
mov rdi, rax
cmp qword [rax + 8], 0
jne 0x14022e423
mov ecx, dword [0x140284a68]
test ecx, ecx
je 0x14022e475
dec ecx
call sub.kernel32.dll_TlsGetValue
test rax, rax
je 0x14022e384
mov rdi, rax
cmp rax, 1
jne 0x14022e3f2
lea rax, [0x140331648]
mov qword [rsp + 0x20], rax
lea rcx, [0x1403315b2]
lea r9, [0x140304108]
lea r8, [rsp + 0x30]
mov edx, 0x46
call fcn.1400427e0
ud2
movzx eax, byte [0x14036c240]
mov rcx, qword [0x14036c198]
test rcx, rcx
jne 0x14022e3af
call sub.kernel32.dll_GetProcessHeap
test rax, rax
je 0x14022e502
mov rcx, rax
mov qword [0x14036c198], rax
mov r8d, 0x18
xor edx, edx
call sub.kernel32.dll_HeapAlloc
test rax, rax
je 0x14022e502
mov rdi, rax
lea rax, [0x140284a50]
mov qword [rdi], rax
mov qword [rdi + 8], 0
mov ecx, dword [0x140284a68]
test ecx, ecx
je 0x14022e4a1
dec ecx
mov rdx, rdi
call sub.kernel32.dll_TlsSetValue
mov rax, qword [rdi + 8]
mov rcx, qword [rdi + 0x10]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x38], rcx
mov qword [rdi + 8], 1
mov qword [rdi + 0x10], 0
test rax, rax
je 0x14022e423
lea rcx, [rsp + 0x38]
call fcn.14022de20
add rdi, 0x10
mov qword [rdi], r14
mov qword [rsi], r14
mov qword [rsi + 8], r15
mov qword [rsi + 0x10], r12
mov qword [rsi + 0x18], r13
add rsp, 0x40
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
call fcn.14022dc40
jmp 0x14022e136
call fcn.140207f90
mov ebx, eax
xor bl, 1
jmp 0x14022e15a
lea rcx, [0x140284a50]
call fcn.140202220
mov ecx, eax
jmp 0x14022e319
lea rcx, [0x140284a50]
call fcn.140202220
mov ecx, eax
jmp 0x14022e342
call fcn.140207f90
test al, al
jne 0x14022e2e6
mov byte [0x140284a20], 1
jmp 0x14022e2e6
lea rcx, [0x140284a50]
call fcn.140202220
mov ecx, eax
jmp 0x14022e3ea
mov qword [rsp + 0x30], r14
mov byte [rsp + 0x38], bl
lea rax, str._A0_
mov qword [rsp + 0x20], rax
lea rcx, str.called__Result::unwrap____on_an__Err__value
lea r9, fcn.14022f950
lea r8, [rsp + 0x30]
mov edx, 0x2b
call fcn.1400427e0
jmp 0x14022e500
lea rcx, str.Ran_out_of_thread_IDs_Users_ma__kiri_.cargo_registry_src_index.crates.io_6f17d22bba15001f_thread_local_1.1.7_src_thread_id.rs
lea r8, [0x1403041c8]
mov edx, 0x15
call fcn.140044220
ud2
mov ecx, 8
mov edx, 0x18
call fcn.140004360
ud2