Function at 0x521470
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55f6b8
mov eax, dword fs:[0]
push eax
sub esp, 0x54
mov eax, dword [0x5b706c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebp + 8]
xorps xmm0, xmm0
cmp ecx, 0xffffffff
movd eax, xmm0
movups xmmword [ebp - 0x20], xmm0
mov dword [ebp - 0x40], 0xffffffff
cmovne eax, ecx
mov dword [ebp - 0x28], 0xffffffff
mov dword [ebp - 0x20], eax
xor eax, eax
cmp ecx, 0xffffffff
setne al
dec eax
mov dword [ebp - 0x50], eax
xor eax, eax
cmp ecx, 0xffffffff
mov ecx, dword [0x5b70a0]
setne al
mov dword [ebp - 0x2c], eax
cmp ecx, 0xffffffff
jne 0x5214e5
mov edi, eax
jmp 0x52153a
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, dword [ebp - 0x2c]
mov edi, esi
mov dword [ebp - 0x2c], edi
test eax, eax
je 0x52153d
mov eax, dword [0x5b70a0]
cmp eax, 0xffffffff
jne 0x521506
xor ecx, ecx
jmp 0x521514
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, eax
mov eax, dword [0x5b70a0]
cmp byte [ecx + 0x38], 0
mov dword [ebp - 0x2c], edi
je 0x52153d
mov dword [ebp - 0x40], esi
cmp eax, 0xffffffff
jne 0x521529
xor eax, eax
jmp 0x521530
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [eax + 0x34]
lea edi, [esi + 1]
mov dword [ebp + esi*4 - 0x20], eax
mov dword [ebp - 0x2c], edi
xor esi, esi
mov dword [ebp - 0x4c], esi
mov eax, dword [ebp + 0x14]
and eax, dword [ebp + 0x18]
mov dword [ebp - 4], esi
cmp eax, 0xffffffff
je 0x5215f6
lea eax, [ebp - 0x48]
push eax
lea ecx, [ebp + 0xc]
call fcn.00521f50
push esi
push esi
push esi
call dword [sym.imp.KERNEL32.dll_CreateWaitableTimerA]
mov esi, eax
mov dword [ebp - 0x4c], esi
test esi, esi
je 0x5215f6
mov eax, 0xcccccccd
mov ecx, 0x20
mul dword [ebp - 0x44]
lea eax, [ebp + 0xc]
shr edx, 4
cmp edx, ecx
push eax
cmova ecx, edx
mov dword [ebp - 0x30], ecx
call fcn.00520c00
mov ecx, dword [0x5be644]
add esp, 4
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
test ecx, ecx
jne 0x5215d1
push str.SetWaitableTimerEx
push 0x5649a4
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov ecx, 0x5206f0
cmovne ecx, eax
mov dword [0x5be644], ecx
push dword [ebp - 0x30]
lea eax, [ebp - 0x3c]
push 0
push 0
push 0
push 0
push eax
push esi
call ecx
test eax, eax
je 0x5215f6
mov edx, edi
mov dword [ebp + edi*4 - 0x20], esi
inc edi
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x2c], edi
jmp 0x5215f9
or edx, 0xffffffff
mov cl, byte [ebp + 0x1c]
xor edi, edi
mov byte [ebp - 0x21], 0
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
cmp edx, 0xffffffff
jne 0x521694
mov eax, dword [ebp + 0x14]
and eax, dword [ebp + 0x18]
cmp eax, edx
je 0x52167d
test cl, cl
je 0x521702
mov ecx, dword [0x5beff8]
test ecx, ecx
jne 0x521653
push 0x564994
push 0x5649a4
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov ecx, 0x410620
cmovne ecx, eax
mov dword [0x5beff8], ecx
call ecx
sub eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x18]
sbb edx, dword [ebp + 0x10]
cmp edx, ecx
ja 0x5216ee
mov edi, dword [ebp + 0x14]
jb 0x52166f
cmp eax, edi
jae 0x5216ee
sub edi, eax
sbb ecx, edx
jne 0x52167a
cmp edi, 0xfffffffe
jbe 0x5216f9
mov edx, dword [ebp - 0x28]
mov byte [ebp - 0x34], 1
mov edi, 0xfffffffe
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x58], eax
mov byte [ebp - 0x21], al
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x2c]
test ecx, ecx
je 0x521777
cmp edx, 0xffffffff
mov eax, edi
push 0
mov edx, 0xffffffff
cmovne eax, edx
push eax
push 0
lea eax, [ebp - 0x20]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjectsEx]
cmp eax, dword [ebp - 0x2c]
jae 0x521781
cmp eax, dword [ebp - 0x50]
je 0x5217d1
cmp eax, dword [ebp - 0x40]
je 0x5217ec
mov edx, dword [ebp - 0x28]
cmp eax, edx
jne 0x521784
mov dword [ebp - 4], 2
jmp 0x5217a4
xorps xmm0, xmm0
movlpd qword [ebp - 0x48], xmm0
mov edi, dword [ebp - 0x48]
mov edx, dword [ebp - 0x28]
mov byte [ebp - 0x34], 0
jmp 0x521686
lea eax, [ebp - 0x3c]
push 0x432260
push eax
call fcn.00434780
mov eax, dword [ebp - 0x38]
add esp, 8
cmp eax, dword [ebp + 0x28]
jl 0x521733
jg 0x521725
mov eax, dword [ebp - 0x3c]
cmp eax, dword [ebp + 0x24]
jb 0x521733
mov edx, dword [ebp - 0x28]
xor edi, edi
mov byte [ebp - 0x34], 0
jmp 0x521686
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x60]
push eax
lea ecx, [ebp + 0x24]
call fcn.00434010
push 0
push 0x3e8
push dword [eax + 4]
push dword [eax]
call fcn.0054c8d0
mov edi, eax
add edi, 1
adc edx, 0
jne 0x52167a
cmp edi, 0xfffffffe
ja 0x52167a
mov edx, dword [ebp - 0x28]
mov byte [ebp - 0x34], 0
jmp 0x521686
test edi, edi
jne 0x52177e
push edi
jmp 0x52177f
push edi
call eax
mov edx, dword [ebp - 0x28]
mov cl, byte [ebp + 0x1c]
test cl, cl
je 0x521793
add dword [ebp + 0x14], 2
adc dword [ebp + 0x18], 0xffffffff
cmp byte [ebp - 0x21], 0
jne 0x521602
mov dword [ebp - 4], 3
test esi, esi
je 0x5217b4
cmp esi, 0xffffffff
je 0x5217b4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0051e9d8
mov esp, ebp
pop ebp
ret
mov dword [ebp - 4], 1
test esi, esi
je 0x5217e8
cmp esi, 0xffffffff
je 0x5217e8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
jmp 0x5217b6
call fcn.00520be0
lea ecx, [eax + 0x34]
call fcn.00520590
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0x5b32a4
lea eax, [ebp - 0x21]
push eax
call fcn.005247ca
int3