Function at 0x180019920
Capabilities:
Allocate thread local storage
Get system information on windows

Disassembly:
mov rax, rsp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov rsi, rcx
xor r12d, r12d
mov dword [rax + 0x18], r12d
mov qword [rax - 0x58], r12
mov dword [rax + 0x20], 0x104
mov dword [rax - 0x68], r12d
mov dword [rax - 0x60], r12d
mov qword [rax - 0x50], r12
add rcx, 0xb0
call qword [sym.imp.KERNEL32.dll_GetSystemInfo]
lea rcx, [rsi + 0xe0]
call qword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov r14d, 1
mov dword [rsi + 0x28], r14d
mov dword [rsi + 0x2c], 0x40
mov dword [rsi + 0x30], 0x17c
movabs rax, 0xa26046cef
mov qword [rsi + 0x38], rax
lea rcx, [0x180132118]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov qword [rsi + 0x410], rax
test rax, rax
je 0x1800199cb
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
mov qword [rsp + 0x48], rcx
mov ecx, dword [rcx + 0x50]
add rcx, rax
mov qword [rsi + 0x418], rcx
xorps xmm0, xmm0
movaps xmmword [rsi + 0x3c0], xmm0
movaps xmmword [rsi + 0x3d0], xmm0
movaps xmmword [rsi + 0x3e0], xmm0
movaps xmmword [rsi + 0x3f0], xmm0
movaps xmmword [rsi + 0x400], xmm0
xor eax, eax
lock cmpxchg dword [rsi + 0x3c0], r14d
je 0x180019a0d
mov edi, 0xc000a003
mov rbx, qword [rsp + 0x40]
jmp 0x180019e02
mov dword [rsi + 0x3c8], 0x14
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [rsi + 0x3c4], eax
cmp eax, 0xffffffff
jne 0x180019a72
mov eax, r14d
lock cmpxchg dword [rsi + 0x3c0], r12d
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x180019a4a
nop
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x180019a59
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx edi, ax
or edi, 0xc0070000
mov dword [rsp + 0xa8], edi
test edi, edi
jns 0x180019b09
mov rbx, qword [rsp + 0x40]
jmp 0x180019e09
lea rdi, ds:[rsi + 0x3d0]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_InitializeSListHead]
lea rax, [0x18001c000]
mov qword [rdi + 0x18], rax
lea rax, [0x18001c020]
mov qword [rdi + 0x20], rax
mov dword [rdi + 0x10], 0xa8
mov dword [rdi + 0x28], 3
mov dword [rdi + 0x2c], r12d
mov rcx, rdi
call fcn.18008aaa0
mov qword ds:[rsi + 0x400], rax
test rax, rax
jne 0x180019ae5
mov eax, r14d
lock cmpxchg dword [rsi + 0x3c0], r12d
mov rcx, rdi
call fcn.18008aa40
mov rbx, qword ds:[rsp + 0x40]
jmp 0x180019dfd
mov rdi, rax
xor eax, eax
mov ecx, 0xa8
rep stosb byte [rdi], al
mov edx, 2
mov eax, r14d
lock cmpxchg dword [rsi + 0x3c0], edx
mov dword [rsp + 0xa8], r12d
lfence
xor edx, edx
mov r8d, 0x220
mov rcx, qword [0x180152670]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
test rax, rax
jne 0x180019b30
mov rbx, r12
jmp 0x180019b64
mov dword [rax + 0xc], 0xaaaaaaaa
mov dword [rax + 8], 0x48435523
mov qword [rax], 0x208
mov dword [rax + 0x218], 0xbbbbbbbb
mov dword [rax + 0x21c], 0x48435523
lock inc dword [0x180152678]
lea rbx, [rax + 0x10]
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x40], rbx
test rbx, rbx
je 0x180019dfd
xor edx, edx
mov r8d, 0x208
mov rcx, rbx
call sub.ntdll.dll_memset
mov r8d, 0x104
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov r15d, eax
mov dword [rsp + 0xb0], eax
mov dword [rsp + 0x34], r14d
mov r13, rbx
nop word [rax + rax]
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x180019cab
nop
cmp r14d, 8
je 0x180019cab
inc r14d
mov dword [rsp + 0x34], r14d
imul edi, r14d, 0x104
mov dword [rsp + 0xb8], edi
lea r8, [r13 - 0x10]
xor edx, edx
mov rcx, qword [0x180152670]
call qword [sym.imp.KERNEL32.dll_HeapFree]
lock dec dword [0x180152678]
mov qword [rsp + 0x40], r12
add rdi, rdi
lea r8, [rdi + 0x18]
lea rax, [rdi + 0x10]
cmp rax, rdi
jae 0x180019c14
mov rbx, r12
jmp 0x180019c66
cmp r8, rdi
jae 0x180019c1e
mov rbx, r12
jmp 0x180019c66
lfence
xor edx, edx
mov rcx, qword [0x180152670]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
test rax, rax
jne 0x180019c3a
mov rbx, r12
jmp 0x180019c66
mov dword [rax + 0xc], 0xaaaaaaaa
mov dword [rax + 8], 0x48435523
mov qword [rax], rdi
mov dword [rax + rdi + 0x10], 0xbbbbbbbb
mov dword [rax + rdi + 0x14], 0x48435523
lock inc dword [0x180152678]
lea rbx, [rax + 0x10]
mov r13, rbx
mov qword [rsp + 0x58], rbx
mov qword [rsp + 0x40], rbx
test rbx, rbx
je 0x180019dfd
mov r8, rdi
xor edx, edx
mov rcx, rbx
call sub.ntdll.dll_memset
mov r8d, dword [rsp + 0xb8]
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov r15d, eax
mov dword [rsp + 0xb0], eax
jmp 0x180019bb0
lea rcx, ds:[rsi + 0x68]
mov dword [rsp + 0x20], 0x48435523
movzx r8d, r15w
mov rdx, rbx
call fcn.18008ad60
mov edi, eax
mov dword [rsp + 0xa8], eax
test eax, eax
jns 0x180019d30
lea rcx, [0x180146040]
mov rax, qword [0x180146040]
cmp rax, rcx
je 0x180019e09
test byte [rax + 0x1c], 1
je 0x180019e09
cmp byte [rax + 0x19], 2
jb 0x180019e09
lfence
mov edx, 0x1c
mov edi, dword [rsp + 0xa8]
mov r9d, edi
lea r8, [0x180132130]
mov rcx, qword [0x180146040]
mov rcx, qword [rcx + 0x10]
call fcn.180012460
mov rbx, qword [rsp + 0x40]
jmp 0x180019e09
lea ecx, [r15 - 1]
mov dword [rsp + 0x30], ecx
test ecx, ecx
js 0x180019d4e
movsxd rax, ecx
cmp word [rbx + rax*2], 0x5c
je 0x180019d4e
dec ecx
mov dword [rsp + 0x30], ecx
jmp 0x180019d38
lfence
mov eax, dword [rsp + 0x30]
inc eax
mov dword [rsp + 0x30], eax
mov edi, dword [rsp + 0xb0]
sub edi, eax
mov dword [rsp + 0x38], edi
cdqe
mov rbx, qword [rsp + 0x40]
lea rdx, [rbx + rax*2]
lea rcx, [rsi + 0x58]
mov dword [rsp + 0x20], 0x48435523
movzx r8d, di
call fcn.18008ad60
mov edi, eax
mov dword [rsp + 0xa8], eax
test eax, eax
jns 0x180019de4
lea rcx, [0x180146040]
mov rax, qword [0x180146040]
cmp rax, rcx
je 0x180019e09
test byte [rax + 0x1c], 1
je 0x180019e09
cmp byte [rax + 0x19], 2
jb 0x180019e09
lfence
mov edx, 0x1d
mov edi, dword [rsp + 0xa8]
mov r9d, edi
lea r8, [0x180132130]
mov rcx, qword [0x180146040]
mov rcx, qword [rcx + 0x10]
call fcn.180012460
mov rbx, qword [rsp + 0x40]
jmp 0x180019e09
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov qword [rsi + 0x78], rax
mov edi, r12d
mov dword [rsp + 0xa8], r12d
jmp 0x180019e09
mov edi, 0xc000009a
mov dword [rsp + 0xa8], edi
test rbx, rbx
je 0x180019e34
lea r8, ds:[rbx - 0x10]
xor edx, edx
mov rcx, qword [0x180152670]
call qword [sym.imp.KERNEL32.dll_HeapFree]
lock dec dword [0x180152678]
mov edi, dword [rsp + 0xa8]
mov eax, edi
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret