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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4aade3
push eax
mov dword fs:[0], esp
sub esp, 0xd7c
mov ecx, 0x4eb358
push ebp
push esi
push edi
call fcn.00418750
mov al, byte [eax + 0xb0]
mov edi, dword [esp + 0xda4]
mov ebp, dword [esp + 0xda0]
and al, 1
cmp al, 1
je 0x416467
cmp ebp, 0x64
jae 0x41644c
cmp edi, 0x64
jb 0x416467
mov ecx, 0x4eb358
call fcn.00418750
mov dword [eax + 0xb4], 0xffffffff
xor eax, eax
jmp 0x416823
mov esi, dword [esp + 0xd9c]
test esi, esi
jne 0x41653b
mov eax, dword [0x4eb358]
cmp eax, 0xffffffff
je 0x416600
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x416600
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x10], eax
test eax, eax
mov dword [esp + 0xd90], esi
je 0x4164bc
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x4164be
xor esi, esi
mov ecx, dword [0x4eb358]
push esi
push ecx
mov dword [esp + 0xd98], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4165ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xc]
push 0x4cb060
push edx
mov dword [esp + 0x14], 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 eax, dword [0x4eb35c]
push 0x4eb360
mov dword [edi + 4], eax
mov dword [0x4eb35c], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esi + 0xb4], 5
xor eax, eax
jmp 0x416823
mov eax, dword [esp + 0xdb0]
test eax, eax
jne 0x416611
mov eax, dword [0x4eb358]
xor esi, esi
cmp eax, 0xffffffff
je 0x416600
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x416600
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x10], eax
test eax, eax
mov dword [esp + 0xd90], 1
je 0x416596
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x416598
xor esi, esi
mov ecx, dword [0x4eb358]
push esi
push ecx
mov dword [esp + 0xd98], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4165ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xc]
push 0x4cb060
push edx
mov dword [esp + 0x14], 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 eax, dword [0x4eb35c]
push 0x4eb360
mov dword [edi + 4], eax
mov dword [0x4eb35c], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esi + 0xb4], 5
xor eax, eax
jmp 0x416823
lea ecx, [eax + 1]
xor eax, eax
xor edx, edx
add eax, 4
mov dl, byte [ecx + 1]
add ecx, 4
mov dword [esp + eax + 0x984], edx
xor edx, edx
mov dl, byte [ecx - 4]
mov dword [esp + eax + 0x184], edx
xor edx, edx
mov dl, byte [ecx - 5]
cmp eax, 0x400
mov dword [esp + eax + 0x584], edx
jl 0x416616
lea ecx, [esp + 0x14]
call fcn.0041fe40
lea eax, [esp + 0x588]
push esi
lea ecx, [esp + 0x18c]
push eax
mov eax, dword [esp + 0xdb4]
lea edx, [esp + 0x990]
push ecx
mov ecx, dword [esp + 0xdb4]
push edx
mov edx, dword [esp + 0xda8]
push 8
push eax
push ecx
push 0
push edi
push ebp
push edx
lea ecx, [esp + 0x40]
mov dword [esp + 0xdbc], 2
call fcn.0041fff0
mov ebp, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [esp + 0x10], eax
mov eax, dword [0x4eb358]
xor esi, esi
cmp eax, 0xffffffff
je 0x416751
push eax
call ebp
mov esi, eax
test esi, esi
jne 0x416751
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0xc], eax
test eax, eax
mov byte [esp + 0xd90], 3
je 0x4166ea
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x4166ec
xor esi, esi
mov eax, dword [0x4eb358]
push esi
push eax
mov byte [esp + 0xd98], 2
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41671e
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0xc]
push 0x4cb060
push ecx
mov dword [esp + 0x14], 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]
mov eax, dword [esp + 0x14]
xor edi, edi
mov dword [esi + 0xb4], eax
mov eax, dword [0x4eb358]
cmp eax, 0xffffffff
mov dword [esp + 0xd90], 0xffffffff
je 0x416818
push eax
call ebp
mov edi, eax
test edi, edi
jne 0x416818
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0xc], eax
test eax, eax
mov dword [esp + 0xd90], 4
je 0x4167ae
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x4167b0
xor edi, edi
mov ecx, dword [0x4eb358]
push edi
push ecx
mov dword [esp + 0xd98], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4167e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xc]
push 0x4cb060
push edx
mov dword [esp + 0x14], 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 eax, dword [edi + 4]
dec eax
mov dword [edi + 4], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0xd88]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebp
add esp, 0xd88
ret