//
// InfoLayer::setupPageInfo from 0x100352c8c to 0x100352f04 (632 bytes)
//
// 2 xrefs:
// > sub_100352FBC @ 0x100352fc0
// > ??> @ 0x1007f3460
//
// 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 __fastcall InfoLayer::setupPageInfo(InfoLayer *a1, char *a2, const char *a3)
{
cocos2d::CCObject *v5; // x20
std::string *p_str; // x8
std::string::size_type size; // x22
std::string *v8; // x9
std::string::size_type v9; // x11
std::string *v10; // x10
__int64 v11; // x8
__int64 v12; // x23
std::string::size_type v13; // x21
std::string *v14; // x1
__int64 v15; // x25
bool v16; // zf
std::string::size_type v17; // x11
std::string *v18; // x8
_BYTE *v19; // x9
_BYTE *v20; // x10
std::string::size_type v21; // x11
__int64 v22; // x8
cocos2d::CCString *v23; // x0
cocos2d::CCString *v24; // x0
cocos2d::CCString *v25; // x0
std::string __str; // [xsp+8h] [xbp-88h] BYREF
std::allocator __a[24]; // [xsp+20h] [xbp-70h] BYREF
std::string v28; // [xsp+38h] [xbp-58h] BYREF
if ( !InfoLayer::isCorrect(a1, a3) )
return;
if ( a2[23] < 0 )
a2 = *(char **)a2;
sub_100009900(&__str, a2);
v5 = sub_10024A15C();
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_str = &__str;
else
p_str = (std::string *)__str.__r_.__value_.__r.__words[0];
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
size = HIBYTE(__str.__r_.__value_.__r.__words[2]);
else
size = __str.__r_.__value_.__l.__size_;
if ( size )
{
v8 = (std::string *)((char *)p_str + size);
v9 = size;
v10 = p_str;
while ( v10->__r_.__value_.__s.__data_[0] != 58 )
{
v10 = (std::string *)((char *)v10 + 1);
if ( !--v9 )
{
v10 = (std::string *)((char *)p_str + size);
break;
}
}
v11 = (char *)v10 - (char *)p_str;
if ( v10 == v8 )
v12 = -1;
else
v12 = v11;
}
else
{
v12 = -1;
}
v13 = 0;
do
{
std::string::basic_string(&v28, &__str, v13, v12 - v13, __a);
if ( SHIBYTE(v28.__r_.__value_.__r.__words[2]) < 0 )
{
if ( v13 == size && !v28.__r_.__value_.__l.__size_ )
goto LABEL_29;
v14 = (std::string *)v28.__r_.__value_.__r.__words[0];
}
else
{
if ( v13 == size && !*((_BYTE *)&v28.__r_.__value_.__s + 23) )
goto LABEL_29;
v14 = &v28;
}
sub_100009900(__a, (char *)v14);
sub_100268E48((__int128 *)__a);
sub_10024A2D0((__int64)v5);
if ( (*(_BYTE *)&__a[23].std::__non_trivial_if & 0x80000000) != 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
LABEL_29:
if ( v12 == -1 )
goto LABEL_30;
v13 = v12 + 1;
v17 = __str.__r_.__value_.__l.__size_;
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v18 = &__str;
else
v18 = (std::string *)__str.__r_.__value_.__r.__words[0];
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v17 = HIBYTE(__str.__r_.__value_.__r.__words[2]);
if ( v17 <= v13 )
{
LABEL_30:
v15 = -1;
}
else
{
v19 = (char *)v18 + v17;
v20 = (char *)v18 + v13;
v21 = ~v12 + v17;
while ( *v20 != 58 )
{
++v20;
if ( !--v21 )
{
v20 = v19;
break;
}
}
v22 = v20 - (_BYTE *)v18;
if ( v20 == v19 )
v15 = -1;
else
v15 = v22;
}
if ( SHIBYTE(v28.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v28.__r_.__value_.__l.__data_);
v16 = v12 == -1;
v12 = v15;
}
while ( !v16 );
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_10024A36C((__int64)v5) >= 3 )
{
v23 = (cocos2d::CCString *)sub_10024A388((__int64)v5, 0);
a1->m_itemCount = cocos2d::CCString::intValue(v23);
v24 = (cocos2d::CCString *)sub_10024A388((__int64)v5, 1u);
a1->m_pageStartIdx = cocos2d::CCString::intValue(v24);
v25 = (cocos2d::CCString *)sub_10024A388((__int64)v5, 2u);
a1->m_pageEndIdx = cocos2d::CCString::intValue(v25);
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_leftArrow->setVisible)(
a1->m_leftArrow,
a1->m_pageStartIdx != 0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_rightArrow->setVisible)(
a1->m_rightArrow,
a1->m_pageEndIdx + a1->m_pageStartIdx < a1->m_itemCount);
InfoLayer::updateLevelsLabel(a1);
}
}