Function at 0x18005f410
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
mov rax, rsp
push r12
push r13
push r14
sub rsp, 0x80
mov qword [rsp + 0x68], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov r13, r9
mov r14, r8
mov rsi, rdx
mov rbp, rcx
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
mov dword [rsp + 0x50], eax
lea edx, [rax + 1]
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov r12, rax
mov dword [rsp + 0x54], eax
lea edx, [rax + 1]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
nop
lea ecx, [r12 + rdi]
test ecx, ecx
jne 0x18005f613
lea rdi, [rbp + 0x18]
mov qword [rsp + 0x70], rdi
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebx, eax
mov ecx, dword [rdi + 4]
cmp ecx, eax
jne 0x18005f4b7
mov rbx, qword [rsp + 0x70]
inc dword [rbx]
jmp 0x18005f4d3
mov rcx, qword [rsp + 0x70]
add rcx, 8
call fcn.180035b50
xchg dword [rdi + 4], ebx
mov rbx, qword [rsp + 0x70]
mov dword [rbx], 1
mov byte [rsp + 0x78], 1
mov rcx, qword [rbp + 0x38]
mov rax, qword [rcx + 8]
cmp byte [rax + 0x31], 0
jne 0x18005f4fe
cmp qword [rax + 0x18], rsi
jae 0x18005f4f2
mov rax, qword [rax + 0x10]
jmp 0x18005f4f8
mov rcx, rax
mov rax, qword [rax]
cmp byte [rax + 0x31], 0
je 0x18005f4e6
mov qword [rsp + 0x58], rcx
mov rax, qword [rbp + 0x38]
cmp rcx, rax
je 0x18005f519
cmp rsi, qword [rcx + 0x18]
jb 0x18005f519
lea rdx, [rsp + 0x58]
jmp 0x18005f523
mov qword [rsp + 0x60], rax
lea rdx, [rsp + 0x60]
mov rdx, qword [rdx]
cmp rdx, rax
je 0x18005f5cd
add rdx, 0x20
mov rax, qword [rsp + 0xe0]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0xc8]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0xd8]
mov r8, qword [rsp + 0xd0]
mov rcx, rbp
call fcn.18005ec10
mov esi, eax
dec dword [rbx]
jne 0x18005f5a6
xor ecx, ecx
xchg dword [rdi + 4], ecx
mov rcx, qword [rsp + 0x70]
add rcx, 8
mov edx, 0x80000000
lock xadd dword [rcx], edx
bt edx, 0x1e
jb 0x18005f5a6
cmp edx, 0x80000000
jle 0x18005f5a6
lock bts dword [rcx], 0x1e
jb 0x18005f5a6
call fcn.180035ad0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
mov edx, dword [rsp + 0x54]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, dword [rsp + 0x50]
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, esi
jmp 0x18005f692
dec dword [rbx]
jne 0x18005f60a
xor ecx, ecx
xchg dword [rdi + 4], ecx
mov rcx, qword [rsp + 0x70]
add rcx, 8
mov eax, 0x80000000
lock xadd dword [rcx], eax
bt eax, 0x1e
jb 0x18005f60a
cmp eax, 0x80000000
jle 0x18005f60a
lock bts dword [rcx], 0x1e
jb 0x18005f60a
call fcn.180035ad0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov edi, dword [rsp + 0x50]
mov r12d, dword [rsp + 0x54]
mov rax, qword [rsp + 0xe8]
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0xe0]
mov qword [rsp + 0x40], rax
mov eax, dword [rsp + 0xd8]
mov dword [rsp + 0x38], eax
mov rax, qword [rsp + 0xd0]
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0xc8]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x20], rax
mov r9, r13
mov r8, r14
mov rdx, rsi
mov rcx, qword [rbp + 0x10]
call fcn.180078570
mov ebx, eax
mov edx, r12d
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, edi
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, ebx
lea r11, [rsp + 0x80]
mov rbx, qword [r11 + 0x20]
mov rbp, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop r13
pop r12
ret