Function at 0x470bf0
Capabilities:
Get thread local storage value

Disassembly:
mov eax, dword [0x5296dc]
sub esp, 0x24
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
xor esi, esi
cmp ebx, esi
jne 0x470c18
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x24
ret
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x44]
xor eax, eax
xor edi, edi
mov ax, word [ecx*2 + 0x51d2b0]
mov ecx, dword [ebx + 0x4558]
mov dword [esp + 0x28], eax
xor eax, eax
mov ax, word [edx*2 + 0x51d2b0]
xor ebp, ebp
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 0x455c]
cmp eax, esi
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x20], 1
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], eax
jl 0x47113d
jg 0x470c76
cmp ecx, esi
jbe 0x47113d
cmp dword [ebx], esi
jne 0x47113d
cmp ebp, 1
jae 0x470cb0
lea esi, [ebx + 0x16828]
push ebx
push esi
call fcn.0046d640
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 0x470c89
xor esi, esi
test byte [esp + 0x10], 1
je 0x470d6c
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x2c]
shr ecx, 1
or eax, 0xffffffff
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x30]
dec ebp
add edx, eax
adc ecx, eax
mov eax, dword [ebx + 0x54]
cmp eax, esi
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], ecx
je 0x470cf9
cmp dword [ebx + 0x5c], esi
je 0x470cf9
cmp dword [ebx + 0x14f98], esi
ja 0x470cf9
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], esi
cmp ebp, 8
jae 0x470d2d
lea esi, [ebx + 0x16828]
push ebx
push esi
call fcn.0046d640
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 0x470d04
xor esi, esi
mov al, byte [esp + 0x10]
mov byte [edi + ebx + 0x4f7c], al
inc edi
cmp edi, 0x8000
mov dword [esp + 0x14], edi
jne 0x470d59
push ebx
push edi
call fcn.0046f1c0
add esp, 8
mov dword [esp + 0x20], esi
mov dword [esp + 0x14], esi
mov edi, esi
mov ecx, dword [esp + 0x10]
shr ecx, 8
mov dword [esp + 0x10], ecx
sub ebp, 8
jmp 0x471127
mov edx, dword [esp + 0x10]
shr edx, 1
dec ebp
mov dword [esp + 0x10], edx
cmp ebp, 7
jae 0x470da9
lea esi, [ebx + 0x16828]
push ebx
push esi
call fcn.0046d640
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, 7
mov dword [esp + 0x10], edi
jb 0x470d82
mov ecx, dword [esp + 0x10]
sub ebp, 7
mov eax, ecx
and eax, 0x7f
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x44]
shr ecx, 7
cmp ebp, eax
mov dword [esp + 0x10], ecx
jae 0x470df6
lea esi, [ebx + 0x16828]
push ebx
push esi
call fcn.0046d640
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 + 0x44]
cmp ebp, eax
mov dword [esp + 0x10], edx
jb 0x470dce
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x24]
not ecx
and ecx, edx
mov edx, dword [esp + 0x3c]
xor eax, eax
mov al, byte [edx + ecx*8]
lea edi, [edx + ecx*8]
mov esi, eax
mov dword [esp + 0x18], edi
cmp esi, 0x10
jbe 0x470e94
cmp esi, 0x63
je 0x471171
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 0x470e6a
lea edi, [ebx + 0x16828]
push ebx
push edi
call fcn.0046d640
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [edi]
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 0x470e40
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
mov edx, dword [edi + 4]
xor eax, eax
mov ax, word [esi*2 + 0x51d2b0]
not ecx
and eax, ecx
xor ecx, ecx
mov cl, byte [edx + eax*8]
lea eax, [edx + eax*8]
mov esi, ecx
cmp esi, 0x10
mov dword [esp + 0x18], eax
mov edi, eax
ja 0x470e19
xor edx, edx
xor eax, eax
mov dl, byte [edi + 1]
mov ax, word [edi + 4]
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 + 0x40]
sub ebp, esi
sub edi, ecx
cmp ebp, eax
mov dword [esp + 0x10], edx
jae 0x470ef3
lea esi, [ebx + 0x16828]
push ebx
push esi
call fcn.0046d640
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 + 0x40]
cmp ebp, eax
jb 0x470ec9
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x38]
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 0x470f94
cmp esi, 0x63
je 0x471171
mov edx, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [eax + 1]
sub esi, 0x10
shr edx, cl
sub ebp, ecx
mov dword [esp + 0x1c], ecx
cmp ebp, esi
mov dword [esp + 0x10], edx
jae 0x470f6d
lea eax, [ebx + 0x16828]
push ebx
push eax
call fcn.0046d640
mov edx, dword [esp + 0x18]
xor eax, eax
mov ax, word [ebx + 0x16828]
mov ecx, ebp
shl eax, cl
add ebp, 8
add esp, 8
or edx, eax
cmp ebp, esi
mov dword [esp + 0x10], edx
jb 0x470f3b
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
mov eax, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x51d2b0]
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 0x470f16
mov edx, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [eax + 1]
shr edx, cl
mov dword [esp + 0x1c], ecx
sub ebp, ecx
xor ecx, ecx
mov cx, word [eax + 4]
mov dword [esp + 0x10], edx
xor edx, edx
cmp esi, edx
mov dword [esp + 0x18], ecx
je 0x471007
cmp ebp, 8
jae 0x470fef
lea esi, [ebx + 0x16828]
push ebx
push esi
call fcn.0046d640
mov eax, dword [esp + 0x18]
xor edx, edx
mov dx, word [esi]
mov ecx, ebp
shl edx, cl
add ebp, 8
add esp, 8
or eax, edx
cmp ebp, 8
mov dword [esp + 0x10], eax
jb 0x470fc4
mov ecx, dword [esp + 0x18]
xor edx, edx
mov eax, dword [esp + 0x10]
mov esi, eax
and esi, 0xff
shr eax, 8
add ecx, esi
mov dword [esp + 0x10], eax
sub ebp, 8
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x30]
sub eax, ecx
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0x54]
sbb esi, edx
cmp eax, edx
mov dword [esp + 0x30], esi
je 0x471037
cmp dword [ebx + 0x5c], edx
je 0x471037
cmp dword [ebx + 0x14f98], edx
ja 0x471037
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edx
mov eax, dword [esp + 0x14]
and edi, 0x7fff
cmp edi, eax
mov dword [esp + 0x1c], edi
mov esi, edi
ja 0x47104d
mov esi, eax
mov edx, 0x8000
sub edx, esi
cmp edx, ecx
jbe 0x47105a
mov edx, ecx
sub ecx, edx
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x47109d
cmp eax, edi
ja 0x47109d
mov esi, dword [esp + 0x14]
mov ecx, edx
xor eax, eax
lea edi, [esi + ebx + 0x4f7c]
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 0x4710f6
mov ecx, eax
sub ecx, edi
cmp ecx, edx
jb 0x4710df
mov ecx, edx
lea esi, [ebx + edi + 0x4f7c]
lea edi, [ebx + eax + 0x4f7c]
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 0x4710f6
mov cl, byte [ebx + edi + 0x4f7c]
mov byte [ebx + eax + 0x4f7c], cl
inc eax
inc edi
dec edx
jne 0x4710df
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x18]
cmp eax, 0x8000
jne 0x471119
push ebx
push eax
call fcn.0046f1c0
mov ecx, dword [esp + 0x20]
add esp, 8
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], eax
test ecx, ecx
jne 0x471037
mov edi, dword [esp + 0x14]
xor esi, esi
cmp dword [esp + 0x30], esi
jg 0x470c76
jl 0x47113d
cmp dword [esp + 0x2c], esi
ja 0x470c76
push ebx
push edi
call fcn.0046f1c0
mov eax, dword [ebx + 0x54]
add esp, 8
cmp eax, esi
jne 0x47117e
mov edx, dword [ebx + 0x4550]
mov eax, dword [ebx + 0x4554]
add ebx, 0x4550
or edx, eax
je 0x47117e
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x24
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret