Function at 0x496520
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
mov ecx, dword [0x0085f180]
cmp ecx, 0xffffffff
je 0x49687e
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov r12, rax
test rax, rax
je 0x49687e
cmp qword [rax + 0x50], 0
mov rbx, qword [rax + 0x18]
je 0x49667d
nop dword [rax + rax]
mov rsi, qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rdi, qword [sym.imp.KERNEL32.dll_HeapFree]
mov rbp, rsi
jmp 0x4965cb
mov rax, qword [rbx + 8]
mov rcx, qword [rbx]
mov r14, rbp
mov qword [r12 + 0x18], rax
test rcx, rcx
je 0x4965b5
mov rax, qword [rcx]
call qword [rax + 0x10]
mov r13, qword [rbx]
mov r14, rsi
mov rax, qword [r13]
mov rcx, r13
call qword [rax]
call rsi
mov rcx, rax
mov r8, r13
xor edx, edx
call rdi
call r14
mov rcx, rax
mov r8, rbx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rbx, qword [r12 + 0x18]
test rbx, rbx
jne 0x496580
cmp qword [r12 + 0x50], 0
je 0x496690
lea rbx, [r12 + 0x30]
lea rsi, [method.boost::detail::sp_counted_base.destroy__]
jmp 0x496600
mov rcx, r13
call sym.operator_delete_void_
sub qword [r12 + 0x50], 1
je 0x496678
mov r13, qword [r12 + 0x40]
mov rcx, qword [r13 + 0x28]
test rcx, rcx
je 0x49661d
mov rdx, qword [r13 + 0x38]
test rdx, rdx
je 0x49661d
mov rax, qword [rcx]
call qword [rax + 0x10]
mov rcx, r13
mov rdx, rbx
call method.std._Rb_tree_rebalance_for_erase_std::_Rb_tree_node_base__std::_Rb_tree_node_base_
mov r14, qword [rax + 0x30]
mov r13, rax
test r14, r14
je 0x4965f0
lock sub dword [r14 + 8], 1
jne 0x4965f0
mov rax, qword [r14]
mov rcx, r14
call qword [rax + 0x10]
lock sub dword [r14 + 0xc], 1
jne 0x4965f0
mov rax, qword [r14]
mov rcx, r14
mov rdx, qword [rax + 0x18]
cmp rdx, rsi
jne 0x496820
call qword [rax + 8]
mov rcx, r13
call sym.operator_delete_void_
sub qword [r12 + 0x50], 1
jne 0x496600
nop dword [rax + rax]
mov rbx, qword [r12 + 0x18]
test rbx, rbx
jne 0x496568
nop word cs:[rax + rax]
lea rbx, [0x00a2f5e8]
mov byte [rsp + 0x38], 0
movabs rax, 0x7f0725e3c15730e2
mov rsi, qword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
mov qword [rsp + 0x30], rax
mov eax, ebx
mov rdi, rbx
mov rbp, rbx
shr al, 4
mov r13, rbx
mov byte [rsp + 0x48], 0
mov qword [rsp + 0x40], 0
add eax, 0x41
mov byte [rsp + 0x25], al
mov rax, rbx
sar rax, 8
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x26], al
mov rax, rbx
sar rax, 0xc
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x27], al
mov rax, rbx
sar rax, 0x10
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x28], al
mov rax, rbx
sar rax, 0x14
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x29], al
mov rax, rbx
sar rax, 0x18
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x2a], al
mov rax, rbx
sar rax, 0x1c
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x2b], al
mov rax, rbx
sar rax, 0x20
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x2c], al
mov rax, rbx
sar rax, 0x24
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x2d], al
mov rax, rbx
sar rax, 0x28
and eax, 0xf
add eax, 0x41
mov byte [rsp + 0x2e], al
mov rax, rbx
sar rax, 0x2c
and eax, 0xf
add eax, 0x41
sar rdi, 0x30
mov byte [rsp + 0x2f], al
mov rax, rbx
sar rbp, 0x34
and edi, 0xf
sar r13, 0x38
shr rax, 0x3c
and ebp, 0xf
add edi, 0x41
and r13d, 0xf
mov r14, rax
add ebp, 0x41
add r13d, 0x41
add r14d, 0x41
jmp 0x4967e5
lock add dword [0x00a2f5ec], 1
mov byte [rsp + 0x38], 1
mov eax, dword [0x00a2f5e8]
cmp eax, dword [rsp + 0x30]
je 0x4968ec
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x496919
xor r8d, r8d
mov edx, 0xffffffff
call rsi
mov eax, dword [0x00a2f5e8]
cmp eax, dword [rsp + 0x30]
je 0x4968ec
mov edx, dword [rsp + 0x34]
xor eax, eax
lock cmpxchg dword [0x00a2f5e8], edx
test eax, eax
je 0x496898
cmp byte [rsp + 0x38], 0
je 0x4967b0
mov rcx, qword [rsp + 0x40]
jmp 0x4967db
call rdx
jmp 0x4965f0
mov eax, dword [0x00a2f5ec]
cmp eax, 1
jg 0x496cd4
mov r13, qword [rsp + 0x40]
test r13, r13
jne 0x4968e3
mov ecx, dword [0x0085f180]
cmp ecx, 0xffffffff
je 0x496857
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
lock sub dword [r12 + 8], 1
jne 0x49687e
mov rax, qword [r12]
mov rcx, r12
call qword [rax]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, r12
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop
add rsp, 0xa8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r15, qword [rsp + 0x40]
test r15, r15
je 0x496aeb
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ResetEvent]
call method.boost.tss_cleanup_implemented__
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp byte [rsp + 0x38], 0
mov dword [0x0085f180], eax
je 0x496b30
mov eax, dword [rsp + 0x30]
xchg dword [0x00a2f5e8], eax
mov r13, qword [rsp + 0x40]
test r13, r13
je 0x496827
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [rsp + 0x40]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x496844
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x0085f180]
cmp ecx, 0xffffffff
je 0x496857
jmp 0x49684f
cmp byte [rsp + 0x48], 0
je 0x496961
lea r9, [rsp + 0x48]
xor r8d, r8d
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rcx, qword [rsp + 0x40]
mov r15, rax
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
jbe 0x496951
mov qword [rsp + 0x40], r15
jmp 0x4967e5
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], r15
jmp 0x4967e5
mov eax, dword [0x009b7230]
movdqu xmm3, xmmword [str.LocalC15730E2_145C_4c5e_B005_3BC753F42475_once_flag]
movdqu xmm4, xmmword [0x009b7210]
movdqu xmm5, xmmword [0x009b7220]
mov dword [rsp + 0x78], eax
movzx eax, word [0x009b7234]
movups xmmword [rsp + 0x48], xmm3
mov word [rsp + 0x7c], ax
mov eax, ebx
and eax, 0xf
movups xmmword [rsp + 0x58], xmm4
add eax, 0x41
movups xmmword [rsp + 0x68], xmm5
mov byte [rsp + 0x7e], al
movzx eax, byte [rsp + 0x25]
mov byte [rsp + 0x7f], al
movzx eax, byte [rsp + 0x26]
mov byte [rsp + 0x80], al
movzx eax, byte [rsp + 0x27]
mov byte [rsp + 0x81], al
movzx eax, byte [rsp + 0x28]
mov byte [rsp + 0x82], al
movzx eax, byte [rsp + 0x29]
mov byte [rsp + 0x83], al
movzx eax, byte [rsp + 0x2a]
mov byte [rsp + 0x84], al
movzx eax, byte [rsp + 0x2b]
mov byte [rsp + 0x85], al
movzx eax, byte [rsp + 0x2c]
mov byte [rsp + 0x86], al
movzx eax, byte [rsp + 0x2d]
mov byte [rsp + 0x87], al
movzx eax, byte [rsp + 0x2e]
mov byte [rsp + 0x88], al
movzx eax, byte [rsp + 0x2f]
mov byte [rsp + 0x89], al
mov byte [rsp + 0x8a], dil
mov byte [rsp + 0x8b], bpl
mov byte [rsp + 0x8c], r13b
mov byte [rsp + 0x8d], r14b
mov byte [rsp + 0x8e], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov edx, eax
mov byte [rsp + 0x96], 0
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x8e], dl
mov edx, eax
shr dl, 4
add edx, 0x41
mov byte [rsp + 0x8f], dl
mov edx, eax
shr edx, 8
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x90], dl
mov edx, eax
shr edx, 0xc
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x91], dl
mov edx, eax
shr edx, 0x10
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x92], dl
mov edx, eax
shr edx, 0x14
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x93], dl
mov edx, eax
shr eax, 0x1c
shr edx, 0x18
add eax, 0x41
and edx, 0xf
mov byte [rsp + 0x95], al
add edx, 0x41
mov byte [rsp + 0x94], dl
jmp 0x496920
cmp byte [rsp + 0x48], 0
je 0x496b4a
mov ecx, 0x100002
lea r8, [rsp + 0x48]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_OpenEventA]
mov rcx, qword [rsp + 0x40]
mov r15, rax
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
jbe 0x496b42
mov qword [rsp + 0x40], r15
test r15, r15
je 0x4968af
jmp 0x4968a6
lock add dword [0x00a2f5ec], 1
mov byte [rsp + 0x38], 1
jmp 0x4968cb
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x496b16
mov eax, dword [0x009b7230]
movdqu xmm0, xmmword [str.LocalC15730E2_145C_4c5e_B005_3BC753F42475_once_flag]
movdqu xmm1, xmmword [0x009b7210]
movdqu xmm2, xmmword [0x009b7220]
mov dword [rsp + 0x78], eax
movzx eax, word [0x009b7234]
movups xmmword [rsp + 0x48], xmm0
mov word [rsp + 0x7c], ax
mov eax, ebx
and eax, 0xf
movups xmmword [rsp + 0x58], xmm1
add eax, 0x41
movups xmmword [rsp + 0x68], xmm2
mov byte [rsp + 0x7e], al
movzx eax, byte [rsp + 0x25]
mov byte [rsp + 0x7f], al
movzx eax, byte [rsp + 0x26]
mov byte [rsp + 0x80], al
movzx eax, byte [rsp + 0x27]
mov byte [rsp + 0x81], al
movzx eax, byte [rsp + 0x28]
mov byte [rsp + 0x82], al
movzx eax, byte [rsp + 0x29]
mov byte [rsp + 0x83], al
movzx eax, byte [rsp + 0x2a]
mov byte [rsp + 0x84], al
movzx eax, byte [rsp + 0x2b]
mov byte [rsp + 0x85], al
movzx eax, byte [rsp + 0x2c]
mov byte [rsp + 0x86], al
movzx eax, byte [rsp + 0x2d]
mov byte [rsp + 0x87], al
movzx eax, byte [rsp + 0x2e]
mov byte [rsp + 0x88], al
movzx eax, byte [rsp + 0x2f]
mov byte [rsp + 0x89], al
mov byte [rsp + 0x8a], dil
mov byte [rsp + 0x8b], bpl
mov byte [rsp + 0x8c], r13b
mov byte [rsp + 0x8d], r14b
mov byte [rsp + 0x8e], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov byte [rsp + 0x96], 0
mov edx, eax
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x8e], dl
mov edx, eax
shr dl, 4
add edx, 0x41
mov byte [rsp + 0x8f], dl
mov edx, eax
shr edx, 8
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x90], dl
mov edx, eax
shr edx, 0xc
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x91], dl
mov edx, eax
shr edx, 0x10
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x92], dl
mov edx, eax
shr edx, 0x14
and edx, 0xf
add edx, 0x41
mov byte [rsp + 0x93], dl
mov edx, eax
shr eax, 0x1c
shr edx, 0x18
add eax, 0x41
and edx, 0xf
mov byte [rsp + 0x95], al
add edx, 0x41
mov byte [rsp + 0x94], dl
jmp 0x496af2
cmp byte [rsp + 0x48], 0
lea rbx, [rsp + 0x48]
je 0x496d0f
xor ecx, ecx
mov r9, rbx
xor r8d, r8d
mov edx, 1
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rcx, qword [rsp + 0x40]
mov r13, rax
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
jbe 0x496d20
mov qword [rsp + 0x40], r13
jmp 0x49683b
lea rdx, [0x00a2f5e8]
mov rcx, rbx
call method.boost::detail.name_once_mutex_char__void_
jmp 0x496ce0
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x496d05