Function at 0x470030
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 0x47005c
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 0x4705b2
jg 0x4700c6
cmp ecx, ebx
jbe 0x4705b2
cmp dword [edi], 0
jne 0x4705b2
cmp ebp, 1
jae 0x4700f7
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 0x4700da
test bl, 1
je 0x47022c
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 0x470138
cmp dword [edi + 0x5c], eax
je 0x470138
cmp dword [edi + 0x14f98], eax
ja 0x470138
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
cmp ebp, dword [esp + 0x48]
jae 0x470164
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 0x470144
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 0x4701ec
cmp esi, 0x63
je 0x4705ea
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4701c7
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 0x47019d
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 0x470184
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 0x470598
push edi
push eax
call fcn.0046f1c0
add esp, 8
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x10], eax
jmp 0x470598
shr ebx, 1
dec ebp
cmp ebp, 7
jae 0x470257
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, 7
jb 0x47023a
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 0x470296
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 0x470274
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 0x47031f
cmp esi, 0x63
je 0x4705ea
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4702fa
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 0x4702d0
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 0x4702b7
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 0x47036c
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 0x47034c
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 0x4703f4
cmp esi, 0x63
je 0x4705ea
xor ecx, ecx
sub esi, 0x10
mov cl, byte [eax + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x4703cf
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 0x4703a5
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 0x47038c
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 0x47044e
cmp ebp, 8
jae 0x470435
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 0x470418
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 0x47047e
cmp dword [edi + 0x5c], eax
je 0x47047e
cmp dword [edi + 0x14f98], eax
ja 0x47047e
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
jmp 0x470490
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 0x4704a3
mov eax, esi
mov edx, 0x8000
sub edx, eax
cmp edx, ecx
jbe 0x4704b0
mov edx, ecx
mov eax, dword [esp + 0x20]
sub ecx, edx
test eax, eax
mov dword [esp + 0x18], ecx
je 0x4704f3
cmp esi, dword [esp + 0x14]
ja 0x4704f3
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 0x470562
sub esi, dword [esp + 0x14]
cmp esi, edx
jb 0x47053f
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 0x470562
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 0x47053b
cmp dword [esp + 0x10], 0x8000
jne 0x470588
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 0x470488
mov eax, dword [esp + 0x34]
test eax, eax
jg 0x4700c6
jl 0x4705b2
mov eax, dword [esp + 0x30]
test eax, eax
ja 0x4700c6
mov eax, dword [esp + 0x10]
push edi
push eax
call fcn.0046f1c0
mov eax, dword [edi + 0x54]
add esp, 8
test eax, eax
jne 0x4705f7
mov ecx, dword [edi + 0x4550]
mov eax, dword [edi + 0x4554]
add edi, 0x4550
or ecx, eax
je 0x4705f7
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