Function at 0x640022
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
mov edi, ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor ebx, ebx
push edi
mov dword [ebp - 4], eax
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [0x728f98]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, dword [edi + 0x20]
mov dword [ebp - 0x10], eax
lea eax, [esi - 8]
neg esi
sbb esi, esi
and esi, eax
je 0x6400c1
mov eax, dword [esi + 8]
cmp eax, ebx
je 0x640074
add eax, 0xfffffff8
mov dword [ebp - 8], eax
jmp 0x640077
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 0x10]
cmp dword [esi + 0x10], eax
jne 0x6400ba
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 4]
mov ecx, esi
call fcn.00648a72
cmp dword [ebp - 0xc], ebx
je 0x6400ba
push esi
lea ecx, [edi + 0x20]
call fcn.0063fd45
fldz
or dword [esi + 0x48], 1
fstp dword [esi + 0x18]
mov eax, dword [ebp - 4]
lea ecx, [edi + 0x1c]
mov dword [esi + 0x40], eax
push esi
mov dword [esi + 0x34], ecx
call fcn.0063fd9b
mov esi, dword [ebp - 8]
cmp esi, ebx
jne 0x640065
mov esi, dword [edi + 0x1c]
lea eax, [esi - 8]
neg esi
sbb esi, esi
and esi, eax
jmp 0x640194
mov eax, dword [esi + 8]
cmp eax, ebx
je 0x6400e1
add eax, 0xfffffff8
mov dword [ebp - 8], eax
jmp 0x6400e4
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 0x10]
cmp dword [esi + 0x10], eax
jne 0x64018f
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 4]
mov ecx, esi
call fcn.00648a72
cmp dword [ebp - 0x14], ebx
je 0x64011d
xor ecx, ecx
lea eax, [esi + 4]
inc ecx
lock xadd dword [eax], ecx
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x24]
call fcn.0063e406
cmp dword [ebp - 0xc], ebx
je 0x64018f
push esi
lea ecx, [edi + 0x1c]
mov dword [esi + 0x34], ebx
call fcn.0063fd45
mov ecx, esi
call fcn.00648b28
cmp dword [esi + 0x24], ebx
mov ecx, esi
jne 0x640147
or dword [esi + 0x48], 8
call fcn.005f938b
jmp 0x64018f
call fcn.0063fccc
push ecx
fstp dword [esp]
call fcn.0063fcae
movzx eax, al
cmp eax, ebx
mov dword [ebp - 0x18], eax
je 0x64016a
mov eax, dword [ebp - 4]
mov dword [esi + 0x40], eax
lea ebx, [edi + 0x1c]
jmp 0x640178
push ebx
push dword [ebp - 4]
mov ecx, esi
call fcn.0063fd0f
lea ebx, [edi + 0x20]
push dword [ebp - 0x18]
mov ecx, esi
call fcn.0063fcf1
push esi
mov ecx, ebx
mov dword [esi + 0x34], ebx
call fcn.0063fd9b
xor ebx, ebx
mov esi, dword [ebp - 8]
cmp esi, ebx
mov dword [ebp - 0x18], esi
jne 0x6400d2
push dword [ebp - 4]
mov ecx, edi
call fcn.0063fe45
mov esi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push edi
mov dword [ebp - 8], eax
call esi
or byte [edi + 0x24], 4
push 1
lea eax, [ebp - 0x24]
push eax
call fcn.0063fd60
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, eax
sub ebx, dword [ebp - 4]
test byte [edi + 0x24], 2
je 0x6401ee
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [ebp - 4]
mov ecx, edi
call fcn.0063fe45
push edi
mov dword [ebp - 8], eax
call esi
and byte [edi + 0x24], 0xfd
cmp ebx, dword [ebp - 8]
jae 0x6401f8
sub dword [ebp - 8], ebx
jmp 0x6401fc
and dword [ebp - 8], 0
and byte [edi + 0x24], 0xfb
lea ecx, [ebp - 0x24]
call fcn.0063add0
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret