//
// SetupSmartTemplateLayer::onClose from 0x1004e3160 to 0x1004e322e (206 bytes)
//
// 6 xrefs:
// > SetupSmartTemplateLayer::onBack @ 0x1004e2e04
// > SetupSmartTemplateLayer::onClick @ 0x1004e2e75
// > SetupSmartTemplateLayer::FLAlert_Clicked @ 0x1004e326c
// > sub_1004E32A0 @ 0x1004e32e0
// > SetupSmartTemplateLayer::keyBackClicked @ 0x1004e3534
// > sub_1004E3560 @ 0x1004e356b
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:31:18 +0000
//
void __fastcall SetupSmartTemplateLayer::onClose(__int64 a1)
{
char v1; // al
__int64 v3; // rdi
__int64 v4; // rax
unsigned int v5; // ecx
__int64 v6; // rax
const std::string::value_type *CString; // rax
__int64 v8; // rax
__int64 v9; // rax
char v10; // [rsp-8h] [rbp-10h]
v10 = v1;
v3 = *(_QWORD *)(a1 + 688);
if ( v3 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v3 + 344LL))(v3, 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 680) + 1160LL))(*(_QWORD *)(a1 + 680), 0);
v4 = *(_QWORD *)(a1 + 672);
v5 = *(unsigned __int8 *)(v4 + 144);
if ( (v5 & 1) != 0 )
{
if ( !*(_QWORD *)(v4 + 152) )
{
LABEL_7:
v6 = sub_10088E820("SmartTemplate_%i", v10);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v6);
std::string::assign((std::string *)(*(_QWORD *)(a1 + 672) + 144LL), CString);
}
}
else if ( !(v5 >> 1) )
{
goto LABEL_7;
}
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1072LL))(a1, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 528LL))(a1, 1);
v8 = cocos2d::CCDirector::sharedDirector();
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 160LL))(v8);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v9, a1);
}