Function at 0x6c579c
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe0
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], ebx
mov esi, ecx
mov ebx, edx
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x6c59fb
push dword fs:[eax]
mov dword fs:[eax], esp
lea edx, [ebp - 0xc]
mov eax, esi
call fcn.006c5688
mov eax, dword [ebp - 8]
add eax, 0xb0
push eax
call sub.KERNEL32.DLL_EnterCriticalSection
mov eax, dword [ebp - 8]
xor edx, edx
mov dword [eax + 0xdc], edx
mov dword [ebp - 0x14], 1
xor edx, edx
push ebp
push 0x6c59d6
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, ebx
mov edx, 0x6c5a18
call fcn.00405d5c
je 0x6c5812
mov edx, ebx
mov eax, dword [ebp - 8]
call fcn.006c3a4c
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov edx, 0x6c5a18
call fcn.00405d5c
je 0x6c5832
mov edx, dword [ebp + 0x10]
mov edx, dword [edx]
mov eax, dword [ebp - 8]
call fcn.0051c4c4
jmp 0x6c584c
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x88]
mov eax, dword [ebp - 8]
mov edx, dword [eax + 0x8c]
mov eax, dword [ebp + 0x10]
call fcn.00405a14
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0xc8]
push eax
push 0xc8
call sub.KERNEL32.DLL_TlsSetValue_1
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.0051c298
test eax, eax
setge byte [ebp - 0xd]
cmp byte [ebp - 0xd], 0
je 0x6c59ae
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x6c588e
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x1c], eax
lea ecx, [ebp - 4]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.006c4fdc
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.0051bc58
mov esi, eax
inc esi
push ebp
mov eax, esi
call fcn.006c53b4
pop ecx
add eax, esi
mov dword [ebp - 0x14], eax
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.006c47a0
mov ebx, eax
add ebx, esi
xor edi, edi
jmp 0x6c599c
inc edi
cmp ebx, dword [ebp - 0x1c]
jg 0x6c59ae
mov edx, ebx
dec edx
mov eax, dword [ebp - 8]
call fcn.0051c298
test eax, eax
jl 0x6c59ae
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.0051bc58
mov esi, eax
inc esi
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.006c47a0
add eax, esi
cmp ebx, eax
je 0x6c5941
lea ecx, [ebp - 4]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.006c4fdc
mov eax, esi
sub eax, ebx
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
push ebp
mov eax, dword [ebp - 0x18]
call fcn.006c53b4
pop ecx
add eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.006c47a0
mov ebx, eax
add ebx, esi
jmp 0x6c599c
inc dword [ebp - 0x14]
inc ebx
cmp ebx, dword [ebp - 0x1c]
jg 0x6c59ae
mov edx, ebx
dec edx
mov eax, dword [ebp - 8]
call fcn.0051c298
test eax, eax
jl 0x6c59ae
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.0051bc58
mov esi, eax
inc esi
lea ecx, [ebp - 4]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.006c4fdc
mov eax, esi
sub eax, ebx
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
push ebp
mov eax, dword [ebp - 0x18]
call fcn.006c53b4
pop ecx
add eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.006c47a0
mov ebx, eax
add ebx, esi
cmp byte [ebp + 0xc], 0
je 0x6c59ae
cmp edi, 0x4e20
jl 0x6c58cf
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x6c59dd
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
mov dword [eax + 0xd8], edx
mov eax, dword [ebp - 8]
add eax, 0xb0
push eax
call sub.KERNEL32.DLL_LeaveCriticalSection
ret