//
// MoreSearchLayer::onCoins from 0x140315c70 to 0x140315e70 (512 bytes)
//
// 2 xrefs:
// > MoreSearchLayer::init @ 0x1403134dc
// > ??> @ 0x1406d4934
//
// 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 MoreSearchLayer::onCoins(MoreSearchLayer *a1, cocos2d::CCObject *a2)
{
__int64 v2; // rcx
cocos2d::CCString *v3; // rax
BOOL v4; // edi
void *v5; // rcx
__int64 v6; // rbx
struct cocos2d::CCString *v7; // rax
void *v8; // rcx
void *v9; // [rsp+20h] [rbp-50h]
void *v10; // [rsp+20h] [rbp-50h]
void *Block[2]; // [rsp+28h] [rbp-48h] BYREF
__int64 v12; // [rsp+38h] [rbp-38h]
unsigned __int64 v13; // [rsp+40h] [rbp-30h]
void *v14[2]; // [rsp+48h] [rbp-28h] BYREF
__int64 v15; // [rsp+58h] [rbp-18h]
unsigned __int64 v16; // [rsp+60h] [rbp-10h]
v2 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v9 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v2 = qword_1406C2EC0;
}
v12 = 11;
v13 = 15;
Block[0] = (void *)0x6C69665F6E696F63LL;
Block[1] = (void *)7497076;
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v2 + 344), Block);
v4 = cocos2d::CCString::boolValue(v3);
if ( v13 > 0xF )
{
v5 = Block[0];
if ( v13 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v5);
}
v12 = 0;
v13 = 15;
LOBYTE(Block[0]) = 0;
v6 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v10 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v6 = qword_1406C2EC0;
}
v15 = 11;
v16 = 15;
v14[0] = (void *)0x6C69665F6E696F63LL;
v14[1] = (void *)7497076;
v7 = cocos2d::CCString::createWithFormat("%i", !v4);
cocos2d::CCDictionary::setObject(*(_QWORD *)(v6 + 344), v7, v14);
if ( v16 > 0xF )
{
v8 = v14[0];
if ( v16 + 1 >= 0x1000 )
{
v8 = *((void **)v14[0] - 1);
if ( (unsigned __int64)((char *)v14[0] - (char *)v8 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v8);
}
}