//
// EndLevelLayer::getCoinString from 0x1004bab60 to 0x1004bad63 (515 bytes)
//
// 1 xrefs:
// > EndLevelLayer::customSetup @ 0x1004b9c8f
//
// 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:03 +0000
//
__int64 __fastcall EndLevelLayer::getCoinString(__int64 a1, __int64 a2)
{
__int64 v2; // rax
int *v4; // rsi
int v5; // r13d
int v6; // r12d
int v7; // r15d
char v8; // al
__int64 v9; // rax
const char *CString; // r14
size_t v11; // rax
size_t v12; // r15
_BYTE *v13; // r12
size_t v15; // r13
std::string v16; // [rsp+0h] [rbp-40h] BYREF
v2 = *(_QWORD *)(a2 + 608);
if ( !v2 )
{
*(_WORD *)a1 = 0;
return a1;
}
strcpy((char *)&v16, "\"all coins");
v4 = *(int **)(v2 + 1936);
v5 = v4[252] - v4[253];
v6 = v4[255] - v4[256];
v7 = v4[258] - v4[259];
if ( v4[241] >= 2 && (v7 == 1 || v6 == 1 || v5 == 1) )
{
std::string::assign(&v16, "coin ");
v8 = 1;
if ( v5 != 1 )
{
std::string::append(&v16, "1");
v8 = 0;
}
if ( v6 != 1 )
{
if ( !v8 )
std::string::append(&v16, ", ");
std::string::append(&v16, "2");
v8 = 0;
}
if ( v7 != 1 && *(int *)(*(_QWORD *)(*(_QWORD *)(a2 + 608) + 1936LL) + 964LL) >= 3 )
{
if ( !v8 )
std::string::append(&v16, ", ");
std::string::append(&v16, "3");
}
}
v9 = sub_10088E820("You need to collect %s to verify the level!", *(_BYTE *)&v16.__r_.__value_.__l.0);
CString = (const char *)cocos2d::CCString::getCString(v9);
v11 = strlen(CString);
if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v12 = v11;
if ( v11 >= 0x17 )
{
v15 = 26;
if ( (v11 | 7) != 0x17 )
v15 = (v11 | 7) + 1;
v13 = operator new(v15);
*(_QWORD *)(a1 + 16) = v13;
*(_QWORD *)a1 = v15 | 1;
*(_QWORD *)(a1 + 8) = v12;
LABEL_26:
memmove(v13, CString, v12);
v13[v12] = 0;
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) == 0 )
return a1;
goto LABEL_21;
}
*(_BYTE *)a1 = 2 * v11;
v13 = (_BYTE *)(a1 + 1);
if ( v11 )
goto LABEL_26;
*v13 = 0;
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
LABEL_21:
operator delete(v16.__r_.__value_.__l.__data_);
return a1;
}