Function at 0x4c5570
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, 0xd0
mov ecx, dword [0x0071b0b0]
test ecx, ecx
je 0x4c564c
dec ecx
call sub.kernel32.dll_TlsGetValue
cmp rax, 1
ja 0x4c5822
je 0x4c5645
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 0x4c55ef
mov esi, eax
lea rdi, [rsp + 0x20]
mov rcx, rdi
mov edx, 0x20
call sub.advapi32.dll_SystemFunction036
test al, al
jne 0x4c55ef
and esi, 0x7fffffff
jne 0x4c587d
movaps xmm0, xmmword [rsp + 0x20]
movaps xmm1, xmmword [rsp + 0x30]
movaps xmmword [rsp + 0x90], xmm1
movaps xmmword [rsp + 0x80], xmm0
mov rax, qword [0x0083c130]
test rax, rax
je 0x4c566e
lea rsi, [rsp + 0x50]
test eax, 0x4000
jne 0x4c567f
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 0x4c5696
xor eax, eax
jmp 0x4c5822
lea rcx, sym.std::sys::thread_local::os_local::destroy_value::hcd6bb79fdb333d1f
call sym.std::sys::pal::windows::thread_local_key::StaticKey::init::h3a56cd97d8b2cb6b
mov ecx, eax
call sub.kernel32.dll_TlsGetValue
cmp rax, 1
jbe 0x4c5599
jmp 0x4c5822
call sym.std_detect::detect::cache::detect_and_initialize::hfe122b35fe975782
lea rsi, [rsp + 0x50]
test eax, 0x4000
je 0x4c5621
lea r8, [0x007b6b78]
lea rdx, [rsp + 0x80]
mov rcx, rsi
call sym._ZN11rand_chacha4guts11init_chacha8impl_avx17hce5f9764efd449a4E.llvm.2343481694024177763
movaps xmm0, xmmword [rsi]
movaps xmm1, xmmword [rsi + 0x10]
movaps xmm2, xmmword [rsi + 0x20]
movups xmmword [rsp + 0x48], xmm0
movups xmmword [rsp + 0x58], xmm1
movups xmmword [rsp + 0x68], xmm2
movzx eax, byte [0x0083c308]
mov edx, 0x170
xor ecx, ecx
call sym.std::sys::pal::windows::alloc::process_heap_alloc::h5a8f05db6a24897c
test rax, rax
je 0x4c585a
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 [0x0083c308]
mov edx, 0x10
xor ecx, ecx
call sym.std::sys::pal::windows::alloc::process_heap_alloc::h5a8f05db6a24897c
test rax, rax
je 0x4c5869
mov qword [rax], rsi
lea rcx, sym.std::sys::thread_local::os_local::destroy_value::hcd6bb79fdb333d1f
mov rsi, rax
mov qword [rax + 8], rcx
mov ecx, dword [0x0071b0b0]
test ecx, ecx
je 0x4c582d
dec ecx
call sub.kernel32.dll_TlsGetValue
mov rdi, rax
mov ecx, dword [0x0071b0b0]
test ecx, ecx
je 0x4c583d
dec ecx
mov rdx, rsi
call fcn.006f5c64
test rdi, rdi
je 0x4c581f
mov r8, qword [rdi]
dec qword [r8]
jne 0x4c580e
dec qword [r8 + 8]
jne 0x4c580e
mov rcx, qword [0x0083c108]
xor edx, edx
call fcn.006f5b74
mov rcx, qword [0x0083c108]
xor edx, edx
mov r8, rdi
call fcn.006f5b74
mov rax, rsi
add rsp, 0xd0
pop rbx
pop rdi
pop rsi
ret
lea rcx, sym.std::sys::thread_local::os_local::destroy_value::hcd6bb79fdb333d1f
call sym.std::sys::pal::windows::thread_local_key::StaticKey::init::h3a56cd97d8b2cb6b
mov ecx, eax
jmp 0x4c57d1
lea rcx, sym.std::sys::thread_local::os_local::destroy_value::hcd6bb79fdb333d1f
call sym.std::sys::pal::windows::thread_local_key::StaticKey::init::h3a56cd97d8b2cb6b
mov ecx, eax
mov rdx, rsi
call fcn.006f5c64
test rdi, rdi
jne 0x4c57f2
jmp 0x4c581f
mov ecx, 0x10
mov edx, 0x170
call sym.alloc::alloc::handle_alloc_error::h033f15fcf3b32b44
mov ecx, 8
mov edx, 0x10
call sym.alloc::alloc::handle_alloc_error::h033f15fcf3b32b44
jmp 0x4c5913
movzx eax, byte [0x0083c308]
mov edx, 4
xor ecx, ecx
call sym.std::sys::pal::windows::alloc::process_heap_alloc::h5a8f05db6a24897c
test rax, rax
jne 0x4c58a4
mov ecx, 4
mov edx, 4
call sym.alloc::alloc::handle_alloc_error::h033f15fcf3b32b44
mov dword [rax], esi
mov qword [rsp + 0x20], rax
lea rax, [0x007414f8]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x80], rdi
lea rax, [sym.__rand_core::error::Error_as_core::fmt::Display_::fmt::hdab359d01ea312b2]
mov qword [rsp + 0x88], rax
lea rax, str.could_not_initialize_thread_rng:
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], 1
mov qword [rsp + 0x60], 0
lea rax, [rsp + 0x80]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x58], 1
lea rdx, str._home_slixe_.cargo_registry_src_index.crates.io_6f17d22bba15001f_rand_0.8.5_src_rngs_thread.rs
lea rcx, [rsp + 0x40]
call sym.core::panicking::panic_fmt::h9e181c62584cc428
ud2