Function at 0x494860
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
push edi
xor esi, esi
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x4948b3
mov edx, dword [eax]
mov ecx, edx
and ecx, 0x3a
jne 0x49488b
and edx, 0x400
je 0x4948a4
mov eax, dword [eax + 8]
cmp eax, 1
jne 0x4948a4
mov eax, dword [ebp + 0x18]
push eax
call fcn.0049ff30
pop ecx
mov esi, eax
test esi, esi
jl 0x4948a0
cmp esi, 3
jle 0x4948b3
xor esi, esi
jmp 0x4948b3
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
and eax, 0x1000
je 0x4948b3
or esi, 0xffffffff
cmp esi, 1
je 0x494bbe
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov eax, dword [eax + 0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov dword [eax + 0x18], 1
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 8]
cmp word [eax + 0x1c], 0
jne 0x494a53
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 8]
mov eax, dword [eax]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 8]
mov eax, dword [eax + 4]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 0x10]
lea ebx, [eax - 1]
jmp 0x494a3d
test esi, esi
je 0x49491b
cmp esi, 2
je 0x494936
cmp esi, 3
je 0x494980
jmp 0x4949b1
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
push 0xffffffffffffffff
mov eax, dword [ebp + 8]
push eax
call fcn.004936b0
add esp, 0x10
jmp 0x494a2a
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00493f40
add esp, 0xc
test eax, eax
jne 0x49496b
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004936b0
add esp, 0x10
jmp 0x494a2a
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
jmp 0x494a2a
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00493f40
add esp, 0xc
test eax, eax
je 0x494a2a
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
jmp 0x494a2a
push 0x7be268
call fcn.0046b2e0
pop ecx
mov eax, dword [ebp + 0x18]
push eax
call fcn.0046a8b0
pop ecx
mov eax, dword [ebp - 8]
push eax
call fcn.0046a8b0
pop ecx
mov eax, dword [ebp - 0xc]
push eax
call fcn.0046a8b0
pop ecx
lea eax, [ebx + 1]
push eax
call fcn.0046ad50
pop ecx
push 3
call fcn.00469190
pop ecx
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [eax + 0x10]
and eax, 0x80
je 0x494a2a
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x18], 0
je 0x494a2a
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
push 0xffffffffffffffff
mov eax, dword [ebp + 8]
push eax
call fcn.004936b0
add esp, 0x10
inc ebx
mov eax, dword [ebp - 8]
lea eax, [eax + 0x20]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0xc]
lea eax, [eax + 0x20]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 0x10]
dec eax
mov edx, dword [ebp + 0x14]
add eax, edx
cmp ebx, eax
jb 0x494908
jmp 0x494bad
mov ebx, dword [ebp + 0x10]
jmp 0x494b9d
push ebx
mov eax, dword [ebp + 0xc]
push eax
call fcn.004951d0
add esp, 8
mov dword [ebp - 8], eax
push ebx
mov eax, dword [ebp + 0xc]
push eax
call fcn.00495250
add esp, 8
mov dword [ebp - 0xc], eax
test esi, esi
je 0x494a8e
cmp esi, 2
je 0x494aa9
cmp esi, 3
je 0x494af3
jmp 0x494b24
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
push 0xffffffffffffffff
mov eax, dword [ebp + 8]
push eax
call fcn.004936b0
add esp, 0x10
jmp 0x494b9c
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00493f40
add esp, 0xc
test eax, eax
jne 0x494ade
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004936b0
add esp, 0x10
jmp 0x494b9c
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
jmp 0x494b9c
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00493f40
add esp, 0xc
test eax, eax
je 0x494b9c
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
jmp 0x494b9c
push 0x7be268
call fcn.0046b2e0
pop ecx
mov eax, dword [ebp + 0x18]
push eax
call fcn.0046a8b0
pop ecx
mov eax, dword [ebp - 8]
push eax
call fcn.0046a8b0
pop ecx
mov eax, dword [ebp - 0xc]
push eax
call fcn.0046a8b0
pop ecx
mov eax, ebx
push eax
call fcn.0046ad50
pop ecx
push 3
call fcn.00469190
pop ecx
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [eax + 0x10]
and eax, 0x80
je 0x494b9c
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x18], 0
je 0x494b9c
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
push 0xffffffffffffffff
mov eax, dword [ebp + 8]
push eax
call fcn.004936b0
add esp, 0x10
inc ebx
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
add eax, edx
cmp ebx, eax
jb 0x494a5b
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x10]
mov dword [eax + 0x18], edx
jmp 0x494d00
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov edi, dword [eax + 0x20]
xor ebx, ebx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
movzx eax, word [eax + 0x1c]
test eax, eax
jne 0x494c74
jmp 0x494c67
mov eax, ebx
shl eax, 5
mov edx, dword [ebp + 8]
mov edx, dword [edx + 8]
mov edx, dword [edx]
add eax, edx
mov dword [ebp - 0x10], eax
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp + 0xc]
push eax
call fcn.00493f40
add esp, 0xc
test eax, eax
jne 0x494c1d
lea eax, [ebx + 1]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
dec edi
jmp 0x494c67
mov eax, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
cmp eax, edx
jb 0x494c30
mov ecx, dword [ebp + 0x14]
add edx, ecx
cmp eax, edx
jbe 0x494c43
lea eax, [ebx + 1]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
dec edi
jmp 0x494c67
mov eax, dword [ebp - 4]
dec eax
shl eax, 5
mov edx, dword [ebp + 0xc]
mov edx, dword [edx + 8]
mov edx, dword [edx + 4]
add eax, edx
push eax
lea eax, [ebx + 1]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00494270
add esp, 0xc
inc ebx
cmp ebx, edi
jb 0x494be0
jmp 0x494d00
mov ebx, 1
jmp 0x494cf8
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.004951d0
add esp, 8
mov dword [ebp - 0x10], eax
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp + 0xc]
push eax
call fcn.00493f40
add esp, 0xc
test eax, eax
jne 0x494cb6
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
dec edi
jmp 0x494cf8
mov eax, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
cmp eax, edx
jb 0x494cc9
mov ecx, dword [ebp + 0x14]
add edx, ecx
cmp eax, edx
jbe 0x494cd9
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.00494020
add esp, 8
dec edi
jmp 0x494cf8
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp + 0xc]
push eax
call fcn.00495250
add esp, 8
push eax
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.00494270
add esp, 0xc
inc ebx
cmp ebx, edi
jbe 0x494c7e
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret