Function at 0x485650
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x1c
mov eax, dword [0x6c24b8]
push ebx
push ebp
push esi
push edi
push eax
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
test ebp, ebp
jne 0x48567e
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret
mov edx, dword [esp + 0x38]
mov ecx, dword [ebp + 0x16818]
xor eax, eax
mov edi, dword [ebp + 0x16820]
mov ax, word [edx*2 + 0x683508]
mov ebx, dword [ebp + 0x16824]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x20], eax
xor eax, eax
mov ax, word [ecx*2 + 0x683508]
mov dword [esp + 0x24], eax
cmp dword [ebp], 0
jne 0x4859fa
cmp ebx, dword [esp + 0x38]
jae 0x4856ee
lea esi, [ebp + 0x16828]
push ebp
push esi
call fcn.004869a0
xor edx, edx
mov eax, dword [esp + 0x40]
mov dx, word [esi]
mov ecx, ebx
shl edx, cl
add ebx, 8
add esp, 8
or edi, edx
cmp ebx, eax
jb 0x4856ce
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x30]
and eax, edi
xor edx, edx
mov dl, byte [ecx + eax*8]
lea eax, [ecx + eax*8]
mov esi, edx
mov dword [esp + 0x10], eax
cmp esi, 0x12
jbe 0x48576f
cmp esi, 0x63
je 0x485671
xor ecx, ecx
sub esi, 0x12
mov cl, byte [eax + 1]
sub ebx, ecx
shr edi, cl
cmp ebx, esi
jae 0x48574e
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.004869a0
xor eax, eax
mov ecx, ebx
mov ax, word [ebp + 0x16828]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
cmp ebx, esi
jb 0x485724
mov eax, dword [esp + 0x10]
mov edx, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x683508]
and ecx, edi
lea eax, [edx + ecx*8]
xor ecx, ecx
mov dword [esp + 0x10], eax
mov cl, byte [eax]
mov esi, ecx
cmp esi, 0x12
ja 0x48570b
xor ecx, ecx
mov cl, byte [eax + 1]
shr edi, cl
sub ebx, ecx
cmp esi, 0x12
jne 0x4857ba
mov dl, byte [eax + 4]
mov eax, dword [esp + 0x14]
mov byte [eax + ebp + 0x4f7c], dl
inc eax
cmp eax, 0x10000
mov dword [esp + 0x14], eax
jne 0x4859d9
push ebp
push eax
call fcn.004855a0
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x485a29
mov dword [esp + 0x14], eax
jmp 0x4859d9
cmp esi, 0x11
je 0x4859fa
cmp ebx, esi
jae 0x4857f1
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.004869a0
xor eax, eax
mov ecx, ebx
mov ax, word [ebp + 0x16828]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
cmp ebx, esi
jb 0x4857c7
mov eax, dword [esp + 0x10]
xor ecx, ecx
xor edx, edx
mov cx, word [esi*2 + 0x683508]
mov dx, word [eax + 4]
mov eax, dword [esp + 0x3c]
and ecx, edi
add ecx, edx
sub ebx, esi
mov dword [esp + 0x1c], ecx
mov ecx, esi
shr edi, cl
cmp ebx, eax
jae 0x48583d
lea esi, [ebp + 0x16828]
push ebp
push esi
call fcn.004869a0
xor eax, eax
mov ecx, ebx
mov ax, word [esi]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
mov eax, dword [esp + 0x3c]
cmp ebx, eax
jb 0x48581d
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x34]
and ecx, edi
xor eax, eax
mov al, byte [edx + ecx*8]
lea edx, [edx + ecx*8]
mov esi, eax
mov dword [esp + 0x10], edx
cmp esi, 0x12
jbe 0x4858c3
cmp esi, 0x63
je 0x485671
xor ecx, ecx
sub esi, 0x12
mov cl, byte [edx + 1]
sub ebx, ecx
shr edi, cl
cmp ebx, esi
jae 0x48589f
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.004869a0
xor ecx, ecx
add esp, 8
mov cx, word [ebp + 0x16828]
mov edx, ecx
mov ecx, ebx
shl edx, cl
add ebx, 8
or edi, edx
cmp ebx, esi
jb 0x485873
mov edx, dword [esp + 0x10]
mov ecx, dword [edx + 4]
xor eax, eax
mov ax, word [esi*2 + 0x683508]
xor edx, edx
and eax, edi
mov dl, byte [ecx + eax*8]
lea eax, [ecx + eax*8]
mov esi, edx
mov dword [esp + 0x10], eax
cmp esi, 0x12
mov edx, eax
ja 0x48585a
xor ecx, ecx
mov cl, byte [edx + 1]
sub ebx, ecx
shr edi, cl
cmp ebx, esi
jae 0x4858fa
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.004869a0
xor eax, eax
mov ecx, ebx
mov ax, word [ebp + 0x16828]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
cmp ebx, esi
jb 0x4858d0
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
xor ecx, ecx
mov cx, word [esi*2 + 0x683508]
and ecx, edi
sub eax, ecx
xor ecx, ecx
mov cx, word [edx + 4]
sub eax, ecx
mov ecx, esi
shr edi, cl
sub ebx, esi
mov dword [esp + 0x28], edi
mov edx, dword [esp + 0x14]
and eax, 0xffff
cmp eax, edx
mov ecx, eax
ja 0x48592f
mov ecx, edx
mov esi, 0x10000
sub esi, ecx
mov ecx, dword [esp + 0x1c]
cmp esi, ecx
mov dword [esp + 0x10], esi
jbe 0x485948
mov esi, ecx
mov dword [esp + 0x10], esi
sub ecx, esi
mov dword [esp + 0x1c], ecx
mov ecx, edx
sub ecx, eax
cmp ecx, esi
jb 0x485990
mov ecx, esi
lea edi, [edx + ebp + 0x4f7c]
mov edx, ecx
lea esi, [eax + ebp + 0x4f7c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x28]
add esi, ecx
add eax, ecx
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov edx, esi
jmp 0x4859ab
mov cl, byte [eax + ebp + 0x4f7c]
mov byte [edx + ebp + 0x4f7c], cl
inc edx
inc eax
dec esi
jne 0x485990
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
cmp edx, 0x10000
jne 0x4859cd
push ebp
push edx
call fcn.004855a0
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x485a29
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jne 0x48591e
mov al, byte [ebp + 0x14fa4]
test al, al
je 0x4859ed
mov eax, dword [ebp + 0x14f98]
test eax, eax
jbe 0x4859fa
cmp dword [ebp + 0x1680c], 1
jle 0x4856b8
mov eax, dword [ebp + 0x54]
mov edx, dword [esp + 0x14]
test eax, eax
mov dword [ebp + 0x16818], edx
mov dword [ebp + 0x16820], edi
mov dword [ebp + 0x16824], ebx
jne 0x485a29
mov al, byte [ebp + 0x14fa4]
test al, al
je 0x485a29
mov dword [esp + 0x18], 1
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret