Function at 0x1016a230
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
sub esp, 0xc
push esi
mov esi, dword [edi + 0x14]
cmp eax, esi
jb 0x1016a259
mov ecx, dword [edi + 0x10]
lea edx, [esi + ecx*4]
cmp eax, edx
jae 0x1016a259
mov eax, 0x8007054f
pop esi
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
mov edx, dword [edi + 0x10]
cmp eax, edx
jae 0x1016a26f
cmp dword [esi + eax*4], ecx
jne 0x1016a26f
mov dword [ebp - 4], eax
jmp 0x1016a28d
mov eax, edx
test eax, eax
jbe 0x1016a284
lea esi, [esi + eax*4]
sub esi, 4
dec eax
cmp dword [esi], ecx
je 0x1016a285
test eax, eax
ja 0x1016a278
dec eax
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
je 0x1016a24d
mov esi, dword [ebp + 8]
mov eax, 1
push ebx
cmp esi, eax
jbe 0x1016a2c2
mov ecx, dword [edi + 0x14]
mov ebx, dword [ebp - 4]
lea ecx, [ecx + ebx*4 + 4]
mov ebx, dword [ebp - 4]
add ebx, eax
cmp ebx, edx
jae 0x1016a2fb
mov edx, dword [ecx]
mov ebx, dword [ebp + 0xc]
cmp edx, dword [ebx + eax*4]
jne 0x1016a2fb
mov edx, dword [edi + 0x10]
inc eax
add ecx, 4
cmp eax, esi
jb 0x1016a2a4
mov ecx, dword [ebp + 0x10]
mov ebx, dword [ecx + 0x10]
cmp ebx, edx
jae 0x1016a2d4
mov eax, dword [edi + 0x14]
cmp dword [eax + ebx*4], ecx
je 0x1016a2f2
mov ebx, edx
test ebx, ebx
jbe 0x1016a2ec
mov eax, dword [edi + 0x14]
lea eax, [eax + ebx*4]
sub eax, 4
dec ebx
cmp dword [eax], ecx
je 0x1016a2ed
test ebx, ebx
ja 0x1016a2e0
dec ebx
cmp ebx, 0xffffffff
je 0x1016a2fb
mov ecx, dword [ebp + 0x14]
sub edx, ebx
cmp ecx, edx
jbe 0x1016a308
pop ebx
mov eax, 0x8007054f
pop esi
mov esp, ebp
pop ebp
ret 0x10
test ecx, ecx
jbe 0x1016a383
lea eax, [ebx*4]
mov dword [ebp + 0x10], eax
mov dword [ebp - 8], ecx
lea esp, [esp]
mov ecx, dword [edi + 0x14]
mov edx, dword [ebp + 0x10]
mov esi, dword [edx + ecx]
test esi, esi
je 0x1016a373
call fcn.10171ee0
mov eax, dword [0x101e316c]
test eax, eax
jl 0x1016a373
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x1016a373
push 0x44
push 0xfe
push esi
call sub.msvcrt.dll_memset
mov ecx, dword [ebp - 0xc]
mov dword [esi], 0
mov eax, dword [ecx + 0x1c]
add esp, 0xc
test eax, eax
je 0x1016a36d
mov dword [eax], esi
jmp 0x1016a370
mov dword [ecx + 0x18], esi
mov dword [ecx + 0x1c], esi
add dword [ebp + 0x10], 4
sub dword [ebp - 8], 1
jne 0x1016a320
mov esi, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
mov eax, dword [ebp - 4]
lea edx, [eax + esi]
mov eax, dword [edi + 0x10]
cmp edx, eax
jae 0x1016a3b7
sub eax, dword [ebp - 4]
mov ecx, dword [edi + 0x14]
sub eax, esi
add eax, eax
add eax, eax
push eax
mov eax, dword [ebp - 4]
lea edx, [ecx + edx*4]
push edx
lea ecx, [ecx + eax*4]
push ecx
call sub.msvcrt.dll_memmove
mov ecx, dword [ebp + 0x14]
add esp, 0xc
or dword [edi + 0x18], 1
sub dword [edi + 0x10], esi
mov eax, dword [edi + 0x10]
cmp esi, ecx
je 0x1016a3ea
mov edx, dword [edi + 0x14]
sub eax, ebx
sub eax, ecx
add eax, eax
add eax, eax
push eax
lea eax, [ebx + ecx]
lea ecx, [edx + eax*4]
push ecx
lea eax, [ebx + esi]
lea ecx, [edx + eax*4]
push ecx
call sub.msvcrt.dll_memmove
mov ecx, dword [ebp + 0x14]
add esp, 0xc
or dword [edi + 0x18], 1
xor eax, eax
test esi, esi
jbe 0x1016a41e
lea ecx, [ebx*4]
mov esi, dword [ebp + 0xc]
mov esi, dword [esi + eax*4]
lea edx, [eax + ebx]
mov dword [esi + 0x10], edx
mov esi, dword [ebp + 0xc]
mov esi, dword [esi + eax*4]
mov edx, dword [edi + 0x14]
mov dword [ecx + edx], esi
inc eax
add ecx, 4
cmp eax, dword [ebp + 8]
jb 0x1016a3f7
mov esi, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
or dword [edi + 0x18], 6
sub esi, ecx
add dword [edi + 0x10], esi
pop ebx
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret 0x10