Function at 0x4a6ec0
Capabilities:
Get thread local storage value

Disassembly:
mov eax, dword [0x527af4]
sub esp, 0x20
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
test ebx, ebx
jne 0x4a6ee6
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x20
ret
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x40]
xor eax, eax
xor edi, edi
mov ax, word [ecx*2 + 0x51e3c4]
xor ebp, ebp
mov dword [esp + 0x2c], eax
xor eax, eax
mov ax, word [edx*2 + 0x51e3c4]
mov dword [esp + 0x14], edi
mov dword [esp + 0x28], eax
mov eax, dword [ebx + 0xab6]
test eax, eax
mov dword [esp + 0x10], ebp
mov dword [esp + 0x24], 1
mov dword [esp + 0x18], eax
jle 0x4a73e6
cmp dword [ebx], 0
jne 0x4a73e6
cmp ebp, 1
jae 0x4a6f69
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.004a3ba0
mov edx, dword [esp + 0x18]
xor eax, eax
mov ax, word [esi]
mov ecx, ebp
shl eax, cl
add ebp, 8
add esp, 8
or edx, eax
cmp ebp, 1
mov dword [esp + 0x10], edx
jb 0x4a6f44
test byte [esp + 0x10], 1
je 0x4a701b
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov eax, dword [ebx + 0x44]
shr esi, 1
dec ebp
dec ecx
test eax, eax
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], ecx
je 0x4a6fa8
mov eax, dword [ebx + 0x48]
test eax, eax
je 0x4a6fa8
mov eax, dword [ebx + 0x8cea]
test eax, eax
ja 0x4a6fa8
mov dword [esp + 0x18], 0
cmp ebp, 8
jae 0x4a6fda
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.004a3ba0
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [esi]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
cmp ebp, 8
mov dword [esp + 0x10], eax
jb 0x4a6fb3
mov al, byte [esp + 0x10]
mov byte [edi + ebx + 0xcd6], al
inc edi
cmp edi, 0x8000
mov dword [esp + 0x14], edi
jne 0x4a7008
push ebx
push edi
call fcn.004a4fc0
add esp, 8
xor eax, eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], eax
mov edi, eax
mov ecx, dword [esp + 0x10]
shr ecx, 8
mov dword [esp + 0x10], ecx
sub ebp, 8
jmp 0x4a73da
mov edx, dword [esp + 0x10]
shr edx, 1
dec ebp
mov dword [esp + 0x10], edx
cmp ebp, 6
jae 0x4a7058
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.004a3ba0
xor ecx, ecx
mov edi, dword [esp + 0x18]
mov cx, word [esi]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or edi, edx
cmp ebp, 6
mov dword [esp + 0x10], edi
jb 0x4a7031
mov ecx, dword [esp + 0x10]
sub ebp, 6
mov eax, ecx
and eax, 0x3f
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x40]
shr ecx, 6
cmp ebp, eax
mov dword [esp + 0x10], ecx
jae 0x4a70a5
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.004a3ba0
mov edx, dword [esp + 0x18]
xor eax, eax
mov ax, word [esi]
mov ecx, ebp
shl eax, cl
add ebp, 8
add esp, 8
or edx, eax
mov eax, dword [esp + 0x40]
cmp ebp, eax
mov dword [esp + 0x10], edx
jb 0x4a707d
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x38]
not eax
and eax, ecx
lea ecx, [eax + eax*2]
xor eax, eax
mov al, byte [edx + ecx*2]
lea edi, [edx + ecx*2]
mov esi, eax
cmp esi, 0x10
jbe 0x4a713f
cmp esi, 0x63
je 0x4a7401
mov eax, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [edi + 1]
sub esi, 0x10
shr eax, cl
sub ebp, ecx
cmp ebp, esi
mov dword [esp + 0x10], eax
jae 0x4a7118
lea eax, [ebx + 0x9088]
push ebx
push eax
call fcn.004a3ba0
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [ebx + 0x9088]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
cmp ebp, esi
mov dword [esp + 0x10], eax
jb 0x4a70e8
mov ecx, dword [esp + 0x10]
xor eax, eax
mov ax, word [esi*2 + 0x51e3c4]
not ecx
and eax, ecx
xor ecx, ecx
lea edx, [eax + eax*2]
mov eax, dword [edi + 2]
mov cl, byte [eax + edx*2]
lea edi, [eax + edx*2]
mov esi, ecx
cmp esi, 0x10
ja 0x4a70c7
xor edx, edx
xor eax, eax
mov dl, byte [edi + 1]
mov ax, word [edi + 2]
mov edi, dword [esp + 0x14]
mov esi, edx
mov edx, dword [esp + 0x10]
mov ecx, esi
shr edx, cl
mov ecx, dword [esp + 0x1c]
sub edi, eax
mov eax, dword [esp + 0x3c]
sub ebp, esi
sub edi, ecx
cmp ebp, eax
mov dword [esp + 0x10], edx
jae 0x4a719e
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.004a3ba0
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [esi]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x3c]
cmp ebp, eax
jb 0x4a7174
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x2c]
not eax
and eax, ecx
mov ecx, dword [esp + 0x34]
lea eax, [eax + eax*2]
lea edx, [ecx + eax*2]
xor eax, eax
mov dword [esp + 0x20], edx
mov al, byte [edx]
mov esi, eax
cmp esi, 0x10
jbe 0x4a7253
cmp esi, 0x63
je 0x4a7401
mov eax, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [edx + 1]
sub esi, 0x10
shr eax, cl
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x10], eax
mov eax, ecx
sub ebp, eax
cmp ebp, esi
jae 0x4a7222
lea eax, [ebx + 0x9088]
push ebx
push eax
call fcn.004a3ba0
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [ebx + 0x9088]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
cmp ebp, esi
mov dword [esp + 0x10], eax
jb 0x4a71ee
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
xor eax, eax
mov ax, word [esi*2 + 0x51e3c4]
not ecx
and eax, ecx
mov ecx, dword [edx + 2]
xor edx, edx
lea eax, [eax + eax*2]
mov dl, byte [ecx + eax*2]
lea eax, [ecx + eax*2]
mov esi, edx
mov dword [esp + 0x20], eax
cmp esi, 0x10
mov edx, eax
ja 0x4a71c7
mov eax, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [edx + 1]
mov dword [esp + 0x1c], ecx
sub ebp, ecx
shr eax, cl
xor ecx, ecx
mov cx, word [edx + 2]
test esi, esi
mov dword [esp + 0x10], eax
mov dword [esp + 0x20], ecx
je 0x4a72c2
cmp ebp, 8
jae 0x4a72aa
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.004a3ba0
mov edx, dword [esp + 0x18]
xor eax, eax
mov ax, word [esi]
mov ecx, ebp
shl eax, cl
add ebp, 8
add esp, 8
or edx, eax
cmp ebp, 8
mov dword [esp + 0x10], edx
jb 0x4a7281
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x10]
mov edx, eax
and edx, 0xff
shr eax, 8
add ecx, edx
mov dword [esp + 0x10], eax
sub ebp, 8
mov edx, dword [esp + 0x18]
mov eax, dword [ebx + 0x44]
sub edx, ecx
test eax, eax
mov dword [esp + 0x18], edx
je 0x4a72ec
mov eax, dword [ebx + 0x48]
test eax, eax
je 0x4a72ec
mov eax, dword [ebx + 0x8cea]
test eax, eax
ja 0x4a72ec
mov dword [esp + 0x18], 0
mov eax, dword [esp + 0x14]
and edi, 0x7fff
cmp edi, eax
mov dword [esp + 0x1c], edi
mov esi, edi
ja 0x4a7302
mov esi, eax
mov edx, 0x8000
sub edx, esi
cmp edx, ecx
jbe 0x4a730f
mov edx, ecx
sub ecx, edx
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x4a7352
cmp eax, edi
ja 0x4a7352
mov esi, dword [esp + 0x14]
mov ecx, edx
xor eax, eax
lea edi, [esi + ebx + 0xcd6]
mov esi, ecx
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 + 0x14]
mov edi, dword [esp + 0x1c]
add ecx, edx
add edi, edx
mov dword [esp + 0x14], ecx
mov eax, ecx
jmp 0x4a73ab
mov ecx, eax
sub ecx, edi
cmp ecx, edx
jb 0x4a7394
mov ecx, edx
lea esi, [ebx + edi + 0xcd6]
lea edi, [ebx + eax + 0xcd6]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
add ecx, edx
add eax, edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], ecx
mov edi, dword [esp + 0x1c]
mov eax, ecx
jmp 0x4a73ab
mov cl, byte [ebx + edi + 0xcd6]
mov byte [ebx + eax + 0xcd6], cl
inc eax
inc edi
dec edx
jne 0x4a7394
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x20]
cmp eax, 0x8000
jne 0x4a73ce
push ebx
push eax
call fcn.004a4fc0
mov ecx, dword [esp + 0x28]
add esp, 8
xor eax, eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], eax
test ecx, ecx
jne 0x4a72ec
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
test eax, eax
jg 0x4a6f30
push ebx
push edi
call fcn.004a4fc0
mov eax, dword [ebx + 0x44]
add esp, 8
test eax, eax
je 0x4a740e
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x20
ret
mov eax, dword [ebx + 0xab2]
pop edi
neg eax
sbb eax, eax
pop esi
pop ebp
and eax, 5
pop ebx
add esp, 0x20
ret