//
// GJBigSprite::finishedLoadingSpriteAsync from 0x10026a3d0 to 0x10026a561 (401 bytes)
//
// 2 xrefs:
// > GJBigSprite::updateSpriteVisibility @ 0x100268b03
// > GJBigSprite::loadSpriteAsync @ 0x10026a3aa
//
// 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
//
void __fastcall GJBigSprite::finishedLoadingSpriteAsync(GJBigSprite *a1, cocos2d::CCObject *a2)
{
double v2; // xmm0_8
__int64 v4; // r15
__int64 v5; // rax
__int64 v6; // r14
__int64 v7; // rdi
int v8; // eax
__int64 v9; // rdi
const char *v10; // rdi
cocos2d::CCTextureCache *v11; // rax
const char *v12; // rsi
cocos2d::CCSprite *v13; // r15
__int64 v14; // rax
__int128 v15; // [rsp+0h] [rbp-30h] BYREF
void *__p; // [rsp+10h] [rbp-20h]
v4 = ((unsigned int (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
v5 = sub_1007200C0(a1->m_spriteNodes, v4);
v6 = v5;
if ( *(_BYTE *)(v5 + 368) == 1 )
{
v7 = *(_QWORD *)(v5 + 344);
if ( !v7 )
goto LABEL_5;
v8 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 64LL))(v7);
v9 = *(_QWORD *)(v6 + 344);
if ( v8 == -1 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 520LL))(v9);
*(_QWORD *)(v6 + 344) = 0;
if ( (*(_BYTE *)(v6 + 320) & 1) == 0 )
goto LABEL_6;
goto LABEL_17;
}
if ( !v9 )
{
LABEL_5:
if ( (*(_BYTE *)(v6 + 320) & 1) == 0 )
{
LABEL_6:
v10 = (const char *)(v6 + 321);
LABEL_18:
v13 = cocos2d::CCSprite::create_1(v10);
v14 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 192LL))(v6);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v13->setPosition)(v13, v14);
((void (__fastcall *)(GJBigSprite *, cocos2d::CCSprite *))a1->addChild)(a1, v13);
*(_QWORD *)(v6 + 344) = v13;
((void (__fastcall *)(cocos2d::CCSprite *, float))v13->setScale)(v13, 1.002);
return;
}
LABEL_17:
v10 = *(const char **)(v6 + 336);
goto LABEL_18;
}
}
else
{
if ( (*(_BYTE *)(v5 + 320) & 1) != 0 )
{
sub_100006B70(&v15, *(const void **)(v5 + 336), *(_QWORD *)(v5 + 328), v2);
}
else
{
__p = *(void **)(v5 + 336);
v15 = *(_OWORD *)(v5 + 320);
}
v11 = cocos2d::CCTextureCache::sharedTextureCache();
if ( (v15 & 1) != 0 )
v12 = (const char *)__p;
else
v12 = (char *)&v15 + 1;
cocos2d::CCTextureCache::removeTextureForKey(v11, v12);
*(_QWORD *)&a1->m_spritesLoaded.__begin_[8 * ((unsigned __int64)(int)v4 >> 6)] &= __ROL8__(-2, v4);
if ( (v15 & 1) != 0 )
operator delete(__p);
}
}