Function at 0x6c2d777c
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebp, dword [esp + 0x40]
mov ecx, dword [0x6c4b83a8]
test ecx, ecx
jne 0x6c2d77a4
mov eax, dword [ebp + 8]
test eax, eax
je 0x6c2d7834
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [ebp + 8]
test esi, esi
je 0x6c2d7843
mov ebx, dword [0x6c4b83f0]
call sub.KERNEL32.dll_GetLastError
mov edi, eax
mov dword [esp], ebx
call sub.KERNEL32.dll_TlsGetValue
push ecx
mov ebx, eax
mov dword [esp], edi
call sub.KERNEL32.dll_SetLastError
push edi
test ebx, ebx
je 0x6c2d77f4
mov edi, dword [ebx]
cmp esi, edi
ja 0x6c2d78c3
dec esi
mov eax, dword [ebx + esi*4 + 4]
test eax, eax
jne 0x6c2d779c
mov eax, ebp
call fcn.6c2e1bec
mov dword [ebx + esi*4 + 4], eax
jmp 0x6c2d779c
mov dword [esp + 4], 4
lea eax, [esi + 0x21]
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov ebx, eax
test eax, eax
je 0x6c2d7908
lea eax, [esi + 0x20]
mov dword [ebx], eax
mov dword [esp + 4], ebx
mov eax, dword [0x6c4b83f0]
mov dword [esp], eax
call sub.KERNEL32.dll_TlsSetValue
push edx
push edx
test eax, eax
jne 0x6c2d77de
call sub.KERNEL32.dll_GetLastError
jmp 0x6c2d77de
mov eax, ebp
call fcn.6c2e1bec
mov dword [ebp + 8], eax
jmp 0x6c2d779c
cmp dword [0x6c36008c], 0
je 0x6c2d793e
mov dword [esp], 0x6c4b83e4
call sub.KERNEL32.dll_InterlockedIncrement
push esi
test eax, eax
jne 0x6c2d790d
mov esi, dword [ebp + 8]
test esi, esi
jne 0x6c2d787c
mov esi, dword [0x6c4b83ec]
inc esi
mov dword [0x6c4b83ec], esi
mov dword [ebp + 8], esi
cmp dword [0x6c4b83a8], 0
je 0x6c2d77af
mov dword [esp], 0x6c4b83e4
call sub.KERNEL32.dll_InterlockedDecrement
push edx
test eax, eax
js 0x6c2d77af
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov eax, dword [0x6c4b83e8]
mov dword [esp], eax
call sub.KERNEL32.dll_ReleaseSemaphore
sub esp, 0xc
jmp 0x6c2d77af
lea edx, [edi + edi]
cmp esi, edx
jbe 0x6c2d78cd
lea edx, [esi + 0x20]
lea eax, [edx*4 + 4]
mov dword [esp + 4], eax
mov dword [esp], ebx
mov dword [esp + 0x1c], edx
call sub.msvcrt.dll_realloc
mov ebx, eax
test eax, eax
mov edx, dword [esp + 0x1c]
je 0x6c2d7908
mov dword [eax], edx
sub edx, edi
lea ecx, [edx*4]
lea edx, [eax + edi*4 + 4]
xor eax, eax
mov edi, edx
rep stosb byte es:[edi], al
jmp 0x6c2d7816
call sub.msvcrt.dll_abort
mov dword [esp + 4], 0xffffffff
mov eax, dword [0x6c4b83e8]
mov dword [esp], eax
call sub.KERNEL32.dll_WaitForSingleObject
push ebx
push ebx
test eax, eax
je 0x6c2d7865
mov dword [esp], 0x6c4b83e4
call sub.KERNEL32.dll_InterlockedDecrement
push ecx
jmp 0x6c2d7865
mov dword [esp], 0x6c360090
call sub.KERNEL32.dll_InterlockedIncrement
push edx
test eax, eax
jne 0x6c2d795e
jmp 0x6c2d7979
mov dword [esp], 0
call sub.msvcrt_ruby200.dll_Sleep_4
push edi
cmp dword [0x6c36008c], 0
je 0x6c2d7951
cmp dword [0x6c4b83a8], 0
je 0x6c2d7865
jmp 0x6c2d7850
mov dword [0x6c4b83e4], 0xffffffff
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xffff
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateSemaphoreA
sub esp, 0x10
mov dword [0x6c4b83e8], eax
call sub.KERNEL32.dll_TlsAlloc
cmp eax, 0xffffffff
je 0x6c2d79e2
mov dword [0x6c4b83f0], eax
mov dword [esp + 4], 0x6c2d7740
mov dword [esp], eax
call fcn.6c2da244
test eax, eax
jne 0x6c2d7908
mov dword [0x6c36008c], 1
jmp 0x6c2d7967
call sub.KERNEL32.dll_GetLastError
jmp 0x6c2d79ce