Function at 0x4a7810
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x1c
mov eax, dword [0x527af4]
push ebx
push ebp
push esi
push edi
xor esi, esi
xor edi, edi
push eax
xor ebx, ebx
mov dword [esp + 0x20], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x14], edi
mov dword [esp + 0x28], 1
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
cmp ebp, esi
je 0x4a7c34
mov ecx, dword [ebp + 0xab6]
xor eax, eax
mov ax, word [ebp + 0xafe]
lea edx, [ebp + 0x4cd6]
dec eax
mov dword [esp + 0x14], ecx
mov dword [ebp + 0x908e], edx
mov dword [ebp + 0x9192], eax
call fcn.004a7c50
cmp dword [esp + 0x14], esi
jle 0x4a7c2a
cmp dword [ebp], esi
jne 0x4a7c2a
mov al, byte [ebx + ebp + 0x9092]
test al, al
mov eax, dword [ebp + 0x8cf2]
jne 0x4a78e6
cmp eax, 8
jge 0x4a78a8
push ebp
call fcn.004a3b30
add esp, 4
mov ecx, dword [0x51e3d4]
mov eax, dword [ebp + 0x8cf2]
xor edx, edx
and ecx, 0xffff
mov dx, word [ebp + 0x8cee]
and edx, ecx
mov ecx, dword [ebp + 0x8cee]
shr ecx, 8
add eax, 0xfffffff8
mov dword [esp + 0x18], edx
mov dword [ebp + 0x8cee], ecx
mov dword [ebp + 0x8cf2], eax
jmp 0x4a79dc
cmp eax, 1
jge 0x4a78f4
push ebp
call fcn.004a3b30
add esp, 4
mov ecx, dword [ebp + 0x8cf2]
xor eax, eax
mov ax, word [ebp + 0x8cee]
xor edx, edx
mov dx, word [0x51e3c6]
and eax, edx
mov edx, dword [ebp + 0x8cee]
shr edx, 1
dec ecx
cmp eax, esi
mov dword [ebp + 0x8cee], edx
mov dword [ebp + 0x8cf2], ecx
je 0x4a7974
cmp ecx, 8
jge 0x4a7935
push ebp
call fcn.004a3b30
add esp, 4
mov ecx, dword [0x51e3d4]
xor eax, eax
mov ax, word [ebp + 0x8cee]
and ecx, 0xffff
and eax, ecx
mov ecx, dword [ebp + 0x8cee]
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0x8cf2]
mov edx, dword [esp + 0x18]
shr ecx, 8
add eax, 0xfffffff8
mov dword [ebp + 0x8cee], ecx
mov dword [ebp + 0x8cf2], eax
jmp 0x4a79dc
xor edx, edx
mov dl, byte [ebx + ebp + 0x9092]
mov esi, dword [edx*4 + 0x51e7f0]
cmp esi, ecx
jle 0x4a7991
push ebp
call fcn.004a3b30
add esp, 4
mov edx, dword [ebp + 0x8cee]
xor eax, eax
mov ax, word [esi*2 + 0x51e3c4]
xor ecx, ecx
mov cx, word [ebp + 0x8cee]
and eax, ecx
mov ecx, esi
shr edx, cl
mov ecx, dword [ebp + 0x8cf2]
sub ecx, esi
mov dword [ebp + 0x8cf2], ecx
mov ecx, dword [ebp + 0x908e]
shl ebx, 6
add ebx, ecx
xor ecx, ecx
mov dword [ebp + 0x8cee], edx
xor esi, esi
mov cl, byte [ebx + eax]
mov dword [esp + 0x18], ecx
mov edx, ecx
mov eax, dword [esp + 0x1c]
cmp eax, 3
ja case.default.0x4a79e9
jmp dword [eax*4 + 0x4a7c3c]
cmp edx, 0x90
je 0x4a7a4e
mov ecx, dword [esp + 0x14]
mov eax, dword [ebp + 0x44]
dec ecx
cmp eax, esi
mov dword [esp + 0x14], ecx
je 0x4a7a19
cmp dword [ebp + 0x48], esi
je 0x4a7a19
cmp dword [ebp + 0x8cea], esi
ja 0x4a7a19
mov dword [esp + 0x14], esi
mov byte [edi + ebp + 0xcd6], dl
inc edi
cmp edi, 0x4000
mov dword [esp + 0x10], edi
jne case.default.0x4a79e9
push ebp
push edi
call fcn.004a4fc0
mov edx, dword [esp + 0x20]
add esp, 8
mov dword [esp + 0x24], esi
mov dword [esp + 0x10], esi
mov edi, esi
jmp case.default.0x4a79e9
mov dword [esp + 0x1c], 1
jmp case.default.0x4a79e9
cmp edx, esi
je 0x4a7a8b
mov eax, dword [ebp + 0x9192]
xor ecx, ecx
mov dword [esp + 0x28], edx
mov esi, dword [eax*4 + 0x51e7b4]
mov eax, esi
and eax, edx
cmp eax, esi
mov dword [esp + 0x20], eax
setne cl
add ecx, 2
mov dword [esp + 0x1c], ecx
jmp 0x4a7c1a
mov ecx, dword [esp + 0x14]
mov eax, dword [ebp + 0x44]
dec ecx
cmp eax, esi
mov dword [esp + 0x14], ecx
je 0x4a7aac
cmp dword [ebp + 0x48], esi
je 0x4a7aac
cmp dword [ebp + 0x8cea], esi
ja 0x4a7aac
mov dword [esp + 0x14], esi
mov byte [edi + ebp + 0xcd6], 0x90
inc edi
cmp edi, 0x4000
mov dword [esp + 0x10], edi
jne 0x4a7ad9
push ebp
push edi
call fcn.004a4fc0
mov edx, dword [esp + 0x20]
add esp, 8
mov dword [esp + 0x24], esi
mov dword [esp + 0x10], esi
mov edi, esi
mov dword [esp + 0x1c], esi
jmp case.default.0x4a79e9
mov eax, dword [esp + 0x20]
mov dword [esp + 0x1c], 3
add eax, edx
mov dword [esp + 0x20], eax
jmp case.default.0x4a79e9
mov eax, dword [esp + 0x20]
mov ebx, dword [esp + 0x28]
lea esi, [eax + 3]
mov eax, dword [ebp + 0x9192]
shl eax, 2
mov ecx, dword [eax + 0x51e7c8]
sar ebx, cl
mov ecx, dword [eax + 0x51e7dc]
mov eax, dword [ebp + 0x44]
and ebx, ecx
shl ebx, 8
mov ecx, ebx
mov ebx, edi
sub ebx, ecx
mov ecx, dword [esp + 0x14]
sub ebx, edx
sub ecx, esi
dec ebx
mov dword [esp + 0x14], ecx
test eax, eax
je 0x4a7b53
mov eax, dword [ebp + 0x48]
test eax, eax
je 0x4a7b53
mov eax, dword [ebp + 0x8cea]
test eax, eax
ja 0x4a7b53
mov dword [esp + 0x14], 0
and ebx, 0x3fff
cmp ebx, edi
mov eax, ebx
ja 0x4a7b61
mov eax, edi
mov edx, 0x4000
sub edx, eax
cmp edx, esi
jbe 0x4a7b6e
mov edx, esi
mov eax, dword [esp + 0x24]
sub esi, edx
test eax, eax
mov dword [esp + 0x1c], esi
je 0x4a7b9b
cmp edi, ebx
ja 0x4a7b9b
mov ecx, edx
xor eax, eax
mov esi, ecx
lea edi, [edi + ebp + 0xcd6]
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
jmp 0x4a7bda
mov eax, edi
sub eax, ebx
cmp eax, edx
jae 0x4a7bbc
mov cl, byte [ebx + ebp + 0xcd6]
mov byte [edi + ebp + 0xcd6], cl
inc edi
inc ebx
dec edx
jne 0x4a7ba3
mov dword [esp + 0x10], edi
jmp 0x4a7bec
mov ecx, edx
lea esi, [ebx + ebp + 0xcd6]
mov eax, ecx
lea edi, [edi + ebp + 0xcd6]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x1c]
add ecx, edx
add ebx, edx
mov dword [esp + 0x10], ecx
mov edi, ecx
cmp edi, 0x4000
jne 0x4a7c0a
push ebp
push edi
call fcn.004a4fc0
add esp, 8
xor eax, eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x10], eax
mov edi, eax
test esi, esi
jne 0x4a7b53
mov edx, dword [esp + 0x18]
mov dword [esp + 0x1c], esi
xor esi, esi
mov eax, dword [esp + 0x14]
mov ebx, edx
cmp eax, esi
jg 0x4a7880
push ebp
push edi
call fcn.004a4fc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret