Function at 0x1006a510
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x10
mov edi, dword [ebp + 0x24]
mov eax, dword [ebp + 0x14]
xor ecx, ecx
test eax, eax
cmovg ecx, eax
cmp ecx, 3
mov eax, 3
cmovl eax, ecx
mov dword [ebp - 0x10], eax
cmp dword [0x101f4f80], 0
je 0x1006a5ce
mov esi, dword [ebp + 0x20]
mov ebx, dword [ebp + 0x18]
bt edi, 9
jb 0x1006a55d
push dword [0x101f45d4]
call dword [sym.imp.kernel32.dll_TlsGetValue]
test eax, eax
je 0x1006a5b6
mov edx, dword [ebp + 0x1c]
xor eax, eax
inc eax
test ebx, ebx
cmove ebx, eax
mov cl, byte [0x101f45cc]
shl eax, cl
add esi, eax
dec esi
shr esi, cl
shl esi, cl
mov ecx, dword [ebp + 8]
lea eax, [ebx - 1]
cmp eax, 1
ja 0x1006a5d8
and edi, 0xfffffd7f
lea eax, [edi + 0x80]
cmp dword [0x101f4fb8], 0
jne 0x1006a715
push eax
push esi
push edx
push ebx
push dword [ebp - 0x10]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ecx
call sym.nss3.dll__PR_NativeCreateThread
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
sub esp, 0x10
movaps xmm0, xmmword [0x101b11e0]
movups xmmword [esp], xmm0
call fcn.1006e720
add esp, 0x10
jmp 0x1006a55d
call fcn.1001b2f0
jmp 0x1006a541
mov ecx, esi
call fcn.101ad540
test eax, eax
je 0x1006a853
mov esi, eax
mov ebx, dword [eax + 0x18]
lea eax, [ebx - 0x144]
mov dword [ebp - 0x14], eax
mov dword [esi + 0x24], eax
push 0x144
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebx - 0x54], 1
mov dword [ebx - 0x134], esi
mov eax, dword [ebp - 0x10]
mov dword [ebx - 0x140], eax
mov eax, dword [ebp + 0xc]
mov dword [ebx - 0x138], eax
mov eax, dword [ebp + 0x10]
mov dword [ebx - 0x13c], eax
lea eax, [ebx - 0x7c]
mov dword [ebx - 0x7c], eax
mov dword [ebp - 0x10], ebx
mov dword [ebx - 0x78], eax
push dword [ebp - 0x14]
call fcn.1001e400
add esp, 4
cmp eax, 0xffffffff
je 0x1006a89a
mov eax, dword [ebp - 0x10]
lea esi, [eax - 0x104]
push esi
call sym.nss3.dll__PR_MD_NEW_LOCK
add esp, 4
cmp eax, 0xffffffff
je 0x1006a8e9
cmp dword [ebp + 0x1c], 0
je 0x1006a92a
mov ebx, dword [0x101f5008]
call fcn.10156040
mov esi, eax
lea eax, [ebx + 0x1c]
push eax
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov dword [ebx + 8], esi
mov ecx, dword [ebp - 0x10]
mov dword [ecx - 0x64], edi
mov eax, dword [0x101f4f94]
inc eax
mov dword [0x101f4f94], eax
mov dword [ecx - 0x68], eax
mov eax, 0x101f4f90
cmp dword [ebp + 8], 1
jne 0x1006a6bc
or edi, 1
mov eax, dword [ebp - 0x10]
mov dword [eax - 0x64], edi
mov eax, 0x101f4f8c
inc dword [eax]
mov eax, dword [ebp - 0x14]
mov dword [eax], 1
mov esi, dword [0x101f5008]
call fcn.10156040
cmp dword [esi + 8], eax
jne 0x1006a6ea
mov dword [esi + 8], 0
add esi, 0x1c
push esi
call sym.nss3.dll__PR_MD_UNLOCK
add esp, 4
push dword [0x101f45c8]
call dword [sym.imp.kernel32.dll_TlsGetValue]
mov ecx, dword [ebp - 0x10]
mov dword [ecx - 0x58], eax
test byte [ecx - 0x63], 2
jne 0x1006a91b
push 0
push 1
mov eax, dword [ebp - 0x10]
push dword [eax - 0x44]
jmp 0x1006a842
mov dword [ebp - 0x18], eax
mov eax, dword [0x101f4fb4]
mov dword [ebp - 0x14], eax
call fcn.10156040
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
add eax, 0x1c
push eax
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x1c]
mov dword [eax + 8], ecx
mov eax, dword [0x101f4fb8]
test eax, eax
je 0x1006a85c
mov esi, dword [0x101f4fbc]
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov dword [edx], ecx
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov dword [ecx + 4], edx
dec eax
mov dword [0x101f4fb8], eax
mov ebx, dword [0x101f4fb4]
call fcn.10156040
cmp dword [ebx + 8], eax
jne 0x1006a789
mov dword [ebx + 8], 0
add ebx, 0x1c
push ebx
call sym.nss3.dll__PR_MD_UNLOCK
add esp, 4
xor eax, eax
mov dword [esi - 0x8c], eax
mov dword [esi - 0x90], eax
mov dword [esi + 0x44], eax
mov dword [esi + 0x3c], eax
mov dword [esi - 0xa4], eax
lea eax, [esi + 0x10]
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov eax, dword [ebp + 0xc]
mov dword [esi - 0xac], eax
mov eax, dword [ebp + 0x10]
mov dword [esi - 0xb0], eax
or edi, 0x81
cmp dword [ebp + 8], 1
mov edx, dword [ebp - 0x18]
cmove edx, edi
mov eax, 0x101f4f8c
mov ecx, 0x101f4f90
cmove ecx, eax
mov dword [esi + 0x28], edx
lock inc dword [ecx]
mov edi, dword [esi + 0x30]
cmp dword [ebp + 0x1c], 0
je 0x1006a8ce
test edi, edi
je 0x1006a812
mov dword [edi + 0x74], 0xffffffff
lea eax, [edi + 0xc]
push eax
call dword [sym.imp.kernel32.dll_DeleteCriticalSection]
push edi
call dword [sym.imp.mozglue.dll_free]
add esp, 4
xor eax, eax
mov dword [esi + 0x30], eax
lea eax, [esi - 0xb8]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x10]
mov dword [esi - 0xb4], ecx
lea eax, [esi + 0x48]
push ecx
push eax
call fcn.1006f320
add esp, 8
mov dword [esi - 0xb8], 2
push 0
push 1
push dword [esi + 0x48]
call dword [sym.imp.kernel32.dll_ReleaseSemaphore]
mov eax, dword [ebp - 0x14]
add esp, 0x10
jmp 0x1006a5b1
push 0
push 0xffffe890
jmp 0x1006a8ba
mov edi, dword [0x101f4fb4]
call fcn.10156040
cmp dword [edi + 8], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0x1c]
mov eax, dword [ebp - 0x18]
jne 0x1006a59b
mov dword [edi + 8], 0
add edi, 0x1c
push edi
call sym.nss3.dll__PR_MD_UNLOCK
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp + 0x1c]
mov ecx, dword [ebp + 8]
add esp, 4
jmp 0x1006a59b
mov eax, dword [ebp - 0x10]
cmp dword [eax - 0x54], 1
je 0x1006a981
push dword [ebp - 0x14]
call dword [sym.imp.mozglue.dll_free]
add esp, 4
push 0
push 0xffffe8aa
call sym.nss3.dll_PR_SetError
add esp, 8
mov dword [ebp - 0x14], 0
jmp 0x1006a848
test edi, edi
jne 0x1006a812
push dword [0x101f4f88]
call sym.nss3.dll_PR_NewCondVar
add esp, 4
jmp 0x1006a80f
mov eax, dword [ebp - 0x10]
cmp dword [eax - 0x54], 1
je 0x1006a981
mov esi, dword [sym.imp.mozglue.dll_free]
mov edi, dword [ebp - 0x10]
push dword [edi - 0x120]
call esi
add esp, 4
mov dword [edi - 0x120], 0
push dword [ebp - 0x14]
call esi
jmp 0x1006a8b0
push 0
push 1
push dword [0x100]
jmp 0x1006a842
push dword [0x101f4f88]
call sym.nss3.dll_PR_NewCondVar
add esp, 4
mov ecx, dword [ebp - 0x10]
mov dword [ecx - 0x5c], eax
test eax, eax
jne 0x1006a675
push esi
call dword [sym.imp.kernel32.dll_DeleteCriticalSection]
mov eax, dword [ebp - 0x10]
cmp dword [eax - 0x54], 1
je 0x1006a994
mov esi, dword [sym.imp.mozglue.dll_free]
mov edi, dword [ebp - 0x10]
push dword [edi - 0x120]
call esi
add esp, 4
mov dword [edi - 0x120], 0
push dword [ebp - 0x14]
call esi
add esp, 4
jmp 0x1006a8c2
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax - 0x134]
call fcn.101ad720
jmp 0x1006a8b3
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax - 0x134]
call fcn.101ad720
jmp 0x1006a8c2