Function at 0x4212d0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x40
mov esi, ecx
mov eax, dword [0x5f3418]
xor eax, ebp
mov dword [ebp - 0x10], eax
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
je 0x421317
mov ecx, dword [esi + 0x1a4]
mov edx, dword [eax + ecx*8 + 4]
cmp edx, dword [esi + 0x1a8]
jne 0x421317
cmp dword [eax + ecx*8], 0
jne 0x4218f7
mov eax, dword [0x6ceb98]
mov ecx, dword [0x5f75b4]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x4219cf
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
je 0x4218f7
mov ecx, dword [0x6ceb90]
mov edx, dword [eax + ecx*8 + 4]
cmp edx, dword [0x6ceb94]
jne 0x4218f7
cmp dword [eax + ecx*8], 0
je 0x4218f7
mov eax, dword [0x6cebc8]
mov ecx, dword [0x5f75b4]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x421a73
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
je 0x4218f7
mov ecx, dword [0x6cebc0]
mov edx, dword [eax + ecx*8 + 4]
cmp edx, dword [0x6cebc4]
jne 0x4218f7
cmp dword [eax + ecx*8], 0
je 0x4218f7
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
je 0x421400
mov ecx, dword [esi + 0x19c]
mov edx, dword [eax + ecx*8 + 4]
cmp edx, dword [esi + 0x1a0]
jne 0x421400
mov edi, dword [eax + ecx*8]
test edi, edi
jne 0x4216ae
mov dword [esp], 0x18
call fcn.00510d64
mov dword [eax], 0x5d6580
mov dword [ebp - 0x24], eax
mov dword [eax + 4], 0x5d6588
mov eax, esi
shr eax, 0xe
mov ecx, esi
shr ecx, 0x13
mov ecx, dword [ecx*4 + 0x6c24fc]
bt ecx, eax
jb 0x421b83
mov eax, esi
shr eax, 0x15
mov byte [eax + 0x6ca4fc], 1
mov ecx, dword [ebp - 0x24]
mov dword [ecx + 8], esi
mov eax, esi
xor esi, esi
mov dword [ecx + 0xc], esi
mov dword [ecx + 0x10], esi
mov dword [ebp - 0x18], eax
mov eax, dword [eax + 0x1e4]
mov dword [ecx + 0x14], eax
mov eax, dword [0x5f75b4]
mov ecx, dword fs:[0x2c]
mov eax, dword [ecx + eax*4]
mov ecx, dword [0x6ceb98]
cmp ecx, dword [eax + 4]
jg 0x421a21
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
je 0x4214aa
mov ecx, dword [0x6ceb90]
mov edx, dword [eax + ecx*8 + 4]
cmp edx, dword [0x6ceb94]
jne 0x4214aa
mov esi, dword [eax + ecx*8]
mov ecx, esi
shr ecx, 0xe
xor edi, edi
inc edi
mov dword [ebp - 0x20], edi
shl edi, cl
mov ebx, esi
shr ebx, 0x13
mov eax, dword [ebx*4 + 0x6c24fc]
bt eax, ecx
jb 0x4219c2
mov eax, esi
shr eax, 0x15
mov byte [eax + 0x6ca4fc], 1
lea ecx, [esi + 0x28c]
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call fcn.0040f560
sub esp, 4
test dword [ebx*4 + 0x6c24fc], edi
jne 0x421b90
call fcn.0040f9d0
mov edi, eax
mov eax, dword [0x6cebc8]
mov ecx, dword [0x5f75b4]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x421ac5
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
mov esi, dword [ebp - 0x18]
je 0x421b7d
mov ecx, dword [0x6cebc0]
mov edx, dword [eax + ecx*8 + 4]
cmp edx, dword [0x6cebc4]
jne 0x421b7d
mov ecx, dword [eax + ecx*8]
test ecx, ecx
je 0x421b7d
mov eax, dword [ebp - 0x24]
add eax, 4
mov ecx, dword [ecx]
test ecx, ecx
je 0x42156f
lock inc dword [ecx + 4]
lea edx, [ebp - 0x14]
mov byte [edx], 1
mov dword [esp + 0xc], edx
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], str.ThreadLocalEventBuffer
mov ecx, edi
call fcn.004fed60
sub esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x1c], eax
lea edi, [esi + 4]
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
sub esp, 4
test al, al
je 0x421b9d
mov eax, dword [0x6cebc8]
mov ecx, dword [0x5f75b4]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x421b17
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
je 0x421b80
mov ecx, dword [0x6cebc0]
mov edx, dword [eax + ecx*8 + 4]
cmp edx, dword [0x6cebc4]
jne 0x421b80
mov eax, dword [eax + ecx*8]
test eax, eax
je 0x421b80
mov eax, dword [eax]
test eax, eax
je 0x421618
lock inc dword [eax + 4]
mov esi, dword [esi + 0x1b8]
test esi, esi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], eax
je 0x4216d1
mov ecx, esi
shr ecx, 1
and ecx, 0x55555555
mov eax, esi
sub eax, ecx
mov ecx, 0x33333333
mov edx, eax
and edx, ecx
shr eax, 2
and eax, ecx
add eax, edx
mov ecx, eax
shr ecx, 4
add ecx, eax
and ecx, 0xf0f0f0f
imul ecx, ecx, 0x1010101
shr ecx, 0x18
cmp ecx, 1
ja 0x421bd2
lea ebx, [esi - 1]
mov edx, dword [ebp - 0x1c]
and ebx, edx
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x1b4]
mov edi, dword [eax + ebx*4]
test edi, edi
je 0x4216d4
lea eax, [esi - 1]
mov dword [ebp - 0x2c], eax
mov edi, dword [edi]
test edi, edi
je 0x4216d4
mov eax, dword [edi + 4]
cmp eax, edx
je 0x4216a4
cmp ecx, 1
ja 0x421ba9
and eax, dword [ebp - 0x2c]
cmp eax, ebx
jne 0x4216d4
cmp dword [edi + 8], edx
jne 0x421687
jmp 0x42189e
mov eax, dword [esi + 0x1e4]
cmp eax, dword [edi + 0x14]
je 0x4218f7
mov ecx, edi
call fcn.0057b390
mov dword [esp], edi
call fcn.0050fc7c
jmp 0x421400
xor ebx, ebx
dec ebx
mov dword [esp], 0x10
call fcn.00510d64
mov edi, eax
mov ecx, dword [ebp - 0x1c]
mov dword [eax + 8], ecx
xor eax, eax
mov dword [edi + 0xc], eax
mov dword [edi + 4], ecx
mov dword [edi], eax
mov ecx, dword [ebp - 0x18]
mov eax, dword [ecx + 0x1c0]
inc eax
movq xmm2, qword [0x5db288]
movd xmm0, eax
por xmm0, xmm2
subsd xmm0, xmm2
cvtsd2ss xmm0, xmm0
movss xmm1, dword [ecx + 0x1c4]
test esi, esi
je 0x421740
movd xmm3, esi
por xmm3, xmm2
subsd xmm3, xmm2
xorps xmm2, xmm2
cvtsd2ss xmm2, xmm3
mulss xmm2, xmm1
ucomiss xmm0, xmm2
jbe 0x42183c
divss xmm0, xmm1
cvtss2sd xmm0, xmm0
movsd qword [esp], xmm0
call fcn.00546e60
fstp dword [ebp - 0x3c]
movss xmm0, dword [ebp - 0x3c]
cvttss2si ecx, xmm0
mov edx, ecx
sar edx, 0x1f
subss xmm0, dword [0x5c6a08]
cvttss2si eax, xmm0
and eax, edx
or eax, ecx
lea ecx, [esi + esi]
cmp esi, 3
jae 0x421bef
mov edx, dword [ebp - 0x20]
or edx, ecx
mov ecx, edx
cmp edx, eax
cmovbe ecx, eax
mov ebx, 2
cmp ecx, 1
je 0x4217b3
lea eax, [ecx - 1]
test ecx, eax
je 0x421cc2
mov dword [esp], ecx
call fcn.004f0a70
mov ebx, eax
mov eax, dword [ebp - 0x18]
mov esi, dword [eax + 0x1b8]
cmp ebx, esi
jbe 0x421c01
cmp ebx, 0x40000000
mov esi, dword [ebp - 0x18]
jae 0x421cbd
lea eax, [ebx*4]
mov dword [esp], eax
call fcn.00510d64
mov ecx, dword [esi + 0x1b4]
mov dword [esi + 0x1b4], eax
test ecx, ecx
je 0x4217f1
mov dword [esp], ecx
call fcn.0050fc7c
mov dword [esi + 0x1b8], ebx
xor eax, eax
mov ecx, dword [esi + 0x1b4]
mov dword [ecx + eax*4], 0
inc eax
cmp ebx, eax
jne 0x4217f9
mov esi, dword [esi + 0x1bc]
test esi, esi
mov edx, dword [ebp - 0x1c]
jne 0x421909
mov eax, dword [ebp - 0x18]
mov esi, dword [eax + 0x1b8]
lea ebx, [esi - 1]
test esi, ebx
jne 0x421830
and ebx, edx
jmp 0x42183c
cmp edx, esi
jb 0x42183a
mov eax, edx
xor edx, edx
div esi
mov ebx, edx
mov edx, dword [ebp - 0x18]
mov ecx, dword [edx + 0x1b4]
mov eax, dword [ecx + ebx*4]
test eax, eax
jne 0x42188f
mov eax, dword [edx + 0x1bc]
mov dword [edi], eax
lea eax, [edx + 0x1bc]
mov dword [edx + 0x1bc], edi
mov dword [ecx + ebx*4], eax
mov eax, dword [edi]
test eax, eax
je 0x421895
mov eax, dword [eax + 4]
lea ecx, [esi - 1]
test esi, ecx
je 0x421cc9
cmp eax, esi
jb 0x421881
xor edx, edx
div esi
mov eax, edx
shl eax, 2
mov ecx, dword [ebp - 0x18]
add eax, dword [ecx + 0x1b4]
jmp 0x421893
mov ecx, dword [eax]
mov dword [edi], ecx
mov dword [eax], edi
mov eax, dword [ebp - 0x18]
inc dword [eax + 0x1c0]
mov eax, dword [edi + 0xc]
mov ecx, dword [ebp - 0x30]
mov dword [edi + 0xc], ecx
test eax, eax
jne 0x421bbb
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
sub esp, 4
mov eax, dword [0x5f50f8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
and eax, 0xfffffffc
mov esi, dword [ebp - 0x18]
je 0x421b69
mov ecx, dword [esi + 0x19c]
mov edx, dword [ebp - 0x24]
mov dword [eax + ecx*8], edx
mov ecx, dword [esi + 0x19c]
mov edx, dword [esi + 0x1a0]
mov dword [eax + ecx*8 + 4], edx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00512ee3
add esp, 0x40
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, ebx
shr ecx, 1
and ecx, 0x55555555
mov eax, ebx
sub eax, ecx
mov ecx, 0x33333333
mov edx, eax
and edx, ecx
shr eax, 2
and eax, ecx
mov ecx, dword [ebp - 0x18]
add ecx, 0x1bc
mov dword [ebp - 0x28], ecx
add eax, edx
mov edx, eax
shr edx, 4
add edx, eax
mov ecx, dword [esi + 4]
and edx, 0xf0f0f0f
imul eax, edx, 0x1010101
shr eax, 0x18
mov dword [ebp - 0x2c], eax
cmp eax, 1
jbe 0x421cd0
cmp ecx, ebx
mov edx, ecx
jb 0x421964
mov eax, edx
xor edx, edx
div ebx
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x1b4]
mov dword [ebp - 0x20], edx
mov ecx, dword [ebp - 0x28]
mov dword [eax + edx*4], ecx
mov ecx, dword [esi]
test ecx, ecx
mov edx, dword [ebp - 0x1c]
je 0x42181c
mov eax, dword [ecx + 4]
cmp dword [ebp - 0x2c], 1
jbe 0x421cdc
cmp eax, ebx
jb 0x42199a
xor edx, edx
div ebx
mov eax, edx
cmp eax, dword [ebp - 0x20]
je 0x421d0b
mov edx, dword [ebp - 0x18]
mov edx, dword [edx + 0x1b4]
cmp dword [edx + eax*4], 0
jne 0x421ce6
mov dword [edx + eax*4], esi
mov esi, ecx
mov ecx, dword [ecx]
mov dword [ebp - 0x20], eax
jmp 0x421978
mov dword [esp], esi
call fcn.004e3a80
jmp 0x4214d8
mov dword [esp], 0x6ceb98
call fcn.00510c6d
cmp dword [0x6ceb98], 0xffffffff
jne 0x421338
mov dword [0x6ceb94], 0
mov dword [0x6ceb90], 0xffffffff
mov dword [esp], 0
mov ecx, 0x6ceb90
call fcn.0040c200
sub esp, 4
mov dword [esp], 0x6ceb98
call fcn.00510d9d
jmp 0x421338
mov dword [esp], 0x6ceb98
call fcn.00510c6d
cmp dword [0x6ceb98], 0xffffffff
jne 0x42147f
mov dword [0x6ceb94], 0
mov dword [0x6ceb90], 0xffffffff
mov dword [esp], 0
mov ecx, 0x6ceb90
call fcn.0040c200
sub esp, 4
mov dword [esp], 0x6ceb98
call fcn.00510d9d
jmp 0x42147f
mov dword [esp], 0x6cebc8
call fcn.00510c6d
cmp dword [0x6cebc8], 0xffffffff
jne 0x421393
mov dword [0x6cebc4], 0
mov dword [0x6cebc0], 0xffffffff
mov dword [esp], 0
mov ecx, 0x6cebc0
call fcn.0040c200
sub esp, 4
mov dword [esp], 0x6cebc8
call fcn.00510d9d
jmp 0x421393
mov dword [esp], 0x6cebc8
call fcn.00510c6d
cmp dword [0x6cebc8], 0xffffffff
jne 0x421521
mov dword [0x6cebc4], 0
mov dword [0x6cebc0], 0xffffffff
mov dword [esp], 0
mov ecx, 0x6cebc0
call fcn.0040c200
sub esp, 4
mov dword [esp], 0x6cebc8
call fcn.00510d9d
jmp 0x421521
mov dword [esp], 0x6cebc8
call fcn.00510c6d
cmp dword [0x6cebc8], 0xffffffff
jne 0x4215d3
mov dword [0x6cebc4], 0
mov dword [0x6cebc0], 0xffffffff
mov dword [esp], 0
mov ecx, 0x6cebc0
call fcn.0040c200
sub esp, 4
mov dword [esp], 0x6cebc8
call fcn.00510d9d
jmp 0x4215d3
cmp dword [ebp - 0x24], 0
je 0x4218f7
call fcn.00404220
jmp 0x4218db
int3
int3
mov dword [esp], esi
call fcn.004e3a80
jmp 0x421442
mov dword [esp], esi
call fcn.004e3ba0
jmp 0x4214f9
mov ecx, edi
call fcn.004f8930
jmp 0x4215b2
cmp eax, esi
jb 0x421bb3
xor edx, edx
div esi
mov eax, edx
mov edx, dword [ebp - 0x1c]
jmp 0x4216a0
lock dec dword [eax + 4]
jne 0x4218af
mov dword [esp], eax
call fcn.0050b620
jmp 0x4218af
mov edx, dword [ebp - 0x1c]
mov ebx, edx
cmp edx, esi
jb 0x421671
mov eax, edx
xor edx, edx
div esi
mov ebx, edx
mov edx, dword [ebp - 0x1c]
jmp 0x421671
lea edx, [esi - 1]
xor ebx, ebx
test esi, edx
setne bl
mov dword [ebp - 0x20], ebx
jmp 0x42177f
mov dword [ebp - 0x20], ebx
mov edx, dword [ebp - 0x1c]
jae 0x42181c
mov eax, dword [ebp - 0x18]
movss xmm0, dword [eax + 0x1c0]
orpd xmm0, xmmword [0x5db290]
subsd xmm0, qword [0x5db288]
cvtsd2ss xmm0, xmm0
divss xmm0, dword [eax + 0x1c4]
cvtss2sd xmm0, xmm0
movsd qword [esp], xmm0
call fcn.00546e60
fstp dword [ebp - 0x38]
movss xmm0, dword [ebp - 0x38]
cvttss2si ecx, xmm0
mov edx, ecx
subss xmm0, dword [0x5c6a08]
cvttss2si eax, xmm0
sar edx, 0x1f
and eax, edx
or eax, ecx
cmp esi, 3
jb 0x421d13
mov edx, esi
shr edx, 1
and edx, 0x55555555
mov ecx, esi
sub ecx, edx
mov edx, 0x33333333
mov ebx, ecx
and ebx, edx
shr ecx, 2
and ecx, edx
add ecx, ebx
mov edx, ecx
shr edx, 4
add edx, ecx
and edx, 0xf0f0f0f
imul ecx, edx, 0x1010101
shr ecx, 0x18
cmp ecx, 1
ja 0x421d13
lea ecx, [eax - 1]
bsr ecx, ecx
xor ecx, 0x1f
neg cl
xor ebx, ebx
inc ebx
shl ebx, cl
cmp eax, 2
cmovb ebx, eax
jmp 0x421d1d
call fcn.00549f00
mov ebx, ecx
jmp 0x4217b3
and eax, ecx
jmp 0x421881
lea eax, [ebx - 1]
and ecx, eax
mov edx, ecx
jmp 0x421964
lea edx, [ebx - 1]
and eax, edx
jmp 0x42199a
mov edx, dword [ecx]
mov dword [ebp - 0x28], esi
mov dword [esi], edx
mov esi, dword [ebp - 0x18]
mov edx, dword [esi + 0x1b4]
mov edx, dword [edx + eax*4]
mov edx, dword [edx]
mov dword [ecx], edx
mov edx, dword [esi + 0x1b4]
mov eax, dword [edx + eax*4]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x20]
jmp 0x4219b9
mov dword [esp], eax
call fcn.004f0a70
mov ebx, eax
mov eax, dword [ebp - 0x20]
cmp eax, ebx
cmova ebx, eax
cmp ebx, esi
mov edx, dword [ebp - 0x1c]
jae 0x42181c
test ebx, ebx
jne 0x4217bb
mov ecx, dword [ebp - 0x18]
mov eax, dword [ecx + 0x1b4]
mov dword [ecx + 0x1b4], 0
test eax, eax
je 0x421d57
mov dword [esp], eax
call fcn.0050fc7c
mov eax, dword [ebp - 0x18]
mov dword [eax + 0x1b8], 0
mov edx, dword [ebp - 0x1c]
jmp 0x42181c