//
// sub_100279C18 from 0x100279c18 to 0x100279d7c (356 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateLayerCapacity @ 0x10027914c
// > sub_10029DA90 @ 0x10029e120
//
// This function is hookable on this platform (idp: arm, 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:01:52 +0000
//
void __fastcall sub_100279C18(std::string *__str, __int64 a2)
{
int v4; // w8
bool v5; // cc
std::string *v6; // 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::size_type v14; // x8
bool v15; // zf
__int64 v16; // x24
int v17; // w8
std::string::size_type v18; // x11
bool v19; // cc
std::string *v20; // x8
_BYTE *v21; // x9
_BYTE *v22; // x10
std::string::size_type v23; // x11
__int64 v24; // x8
std::string __p; // [xsp+0h] [xbp-50h] BYREF
std::allocator __a; // [xsp+1Fh] [xbp-31h] BYREF
v4 = SHIBYTE(__str->__r_.__value_.__r.__words[2]);
v5 = v4 < 0;
if ( v4 >= 0 )
v6 = __str;
else
v6 = (std::string *)__str->__r_.__value_.__r.__words[0];
if ( v5 )
size = __str->__r_.__value_.__l.__size_;
else
size = HIBYTE(__str->__r_.__value_.__r.__words[2]);
if ( size )
{
v8 = (std::string *)((char *)v6 + size);
v9 = size;
v10 = v6;
while ( v10->__r_.__value_.__s.__data_[0] != 44 )
{
v10 = (std::string *)((char *)v10 + 1);
if ( !--v9 )
{
v10 = (std::string *)((char *)v6 + size);
break;
}
}
v11 = (char *)v10 - (char *)v6;
if ( v10 == v8 )
v12 = -1;
else
v12 = v11;
}
else
{
v12 = -1;
}
v13 = 0;
do
{
std::string::basic_string(&__p, __str, v13, v12 - v13, &__a);
v14 = HIBYTE(__p.__r_.__value_.__r.__words[2]);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v14 = __p.__r_.__value_.__l.__size_;
if ( v14 )
v15 = 0;
else
v15 = v13 == size;
if ( !v15 )
sub_100017C70(a2);
if ( v12 == -1 )
goto LABEL_25;
v13 = v12 + 1;
v17 = SHIBYTE(__str->__r_.__value_.__r.__words[2]);
v18 = __str->__r_.__value_.__l.__size_;
v19 = v17 < 0;
if ( v17 >= 0 )
v20 = __str;
else
v20 = (std::string *)__str->__r_.__value_.__r.__words[0];
if ( !v19 )
v18 = HIBYTE(__str->__r_.__value_.__r.__words[2]);
if ( v18 <= v13 )
{
LABEL_25:
v16 = -1;
}
else
{
v21 = (char *)v20 + v18;
v22 = (char *)v20 + v13;
v23 = ~v12 + v18;
while ( *v22 != 44 )
{
++v22;
if ( !--v23 )
{
v22 = v21;
break;
}
}
v24 = v22 - (_BYTE *)v20;
if ( v22 == v21 )
v16 = -1;
else
v16 = v24;
}
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v15 = v12 == -1;
v12 = v16;
}
while ( !v15 );
}