Function at 0x14001b9b0
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
sub rsp, 0xb8
mov ecx, dword [0x140058020]
test ecx, ecx
je 0x14001ba88
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
ja 0x14001bc76
je 0x14001ba81
xorps xmm0, xmm0
movaps xmmword [rsp + 0x30], xmm0
movaps xmmword [rsp + 0x20], xmm0
lea rdx, [rsp + 0x20]
xor ecx, ecx
mov r8d, 0x20
mov r9d, 2
call sub.bcrypt.dll_BCryptGenRandom
cmp eax, 0xc0000000
jb 0x14001ba2b
mov esi, eax
lea rcx, [rsp + 0x20]
mov edx, 0x20
call sub.ADVAPI32.dll_SystemFunction036
test al, al
jne 0x14001ba2b
and esi, 0x7fffffff
jne 0x14001bcad
movaps xmm0, xmmword [rsp + 0x20]
movaps xmm1, xmmword [rsp + 0x30]
movaps xmmword [rsp + 0x90], xmm1
movaps xmmword [rsp + 0x80], xmm0
mov rax, qword [0x1428c80f8]
test rax, rax
je 0x14001baaa
lea rsi, [rsp + 0x50]
test eax, 0x4000
jne 0x14001babb
movaps xmm0, xmmword [rsp + 0x80]
movaps xmm1, xmmword [rsp + 0x90]
movaps xmmword [rsp + 0x50], xmm0
movaps xmmword [rsp + 0x60], xmm1
xorps xmm0, xmm0
movaps xmmword [rsp + 0x70], xmm0
jmp 0x14001bad2
xor eax, eax
jmp 0x14001bc76
lea rcx, [0x140058008]
call fcn.14002abc0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
jbe 0x14001b9d8
jmp 0x14001bc76
call fcn.140035470
lea rsi, [rsp + 0x50]
test eax, 0x4000
je 0x14001ba5d
lea r8, [0x1428c2570]
lea rdx, [rsp + 0x80]
mov rcx, rsi
call fcn.14001dff0
movaps xmm0, xmmword [rsi]
movaps xmm1, xmmword [rsi + 0x10]
movaps xmm2, xmmword [rsi + 0x20]
movaps xmmword [rsp + 0x80], xmm0
movaps xmmword [rsp + 0x90], xmm1
movaps xmmword [rsp + 0xa0], xmm2
movups xmmword [rsp + 0x48], xmm0
movups xmmword [rsp + 0x58], xmm1
movups xmmword [rsp + 0x68], xmm2
movzx eax, byte [0x1428c8100]
mov edx, 0x170
xor ecx, ecx
call fcn.1400321e0
test rax, rax
je 0x14001bcc5
mov rsi, 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 + 0x40]
movups xmm1, xmmword [rsp + 0x50]
movups xmm2, xmmword [rsp + 0x60]
movups xmmword [rax + 0x118], xmm0
movups xmmword [rax + 0x128], xmm1
movups xmmword [rax + 0x138], xmm2
mov rax, qword [rsp + 0x70]
mov qword [rsi + 0x148], rax
mov qword [rsi + 0x150], 0x10000
mov qword [rsi + 0x158], 0x10000
mov qword [rsi + 0x160], 0
movzx eax, byte [0x1428c8100]
mov edx, 0x10
xor ecx, ecx
call fcn.1400321e0
test rax, rax
je 0x14001bcc5
mov qword [rax], rsi
lea rcx, [0x140058008]
mov rsi, rax
mov qword [rax + 8], rcx
mov ecx, dword [0x140058020]
test ecx, ecx
je 0x14001bc80
dec ecx
call sub.KERNEL32.dll_TlsGetValue
mov rdi, rax
mov ecx, dword [0x140058020]
test ecx, ecx
je 0x14001bc90
dec ecx
mov rdx, rsi
call sub.KERNEL32.dll_TlsSetValue
test rdi, rdi
je 0x14001bc73
mov r8, qword [rdi]
dec qword [r8]
jne 0x14001bc62
dec qword [r8 + 8]
jne 0x14001bc62
mov rcx, qword [0x1428c80c8]
xor edx, edx
call sub.KERNEL32.dll_HeapFree
mov rcx, qword [0x1428c80c8]
xor edx, edx
mov r8, rdi
call sub.KERNEL32.dll_HeapFree
mov rax, rsi
add rsp, 0xb8
pop rdi
pop rsi
ret
lea rcx, [0x140058008]
call fcn.14002abc0
mov ecx, eax
jmp 0x14001bc25
lea rcx, [0x140058008]
call fcn.14002abc0
mov ecx, eax
mov rdx, rsi
call sub.KERNEL32.dll_TlsSetValue
test rdi, rdi
jne 0x14001bc46
jmp 0x14001bc73
movzx eax, byte [0x1428c8100]
mov edx, 4
xor ecx, ecx
call fcn.1400321e0
test rax, rax
jne 0x14001bcc7
ud2
mov dword [rax], esi
ud2