Function at 0x10016490
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x34
mov eax, dword [0x1002b150]
push ebx
push esi
push edi
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [eax + 0x770]
mov esi, eax
mov dword [esp + 0x38], 0
mov eax, dword [esi + 0x760]
test edx, edx
mov dword [esp + 0x40], eax
jle 0x100164d5
lea edi, [esi + 0x7cc]
mov ecx, edx
mov eax, dword [edi]
add edi, 4
add dword [esp + 0x38], eax
dec ecx
jne 0x100164c9
shl dword [esp + 0x38], 6
cmp dword [esi + 0x76c], 1
jne 0x100167f2
mov edi, dword [esp + 0x48]
cmp dword [edi], 0
jne 0x100167e5
mov ecx, dword [esi + 0x5c50]
mov eax, dword [edi + 8]
inc eax
cmp eax, ecx
jl 0x100167e5
mov eax, dword [esi + 0x6f8]
imul eax, dword [esi + 0x7bc]
cmp eax, ecx
jb 0x100167e5
mov eax, dword [esi + edx*4 + 0x5bf8]
mov ebx, dword [esi + edx*4 + 0x5c40]
lea ecx, [esi + edx*4]
mov edx, dword [esi + eax*8 + 0x5bdc]
mov eax, dword [esi + ebx*8 + 0x5c24]
mov dword [esp + 0x24], edx
mov ecx, dword [ecx + 0x5c7c]
mov dword [esp + 0x10], eax
mov dword [esp + 0x3c], ecx
test ecx, ecx
mov dword [esp + 0x2c], 0
jle 0x10016790
mov eax, dword [esi + 0x770]
mov eax, dword [esi + eax*4 + 0x5c6c]
mov dword [esp + 0x28], 0
imul eax, dword [esp + 0x2c]
shl eax, 6
add eax, dword [esp + 0x38]
add eax, eax
add eax, dword [esi + 0x760]
cmp dword [esi + 0x6f8], 0
mov dword [esp + 0x34], eax
jle 0x1001677e
mov eax, dword [esi + 0x770]
mov dword [esp + 0x20], 0
cmp dword [esi + eax*4 + 0x5c6c], 0
jle 0x10016759
mov ebx, dword [esp + 0x34]
xor ebp, ebp
mov ecx, dword [edi + 4]
mov eax, dword [esp + 0x2c]
lea edx, [ecx + eax*8]
mov eax, dword [edi + 0xc]
mov dword [esp + 0x18], edx
lea ecx, [edx + 7]
cmp ecx, eax
jl 0x100165d2
mov ecx, eax
mov eax, dword [esi + 0x7bc]
imul eax, dword [esp + 0x28]
add eax, ebp
lea edx, [eax + 7]
mov dword [esp + 0x14], edx
mov edx, dword [edi + 8]
mov dword [esp + 0x1c], edx
mov edx, dword [esp + 0x14]
cmp edx, dword [esp + 0x1c]
jl 0x100165ff
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x14], edx
mov edx, dword [edi]
mov dword [esp + 0x1c], edx
cmp edx, eax
jg 0x1001660d
mov dword [esp + 0x1c], eax
mov edx, dword [esp + 0x14]
cmp edx, dword [esp + 0x1c]
jl 0x10016735
cmp dword [esp + 0x18], ecx
jg 0x10016735
mov eax, dword [esi + 0x5a0c]
test eax, eax
jge 0x1001663c
cmp dword [esi + 0x59fc], 1
je 0x100167cb
mov ecx, dword [esi + 0x7e0]
test ecx, ecx
jne 0x1001666a
cmp dword [esi + 0x5a00], 0
je 0x10016666
mov edx, dword [esi + 0x5d4c]
test edx, edx
je 0x10016662
cmp eax, 7
jle 0x10016680
test edx, edx
jne 0x10016666
test eax, eax
jle 0x10016680
test ecx, ecx
je 0x100166c1
cmp dword [esi + 0x5a00], 0
je 0x100166c1
mov eax, dword [esi + 0x7dc]
cdq
idiv ecx
test edx, edx
jne 0x100166c1
lea eax, [esp + 0x30]
push eax
call fcn.10012b50
add esp, 4
test eax, eax
jne 0x100169fb
cmp dword [esi + 0x790], 0
jne 0x10016790
call fcn.100128b0
test eax, eax
jne 0x100169fb
call fcn.100107a0
cmp dword [esi + 0x794], 0
jne 0x10016790
mov eax, dword [esi + 0x7dc]
inc eax
mov dword [esi + 0x7dc], eax
mov ecx, dword [esi + 0x7e0]
cmp eax, ecx
jl 0x100166e0
sub eax, ecx
mov dword [esi + 0x7dc], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x24]
push eax
lea edx, [esi + 0x58e8]
mov dword [esi + 0x5d4c], 0
cmp dword [esi + 0x7a4], 0
push ecx
push edx
push ebx
jne 0x1001671f
call fcn.10011250
add esp, 0x10
mov dword [esi + 0x5d84], eax
test eax, eax
je 0x10016735
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x34
ret
call fcn.10011c40
add esp, 0x10
mov dword [esi + 0x5d84], eax
test eax, eax
jne 0x100167d7
add ebx, 0x80
add ebp, 8
mov ecx, dword [esi + 0x770]
inc dword [esp + 0x20]
mov eax, dword [esp + 0x20]
cmp dword [esi + ecx*4 + 0x5c6c], eax
jg 0x100165b8
mov ecx, dword [esi + 0x758]
mov eax, dword [esp + 0x34]
inc dword [esp + 0x28]
lea edx, [eax + ecx*2]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x34], edx
cmp dword [esi + 0x6f8], ecx
jg 0x10016596
inc dword [esp + 0x2c]
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x3c]
jl 0x1001655c
cmp dword [esi + 0x5d50], 0
je 0x100167ac
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x4c]
push eax
push ecx
push edi
call fcn.10016a20
add esp, 0xc
mov eax, dword [esi + 0x758]
pop ebp
imul eax, dword [esi + 0x6f8]
add eax, eax
pop edi
add dword [esi + 0x760], eax
xor eax, eax
pop esi
pop ebx
add esp, 0x34
ret
mov dword [esi + 0x790], 1
jmp 0x10016790
mov eax, dword [esi + 0x5d84]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x34
ret
mov eax, 0xffffffd3
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x34
ret
mov dword [esp + 0x20], 0
cmp dword [esi + 0x6f8], 0
jle 0x100169d3
mov eax, dword [esi + 0x5a0c]
test eax, eax
jge 0x1001681e
cmp dword [esi + 0x59fc], 1
je 0x10016a03
mov edi, dword [esi + 0x7e0]
test edi, edi
jne 0x1001684c
cmp dword [esi + 0x5a00], 0
je 0x10016848
mov ecx, dword [esi + 0x5d4c]
test ecx, ecx
je 0x10016844
cmp eax, 7
jle 0x10016862
test ecx, ecx
jne 0x10016848
test eax, eax
jle 0x10016862
test edi, edi
je 0x100168a3
cmp dword [esi + 0x5a00], 0
je 0x100168a3
mov eax, dword [esi + 0x7dc]
cdq
idiv edi
test edx, edx
jne 0x100168a3
lea eax, [esp + 0x30]
push eax
call fcn.10012b50
add esp, 4
test eax, eax
jne 0x100169fb
cmp dword [esi + 0x790], 0
jne 0x100169d3
call fcn.100128b0
test eax, eax
jne 0x100169fb
call fcn.100107a0
cmp dword [esi + 0x794], 0
jne 0x100169d3
mov ecx, dword [esi + 0x7dc]
inc ecx
mov dword [esi + 0x7dc], ecx
mov eax, dword [esi + 0x7e0]
cmp ecx, eax
jl 0x100168c2
sub ecx, eax
mov dword [esi + 0x7dc], ecx
mov dword [esi + 0x5d4c], 0
mov dword [esp + 0x3c], 0
cmp dword [esi + 0x76c], 0
mov eax, dword [esp + 0x38]
mov dword [esp + 0x34], eax
jle 0x100169b1
lea edi, [esi + 0x770]
mov eax, dword [edi]
mov edx, dword [esi + eax*4 + 0x5bf8]
lea ecx, [esi + eax*4]
mov dword [esp + 0x2c], 0
mov ebx, dword [esi + edx*8 + 0x5bdc]
mov eax, dword [ecx + 0x5c40]
cmp dword [ecx + 0x7cc], 0
mov edx, dword [esi + eax*8 + 0x5c24]
mov dword [esp + 0x10], edx
jle 0x1001699a
mov ebp, dword [esp + 0x34]
add ebp, ebp
mov eax, dword [esp + 0x10]
lea ecx, [edi + 0x5178]
cmp dword [esi + 0x7a4], 0
push eax
push ebx
push ecx
mov eax, dword [esi + 0x760]
jne 0x10016963
add eax, ebp
push eax
call fcn.10011250
add esp, 0x10
mov dword [esi + 0x5d84], eax
test eax, eax
je 0x1001697c
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x34
ret
add eax, ebp
push eax
call fcn.10011c40
add esp, 0x10
mov dword [esi + 0x5d84], eax
test eax, eax
jne 0x10016a0f
add ebp, 0x80
mov ecx, dword [edi]
add dword [esp + 0x34], 0x40
inc dword [esp + 0x2c]
mov eax, dword [esp + 0x2c]
cmp dword [esi + ecx*4 + 0x7cc], eax
jg 0x1001692a
add edi, 4
inc dword [esp + 0x3c]
mov eax, dword [esp + 0x3c]
cmp dword [esi + 0x76c], eax
jg 0x100168ef
mov eax, dword [esi + 0x758]
inc dword [esp + 0x20]
add eax, eax
mov ecx, dword [esp + 0x20]
add dword [esi + 0x760], eax
cmp dword [esi + 0x6f8], ecx
jg 0x10016807
cmp dword [esi + 0x5d50], 0
je 0x100169f3
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x4c]
mov edi, dword [esp + 0x48]
push eax
push ecx
push edi
call fcn.10016a20
add esp, 0xc
xor eax, eax
dec dword [esi + 0x7e4]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x34
ret
mov dword [esi + 0x790], 1
jmp 0x100169d3
mov eax, dword [esi + 0x5d84]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x34
ret