Function at 0x501280
Capabilities:
Allocate thread local storage

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x18
mov ebx, ecx
lea eax, [ecx + 0x40]
mov dword [ebp - 0x10], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x501618
cmp byte [ebx + 0x1168], 0
jne 0x501625
lea ecx, [ebp + 8]
cmp byte [ecx], 1
sete byte [ebx + 4]
cmp byte [ecx + 3], 1
sete byte [ebx + 5]
mov al, byte [ecx + 4]
cmp al, 1
sete byte [ebx + 6]
cmp byte [ecx + 5], 1
sete byte [ebx + 7]
jne 0x5012da
cmp al, 1
jne 0x50164d
xor edx, edx
mov byte [ebx + 8], 0
mov dword [ebx + 0xc], edx
mov dword [ebx + 0x10], edx
cmp al, 1
je 0x501600
cmp byte [ecx + 2], 0
setne byte [ebx]
xorpd xmm0, xmm0
movupd xmmword [ebx + 0x1148], xmm0
movupd xmmword [ebx + 0x1158], xmm0
call fcn.004f04f0
mov dword [ebx + 0x1148], eax
mov eax, ebx
not eax
mov dword [ebx + 0x13cc], eax
mov eax, 8
xor esi, esi
mov dword [ebp - 0x24], ebx
mov edi, esi
shl edi, 5
mov dword [ebx + edi + 0x54], eax
xor ecx, ecx
push ecx
push eax
push 0x3ff
push 0xffffffffffffffff
call fcn.00539110
add eax, 1
mov ecx, 0
adc edx, ecx
mov dword [ebx + edi + 0x60], eax
mov dword [ebx + edi + 0x64], edx
call fcn.004f04f0
mov dword [ebx + edi + 0x48], eax
xor eax, eax
mov dword [ebx + edi + 0x4c], eax
mov dword [ebx + edi + 0x50], eax
movzx eax, byte [ebx + edi + 0x58]
mov dword [ebx + edi + 0x58], eax
mov dword [ebp - 0x18], edi
mov eax, dword [ebx + edi + 0x54]
cmp eax, 0x10000
ja 0x501441
mov dword [ebp - 0x14], esi
mov edi, 3
mov ecx, 0x3000
xor edx, edx
movsd xmm0, qword [0x5c6860]
movq xmm3, qword [0x5db288]
mov dword [ebp - 0x1c], eax
nop word cs:[eax + eax]
mov dword [ebp - 0x20], edx
mov esi, edi
and esi, 3
lea eax, [esi*4]
mov ebx, 0x10
sub ebx, eax
mov eax, ecx
xor edx, edx
div dword [ebp - 0x1c]
test esi, esi
cmove ebx, esi
add ebx, edx
mov edx, dword [ebp - 0x20]
movd xmm1, ebx
por xmm1, xmm3
subsd xmm1, xmm3
movd xmm2, ecx
por xmm2, xmm3
subsd xmm2, xmm3
divsd xmm1, xmm2
ucomisd xmm0, xmm1
minsd xmm1, xmm0
cmova edx, edi
inc edi
add ecx, 0x1000
movapd xmm0, xmm1
cmp ecx, 0x11000
jne 0x5013b0
cmp dx, 0x10
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x14]
ja 0x50160c
mov eax, dword [ebp - 0x18]
add eax, ebx
add eax, 0x58
movzx ecx, dl
mov dword [eax], ecx
mov eax, dword [esi*4 + 0x5de12c]
inc esi
cmp eax, 1
jne 0x501328
jmp 0x501453
test eax, 0xff00000
jne 0x50160f
shr eax, 0xc
mov edx, eax
jmp 0x501421
cmp esi, 0x87
ja 0x501570
mov edi, esi
shl edi, 5
mov dword [ebx + edi + 0x54], 1
xor eax, eax
mov dword [ebx + edi + 0x60], eax
mov dword [ebx + edi + 0x64], 0x400
call fcn.004f04f0
mov dword [ebx + edi + 0x48], eax
xor eax, eax
mov dword [ebx + edi + 0x4c], eax
mov dword [ebx + edi + 0x50], eax
movzx eax, byte [ebx + edi + 0x58]
mov dword [ebx + edi + 0x58], eax
mov dword [ebp - 0x18], edi
mov eax, dword [ebx + edi + 0x54]
cmp eax, 0x10000
ja 0x50155e
mov dword [ebp - 0x14], esi
mov edi, 3
mov ecx, 0x3000
xor edx, edx
movsd xmm0, qword [0x5c6860]
movq xmm3, qword [0x5db288]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], edx
mov esi, edi
and esi, 3
lea eax, [esi*4]
mov ebx, 0x10
sub ebx, eax
mov eax, ecx
xor edx, edx
div dword [ebp - 0x1c]
test esi, esi
cmove ebx, esi
add ebx, edx
mov edx, dword [ebp - 0x20]
movd xmm1, ebx
por xmm1, xmm3
subsd xmm1, xmm3
movd xmm2, ecx
por xmm2, xmm3
subsd xmm2, xmm3
divsd xmm1, xmm2
ucomisd xmm0, xmm1
minsd xmm1, xmm0
cmova edx, edi
inc edi
add ecx, 0x1000
movapd xmm0, xmm1
cmp ecx, 0x11000
jne 0x5014ca
cmp dx, 0x10
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x14]
ja 0x501612
mov eax, dword [ebp - 0x18]
add eax, ebx
add eax, 0x48
movzx ecx, dl
mov dword [eax + 0x10], ecx
mov dword [eax], 0
inc esi
cmp esi, 0x88
jne 0x50145f
jmp 0x501570
test eax, 0xff00000
jne 0x501615
shr eax, 0xc
mov edx, eax
jmp 0x50153b
push 0x5f6218
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x501630
cmp byte [0x6cd708], 0
je 0x5015cf
push 0x5f6218
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
lea eax, [ebp + 8]
cmp byte [eax + 1], 1
sete byte [ebx + 3]
mov esi, ebx
je 0x50163f
mov bl, 1
mov byte [esi + 0x1168], bl
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
xor eax, eax
lock cmpxchg byte [0x6cd6b0], bl
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret 8
cmp dword [0x6cf598], 0
jne 0x501653
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x501650
mov dword [0x6cd6b4], eax
mov dword [0x6cf59c], eax
mov dword [0x6cf598], 0x50d050
mov byte [0x6cd708], 1
jmp 0x50158c
mov dword [ebx + 0xc], 4
jmp 0x5012ee
int3
int3
int3
int3
mov ecx, dword [ebp - 0x10]
call fcn.004ef6b0
jmp 0x5012a0
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x5015c5
mov ecx, 0x5f6218
call fcn.004ef6b0
jmp 0x501583
push esi
call fcn.004d45b0
add esp, 4
jmp 0x5015aa
int3
int3
int3