Function at 0x1001bee0
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 8
mov eax, dword [0x1002b150]
push ebx
push esi
push edi
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov eax, dword [esp + 0x1c]
lea ecx, [eax + eax*2]
mov edx, dword [esi + ecx*8 + 0x690c]
lea edi, [esi + ecx*8 + 0x6908]
cmp edx, 0xffffffff
je 0x1001c0d2
mov ecx, dword [edi + 8]
cmp ecx, 0xffffffff
je 0x1001c0d2
mov eax, dword [edi + 0x10]
lea ebx, [edx + edx*2]
lea ebp, [ecx + ecx*2]
mov dword [esp + 0x14], eax
mov eax, dword [esi + ebx*8 + 0x6918]
sub eax, dword [esi + ebp*8 + 0x6918]
test eax, eax
jle 0x1001bf41
push edx
jmp 0x1001bf53
jge 0x1001bf46
push ecx
jmp 0x1001bf53
push edx
call fcn.1001bee0
add esp, 4
mov eax, dword [edi + 8]
push eax
call fcn.1001bee0
add esp, 4
mov eax, dword [edi + 4]
lea edx, [eax + eax*2]
mov eax, dword [edi + 8]
mov ecx, dword [esi + edx*8 + 0x6918]
lea edx, [eax + eax*2]
mov eax, dword [esi + edx*8 + 0x6918]
cmp ecx, eax
jg 0x1001bf7b
mov ecx, eax
inc ecx
mov dword [edi + 0x10], ecx
cmp dword [esp + 0x14], ecx
jle 0x1001bf92
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
mov eax, dword [edi + 4]
lea ecx, [eax + eax*2]
mov eax, dword [edi + 8]
lea edx, [esi + ecx*8 + 0x6908]
lea ebx, [eax + eax*2]
mov dword [esp + 0x10], edx
lea ecx, [esi + ebx*8 + 0x6908]
mov eax, dword [edx + 0x10]
mov ebx, dword [ecx + 0x10]
sub ebx, 2
cmp ebx, eax
jge 0x1001bfd3
lea edx, [eax - 2]
cmp edx, dword [ecx + 0x10]
jge 0x1001bfcf
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
cmp ebx, eax
jl 0x1001bfd9
mov edx, dword [esp + 0x10]
jmp 0x1001bfdf
mov edx, ecx
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 4]
lea ebp, [eax + eax*2]
mov eax, dword [ecx + 8]
lea ebx, [esi + ebp*8]
lea eax, [eax + eax*2]
lea ebp, [esi + eax*8]
mov eax, dword [esi + eax*8 + 0x6918]
cmp dword [ebx + 0x6918], eax
jne 0x1001c00a
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
mov eax, dword [ebp + 0x6918]
cmp dword [ebx + 0x6918], eax
mov eax, dword [esp + 0x1c]
jle 0x1001c047
mov dword [ebx + 0x6908], eax
cmp edx, dword [esp + 0x10]
jne 0x1001c039
mov eax, dword [edi + 4]
mov ebx, dword [ecx + 4]
mov dword [edi + 4], ebx
mov dword [ecx + 4], eax
mov ebp, dword [edi + 8]
jmp 0x1001c073
mov eax, dword [edi + 8]
mov ebx, dword [ecx + 4]
mov dword [edi + 8], ebx
mov dword [ecx + 4], eax
jmp 0x1001c070
mov dword [ebp + 0x6908], eax
cmp edx, dword [esp + 0x10]
jne 0x1001c064
mov eax, dword [edi + 4]
mov ebx, dword [ecx + 8]
mov dword [edi + 4], ebx
mov dword [ecx + 8], eax
mov ebp, dword [edi + 8]
jmp 0x1001c073
mov eax, dword [edi + 8]
mov ebx, dword [ecx + 8]
mov dword [edi + 8], ebx
mov dword [ecx + 8], eax
mov ebp, dword [edi + 4]
mov dword [edx], ebp
mov eax, dword [ecx + 4]
lea ebx, [eax + eax*2]
mov eax, dword [ecx + 8]
mov edx, dword [esi + ebx*8 + 0x6918]
lea ebx, [eax + eax*2]
mov eax, dword [esi + ebx*8 + 0x6918]
cmp edx, eax
jg 0x1001c095
mov edx, eax
inc edx
mov dword [ecx + 0x10], edx
mov eax, dword [edi + 4]
lea ebx, [eax + eax*2]
mov eax, dword [edi + 8]
mov ecx, dword [esi + ebx*8 + 0x6918]
lea ebx, [eax + eax*2]
mov eax, dword [esi + ebx*8 + 0x6918]
cmp ecx, eax
jg 0x1001c0b9
mov ecx, eax
inc ecx
mov eax, 1
mov dword [edi + 0x10], ecx
cmp dword [esp + 0x14], ecx
jg 0x1001c0d4
pop ebp
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 8
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret