Function at 0x1001b090
Capabilities:
Set thread local storage value

Disassembly:
mov eax, dword [esp + 0xc]
push ebx
push ebp
mov ebp, dword [esp + 0xc]
push esi
mov esi, dword [eax]
inc esi
cmp dword [ebp + esi*4 + 0x458], 0
lea ebx, [ebp + esi*4 + 0x458]
push edi
mov edi, esi
je 0x1001b0f7
mov eax, ebx
mov esi, dword [eax]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [esi + 0x1cc]
test ecx, ecx
je 0x1001b0d9
cmp dword [esi + 0x214], eax
jne 0x1001b0ea
inc dword [esi + 0x210]
jmp 0x1001b355
mov edx, 1
lea ecx, [esi + 0x1cc]
xchg dword [ecx], edx
test edx, edx
je 0x1001b139
add ebx, 4
inc edi
cmp dword [ebx], 0
mov esi, edi
mov eax, ebx
jne 0x1001b0b4
mov edx, dword [esp + 0x1c]
xor edi, edi
cmp dword [edx], edi
jle 0x1001b169
lea eax, [ebp + 0x458]
mov dword [esp + 0x14], eax
jmp 0x1001b110
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx]
test eax, eax
je 0x1001b169
lea ebx, [eax + 0x1cc]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebx]
test edx, edx
je 0x1001b14e
cmp dword [ebx + 0x48], eax
jne 0x1001b15b
inc dword [ebx + 0x44]
jmp 0x1001b355
mov dword [esi + 0x214], eax
mov dword [esi + 0x210], 1
jmp 0x1001b355
mov ecx, 1
mov edx, ebx
xchg dword [edx], ecx
test ecx, ecx
je 0x1001b1a5
mov eax, dword [esp + 0x1c]
add dword [esp + 0x14], 4
inc edi
cmp edi, dword [eax]
jl 0x1001b110
cmp esi, dword [ebp + 0x50]
jge 0x1001b28b
mov ecx, dword [0x100836ac]
test ecx, ecx
jne 0x1001b181
call fcn.10018140
mov ecx, dword [esp + 0x20]
mov edx, 0xfffffdb0
sub edx, dword [0x100836b0]
cmp ecx, edx
jae 0x1001b28b
mov eax, dword [0x100836b4]
test ecx, ecx
jne 0x1001b1b4
mov ecx, eax
jmp 0x1001b1ba
mov dword [ebx + 0x48], eax
mov dword [ebx + 0x44], 1
jmp 0x1001b355
add ecx, 0x250
lea ebx, [eax + ecx - 1]
dec eax
push 4
not eax
push 0x3000
and ebx, eax
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x1001b28b
cmp eax, 0xffffffff
je 0x1001b28b
call fcn.10019d60
mov edi, eax
or dword [edi + 0x1b8], 2
mov dword [edi + 0x1c8], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esp + 0x14], eax
xor ebx, ebx
mov ecx, dword [ebp]
test ecx, ecx
je 0x1001b219
cmp dword [ebp + 0x48], eax
jne 0x1001b226
inc dword [ebp + 0x44]
jmp 0x1001b246
mov edx, 1
mov ecx, ebp
xchg dword [ecx], edx
test edx, edx
je 0x1001b23c
inc ebx
test bl, 0x3f
jne 0x1001b208
push 0
push 0
call dword [sym.imp.KERNEL32.dll_SleepEx]
mov eax, dword [esp + 0x14]
jmp 0x1001b208
mov dword [ebp + 0x48], eax
mov dword [ebp + 0x44], 1
cmp dword [ebp + esi*4 + 0x458], 0
lea eax, [ebp + esi*4 + 0x458]
je 0x1001b26d
mov ecx, dword [ebp + 0x50]
lea ebx, [ebx]
cmp esi, ecx
jge 0x1001b26d
add eax, 4
inc esi
cmp dword [eax], 0
jne 0x1001b260
cmp esi, dword [ebp + 0x50]
jl 0x1001b2d4
dec dword [ebp + 0x44]
jne 0x1001b284
mov dword [ebp + 0x48], 0
xor edx, edx
mov eax, ebp
xchg dword [eax], edx
mov eax, edi
call fcn.10019ed0
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
mov esi, dword [ebp + edx*4 + 0x458]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
xor ebx, ebx
mov eax, dword [esi + 0x1cc]
test eax, eax
je 0x1001b399
cmp dword [esi + 0x214], edi
jne 0x1001b3aa
mov eax, dword [esp + 0x1c]
inc dword [esi + 0x210]
mov ecx, dword [eax]
mov eax, dword [ebp + ecx*4 + 0x458]
pop edi
pop esi
pop ebp
pop ebx
ret
mov dword [ebp + esi*4 + 0x458], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esp + 0x14], eax
xor ebx, ebx
jmp 0x1001b2f0
mov ecx, dword [edi + 0x1cc]
test ecx, ecx
je 0x1001b30a
cmp dword [edi + 0x214], eax
jne 0x1001b31b
inc dword [edi + 0x210]
jmp 0x1001b341
mov edx, 1
lea ecx, [edi + 0x1cc]
xchg dword [ecx], edx
test edx, edx
je 0x1001b331
inc ebx
test bl, 0x3f
jne 0x1001b2f0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_SleepEx]
mov eax, dword [esp + 0x14]
jmp 0x1001b2f0
mov dword [edi + 0x214], eax
mov dword [edi + 0x210], 1
dec dword [ebp + 0x44]
jne 0x1001b353
mov dword [ebp + 0x48], 0
xor edx, edx
mov eax, ebp
xchg dword [eax], edx
mov edi, esi
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov dword [ecx], edi
test eax, eax
je 0x1001b371
mov dword [eax], edi
mov eax, dword [ebp + edi*4 + 0x458]
pop edi
pop esi
pop ebp
pop ebx
ret
mov eax, dword [ebp + 0x454]
or edx, 0xffffffff
sub edx, edi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x1001b38d
call fcn.10020f0a
mov eax, dword [ebp + edi*4 + 0x458]
pop edi
pop esi
pop ebp
pop ebx
ret
mov ecx, 1
lea edx, [esi + 0x1cc]
xchg dword [edx], ecx
test ecx, ecx
je 0x1001b3c3
inc ebx
test bl, 0x3f
jne 0x1001b2a2
push 0
push 0
call dword [sym.imp.KERNEL32.dll_SleepEx]
jmp 0x1001b2a2
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax]
mov eax, dword [ebp + ecx*4 + 0x458]
mov dword [esi + 0x214], edi
pop edi
mov dword [esi + 0x210], 1
pop esi
pop ebp
pop ebx
ret