Function at 0x52d5a0
Capabilities:
Get thread local storage value
Resolve function by parsing pe exports
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 8], 0
mov edi, dword [esi + 0x10]
mov eax, dword [esi + 0x40]
and eax, 0x20000
mov dword [ebp - 0x18], eax
mov ebx, dword [edi + 0x34]
mov dword [ebp - 0xc], ebx
je 0x52d750
test ebx, ebx
jne 0x52d5f8
mov eax, dword [edi + 0x3c]
mov ecx, dword [eax + 0x4c]
mov eax, dword [edi + 0x38]
cmp dword [eax + 0x4c], ecx
sbb eax, eax
and eax, 4
mov ebx, dword [eax + edi + 0x38]
mov eax, dword [ebx + 0x4c]
mov dword [esi + 0xc], eax
mov dword [esi + 0x24], 0
jmp 0x52d803
test dword [edi + 0xc], 0x200000
je 0x52d606
mov ebx, dword [esi + 0x24]
jmp 0x52d611
push dword [edi + 0x64]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
test ebx, ebx
je 0x52d632
mov ecx, dword [ebx + 4]
cmp ecx, dword [edi + 0x28]
jne 0x52d626
cmp dword [ebx], 0xffffffff
je 0x52d728
pop edi
pop esi
mov eax, 0xffff87c1
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x28]
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [edi + 0x88], 0
mov ebx, dword [edi + 0x90]
mov dword [ebp - 0x10], eax
mov dword [ebp - 8], ebx
jne 0x52d65d
mov dword [edi + 0x88], 1
push 0xffffffffffffffff
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x52d67d
push eax
push ebx
push edi
call fcn.00528740
add esp, 0xc
test eax, eax
jne 0x52d8ca
mov eax, dword [ebp - 0xc]
xor ecx, ecx
mov edx, dword [eax + 0xc]
mov dword [ebp - 4], edx
test edx, edx
je 0x52d6a4
mov ebx, dword [ebp - 4]
lea edx, [eax + 0x44]
cmp dword [edx], 0
je 0x52d69f
inc ecx
add edx, 0x40
cmp ecx, ebx
jb 0x52d692
mov edx, ebx
mov ebx, dword [ebp - 8]
cmp ecx, dword [edi + 0x18]
jne 0x52d6bc
push ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
mov eax, 0xffff87ba
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x10]
lea ebx, [ecx + 1]
shl ebx, 6
add ebx, eax
mov dword [ebx + 4], 0
mov dword [ebx], 0xffffffff
mov dword [ebx + 8], esi
mov esi, dword [ebp + 8]
cmp ecx, edx
jne 0x52d6e2
inc edx
mov dword [eax + 0xc], edx
mov eax, dword [ebp - 0x14]
push dword [ebp - 8]
mov dword [edi + 0x1c], edx
mov dword [ebx + 4], eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [edi + 0xc]
and edx, 0x200000
mov dword [ebp - 8], edx
jne 0x52d728
push ebx
push dword [edi + 0x64]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x52d728
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x52d728
pop edi
pop esi
mov dword [ebx + 4], 0
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xc]
nop dword [eax + eax]
mov eax, dword [ecx + 8]
mov dword [ebx], eax
mov eax, dword [ebx]
cmp eax, dword [ecx + 8]
jne 0x52d730
mov eax, dword [ebx]
mov dword [esi + 0xc], eax
and eax, 1
mov dword [esi + 0x24], ebx
mov ebx, dword [edi + eax*4 + 0x38]
jmp 0x52d803
test ebx, ebx
je 0x52d78f
push 0xffffffffffffffff
push dword [edi + 0x94]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x52d77e
push eax
push dword [edi + 0x94]
push edi
call fcn.00528740
add esp, 0xc
test eax, eax
jne 0x52d8ca
mov ecx, dword [ebx + 8]
mov eax, ecx
and eax, 1
mov dword [esi + 0xc], ecx
mov ebx, dword [edi + eax*4 + 0x38]
jmp 0x52d7aa
mov eax, dword [edi + 0x3c]
mov ecx, dword [eax + 0x4c]
mov eax, dword [edi + 0x38]
cmp dword [eax + 0x4c], ecx
sbb eax, eax
and eax, 4
mov ebx, dword [eax + edi + 0x38]
mov ecx, dword [ebx + 0x4c]
mov dword [esi + 0xc], ecx
mov dword [esi + 4], 0
lea eax, [ecx + 1]
mov dword [esi + 0xc], eax
mov dword [esi + 0x18], 0
mov dword [esi + 0x1c], 0
mov dword [esi + 0x44], 0x1ffff
mov eax, dword [edi + 0x7c]
mov dword [esi + 0x24], eax
mov dword [eax], 0
mov eax, dword [edi + 0x78]
mov dword [esi + 0x14], eax
mov dword [eax], 0
mov dword [esi + 0x20], 0
mov eax, dword [edi + 0x24]
shl eax, 2
push eax
push dword [edi + 0x60]
mov dword [edi + 0x44], esi
push dword [esi + 0x30]
call fcn.004f2d40
add esp, 0xc
movups xmm0, xmmword [ebx + 0x10]
mov eax, dword [esi + 0x2c]
movups xmmword [eax], xmm0
movups xmm0, xmmword [ebx + 0x20]
movups xmmword [eax + 0x10], xmm0
movups xmm0, xmmword [ebx + 0x30]
movups xmmword [eax + 0x20], xmm0
movq xmm0, qword [ebx + 0x40]
movq qword [eax + 0x30], xmm0
mov eax, dword [ebx + 0x48]
mov ebx, 2
inc eax
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x40], eax
mov eax, dword [edi + 0x20]
mov dword [esi + 0x3c], eax
cmp eax, ebx
jbe 0x52d888
mov dword [ebp - 4], 0x38
nop word [eax + eax]
mov eax, dword [edi + 0x5c]
movzx edx, word [eax + ebx*2]
mov eax, dword [esi + 0x2c]
mov ecx, edx
mov esi, dword [ebp - 4]
and ecx, 0x7fff
test dx, dx
mov word [esi + eax + 4], cx
setns cl
mov esi, dword [ebp + 8]
dec cl
add dword [ebp - 4], 0x1c
and cl, 0x1a
mov eax, dword [esi + 0x38]
mov byte [ebx + eax], cl
inc ebx
cmp ebx, dword [esi + 0x3c]
jb 0x52d850
mov eax, dword [esi + 0x38]
mov byte [eax + 1], 0x18
mov eax, dword [esi + 0x38]
mov byte [eax], 8
cmp dword [edi + 0xc], 0
jge 0x52d8a2
mov edi, 0xffff87b5
jmp 0x52d8af
mov eax, dword [edi + 0x54]
cmp eax, dword [esi + 8]
jae 0x52d8c8
mov edi, 0xffff87bf
mov eax, dword [ebp - 8]
or eax, 5
push eax
push esi
call fcn.0052d350
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret