Function at 0x489360
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x28
mov eax, dword [0x6c24b8]
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
xor ebx, ebx
cmp edi, ebx
mov dword [esp + 0x1c], edi
jne 0x48938c
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x28
ret
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
xor eax, eax
xor ebp, ebp
mov ax, word [ecx*2 + 0x683508]
mov ecx, dword [esp + 0x50]
mov dword [esp + 0x24], eax
xor eax, eax
mov ax, word [edx*2 + 0x683508]
mov dword [esp + 0x10], ebx
mov dword [esp + 0x2c], eax
xor eax, eax
mov ax, word [ecx*2 + 0x683508]
mov ecx, dword [edi + 0x4558]
mov dword [esp + 0x28], eax
mov eax, dword [edi + 0x455c]
cmp eax, ebx
mov dword [esp + 0x20], 1
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], eax
jl 0x4898e2
jg 0x4893f6
cmp ecx, ebx
jbe 0x4898e2
cmp dword [edi], 0
jne 0x4898e2
cmp ebp, 1
jae 0x489427
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.004869a0
xor edx, edx
mov ecx, ebp
mov dx, word [esi]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, 1
jb 0x48940a
test bl, 1
je 0x48955c
mov esi, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov ecx, dword [edi + 0x54]
or eax, 0xffffffff
shr ebx, 1
dec ebp
add esi, eax
adc edx, eax
xor eax, eax
cmp ecx, eax
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], edx
je 0x489468
cmp dword [edi + 0x5c], eax
je 0x489468
cmp dword [edi + 0x14f98], eax
ja 0x489468
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
cmp ebp, dword [esp + 0x48]
jae 0x489494
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.004869a0
xor eax, eax
mov ecx, ebp
mov ax, word [esi]
add ebp, 8
shl eax, cl
add esp, 8
or ebx, eax
mov eax, dword [esp + 0x48]
cmp ebp, eax
jb 0x489474
mov edx, dword [esp + 0x24]
mov ecx, ebx
not ecx
and ecx, edx
mov edx, dword [esp + 0x3c]
lea eax, [edx + ecx*8]
xor ecx, ecx
mov dword [esp + 0x18], eax
mov cl, byte [eax]
mov esi, ecx
cmp esi, 0x10
jbe 0x48951c
cmp esi, 0x63
je 0x48991a
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4894f7
lea eax, [edi + 0x16828]
push edi
push eax
call fcn.004869a0
xor edx, edx
mov ecx, ebp
mov dx, word [edi + 0x16828]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, esi
jb 0x4894cd
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x683508]
mov edx, ebx
not edx
and ecx, edx
lea eax, [eax + ecx*8]
xor ecx, ecx
mov dword [esp + 0x18], eax
mov cl, byte [eax]
mov esi, ecx
cmp esi, 0x10
ja 0x4894b4
mov dl, byte [eax + 4]
xor ecx, ecx
mov cl, byte [eax + 1]
mov eax, dword [esp + 0x10]
shr ebx, cl
sub ebp, ecx
mov byte [eax + edi + 0x4f7c], dl
inc eax
cmp eax, 0x8000
mov dword [esp + 0x10], eax
jne 0x4898c8
push edi
push eax
call fcn.004884f0
add esp, 8
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x10], eax
jmp 0x4898c8
shr ebx, 1
dec ebp
cmp ebp, 7
jae 0x489587
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.004869a0
xor eax, eax
mov ecx, ebp
mov ax, word [esi]
add ebp, 8
shl eax, cl
add esp, 8
or ebx, eax
cmp ebp, 7
jb 0x48956a
mov eax, ebx
sub ebp, 7
and eax, 0x7f
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x50]
shr ebx, 7
cmp ebp, eax
jae 0x4895c6
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.004869a0
xor ecx, ecx
mov eax, dword [esp + 0x58]
mov cx, word [esi]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or ebx, edx
cmp ebp, eax
jb 0x4895a4
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x44]
mov eax, ebx
not eax
and eax, edx
xor edx, edx
mov dl, byte [ecx + eax*8]
lea eax, [ecx + eax*8]
mov esi, edx
cmp esi, 0x10
mov dword [esp + 0x18], eax
jbe 0x48964f
cmp esi, 0x63
je 0x48991a
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x48962a
lea eax, [edi + 0x16828]
push edi
push eax
call fcn.004869a0
xor eax, eax
mov ecx, ebp
mov ax, word [edi + 0x16828]
add ebp, 8
shl eax, cl
add esp, 8
or ebx, eax
cmp ebp, esi
jb 0x489600
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x683508]
mov edx, ebx
not edx
and ecx, edx
lea eax, [eax + ecx*8]
xor ecx, ecx
mov dword [esp + 0x18], eax
mov cl, byte [eax]
mov esi, ecx
cmp esi, 0x10
ja 0x4895e7
xor ecx, ecx
xor edx, edx
mov cl, byte [eax + 1]
mov dx, word [eax + 4]
mov eax, dword [esp + 0x10]
sub ebp, ecx
shr ebx, cl
mov ecx, dword [esp + 0x14]
sub eax, edx
sub eax, ecx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x4c]
cmp ebp, eax
jae 0x48969c
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.004869a0
xor eax, eax
mov ecx, ebp
mov ax, word [esi]
add ebp, 8
shl eax, cl
add esp, 8
or ebx, eax
mov eax, dword [esp + 0x4c]
cmp ebp, eax
jb 0x48967c
mov edx, dword [esp + 0x2c]
mov ecx, ebx
not ecx
and ecx, edx
mov edx, dword [esp + 0x40]
lea eax, [edx + ecx*8]
xor ecx, ecx
mov dword [esp + 0x18], eax
mov cl, byte [eax]
mov esi, ecx
cmp esi, 0x10
jbe 0x489724
cmp esi, 0x63
je 0x48991a
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4896ff
lea eax, [edi + 0x16828]
push edi
push eax
call fcn.004869a0
xor edx, edx
mov ecx, ebp
mov dx, word [edi + 0x16828]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, esi
jb 0x4896d5
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x683508]
mov edx, ebx
not edx
and ecx, edx
lea eax, [eax + ecx*8]
xor ecx, ecx
mov dword [esp + 0x18], eax
mov cl, byte [eax]
mov esi, ecx
cmp esi, 0x10
ja 0x4896bc
xor ecx, ecx
mov cl, byte [eax + 1]
shr ebx, cl
sub ebp, ecx
xor ecx, ecx
mov cx, word [eax + 4]
xor eax, eax
cmp esi, eax
mov dword [esp + 0x18], ecx
je 0x48977e
cmp ebp, 8
jae 0x489765
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.004869a0
xor edx, edx
mov ecx, ebp
mov dx, word [esi]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, 8
jb 0x489748
mov ecx, dword [esp + 0x18]
mov eax, ebx
and eax, 0xff
sub ebp, 8
add ecx, eax
shr ebx, 8
mov dword [esp + 0x18], ecx
xor eax, eax
mov esi, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
sub esi, ecx
mov ecx, dword [edi + 0x54]
sbb edx, eax
cmp ecx, eax
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], edx
je 0x4897ae
cmp dword [edi + 0x5c], eax
je 0x4897ae
cmp dword [edi + 0x14f98], eax
ja 0x4897ae
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
jmp 0x4897c0
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
and eax, 0x7fff
cmp eax, esi
mov dword [esp + 0x14], eax
ja 0x4897d3
mov eax, esi
mov edx, 0x8000
sub edx, eax
cmp edx, ecx
jbe 0x4897e0
mov edx, ecx
mov eax, dword [esp + 0x20]
sub ecx, edx
test eax, eax
mov dword [esp + 0x18], ecx
je 0x489823
cmp esi, dword [esp + 0x14]
ja 0x489823
mov ecx, edx
lea edi, [esi + edi + 0x4f7c]
mov esi, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
add ecx, edx
add eax, edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
jmp 0x489892
sub esi, dword [esp + 0x14]
cmp esi, edx
jb 0x48986f
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
mov ecx, edx
lea esi, [eax + esi + 0x4f7c]
lea edi, [eax + edi + 0x4f7c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x14]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
add ecx, edx
add eax, edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
jmp 0x489892
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
inc esi
mov cl, byte [edi + eax + 0x4f7c]
inc eax
mov byte [edi + esi + 0x4f7b], cl
dec edx
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
jne 0x48986b
cmp dword [esp + 0x10], 0x8000
jne 0x4898b8
mov edx, dword [esp + 0x1c]
push edx
push 0x8000
call fcn.004884f0
add esp, 8
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
test eax, eax
jne 0x4897b8
mov eax, dword [esp + 0x34]
test eax, eax
jg 0x4893f6
jl 0x4898e2
mov eax, dword [esp + 0x30]
test eax, eax
ja 0x4893f6
mov eax, dword [esp + 0x10]
push edi
push eax
call fcn.004884f0
mov eax, dword [edi + 0x54]
add esp, 8
test eax, eax
jne 0x489927
mov ecx, dword [edi + 0x4550]
mov eax, dword [edi + 0x4554]
add edi, 0x4550
or ecx, eax
je 0x489927
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x28
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x28
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x28
ret