Function at 0x488fc4
Capabilities:
Set thread local storage value

Disassembly:
push 0x40
mov eax, 0x521b35
call fcn.004d8abf
mov edi, ecx
and dword [ebp - 4], 0
mov eax, dword [0x57d3ec]
xor ebx, ebx
add eax, 0x54
inc ebx
push eax
mov byte [ebp - 0xd], bl
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [ebp - 4], 3
call fcn.0044f24f
lea ecx, [eax + 0x1b8]
lea eax, [edi + 0x4c]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.004b58df
push str.Waiting_to_connect
mov esi, dword [eax]
call fcn.004ddaa2
pop ecx
push eax
push str.Waiting_to_connect
lea ecx, [esi + 0x18]
call fcn.00406efb
lea ecx, [ebp - 0xd]
call fcn.0044f694
and dword [ebp - 0x14], 0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x14]
mov eax, dword [0x57d3ec]
add eax, 8
push eax
push dword [edi]
lea eax, [ebp - 0x34]
push eax
call fcn.00485f03
mov byte [ebp - 4], 5
cmp dword [ebp - 0x34], 0
jge 0x4890f8
cmp dword [ebp - 0x30], 0
mov eax, 0x3064
cmovne eax, dword [ebp - 0x30]
push eax
push dword [ebp - 0x34]
push ecx
mov ecx, dword [ebp - 0x2c]
mov esi, esp
mov dword [ebp + 0xc], esi
lea ecx, [ecx - 0x10]
call fcn.004070e7
add eax, 0x10
lea ecx, [ebp - 0x4c]
mov dword [esi], eax
call fcn.00406620
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x4c]
push eax
mov byte [ebp - 4], 6
call fcn.0040121b
mov ecx, dword [ebp - 0x44]
lea ecx, [ecx - 0x10]
call fcn.00407189
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00407189
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4890d7
push 0
push ebx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov eax, dword [0x57d3ec]
mov eax, dword [eax + 0xf8]
cmp eax, 0xffffffff
je 0x4890d7
push 0
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [ebp + 0x10]
lea ecx, [ecx - 0x10]
call fcn.00407189
mov ecx, dword [ebp + 0x14]
add ecx, 0xfffffff0
call fcn.00407189
mov ecx, dword [ebp + 0x18]
add ecx, 0xfffffff0
jmp 0x489373
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00407189
mov eax, dword [0x57d3ec]
add eax, 0x54
mov byte [ebp - 0xd], bl
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [ebp - 4], 7
call fcn.0044f24f
lea ecx, [eax + 0x1b8]
lea eax, [edi + 0x4c]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.004b58df
push str.Connecting
mov esi, dword [eax]
call fcn.004ddaa2
pop ecx
push eax
push str.Connecting
lea ecx, [esi + 0x18]
call fcn.00406efb
lea ecx, [ebp - 0xd]
mov byte [ebp - 4], 4
call fcn.0044f694
mov eax, dword [ebp + 0x18]
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x28], esp
mov esi, esp
mov ecx, eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x20], eax
call fcn.004070e7
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 8
mov eax, dword [ebp + 0x14]
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x2c], esp
mov esi, esp
mov ecx, eax
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x1c], eax
call fcn.004070e7
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 9
mov eax, dword [ebp + 0x10]
push ecx
add eax, 0xfffffff0
mov esi, esp
mov dword [ebp - 0x18], esi
mov ecx, eax
mov dword [ebp - 0x18], eax
call fcn.004070e7
add eax, 0x10
mov ecx, edi
mov dword [esi], eax
lea eax, [ebp - 0x40]
push eax
mov byte [ebp - 4], 4
call fcn.0048839f
mov byte [ebp - 4], 0xa
cmp dword [ebp - 0x40], 0
jge 0x48921f
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x40]
push eax
call fcn.0040121b
mov ecx, dword [ebp - 0x38]
lea ecx, [ecx - 0x10]
call fcn.00407189
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x489360
push 0
push ebx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov eax, dword [0x57d3ec]
mov eax, dword [eax + 0xf8]
cmp eax, 0xffffffff
je 0x489360
push 0
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x489360
mov ecx, dword [ebp - 0x38]
lea ecx, [ecx - 0x10]
call fcn.00407189
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x489259
push 0
push ebx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov eax, dword [0x57d3ec]
mov eax, dword [eax + 0xf8]
cmp eax, 0xffffffff
je 0x489259
push 0
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push ebx
lea eax, [ebp - 0x34]
mov ecx, edi
push eax
call fcn.00488f09
mov byte [ebp - 4], 0xb
cmp dword [ebp - 0x34], 0
jl 0x48930e
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00407189
inc ebx
cmp ebx, 2
jb 0x489259
push dword [ebp + 0xc]
lea eax, [ebp - 0x40]
mov ecx, edi
push dword [edi + 0x14]
push eax
call fcn.004880d7
mov byte [ebp - 4], 0xd
mov esi, dword [ebp - 0x40]
test esi, esi
jns 0x4892d5
lea eax, [ebp - 0x4c]
mov ecx, edi
push eax
call fcn.00488c22
mov ecx, dword [ebp - 0x44]
lea ecx, [ecx - 0x10]
call fcn.00407189
test esi, esi
jns 0x4892d5
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x40]
push eax
call fcn.0040121b
mov ecx, dword [ebp - 0x38]
lea ecx, [ecx - 0x10]
jmp 0x48935b
mov esi, dword [ebp + 8]
and dword [esi], 0
lea ecx, [esi + 8]
and dword [esi + 4], 0
call fcn.0040687a
mov ecx, dword [ebp - 0x38]
add ecx, 0xfffffff0
call fcn.00407189
mov ecx, dword [ebp - 0x18]
call fcn.00407189
mov ecx, dword [ebp - 0x1c]
call fcn.00407189
mov ecx, dword [ebp - 0x20]
call fcn.00407189
mov eax, esi
jmp 0x48937b
cmp dword [ebp - 0x30], 0
mov eax, 0x3073
mov edi, dword [ebp - 0x2c]
cmovne eax, dword [ebp - 0x30]
push eax
push dword [ebp - 0x34]
push ecx
mov esi, esp
lea ecx, [edi - 0x10]
mov dword [ebp + 0xc], esi
call fcn.004070e7
add eax, 0x10
lea ecx, [ebp - 0x4c]
mov dword [esi], eax
call fcn.00406620
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x4c]
push eax
mov byte [ebp - 4], 0xc
call fcn.0040121b
mov ecx, dword [ebp - 0x44]
lea ecx, [ecx - 0x10]
call fcn.00407189
lea ecx, [edi - 0x10]
call fcn.00407189
mov ecx, dword [ebp - 0x18]
call fcn.00407189
mov ecx, dword [ebp - 0x1c]
call fcn.00407189
mov ecx, dword [ebp - 0x20]
call fcn.00407189
mov eax, dword [ebp + 8]
call fcn.004d8a8d
ret 0x14