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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5cdebc
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
sub esp, 0xac
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0xb0], ecx
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0xb0]
cmp dword [eax], 0xffffffff
je 0x475cf7
mov ecx, dword [ebp - 0xb0]
mov edx, dword [ecx]
push edx
call dword [sym.imp.kernel32.dll_TlsGetValue]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x475cf7
push 0
mov eax, dword [ebp - 0xb0]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.kernel32.dll_TlsSetValue]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x4759ba
call dword [sym.imp.kernel32.dll_GetLastError]
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
push 0x6079b8
lea ecx, [ebp - 0x1c]
push ecx
call fcn.004f82ed
mov edx, dword [ebp - 0xb0]
add edx, 0x10
push edx
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0xb0]
add eax, 4
mov dword [ebp - 0x64], eax
mov ecx, dword [ebp - 0x64]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x40], edx
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x64]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x44]
mov ecx, dword [eax]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x48]
mov dword [ebp - 0x30], edx
mov eax, dword [ebp - 0x30]
xor ecx, ecx
cmp eax, dword [ebp - 0x34]
sete cl
and ecx, 0xff
neg ecx
sbb ecx, ecx
inc ecx
and ecx, 0xff
test ecx, ecx
je 0x475ab0
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 8]
cmp eax, dword [ebp - 0x14]
jne 0x475aa3
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x4c], ecx
mov edx, dword [ebp - 0x30]
mov eax, dword [edx]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x4c]
mov dword [ebp - 0x38], ecx
mov edx, dword [ebp - 0x38]
mov dword [ebp - 0x60], edx
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0x58], eax
mov ecx, dword [ebp - 0x60]
mov edx, dword [ecx]
mov dword [ebp - 0x60], edx
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x54], eax
mov ecx, dword [ebp - 0x54]
mov dword [ebp - 0x50], ecx
mov edx, dword [ebp - 0x50]
mov eax, dword [edx + 4]
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x50]
mov eax, dword [edx]
mov dword [ecx], eax
mov ecx, dword [ebp - 0x50]
mov edx, dword [ecx]
mov eax, dword [ebp - 0x50]
mov ecx, dword [eax + 4]
mov dword [edx + 4], ecx
mov edx, dword [ebp - 0x50]
push edx
call fcn.00596929
add esp, 4
mov eax, dword [ebp - 0x64]
mov ecx, dword [eax + 8]
sub ecx, 1
mov edx, dword [ebp - 0x64]
mov dword [edx + 8], ecx
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0x3c], eax
jmp 0x475aab
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx]
mov dword [ebp - 0x30], edx
jmp 0x4759fc
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x24], ecx
cmp dword [ebp - 0x24], 0
je 0x475cdd
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 0x18]
mov dword [ebp - 0x68], eax
jmp 0x475ade
mov ecx, dword [ebp - 0x68]
add ecx, 4
mov dword [ebp - 0x68], ecx
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 0x1c]
mov dword [ebp - 0x78], eax
mov ecx, dword [ebp - 0x68]
cmp ecx, dword [ebp - 0x78]
je 0x475b3b
mov edx, dword [ebp - 0x68]
mov eax, dword [edx]
mov dword [ebp - 0x6c], eax
cmp dword [ebp - 0x6c], 0
je 0x475b39
mov ecx, dword [ebp - 0x6c]
mov dword [ebp - 0x74], ecx
mov edx, dword [ebp - 0x74]
mov dword [ebp - 0x70], edx
cmp dword [ebp - 0x70], 0
je 0x475b2f
push 1
mov eax, dword [ebp - 0x70]
mov edx, dword [eax]
mov ecx, dword [ebp - 0x70]
call dword [edx]
mov dword [ebp - 0xb4], eax
mov eax, dword [ebp - 0xb4]
mov dword [ebp - 0xb8], eax
jmp 0x475b39
mov dword [ebp - 0xb8], 0
jmp 0x475ad5
mov ecx, dword [ebp - 0x24]
add ecx, 0x14
mov dword [ebp - 0x9c], ecx
mov edx, dword [ebp - 0x9c]
mov eax, dword [edx + 8]
mov dword [ebp - 0x7c], eax
mov ecx, dword [ebp - 0x9c]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x80], edx
mov eax, dword [ebp - 0x9c]
mov ecx, dword [eax + 8]
mov dword [ebp - 0x88], ecx
mov edx, dword [ebp - 0x80]
mov dword [ebp - 0x90], edx
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x8c], eax
jmp 0x475ba0
mov ecx, dword [ebp - 0x90]
add ecx, 4
mov dword [ebp - 0x90], ecx
mov edx, dword [ebp - 0x8c]
add edx, 4
mov dword [ebp - 0x8c], edx
mov eax, dword [ebp - 0x8c]
cmp eax, dword [ebp - 0x88]
je 0x475bc0
mov ecx, dword [ebp - 0x90]
mov edx, dword [ebp - 0x8c]
mov eax, dword [edx]
mov dword [ecx], eax
jmp 0x475b82
mov ecx, dword [ebp - 0x90]
mov dword [ebp - 0x84], ecx
mov edx, dword [ebp - 0x9c]
mov eax, dword [edx + 8]
mov dword [ebp - 0x94], eax
mov ecx, dword [ebp - 0x84]
mov dword [ebp - 0x98], ecx
jmp 0x475bf8
mov edx, dword [ebp - 0x98]
add edx, 4
mov dword [ebp - 0x98], edx
mov eax, dword [ebp - 0x98]
cmp eax, dword [ebp - 0x94]
je 0x475c08
jmp 0x475be9
mov ecx, dword [ebp - 0x9c]
mov edx, dword [ebp - 0x84]
mov dword [ecx + 8], edx
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x24]
add eax, 0x14
mov dword [ebp - 0xac], eax
mov ecx, dword [ebp - 0xac]
mov edx, dword [ecx + 4]
mov dword [ebp - 0xa0], edx
jmp 0x475c47
mov eax, dword [ebp - 0xa0]
add eax, 4
mov dword [ebp - 0xa0], eax
mov ecx, dword [ebp - 0xac]
mov edx, dword [ebp - 0xa0]
cmp edx, dword [ecx + 8]
je 0x475c5a
jmp 0x475c38
mov eax, dword [ebp - 0xac]
mov ecx, dword [ebp - 0xac]
mov edx, dword [eax + 0xc]
sub edx, dword [ecx + 4]
sar edx, 2
mov dword [ebp - 0xa8], edx
mov eax, dword [ebp - 0xac]
mov ecx, dword [eax + 4]
mov dword [ebp - 0xa4], ecx
mov edx, dword [ebp - 0xa4]
push edx
call fcn.00596929
add esp, 4
mov eax, dword [ebp - 0xac]
mov dword [eax + 4], 0
mov ecx, dword [ebp - 0xac]
mov dword [ecx + 8], 0
mov edx, dword [ebp - 0xac]
mov dword [edx + 0xc], 0
mov eax, 1
and eax, 1
test eax, eax
je 0x475cd2
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.00596929
add esp, 4
mov edx, dword [ebp - 0x24]
mov dword [ebp - 0xbc], edx
jmp 0x475ce7
mov dword [ebp - 0xbc], 0
mov eax, dword [ebp - 0xb0]
add eax, 0x10
push eax
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
jmp 0x475cff
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret