//
// SmartTemplateCell::onClick from 0x14015e130 to 0x14015e202 (210 bytes)
//
// 3 xrefs:
// > SmartTemplateCell::loadFromObject @ 0x14015de4d
// > SmartTemplateCell::loadFromObject @ 0x14015def2
// > ??> @ 0x140917c48
//
// 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 11:27:23 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall SmartTemplateCell::onClick(__int64 a1, __int64 a2)
{
int v3; // eax
void (__fastcall ***v4)(_QWORD, __int64, __int64, __int64, _QWORD); // rcx
__int64 v5; // r9
__int64 v6; // rcx
void *v7; // [rsp+48h] [rbp+10h]
if ( a2 )
{
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
if ( v3 )
{
if ( v3 == 1 )
{
v4 = *(void (__fastcall ****)(_QWORD, __int64, __int64, __int64, _QWORD))(*(_QWORD *)(a1 + 416) + 624LL);
if ( v4 )
{
v5 = 6;
LABEL_11:
(**v4)(v4, a1, 20, v5, 0);
}
}
}
else if ( *(_QWORD *)(a1 + 560) )
{
v6 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v7 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v7);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v6 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v6 + 1664) = *(_QWORD *)(a1 + 560);
v4 = *(void (__fastcall ****)(_QWORD, __int64, __int64, __int64, _QWORD))(*(_QWORD *)(a1 + 416) + 624LL);
if ( v4 )
{
v5 = 1;
goto LABEL_11;
}
}
}
}