Function at 0x501720
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x48
push esi
push edi
push dword [0x884adc]
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], connect
mov dword [esp + 0x50], 0x3e8
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 8], 0x1000
mov edx, dword [eax + 0xc]
lea ecx, [edx + 0x1000]
jl 0x501773
cmp ecx, dword [eax + 0x10]
ja 0x501773
mov dword [eax + 0xc], ecx
jmp 0x501781
push 0x1000
mov ecx, eax
call fcn.0046a3c0
mov edx, eax
mov edi, dword [ebp + 0x14]
xor ecx, ecx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x44], 0x800003e8
mov dword [esp + 0x48], edx
mov dword [esp + 0xc], ecx
cmp dword [edi + 4], ecx
jle 0x501817
mov esi, dword [ebp + 0x18]
mov eax, dword [edi]
mov edi, dword [eax + ecx*4]
mov ecx, dword [esi]
movzx eax, word [edi + 0xa8]
cmp byte [eax + ecx], 0
jne 0x5017d8
movss xmm0, dword [ebp + 0x10]
mov byte [eax + ecx], 1
lea eax, [edi + 0xf0]
push eax
push ecx
add eax, 0x40
movss dword [esp], xmm0
push eax
call fcn.00650310
add esp, 0xc
movzx ecx, word [edi + 0xa8]
mov eax, dword [esi]
movss xmm0, dword [ebp + 0x10]
mov byte [ecx + eax], 8
lea eax, [esp + 0x3c]
push eax
push esi
push ecx
movss dword [esp], xmm0
push dword [ebp + 0xc]
push edi
call fcn.00502090
mov ecx, dword [esp + 0x20]
add esp, 0x14
mov edi, dword [ebp + 0x14]
inc ecx
mov dword [esp + 0xc], ecx
cmp ecx, dword [edi + 4]
jl 0x5017a2
mov edx, dword [esp + 0x3c]
mov esi, dword [ebp + 8]
xorps xmm1, xmm1
movups xmm0, xmmword [esi + 0x50]
movaps xmmword [esp + 0x20], xmm0
movss xmm0, dword [ebp + 0x10]
movss dword [esi + 0x54], xmm0
subss xmm0, dword [esi + 0x50]
comiss xmm0, xmm1
movss dword [esi + 0x58], xmm0
jbe 0x50184b
movss xmm1, dword [0x718824]
divss xmm1, xmm0
movss dword [esi + 0x5c], xmm1
mov eax, dword [edi]
push 2
mov ecx, dword [eax]
push dword [ecx + 0xcc]
mov ecx, dword [ecx + 8]
push esi
push dword [esp + 0x4c]
mov ecx, dword [ecx + 8]
push edx
call fcn.00500520
mov edi, dword [esp + 0x48]
xor ecx, ecx
mov eax, dword [esp + 0x40]
cmp edi, dword [esp + 0x3c]
movaps xmm0, xmmword [esp + 0x20]
cmove eax, ecx
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x4c]
movups xmmword [esi + 0x50], xmm0
push dword [0x884adc]
lea esi, [eax*4 + 0x7f]
and esi, 0xffffff80
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea edx, [esi + 0xf]
and edx, 0xfffffff0
cmp esi, dword [eax + 8]
jg 0x5018c2
lea ecx, [edx + edi]
cmp ecx, dword [eax + 0xc]
jne 0x5018c2
cmp dword [eax + 0x14], edi
je 0x5018c2
mov dword [eax + 0xc], edi
jmp 0x5018cb
push edx
push edi
mov ecx, eax
call fcn.0046a590
mov eax, dword [esp + 0x44]
mov dword [esp + 0x40], 0
test eax, eax
js 0x5018f5
and eax, 0x3fffffff
mov ecx, 0x7d8954
shl eax, 2
push eax
mov eax, dword [0x7d8954]
push dword [esp + 0x40]
call dword [eax + 0x10]
mov eax, dword [ebp + 0x14]
xor ecx, ecx
mov dword [esp + 0x18], ecx
cmp dword [eax + 4], ecx
jle 0x501c78
mov esi, dword [ebp + 0x20]
mov edi, dword [ebp + 0x1c]
nop dword [eax]
mov eax, dword [eax]
mov edx, dword [ebp + 0x18]
mov dword [esp + 0x14], 0
mov eax, dword [eax + ecx*4]
mov dword [esp + 8], eax
movzx ecx, word [eax + 0xa8]
mov eax, dword [edx]
mov byte [ecx + eax], 0x10
xor ecx, ecx
mov eax, dword [esp + 8]
cmp cx, word [eax + 0xb0]
jae 0x501aa6
xor edi, edi
mov dword [esp + 0xc], edi
nop word [eax + eax]
mov ecx, dword [eax + 0xac]
mov eax, dword [ecx + edi]
add ecx, edi
mov dword [esp + 0x10], ecx
movzx eax, byte [eax + 0x1c]
cmp dword [ebp + 0xc], eax
jg 0x501a7a
mov edi, dword [ecx + 8]
xor edi, dword [ecx + 4]
xor edi, dword [esp + 8]
cmp byte [edi + 0xe8], 5
jne 0x5019b5
mov eax, dword [esi + 8]
and eax, 0x3fffffff
cmp dword [esi + 4], eax
jne 0x50199c
push 4
push esi
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov edx, dword [esi + 4]
mov eax, dword [esp + 0x10]
mov ecx, dword [esi]
mov eax, dword [eax]
mov dword [ecx + edx*4], eax
inc dword [esi + 4]
mov edx, dword [ebp + 0x18]
jmp 0x501a7a
movzx ecx, word [edi + 0xa8]
mov eax, dword [edx]
cmp byte [ecx + eax], 0x10
je 0x501a7a
mov eax, dword [esi + 8]
and eax, 0x3fffffff
cmp dword [esi + 4], eax
jne 0x5019e5
push 4
push esi
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov edx, dword [esi + 4]
mov ecx, dword [esi]
mov eax, dword [esp + 0x10]
mov eax, dword [eax]
mov dword [ecx + edx*4], eax
mov edx, dword [ebp + 0x18]
inc dword [esi + 4]
movzx ecx, word [edi + 0xa8]
mov eax, dword [edx]
cmp byte [ecx + eax], 2
jae 0x501a7a
mov edx, dword [ebp + 0x1c]
mov eax, dword [edx + 8]
and eax, 0x3fffffff
cmp dword [edx + 4], eax
jne 0x501a2b
push 4
push edx
push 0x7d8954
call fcn.00467c00
mov edx, dword [ebp + 0x1c]
add esp, 0xc
mov ecx, dword [edx + 4]
mov eax, dword [edx]
mov dword [eax + ecx*4], edi
inc dword [edx + 4]
mov edx, dword [ebp + 0x18]
movzx eax, word [edi + 0xa8]
mov ecx, dword [edx]
cmp byte [eax + ecx], 0
jne 0x501a6d
movss xmm0, dword [ebp + 0x10]
mov byte [eax + ecx], 1
lea eax, [edi + 0xf0]
push eax
push ecx
add eax, 0x40
movss dword [esp], xmm0
push eax
call fcn.00650310
mov edx, dword [ebp + 0x18]
add esp, 0xc
movzx ecx, word [edi + 0xa8]
mov eax, dword [edx]
mov byte [ecx + eax], 2
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x14]
add dword [esp + 0xc], 0x30
inc ecx
mov edi, dword [esp + 0xc]
movzx eax, word [eax + 0xb0]
cmp ecx, eax
mov dword [esp + 0x14], ecx
mov eax, dword [esp + 8]
jl 0x501950
mov edi, dword [ebp + 0x1c]
mov ecx, dword [esi + 4]
mov dword [esp + 0xc], ecx
mov ecx, dword [edi + 4]
mov dword [esp + 0x1c], ecx
xor ecx, ecx
mov dword [esp + 0x10], ecx
cmp dword [eax + 0xb8], ecx
jle 0x501c19
nop word [eax + eax]
mov eax, dword [eax + 0xb4]
mov eax, dword [eax + ecx*4]
mov ecx, dword [eax + 0x30]
mov dword [esp + 0x14], ecx
mov eax, dword [ecx]
movzx eax, byte [eax + 0x1c]
cmp dword [ebp + 0xc], eax
jg 0x501bfd
mov edi, dword [ecx + 8]
xor edi, dword [ecx + 4]
xor edi, dword [esp + 8]
cmp byte [edi + 0xe8], 5
jne 0x501b38
mov eax, dword [esi + 8]
and eax, 0x3fffffff
cmp dword [esi + 4], eax
jne 0x501b1f
push 4
push esi
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov edx, dword [esi + 4]
mov eax, dword [esp + 0x14]
mov ecx, dword [esi]
mov eax, dword [eax]
mov dword [ecx + edx*4], eax
inc dword [esi + 4]
mov edx, dword [ebp + 0x18]
jmp 0x501bfd
movzx ecx, word [edi + 0xa8]
mov eax, dword [edx]
cmp byte [ecx + eax], 0x10
je 0x501bfd
mov eax, dword [esi + 8]
and eax, 0x3fffffff
cmp dword [esi + 4], eax
jne 0x501b68
push 4
push esi
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov edx, dword [esi + 4]
mov ecx, dword [esi]
mov eax, dword [esp + 0x14]
mov eax, dword [eax]
mov dword [ecx + edx*4], eax
mov edx, dword [ebp + 0x18]
inc dword [esi + 4]
movzx ecx, word [edi + 0xa8]
mov eax, dword [edx]
cmp byte [ecx + eax], 2
jae 0x501bfd
mov edx, dword [ebp + 0x1c]
mov eax, dword [edx + 8]
and eax, 0x3fffffff
cmp dword [edx + 4], eax
jne 0x501bae
push 4
push edx
push 0x7d8954
call fcn.00467c00
mov edx, dword [ebp + 0x1c]
add esp, 0xc
mov ecx, dword [edx + 4]
mov eax, dword [edx]
mov dword [eax + ecx*4], edi
inc dword [edx + 4]
mov edx, dword [ebp + 0x18]
movzx eax, word [edi + 0xa8]
mov ecx, dword [edx]
cmp byte [eax + ecx], 0
jne 0x501bf0
movss xmm0, dword [ebp + 0x10]
mov byte [eax + ecx], 1
lea eax, [edi + 0xf0]
push eax
push ecx
add eax, 0x40
movss dword [esp], xmm0
push eax
call fcn.00650310
mov edx, dword [ebp + 0x18]
add esp, 0xc
movzx ecx, word [edi + 0xa8]
mov eax, dword [edx]
mov byte [ecx + eax], 2
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 8]
inc ecx
mov dword [esp + 0x10], ecx
cmp ecx, dword [eax + 0xb8]
jl 0x501ad0
mov edi, dword [ebp + 0x1c]
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0xc]
sub eax, ecx
cmp eax, 1
jle 0x501c3e
dec eax
push 0x5021e0
push eax
mov eax, dword [esi]
push 0
lea eax, [eax + ecx*4]
push eax
call fcn.00502370
add esp, 0x10
mov eax, dword [edi + 4]
mov ecx, dword [esp + 0x1c]
sub eax, ecx
cmp eax, 1
jle 0x501c63
dec eax
push 0x5021c0
push eax
mov eax, dword [edi]
push 0
lea eax, [eax + ecx*4]
push eax
call fcn.00502470
add esp, 0x10
mov ecx, dword [esp + 0x18]
mov eax, dword [ebp + 0x14]
inc ecx
mov dword [esp + 0x18], ecx
cmp ecx, dword [eax + 4]
jl 0x501910
pop edi
pop esi
mov esp, ebp
pop ebp
ret