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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4ab354
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
sub esp, 0x20
push ebx
push esi
push edi
mov edi, ecx
mov ecx, 0x4eb358
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x1c], edi
call fcn.00418750
mov ecx, dword [eax + 4]
add eax, 4
inc ecx
mov dword [eax], ecx
mov esi, dword [ebp + 8]
mov dword [ebp - 4], 0
test esi, esi
mov dword [edi], 0
jne 0x41d716
mov dword [edi], 5
jmp 0x41d753
mov ebx, dword [ebp + 0xc]
mov byte [ebp - 4], 1
push ebx
call fcn.0048b346
add esp, 4
mov dword [ebp - 0x14], eax
jmp 0x41d741
mov eax, dword [ebp - 0x14]
xor ecx, ecx
cmp eax, ecx
mov dword [ebp - 4], ecx
jne 0x41d782
mov dword [edi], 1
mov ecx, 0x4eb358
mov dword [ebp - 4], 0xffffffff
call fcn.00418750
mov ecx, dword [eax + 4]
add eax, 4
dec ecx
mov dword [eax], ecx
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp + 0x10]
mov dword [ebp + 0xc], esi
mov dword [ebp - 0x18], ecx
lea edx, [eax - 1]
imul edx, ebx
add edx, esi
inc eax
shr eax, 1
mov dword [ebp - 0x2c], eax
je 0x41d98d
mov dword [ebp + 8], ecx
jmp 0x41d7a7
mov edx, dword [ebp - 0x20]
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp - 0x14]
mov ecx, ebx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp + 0xc]
mov ecx, ebx
mov esi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x14]
mov ecx, ebx
mov edi, edx
sub edx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov dword [ebp - 0x20], edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp + 0xc]
mov ecx, 0x4eb358
add edi, ebx
mov dword [ebp + 0xc], edi
call fcn.00418750
cmp dword [eax + 4], 1
jne 0x41d968
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, 0xffffffff
je 0x41d8ae
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x41d8a9
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp - 0x30], eax
test eax, eax
mov byte [ebp - 4], 3
je 0x41d848
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x41d84a
xor edi, edi
mov ecx, dword [0x4eb358]
push edi
push ecx
mov byte [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41d877
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [ebp - 0x24]
push 0x4cb060
push edx
mov dword [ebp - 0x24], 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 [0x4eb358]
cmp dword [edi], 0
je 0x41d968
xor edi, edi
cmp eax, 0xffffffff
je 0x41d957
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x41d957
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp - 0x30], eax
test eax, eax
mov byte [ebp - 4], 4
je 0x41d8f6
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x41d8f8
xor edi, edi
mov ecx, dword [0x4eb358]
push edi
push ecx
mov byte [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41d925
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [ebp - 0x28]
push 0x4cb060
push edx
mov dword [ebp - 0x28], 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 ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
push ecx
push edx
call dword [edi]
neg eax
sbb eax, eax
inc eax
jmp 0x41d96a
xor eax, eax
test eax, eax
jne 0x41da65
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 0x2c]
inc eax
add edx, 2
cmp eax, ecx
mov dword [ebp - 0x18], eax
mov dword [ebp + 8], edx
jb 0x41d7a4
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.0048b36f
mov eax, dword [0x4eb358]
or esi, 0xffffffff
add esp, 4
xor edi, edi
cmp eax, esi
mov dword [ebp - 4], esi
je 0x41da46
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x41da46
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0xc], eax
test eax, eax
mov dword [ebp - 4], 6
je 0x41d9e5
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x41d9e7
xor edi, edi
mov edx, dword [0x4eb358]
push edi
push edx
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41da13
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
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 eax, dword [edi + 4]
dec eax
mov dword [edi + 4], eax
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp - 0x1c]
or esi, 0xffffffff
xor edi, edi
mov dword [ebp - 4], esi
mov dword [eax], 0xe
mov eax, dword [0x4eb358]
cmp eax, esi
je 0x41db1a
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x41db1a
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0xc], eax
test eax, eax
mov dword [ebp - 4], 5
je 0x41daba
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x41dabc
xor edi, edi
mov ecx, dword [0x4eb358]
push edi
push ecx
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41dae8
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [ebp + 0xc]
push 0x4cb060
push edx
mov dword [ebp + 0xc], 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]
mov ecx, dword [ebp - 0xc]
dec eax
mov dword [edi + 4], eax
pop edi
pop esi
xor eax, eax
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0xc