Function at 0x45a880
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov edi, dword [ebp + 8]
mov eax, dword [0x520014]
xor eax, ebp
mov dword [ebp - 0x10], eax
test edi, edi
je 0x45aa8b
cmp dword [0x522cf0], 0xe69e32f3
jne 0x45aa8e
mov edx, dword [edi + 8]
lea esi, [edx + 0x1c8]
mov byte [ebp - 0x11], 0xff
cmp byte [edi + 3], 0
mov eax, esi
mov dword [ebp - 0x1c], esi
je 0x45aa91
mov edx, 0x20
mov ecx, 0x20
test eax, eax
je 0x45a8de
bsr ecx, eax
xor ecx, 0x1f
sub edx, ecx
mov cl, byte [edx + 0x512e64]
mov esi, eax
shr esi, cl
and esi, 3
and eax, dword [edx*4 + 0x512e88]
lea ecx, [esi + edx*4]
cmp eax, 1
sbb ecx, 0xffffffff
movzx esi, word [ecx + ecx + 0x512d58]
shl esi, 5
lea eax, [edi + esi]
add eax, 0x48
mov dword [ebp - 0x20], eax
lea ecx, [edi + 0x40]
xor ebx, ebx
inc ebx
xor edi, edi
mov eax, dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov dword [ebp - 0x18], ecx
push ecx
call eax
test al, al
je 0x45aa51
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
mov edi, dword [eax]
test edi, edi
je 0x45aa00
mov byte [ebp - 0x11], 0
mov edx, dword [edi]
test edx, edx
je 0x45a9f6
mov ebx, dword [ebp + 8]
mov ecx, dword [ebx + esi + 0x54]
bswap edx
mov esi, edx
xor esi, edi
cmp esi, 0x1fffff
ja 0x45aa86
mov esi, edx
and esi, 0x1fc000
je 0x45aa86
prefetcht0 byte [edx]
mov dword [eax], edx
mov ecx, dword [eax + 0xc]
lea edx, [ecx + 2]
and edx, 0x3ffe
and ecx, 0xffffc001
or ecx, edx
mov dword [eax + 0xc], ecx
mov eax, dword [eax + 8]
mov ecx, dword [ebx + 0x8fc]
add ecx, dword [eax + 0xc]
mov eax, dword [ebx + 0x900]
mov dword [ebx + 0x8fc], ecx
cmp eax, ecx
cmovae ecx, eax
mov dword [ebx + 0x900], ecx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, edi
push ebx
call fcn.00481080
push edi
push dword [0x532fcc]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [0x52420c]
mov ecx, dword fs:[0x2c]
mov eax, dword [ecx + eax*4]
mov dword [eax + 0x90], edi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0048f468
mov eax, edi
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret
xor edx, edx
mov ebx, dword [ebp + 8]
jmp 0x45a973
lea eax, [ebp - 0x11]
push eax
push 0x4000
push dword [ebp - 0x1c]
push 2
mov ebx, dword [ebp + 8]
push ebx
call fcn.00464920
test eax, eax
je 0x45aae0
mov edi, eax
mov ecx, eax
and ecx, 0xffe00000
mov edx, eax
shr edx, 9
and edx, 0xfe0
lea eax, [edx + ecx]
movzx ecx, byte [edx + ecx + 0x101e]
and ecx, 0x3f
shl ecx, 5
sub eax, ecx
add eax, 0x1000
jmp 0x45a98c
mov eax, ebx
test ebx, ebx
jle 0x45aa5e
pause
dec eax
jne 0x45aa57
add edi, ebx
mov ecx, dword [ebp - 0x18]
add ebx, ebx
cmp ebx, 0x10
mov eax, 0x10
cmovge ebx, eax
cmp edi, 0x40
mov eax, dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
jl 0x45a921
call fcn.0045ab00
jmp 0x45a92c
call fcn.004b92a0
int3
int3
lea ecx, [edx + 0xc7]
mov eax, esi
cmp ecx, 0x7fefe
ja 0x45a8ca
xor ecx, ecx
cmp esi, 1
sbb ecx, ecx
or ecx, 0x20
add edx, 0x1c7
je 0x45aad9
bsr eax, edx
xor eax, 0x1f
sub ecx, eax
xor edx, edx
inc edx
shl edx, cl
mov eax, edx
shr eax, 1
lea eax, [eax + eax*4]
shr eax, 2
cmp eax, dword [ebp - 0x1c]
cmovb eax, edx
jmp 0x45a8ca
mov eax, 0x20
jmp 0x45aabd
xor edi, edi
jmp 0x45a9af