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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4603b9
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x47c008]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
call fcn.00402f40
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x402d32
push 0x14
call fcn.0044d73a
mov esi, eax
add esp, 4
mov dword [esi], edi
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0xffffffff
mov byte [esi + 4], 0
mov dword [esi + 0x10], 0
call fcn.00402f40
push esi
push dword [eax]
call ebx
call fcn.00402f40
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x402d47
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [edi + 4], eax
mov eax, dword [edi + 0x18]
cmp eax, 3
jne 0x402d61
mov ecx, dword [edi + 0x20]
mov eax, dword [ecx]
call dword [eax]
jmp 0x402dd6
push 0xb8
cmp eax, 2
jne 0x402d8a
call fcn.0044d73a
add esp, 4
mov dword [ebp - 0x10], eax
mov dword [ebp - 4], 0
test eax, eax
je 0x402dcd
mov ecx, eax
call fcn.00405e60
jmp 0x402dcf
cmp eax, 1
jne 0x402dae
call fcn.0044d73a
add esp, 4
mov dword [ebp - 0x10], eax
mov dword [ebp - 4], 1
test eax, eax
je 0x402dcd
mov ecx, eax
call fcn.00405d90
jmp 0x402dcf
call fcn.0044d73a
add esp, 4
mov dword [ebp - 0x10], eax
mov dword [ebp - 4], 2
test eax, eax
je 0x402dcd
mov ecx, eax
call fcn.004045d0
jmp 0x402dcf
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov dword [edi + 0x1c], eax
mov ecx, edi
mov eax, dword [edi]
call dword [eax + 8]
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [edi + 0x1c]
mov edx, dword [edi + 0x28]
mov dword [ebp - 0x18], ecx
mov eax, dword [ecx + 8]
mov dword [ebp - 0x14], eax
test eax, eax
je 0x402e04
mov eax, dword [eax]
inc eax
mov dword [ebp - 0x24], eax
jmp 0x402e0b
mov dword [ebp - 0x24], 1
lea eax, [ebp - 0x24]
mov dword [ecx + 8], eax
mov byte [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], 3
mov eax, dword [ecx + 8]
mov dword [eax + 8], edx
call fcn.00404cb0
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x14]
mov dword [eax + 8], ecx
mov ecx, edi
mov eax, dword [edi]
call dword [eax + 0xc]
cmp dword [edi + 0x18], 3
mov ecx, dword [edi + 0x1c]
je 0x402e5a
test ecx, ecx
je 0x402ea4
mov eax, dword [ecx]
push 1
call dword [eax]
jmp 0x402ea4
test ecx, ecx
je 0x402e64
mov eax, dword [ecx]
push 1
call dword [eax]
mov esi, dword [edi + 0x24]
mov dword [edi + 0x24], 0
mov dword [edi + 0x20], 0
test esi, esi
je 0x402ea4
or ebx, 0xffffffff
lea ecx, [esi + 4]
mov eax, ebx
lock xadd dword [ecx], eax
jne 0x402e9e
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lea eax, [esi + 8]
lock xadd dword [eax], ebx
dec ebx
jne 0x402e9e
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov ebx, dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [edi + 0x1c], 0
mov dword [edi + 4], 0
call fcn.00402f40
mov edi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
push dword [eax]
call edi
call fcn.00402f40
push dword [eax]
call edi
mov esi, eax
test esi, esi
je 0x402ee4
call fcn.00402f40
push 0
push dword [eax]
call ebx
push esi
call fcn.0044d735
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret