Function at 0x1797e40
Capabilities:
Get thread local storage value

Disassembly:
push rdi
sub rsp, 0x50
mov qword [rsp + 0x30], 0xfffffffffffffffe
mov qword [rsp + 0x68], rbx
mov qword [rsp + 0x70], rbp
mov qword [rsp + 0x78], rsi
mov esi, ecx
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 0x1797e84
lea rdi, [rax + 0x20]
jmp 0x1797e86
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
cmp esi, 1
jae 0x1797eb7
mov rcx, qword [rdi + 0x30]
mov r8, qword [rcx]
mov rdx, rax
call qword [r8 + 0x78]
xor eax, eax
jmp 0x17980b6
mov rcx, qword [rdi + 0x30]
mov rax, qword [rcx]
mov edx, 0x8000
call qword [rax + SafeArrayCopy]
mov rbx, rax
test rax, rax
jne 0x1797f00
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 0x17980b6
mov dword [rsp + 0x60], 0x8000
lea rdx, [rsp + 0x60]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetLogicalProcessorInformation]
test eax, eax
jne 0x1798002
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x1797f5b
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 0x17980b6
mov rcx, qword [rdi + 0x30]
mov edx, dword [rsp + 0x60]
shr rdx, 5
add rdx, 1
movabs rax, 0x3ffffffffffffff
cmp rdx, rax
jae 0x1797fd0
mov rax, qword [rcx]
shl rdx, 5
call qword [rax + SafeArrayCopy]
mov rbx, rax
test rax, rax
je 0x1797fd0
lea rdx, [rsp + 0x60]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetLogicalProcessorInformation]
test eax, eax
jne 0x1798002
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 0x17980b6
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 0x17980b6
xor ecx, ecx
xor edx, edx
xor r9d, r9d
xor r10d, r10d
xor r8d, r8d
mov r11d, dword [rsp + 0x60]
shr r11d, 5
je 0x179804f
nop
nop
cmp ecx, esi
jae 0x179804f
mov eax, dword [rbx + 8]
test eax, eax
je 0x1798038
cmp eax, 3
jne 0x1798042
add ecx, 1
or r9, qword [rbx]
jmp 0x1798042
add edx, 1
cmp edx, esi
ja 0x1798042
or r10, qword [rbx]
add r8d, 1
add rbx, 0x20
cmp r8d, r11d
jb 0x1798020
test r9, r9
cmove r9, r10
mov rdx, r9
mov rcx, qword [0x039f50f8]
call qword [sym.imp.KERNEL32.dll_SetProcessAffinityMask]
test eax, eax
jne 0x179808f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rsp + 0x20], 0x1000000f
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov ecx, 0xc1010000
call fcn.0124e580
mov ebx, eax
jmp 0x1798091
xor ebx, ebx
test ebx, ebx
jns 0x17980a7
mov rcx, qword [rdi + 0x30]
mov r8, qword [rcx]
mov rdx, rbp
call qword [r8 + 0x78]
mov eax, ebx
jmp 0x17980b6
mov rcx, qword [rdi + 0x30]
mov rax, qword [rcx]
mov rdx, rbp
call qword [rax + 0x78]
xor eax, eax
mov rbx, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
add rsp, 0x50
pop rdi
ret