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

Disassembly:
push 0xffffffffffffffff
push 0x4aae74
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x24
push ebx
push ebp
push esi
push edi
lea ecx, [esp + 0x14]
call fcn.00420c60
xor ebx, ebx
mov ecx, 0x4eb358
mov dword [esp + 0x3c], ebx
call fcn.00418750
mov ecx, dword [eax + 0x24]
push ecx
lea ecx, [esp + 0x18]
mov edx, dword [eax + 0x20]
push edx
call fcn.00420fd0
mov eax, dword [0x4eb358]
xor esi, esi
cmp eax, 0xffffffff
je 0x416f6f
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
cmp esi, ebx
jne 0x416f6f
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x10], eax
cmp eax, ebx
mov byte [esp + 0x3c], 1
je 0x416f0c
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x416f0e
xor esi, esi
mov eax, dword [0x4eb358]
push esi
push eax
mov byte [esp + 0x44], bl
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp eax, ebx
jne 0x416f3c
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x10]
push 0x4cb060
push ecx
mov dword [esp + 0x18], eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov edi, eax
push 0x4eb360
mov dword [edi], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [0x4eb35c]
push 0x4eb360
mov dword [edi + 4], edx
mov dword [0x4eb35c], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
add esi, 0x28
lea ecx, [esp + 0x14]
push esi
call fcn.00420ff0
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x44]
push eax
push ecx
push edx
lea ecx, [esp + 0x20]
call fcn.00421010
mov ebp, eax
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, 0xffffffff
je 0x41703f
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
cmp edi, ebx
jne 0x41703f
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x44], eax
cmp eax, ebx
mov byte [esp + 0x3c], 2
je 0x416fdc
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x416fde
xor edi, edi
mov eax, dword [0x4eb358]
push edi
push eax
mov byte [esp + 0x44], bl
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp eax, ebx
jne 0x41700c
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x44]
push 0x4cb060
push ecx
mov dword [esp + 0x4c], eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov esi, eax
push 0x4eb360
mov dword [esi], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], edx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x14]
mov dword [edi + 0xb4], eax
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, 0xffffffff
je 0x4170f2
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
cmp edi, ebx
jne 0x4170f2
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x44], eax
cmp eax, ebx
mov byte [esp + 0x3c], 3
je 0x41708f
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x417091
xor edi, edi
mov ecx, dword [0x4eb358]
push edi
push ecx
mov byte [esp + 0x44], bl
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp eax, ebx
jne 0x4170c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0x44]
push 0x4cb060
push edx
mov dword [esp + 0x4c], eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov esi, eax
push 0x4eb360
mov dword [esi], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], eax
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov cl, byte [edi + 0xb0]
and cl, 1
cmp cl, 1
je 0x4171f9
mov edx, dword [esp + 0x48]
cmp dword [edx], 0x64
jae 0x41711a
mov eax, dword [esp + 0x4c]
cmp dword [eax], 0x64
jb 0x4171f9
cmp ebp, ebx
je 0x417125
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, 0xffffffff
je 0x4171ce
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
cmp edi, ebx
jne 0x4171ce
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x48], eax
cmp eax, ebx
mov byte [esp + 0x3c], 4
je 0x41716b
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x41716d
xor edi, edi
mov ecx, dword [0x4eb358]
push edi
push ecx
mov byte [esp + 0x44], bl
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp eax, ebx
jne 0x41719c
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0x48]
push 0x4cb060
push edx
mov dword [esp + 0x50], eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov esi, eax
push 0x4eb360
mov dword [esi], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], eax
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or eax, 0xffffffff
lea ecx, [esp + 0x14]
mov dword [edi + 0xb4], eax
mov dword [esp + 0x3c], eax
call fcn.00420e20
xor eax, eax
mov ecx, dword [esp + 0x34]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
lea ecx, [esp + 0x14]
mov dword [esp + 0x3c], 0xffffffff
call fcn.00420e20
mov ecx, dword [esp + 0x34]
pop edi
mov eax, ebp
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x30
ret