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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4aac74
push eax
mov eax, dword [0x4eb358]
mov dword fs:[0], esp
sub esp, 0xc
push ebx
push ebp
push esi
push edi
xor edi, edi
cmp eax, 0xffffffff
je 0x4151a8
mov ebx, dword [sym.imp.KERNEL32.dll_TlsGetValue]
push eax
call ebx
mov edi, eax
test edi, edi
jne 0x4151a1
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x10], eax
test eax, eax
mov dword [esp + 0x24], edi
je 0x415133
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x415135
xor edi, edi
mov eax, dword [0x4eb358]
push edi
push eax
mov dword [esp + 0x2c], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x415167
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 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 [0x4eb358]
jmp 0x4151ae
mov eax, dword [0x4eb358]
jmp 0x4151ae
mov ebx, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov cl, byte [edi + 0xb0]
mov edi, dword [esp + 0x38]
mov ebp, dword [esp + 0x34]
and cl, 1
cmp cl, 1
je 0x41529d
cmp ebp, 0x64
jae 0x4151d6
cmp edi, 0x64
jb 0x41529d
xor edi, edi
cmp eax, 0xffffffff
je 0x41527e
push eax
call ebx
mov edi, eax
test edi, edi
jne 0x41527e
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x38], eax
test eax, eax
mov dword [esp + 0x24], 1
je 0x415216
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x415218
xor edi, edi
mov edx, dword [0x4eb358]
push edi
push edx
mov dword [esp + 0x2c], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41524b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x38], eax
lea eax, [esp + 0x38]
push 0x4cb060
push 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 ecx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], ecx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [edi + 0xb4], 0xffffffff
xor eax, eax
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov esi, dword [esp + 0x30]
test esi, esi
jne 0x415370
xor edi, edi
cmp eax, 0xffffffff
je 0x415351
push eax
call ebx
mov edi, eax
test edi, edi
jne 0x415351
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x38], eax
test eax, eax
mov dword [esp + 0x24], 2
je 0x4152e9
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x4152eb
xor edi, edi
mov edx, dword [0x4eb358]
push edi
push edx
mov dword [esp + 0x2c], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41531e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x38], eax
lea eax, [esp + 0x38]
push 0x4cb060
push 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 ecx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], ecx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [edi + 0xb4], 5
xor eax, eax
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
lea ecx, [esp + 0x14]
call fcn.00418f10
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
push edx
mov edx, dword [esp + 0x30]
push eax
push ecx
push edi
push ebp
mov ebx, 3
push esi
push edx
lea ecx, [esp + 0x30]
mov dword [esp + 0x40], ebx
call fcn.00419580
mov ebp, eax
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, 0xffffffff
je 0x41544d
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x41544d
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x38], eax
test eax, eax
mov byte [esp + 0x24], 4
je 0x4153ea
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x4153ec
xor edi, edi
mov eax, dword [0x4eb358]
push edi
push eax
mov byte [esp + 0x2c], bl
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41541a
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x38]
push 0x4cb060
push ecx
mov dword [esp + 0x40], 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]
lea ecx, [esp + 0x14]
mov dword [edi + 0xb4], eax
mov dword [esp + 0x24], 0xffffffff
call fcn.00420e20
mov ecx, dword [esp + 0x1c]
pop edi
mov eax, ebp
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x18
ret