//
// SetupSmartTemplateLayer::onClose from 0x674a50 to 0x674ad0 (128 bytes)
//
// 2 xrefs:
// > SetupSmartTemplateLayer::onBack @ 0x674ad6
// > SetupSmartTemplateLayer::onClick @ 0x6757c4
//
// 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 11:55:55 +0000
//
int __fastcall SetupSmartTemplateLayer::onClose(SetupSmartTemplateLayer *this, cocos2d::CCObject *a2)
{
int v3; // r0
int v4; // r5
int v5; // r3
int v6; // r2
int v7; // r3
cocos2d::CCString *v8; // r0
const char *CString; // r6
size_t v10; // r0
cocos2d::CCDirector *v11; // r0
int v12; // r0
cocos2d::CCTouchDispatcher *v13; // r0
v3 = *((_DWORD *)this + 133);
if ( v3 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)v3 + 172))(v3, 1);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 132) + 580))(*((_DWORD *)this + 132), 0);
v4 = *((_DWORD *)this + 131);
v5 = *(unsigned __int8 *)(v4 + 96);
v6 = v5 << 31;
if ( (v5 & 1) != 0 )
v7 = *(_DWORD *)(v4 + 100);
else
v7 = v5 >> 1;
if ( !v7 )
{
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"SmartTemplate_%i",
*(const char **)(v4 + 120),
v6);
CString = (const char *)cocos2d::CCString::getCString(v8);
v10 = strlen(CString);
std::string::assign((_DWORD *)(v4 + 96), CString, v10);
}
(*(void (__fastcall **)(SetupSmartTemplateLayer *, _DWORD, int))(*(_DWORD *)this + 536))(this, 0, v6);
v11 = (cocos2d::CCDirector *)(*(int (__fastcall **)(SetupSmartTemplateLayer *, int))(*(_DWORD *)this + 264))(this, 1);
v12 = cocos2d::CCDirector::sharedDirector(v11);
v13 = (cocos2d::CCTouchDispatcher *)(*(int (__fastcall **)(int))(*(_DWORD *)v12 + 80))(v12);
return cocos2d::CCTouchDispatcher::unregisterForcePrio(v13, this);
}