//
// sub_100508830 from 0x100508830 to 0x10050891c (236 bytes)
//
// 3 xrefs:
// > sub_1004FCC08 @ 0x1004fccd0
// > sub_1004FCC08 @ 0x1004fcd8c
// > sub_1004FCC08 @ 0x1004fce48
//
// 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:06:58 +0000
//
__int64 __usercall sub_100508830@(__int64 a1@, std::string *a2@)
{
signed int v4; // w21
__int64 v5; // x0
void **v6; // x1
std::string::size_type v7; // x2
__int64 result; // x0
void *__p[2]; // [xsp+0h] [xbp-50h] BYREF
__int64 v10; // [xsp+10h] [xbp-40h]
v4 = 0;
a2->__r_.__value_.__r.__words[0] = 0;
a2->__r_.__value_.__l.__size_ = 0;
a2->__r_.__value_.__r.__words[2] = 0;
if ( a1 )
goto LABEL_17;
LABEL_18:
for ( result = 0; v4 < (int)result; result = sub_1002E757C(a1) )
{
if ( v4 )
std::string::append(a2, ", ");
v5 = sub_1002E75A0(a1, v4);
if ( *(char *)(v5 + 343) < 0 )
{
sub_1000097D0(__p, *(void **)(v5 + 320), *(_QWORD *)(v5 + 328));
}
else
{
*(_OWORD *)__p = *(_OWORD *)(v5 + 320);
v10 = *(_QWORD *)(v5 + 336);
}
if ( v10 >= 0 )
v6 = __p;
else
v6 = (void **)__p[0];
if ( v10 >= 0 )
v7 = HIBYTE(v10);
else
v7 = (std::string::size_type)__p[1];
std::string::append(a2, (const std::string::value_type *)v6, v7);
if ( SHIBYTE(v10) < 0 )
operator delete(__p[0]);
++v4;
if ( !a1 )
goto LABEL_18;
LABEL_17:
;
}
return result;
}