Function at 0x46c240
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x1c
mov eax, dword [0x5296dc]
push ebx
push ebp
push esi
push edi
push eax
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
test ebp, ebp
jne 0x46c26e
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret
mov edx, dword [esp + 0x38]
mov ecx, dword [ebp + 0x16818]
xor eax, eax
mov edi, dword [ebp + 0x16820]
mov ax, word [edx*2 + 0x51d2b0]
mov ebx, dword [ebp + 0x16824]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x20], eax
xor eax, eax
mov ax, word [ecx*2 + 0x51d2b0]
mov dword [esp + 0x24], eax
cmp dword [ebp], 0
jne 0x46c5ea
cmp ebx, dword [esp + 0x38]
jae 0x46c2de
lea esi, [ebp + 0x16828]
push ebp
push esi
call fcn.0046d640
xor edx, edx
mov eax, dword [esp + 0x40]
mov dx, word [esi]
mov ecx, ebx
shl edx, cl
add ebx, 8
add esp, 8
or edi, edx
cmp ebx, eax
jb 0x46c2be
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x30]
and eax, edi
xor edx, edx
mov dl, byte [ecx + eax*8]
lea eax, [ecx + eax*8]
mov esi, edx
mov dword [esp + 0x10], eax
cmp esi, 0x12
jbe 0x46c35f
cmp esi, 0x63
je 0x46c261
xor ecx, ecx
sub esi, 0x12
mov cl, byte [eax + 1]
sub ebx, ecx
shr edi, cl
cmp ebx, esi
jae 0x46c33e
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.0046d640
xor eax, eax
mov ecx, ebx
mov ax, word [ebp + 0x16828]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
cmp ebx, esi
jb 0x46c314
mov eax, dword [esp + 0x10]
mov edx, dword [eax + 4]
xor ecx, ecx
mov cx, word [esi*2 + 0x51d2b0]
and ecx, edi
lea eax, [edx + ecx*8]
xor ecx, ecx
mov dword [esp + 0x10], eax
mov cl, byte [eax]
mov esi, ecx
cmp esi, 0x12
ja 0x46c2fb
xor ecx, ecx
mov cl, byte [eax + 1]
shr edi, cl
sub ebx, ecx
cmp esi, 0x12
jne 0x46c3aa
mov dl, byte [eax + 4]
mov eax, dword [esp + 0x14]
mov byte [eax + ebp + 0x4f7c], dl
inc eax
cmp eax, 0x10000
mov dword [esp + 0x14], eax
jne 0x46c5c9
push ebp
push eax
call fcn.0046c190
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x46c619
mov dword [esp + 0x14], eax
jmp 0x46c5c9
cmp esi, 0x11
je 0x46c5ea
cmp ebx, esi
jae 0x46c3e1
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.0046d640
xor eax, eax
mov ecx, ebx
mov ax, word [ebp + 0x16828]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
cmp ebx, esi
jb 0x46c3b7
mov eax, dword [esp + 0x10]
xor ecx, ecx
xor edx, edx
mov cx, word [esi*2 + 0x51d2b0]
mov dx, word [eax + 4]
mov eax, dword [esp + 0x3c]
and ecx, edi
add ecx, edx
sub ebx, esi
mov dword [esp + 0x1c], ecx
mov ecx, esi
shr edi, cl
cmp ebx, eax
jae 0x46c42d
lea esi, [ebp + 0x16828]
push ebp
push esi
call fcn.0046d640
xor eax, eax
mov ecx, ebx
mov ax, word [esi]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
mov eax, dword [esp + 0x3c]
cmp ebx, eax
jb 0x46c40d
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x34]
and ecx, edi
xor eax, eax
mov al, byte [edx + ecx*8]
lea edx, [edx + ecx*8]
mov esi, eax
mov dword [esp + 0x10], edx
cmp esi, 0x12
jbe 0x46c4b3
cmp esi, 0x63
je 0x46c261
xor ecx, ecx
sub esi, 0x12
mov cl, byte [edx + 1]
sub ebx, ecx
shr edi, cl
cmp ebx, esi
jae 0x46c48f
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.0046d640
xor ecx, ecx
add esp, 8
mov cx, word [ebp + 0x16828]
mov edx, ecx
mov ecx, ebx
shl edx, cl
add ebx, 8
or edi, edx
cmp ebx, esi
jb 0x46c463
mov edx, dword [esp + 0x10]
mov ecx, dword [edx + 4]
xor eax, eax
mov ax, word [esi*2 + 0x51d2b0]
xor edx, edx
and eax, edi
mov dl, byte [ecx + eax*8]
lea eax, [ecx + eax*8]
mov esi, edx
mov dword [esp + 0x10], eax
cmp esi, 0x12
mov edx, eax
ja 0x46c44a
xor ecx, ecx
mov cl, byte [edx + 1]
sub ebx, ecx
shr edi, cl
cmp ebx, esi
jae 0x46c4ea
lea eax, [ebp + 0x16828]
push ebp
push eax
call fcn.0046d640
xor eax, eax
mov ecx, ebx
mov ax, word [ebp + 0x16828]
add ebx, 8
shl eax, cl
add esp, 8
or edi, eax
cmp ebx, esi
jb 0x46c4c0
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
xor ecx, ecx
mov cx, word [esi*2 + 0x51d2b0]
and ecx, edi
sub eax, ecx
xor ecx, ecx
mov cx, word [edx + 4]
sub eax, ecx
mov ecx, esi
shr edi, cl
sub ebx, esi
mov dword [esp + 0x28], edi
mov edx, dword [esp + 0x14]
and eax, 0xffff
cmp eax, edx
mov ecx, eax
ja 0x46c51f
mov ecx, edx
mov esi, 0x10000
sub esi, ecx
mov ecx, dword [esp + 0x1c]
cmp esi, ecx
mov dword [esp + 0x10], esi
jbe 0x46c538
mov esi, ecx
mov dword [esp + 0x10], esi
sub ecx, esi
mov dword [esp + 0x1c], ecx
mov ecx, edx
sub ecx, eax
cmp ecx, esi
jb 0x46c580
mov ecx, esi
lea edi, [edx + ebp + 0x4f7c]
mov edx, ecx
lea esi, [eax + ebp + 0x4f7c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x28]
add esi, ecx
add eax, ecx
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov edx, esi
jmp 0x46c59b
mov cl, byte [eax + ebp + 0x4f7c]
mov byte [edx + ebp + 0x4f7c], cl
inc edx
inc eax
dec esi
jne 0x46c580
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
cmp edx, 0x10000
jne 0x46c5bd
push ebp
push edx
call fcn.0046c190
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x46c619
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jne 0x46c50e
mov al, byte [ebp + 0x14fa4]
test al, al
je 0x46c5dd
mov eax, dword [ebp + 0x14f98]
test eax, eax
jbe 0x46c5ea
cmp dword [ebp + 0x1680c], 1
jle 0x46c2a8
mov eax, dword [ebp + 0x54]
mov edx, dword [esp + 0x14]
test eax, eax
mov dword [ebp + 0x16818], edx
mov dword [ebp + 0x16820], edi
mov dword [ebp + 0x16824], ebx
jne 0x46c619
mov al, byte [ebp + 0x14fa4]
test al, al
je 0x46c619
mov dword [esp + 0x18], 1
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret