Function at 0x1797bb0
Capabilities:
Get thread local storage value

Disassembly:
push rsi
push rdi
push r12
sub rsp, 0x50
mov qword [rsp + 0x30], 0xfffffffffffffffe
mov qword [rsp + 0x78], rbx
mov qword [rsp + 0x80], rbp
mov r12, rdx
mov rsi, rcx
mov qword [rsp + 0x38], 0
mov rax, qword [0x039f1180]
mov ecx, dword [rax + 8]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x1797bf9
lea rdi, [rax + 0x20]
jmp 0x1797bfb
xor edi, edi
mov qword [rsp + 0x38], rdi
mov rcx, qword [rdi + 0x30]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VarBstrFromCy]
mov rbp, rax
mov qword [rsp + 0x40], rax
mov ecx, dword [0x039f5040]
mov dword [r12], ecx
mov ecx, dword [0x039f5040]
mov dword [rsi], ecx
cmp dword [0x039f5040], 1
jne 0x1797c42
mov rcx, qword [rdi + 0x30]
mov r8, qword [rcx]
mov rdx, rax
call qword [r8 + 0x78]
xor eax, eax
jmp 0x1797dff
mov rcx, qword [rdi + 0x30]
mov rax, qword [rcx]
mov edx, 0x8000
call qword [rax + SafeArrayCopy]
mov rbx, rax
test rax, rax
jne 0x1797c8b
mov qword [rsp + 0x20], 0x1000000f
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov ecx, 0xc1030001
call fcn.0124e580
mov ebx, eax
mov rcx, qword [rdi + 0x30]
mov r8, qword [rcx]
mov rdx, rbp
call qword [r8 + 0x78]
mov eax, ebx
jmp 0x1797dff
mov dword [rsp + 0x70], 0x8000
lea rdx, [rsp + 0x70]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetLogicalProcessorInformation]
test eax, eax
jne 0x1797d8a
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x1797ce6
mov qword [rsp + 0x20], 0x1000000f
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov ecx, 0xc1010000
call fcn.0124e580
mov ebx, eax
mov rcx, qword [rdi + 0x30]
mov r8, qword [rcx]
mov rdx, rbp
call qword [r8 + 0x78]
mov eax, ebx
jmp 0x1797dff
mov rcx, qword [rdi + 0x30]
mov edx, dword [rsp + 0x70]
shr rdx, 5
add rdx, 1
movabs rax, 0x3ffffffffffffff
cmp rdx, rax
jae 0x1797d5b
mov rax, qword [rcx]
shl rdx, 5
call qword [rax + SafeArrayCopy]
mov rbx, rax
test rax, rax
je 0x1797d5b
lea rdx, [rsp + 0x70]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetLogicalProcessorInformation]
test eax, eax
jne 0x1797d8a
mov qword [rsp + 0x20], 0x1000000f
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov ecx, 0xc1010000
call fcn.0124e580
mov ebx, eax
mov rcx, qword [rdi + 0x30]
mov r8, qword [rcx]
mov rdx, rbp
call qword [r8 + 0x78]
mov eax, ebx
jmp 0x1797dff
mov qword [rsp + 0x20], 0x1000000f
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov ecx, 0xc1030001
call fcn.0124e580
mov ebx, eax
mov rcx, qword [rdi + 0x30]
mov r8, qword [rcx]
mov rdx, rbp
call qword [r8 + 0x78]
mov eax, ebx
jmp 0x1797dff
xor r8d, r8d
xor edx, edx
xor r9d, r9d
mov eax, dword [rsp + 0x70]
shr eax, 5
je 0x1797df0
mov r10d, eax
nop
mov eax, dword [rbx + 8]
test eax, eax
je 0x1797db2
cmp eax, 3
jne 0x1797dcb
add r8, 1
jmp 0x1797dcb
add r9, 1
mov ecx, dword [rbx]
test ecx, ecx
je 0x1797dcb
nop
lea eax, [rcx - 1]
add rdx, 1
and ecx, eax
jne 0x1797dc0
add rbx, 0x20
sub r10, 1
jne 0x1797da0
test r8, r8
jle 0x1797ddf
mov dword [rsi], r8d
jmp 0x1797de7
test r9, r9
jle 0x1797de7
mov dword [rsi], r9d
test rdx, rdx
jle 0x1797df0
mov dword [r12], edx
mov rcx, qword [rdi + 0x30]
mov rax, qword [rcx]
mov rdx, rbp
call qword [rax + 0x78]
xor eax, eax
mov rbx, qword [rsp + 0x78]
mov rbp, qword [rsp + 0x80]
add rsp, 0x50
pop r12
pop rdi
pop rsi
ret