Function at 0x504f10
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55cf98
mov eax, dword fs:[0]
push eax
sub esp, 8
push ebx
push esi
push edi
mov eax, dword [0x5a5014]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
push edi
mov dword [ebp - 4], 0
call fcn.00504090
mov esi, eax
add esp, 4
or ebx, 0xffffffff
test esi, esi
je 0x50509d
cmp byte [ebp + 0x18], 0
je 0x504f71
mov ecx, dword [esi]
test ecx, ecx
je 0x504f71
mov edx, dword [esi + 8]
test edx, edx
je 0x504f71
mov eax, dword [ecx]
push edx
call dword [eax + 4]
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x505043
test ebx, ebx
jne 0x505043
mov eax, dword [0x5a5700]
mov esi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp eax, 0xffffffff
je 0x504fa1
push eax
call esi
test eax, eax
jne 0x504fb7
call fcn.005047b0
mov eax, dword [0x5a5700]
cmp eax, 0xffffffff
jne 0x504fb4
xor eax, eax
jmp 0x504fb7
push eax
call esi
mov ebx, dword [eax + 0x14]
add eax, 0x14
mov dword [ebp - 0x14], eax
mov esi, ebx
mov eax, dword [ebx + 4]
mov ecx, eax
cmp byte [ecx + 0xd], 0
jne 0x504ff1
nop dword [eax]
mov edx, dword [ecx + 0x10]
cmp edx, edi
jae 0x504fdc
mov ecx, dword [ecx + 8]
jmp 0x504feb
cmp byte [esi + 0xd], 0
je 0x504fe7
cmp edi, edx
cmovb esi, ecx
mov ebx, ecx
mov ecx, dword [ecx]
cmp byte [ecx + 0xd], 0
je 0x504fd0
cmp byte [esi + 0xd], 0
jne 0x504ff9
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
jne 0x505014
nop
cmp edi, dword [eax + 0x10]
jae 0x50500b
mov esi, eax
mov eax, dword [eax]
jmp 0x50500e
mov eax, dword [eax + 8]
cmp byte [eax + 0xd], 0
je 0x505000
mov dword [ebp - 0x10], ebx
cmp ebx, esi
je 0x50502d
nop dword [eax + eax]
lea ecx, [ebp - 0x10]
call fcn.004a5bc0
cmp dword [ebp - 0x10], esi
jne 0x505020
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x10]
push esi
push ebx
push eax
call fcn.00503ee0
or ebx, 0xffffffff
jmp 0x5050d2
mov edx, dword [ebp + 0x10]
test edx, edx
je 0x505059
lea ecx, [edx + 4]
mov eax, 1
lock xadd dword [ecx], eax
mov eax, dword [ebp - 0x14]
mov dword [esi], eax
mov edi, dword [esi + 4]
mov dword [esi + 4], edx
mov byte [ebp - 4], 1
test edi, edi
je 0x505095
lea eax, [edi + 4]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
cmp ecx, 1
jne 0x505095
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 4]
lea eax, [edi + 8]
or edx, 0xffffffff
lock xadd dword [eax], edx
cmp edx, 1
jne 0x505095
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 8]
mov dword [esi + 8], ebx
or ebx, 0xffffffff
jmp 0x5050d2
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x14]
test ecx, ecx
jne 0x5050ab
test eax, eax
je 0x5050d2
push eax
sub esp, 8
mov eax, esp
mov dword [eax], ecx
mov ecx, dword [ebp + 0x10]
mov dword [eax + 4], ecx
test ecx, ecx
je 0x5050c9
add ecx, 4
mov eax, 1
lock xadd dword [ecx], eax
push edi
call fcn.00503a60
add esp, 0x10
mov esi, dword [ebp + 0x10]
mov dword [ebp - 4], 2
test esi, esi
je 0x505108
lea eax, [esi + 4]
mov ecx, ebx
lock xadd dword [eax], ecx
cmp ecx, 1
jne 0x505108
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
lea eax, [esi + 8]
lock xadd dword [eax], ebx
cmp ebx, 1
jne 0x505108
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 8]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret