Function at 0x470610
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x28
mov eax, dword [0x5296dc]
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 0x47063c
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 + 0x51d2b0]
mov ecx, dword [esp + 0x50]
mov dword [esp + 0x24], eax
xor eax, eax
mov ax, word [edx*2 + 0x51d2b0]
mov dword [esp + 0x10], ebx
mov dword [esp + 0x2c], eax
xor eax, eax
mov ax, word [ecx*2 + 0x51d2b0]
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 0x470b92
jg 0x4706a6
cmp ecx, ebx
jbe 0x470b92
cmp dword [edi], 0
jne 0x470b92
cmp ebp, 1
jae 0x4706d7
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.0046d640
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 0x4706ba
test bl, 1
je 0x47080c
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 0x470718
cmp dword [edi + 0x5c], eax
je 0x470718
cmp dword [edi + 0x14f98], eax
ja 0x470718
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
cmp ebp, dword [esp + 0x48]
jae 0x470744
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.0046d640
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 0x470724
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 0x4707cc
cmp esi, 0x63
je 0x470bca
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4707a7
lea eax, [edi + 0x16828]
push edi
push eax
call fcn.0046d640
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 0x47077d
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x51d2b0]
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 0x470764
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 0x470b78
push edi
push eax
call fcn.0046f1c0
add esp, 8
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x10], eax
jmp 0x470b78
shr ebx, 1
dec ebp
cmp ebp, 6
jae 0x470837
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.0046d640
xor eax, eax
mov ecx, ebp
mov ax, word [esi]
add ebp, 8
shl eax, cl
add esp, 8
or ebx, eax
cmp ebp, 6
jb 0x47081a
mov eax, ebx
sub ebp, 6
and eax, 0x3f
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x50]
shr ebx, 6
cmp ebp, eax
jae 0x470876
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.0046d640
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 0x470854
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 0x4708ff
cmp esi, 0x63
je 0x470bca
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4708da
lea eax, [edi + 0x16828]
push edi
push eax
call fcn.0046d640
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 0x4708b0
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x51d2b0]
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 0x470897
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 0x47094c
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.0046d640
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 0x47092c
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 0x4709d4
cmp esi, 0x63
je 0x470bca
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4709af
lea eax, [edi + 0x16828]
push edi
push eax
call fcn.0046d640
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 0x470985
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x51d2b0]
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 0x47096c
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 0x470a2e
cmp ebp, 8
jae 0x470a15
lea esi, [edi + 0x16828]
push edi
push esi
call fcn.0046d640
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 0x4709f8
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 0x470a5e
cmp dword [edi + 0x5c], eax
je 0x470a5e
cmp dword [edi + 0x14f98], eax
ja 0x470a5e
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
jmp 0x470a70
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 0x470a83
mov eax, esi
mov edx, 0x8000
sub edx, eax
cmp edx, ecx
jbe 0x470a90
mov edx, ecx
mov eax, dword [esp + 0x20]
sub ecx, edx
test eax, eax
mov dword [esp + 0x18], ecx
je 0x470ad3
cmp esi, dword [esp + 0x14]
ja 0x470ad3
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 0x470b42
sub esi, dword [esp + 0x14]
cmp esi, edx
jb 0x470b1f
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 0x470b42
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 0x470b1b
cmp dword [esp + 0x10], 0x8000
jne 0x470b68
mov edx, dword [esp + 0x1c]
push edx
push 0x8000
call fcn.0046f1c0
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 0x470a68
mov eax, dword [esp + 0x34]
test eax, eax
jg 0x4706a6
jl 0x470b92
mov eax, dword [esp + 0x30]
test eax, eax
ja 0x4706a6
mov eax, dword [esp + 0x10]
push edi
push eax
call fcn.0046f1c0
mov eax, dword [edi + 0x54]
add esp, 8
test eax, eax
jne 0x470bd7
mov ecx, dword [edi + 0x4550]
mov eax, dword [edi + 0x4554]
add edi, 0x4550
or ecx, eax
je 0x470bd7
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