//
// cocos2d::CCTextureETC::initWithFile from 0xb3716c to 0xb37240 (212 bytes)
//
// 2 xrefs:
// > cocos2d::CCTexture2D::initWithETCFile @ 0xb31504
// > ??> @ 0x2bfc8
//
// 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
//
bool cocos2d::CCTextureETC::initWithFile(cocos2d::CCTextureETC *a1, const char *a2)
{
cocos2d::CCFileUtils *v3; // x0
bool Texture; // w20
char *v5; // x0
unsigned int *v7; // x2
int v8; // w1
char *v10; // [xsp+40h] [xbp+40h] BYREF
v3 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(char **__return_ptr, cocos2d::CCFileUtils *, const char *, _QWORD))v3->createCCArrayWithContentsOfFile)(
&v10,
v3,
a2,
0);
Texture = cocos2d::CCTextureETC::loadTexture(a1, v10);
v5 = v10 - 24;
if ( v10 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v10 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v10 - 2);
*((_DWORD *)v10 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v5);
}
return Texture;
}