//
// std::__ndk1::__shared_weak_count::lock from 0x976f1c to 0x976f5c (64 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:05:58 +0000
//
int __fastcall std::__shared_weak_count::lock(int this)
{
unsigned int v1; // r3
unsigned int *v2; // r12
unsigned int v3; // r2
v1 = *(_DWORD *)(this + 4);
__dmb(0xBu);
if ( v1 != -1 )
{
v2 = (unsigned int *)(this + 4);
do
{
v3 = __ldrex(v2);
if ( v3 == v1 )
{
__dmb(0xBu);
if ( !__strex(v1 + 1, v2) )
{
__dmb(0xBu);
return this;
}
}
else
{
__clrex();
}
v1 = v3;
__dmb(0xBu);
}
while ( v3 != -1 );
}
return 0;
}