Function at 0x1400a2120
Capabilities:
Generate random numbers via rtlgenrandom
Generate random numbers via winapi
Get thread local storage value
Set thread local storage value

Disassembly:
push rsi
push rdi
push rbx
sub rsp, 0xb0
mov esi, dword [0x1401fe0e8]
test esi, esi
je 0x1400a239e
dec esi
mov ecx, esi
call sub.kernel32.dll_TlsGetValue
cmp rax, 1
ja 0x1400a2393
je 0x1400a21f6
xorps xmm0, xmm0
movaps xmmword [rsp + 0xa0], xmm0
movaps xmmword [rsp + 0x90], xmm0
lea rdx, [rsp + 0x90]
xor ecx, ecx
mov r8d, 0x20
mov r9d, 2
call sub.bcrypt.dll_BCryptGenRandom
cmp eax, 0xc0000000
jb 0x1400a21a5
mov edi, eax
lea rbx, [rsp + 0x90]
mov rcx, rbx
mov edx, 0x20
call sub.advapi32.dll_SystemFunction036
test al, al
je 0x1400a23e7
movaps xmm0, xmmword [rsp + 0x90]
movaps xmm1, xmmword [rsp + 0xa0]
movaps xmmword [rsp + 0x70], xmm1
movaps xmmword [rsp + 0x60], xmm0
mov rax, qword [0x14031a2b0]
test rax, rax
je 0x1400a23bf
and eax, 0x4000
xor ecx, ecx
lea rdi, [rsp + 0x30]
or rax, rcx
je 0x1400a21fd
lea r8, [0x1402dcb30]
lea rdx, [rsp + 0x60]
mov rcx, rdi
call fcn.1400a24b0
jmp 0x1400a2219
xor eax, eax
jmp 0x1400a2393
movaps xmm0, xmmword [rsp + 0x60]
movaps xmm1, xmmword [rsp + 0x70]
movaps xmmword [rsp + 0x30], xmm0
movaps xmmword [rsp + 0x40], xmm1
xorps xmm0, xmm0
movaps xmmword [rsp + 0x50], xmm0
movaps xmm0, xmmword [rdi]
movaps xmm1, xmmword [rdi + 0x10]
movaps xmm2, xmmword [rdi + 0x20]
movaps xmmword [rsp + 0x60], xmm0
movaps xmmword [rsp + 0x70], xmm1
movaps xmmword [rsp + 0x80], xmm2
movups xmmword [rsp + 0x28], xmm0
movups xmmword [rsp + 0x38], xmm1
movups xmmword [rsp + 0x48], xmm2
movzx eax, byte [0x14031a2c8]
mov edx, 0x160
xor ecx, ecx
call fcn.1401dbaa0
test rax, rax
je 0x1400a23c9
mov rdi, rax
mov qword [rax], 1
mov qword [rax + 8], 1
xorps xmm0, xmm0
movaps xmmword [rax + 0x10], xmm0
movaps xmmword [rax + 0x20], xmm0
movaps xmmword [rax + 0x30], xmm0
movaps xmmword [rax + 0x40], xmm0
movaps xmmword [rax + 0x50], xmm0
movaps xmmword [rax + 0x60], xmm0
movaps xmmword [rax + 0x70], xmm0
movaps xmmword [rax + 0x80], xmm0
movaps xmmword [rax + 0x90], xmm0
movaps xmmword [rax + 0xa0], xmm0
movaps xmmword [rax + 0xb0], xmm0
movaps xmmword [rax + 0xc0], xmm0
movaps xmmword [rax + 0xd0], xmm0
movaps xmmword [rax + 0xe0], xmm0
movaps xmmword [rax + 0xf0], xmm0
movaps xmmword [rax + 0x100], xmm0
mov qword [rax + 0x110], 0x40
movups xmm0, xmmword [rsp + 0x20]
movups xmm1, xmmword [rsp + 0x30]
movups xmm2, xmmword [rsp + 0x40]
movups xmmword [rax + 0x118], xmm0
movups xmmword [rax + 0x128], xmm1
movups xmmword [rax + 0x138], xmm2
mov rax, qword [rsp + 0x50]
mov qword [rdi + 0x148], rax
mov qword [rdi + 0x150], 0x10000
mov qword [rdi + 0x158], 0x10000
movzx eax, byte [0x14031a2c8]
mov edx, 0x10
xor ecx, ecx
call fcn.1401dbaa0
test rax, rax
je 0x1400a23d8
mov qword [rax], rdi
mov dword [rax + 8], esi
mov ecx, esi
mov rbx, rax
call sub.kernel32.dll_TlsGetValue
mov rdi, rax
mov ecx, esi
mov rsi, rbx
mov rdx, rbx
call sub.kernel32.dll_TlsSetValue
test rdi, rdi
je 0x1400a2390
mov r8, qword [rdi]
dec qword [r8]
jne 0x1400a237f
dec qword [r8 + 8]
jne 0x1400a237f
mov rcx, qword [0x14031a288]
xor edx, edx
call fcn.1401fb9c4
mov rcx, qword [0x14031a288]
xor edx, edx
mov r8, rdi
call fcn.1401fb9c4
mov rax, rsi
add rsp, 0xb0
pop rbx
pop rdi
pop rsi
ret
lea rcx, str.P__n_
call fcn.1401b4d10
mov esi, eax
mov ecx, esi
call sub.kernel32.dll_TlsGetValue
cmp rax, 1
jbe 0x1400a214b
jmp 0x1400a2393
call fcn.1401de920
jmp 0x1400a21cf
mov ecx, 0x10
mov edx, 0x160
call fcn.140033f80
mov ecx, 8
mov edx, 0x10
call fcn.140033f80
and edi, 0x7fffffff
mov dword [rsp + 0x90], edi
mov qword [rsp + 0x60], rbx
lea rax, [0x1400622f0]
mov qword [rsp + 0x68], rax
lea rax, [0x14027b590]
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x28], 1
mov qword [rsp + 0x40], 0
lea rax, [rsp + 0x60]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x38], 1
lea rdx, str._redacted_
lea rcx, [rsp + 0x20]
call fcn.1400567b0
int3