//
// __cxa_guard_acquire from 0xcccf2c to 0xccd0a4 (376 bytes)
//
// 16 xrefs:
// > cocos2d::CCCallFuncND::getClassTypeInfo @ 0xabd6c0
// > cocos2d::CCCallFuncO::getClassTypeInfo @ 0xabd770
// > cocos2d::CCCallFuncN::getClassTypeInfo @ 0xabd820
// > cocos2d::CCDirector::getClassTypeInfo @ 0xad5a6c
// > cocos2d::CCFileUtils::getClassTypeInfo @ 0xb04830
// > cocos2d::CCEGLView::sharedOpenGLView @ 0xb0aa3c
// > cocos2d::CCImage::initWithString @ 0xb0d65c
// > cocos2d::CCImage::initWithStringShadowStroke @ 0xb0dac8
// > Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC @ 0xb0dd38
// > cocos2d::CCIMEDispatcher::sharedDispatcher @ 0xb2fb8c
// > sub_CCBA98 @ 0xccbab4
// > sub_CEA7E4 @ 0xcea884
// > sub_CEBD04 @ 0xcebdf8
// > sub_CEBFFC @ 0xcec0d4
// > sub_D1461C @ 0xd14654
// > ??> @ 0x88dd0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int _cxa_guard_acquire(__guard *a1)
{
unsigned int v2; // w0
int result; // w0
unsigned int v4; // w1
_QWORD *exception; // x0
int v6; // [xsp+48h] [xbp+48h]
if ( &_google_potentially_blocking_region_begin )
__google_potentially_blocking_region_begin();
if ( *(_BYTE *)a1 )
goto LABEL_10;
if ( !&pthread_create )
{
if ( !*(_BYTE *)a1 )
{
if ( *((_BYTE *)a1 + 1) )
{
exception = _cxa_allocate_exception(8u);
*exception = off_121CA70;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'__gnu_cxx::recursive_init_error,
(void (*)(void *))__gnu_cxx::recursive_init_error::~recursive_init_error);
}
result = 1;
*((_BYTE *)a1 + 1) = 1;
goto LABEL_11;
}
LABEL_10:
result = 0;
goto LABEL_11;
}
while ( 1 )
{
do
v2 = __ldaxr((unsigned int *)a1);
while ( !v2 && __stlxr(0x100u, (unsigned int *)a1) );
if ( !v2 )
break;
if ( v2 == 1 )
goto LABEL_10;
if ( v2 == 256 )
{
do
v4 = __ldaxr((unsigned int *)a1);
while ( v4 == v2 && __stlxr(0x10100u, (unsigned int *)a1) );
if ( v4 != v2 )
{
if ( v4 == 1 )
goto LABEL_10;
if ( !v4 )
continue;
}
}
syscall(98, a1, 0);
}
result = 1;
LABEL_11:
if ( &_google_potentially_blocking_region_end )
{
v6 = result;
__google_potentially_blocking_region_end();
return v6;
}
return result;
}