//
// sub_1002D132C from 0x1002d132c to 0x1002d1d40 (2580 bytes)
//
// 1 xrefs:
// > sub_1002D0568 @ 0x1002d06e4
//
// 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:02:39 +0000
//
__n128 __usercall sub_1002D132C@(__int64 *__return_ptr a1@, std::string *__s@, __int64 a3@)
{
__int64 v4; // x25
std::string *v5; // x23
__int64 size; // x8
char *v7; // x24
std::string *v8; // x0
char *v9; // x0
signed __int64 v10; // x23
signed __int64 v11; // x25
std::string::size_type v12; // x26
std::string::reference v13; // x0
unsigned __int64 v14; // x8
unsigned __int64 v15; // x27
int v16; // w8
std::string *v18; // x0
std::string *v19; // x0
int v20; // w8
std::string *v21; // x23
__int64 v22; // x8
char *v23; // x24
std::string *v24; // x0
char *v25; // x0
signed __int64 v26; // x23
std::string *v27; // x0
int v28; // w24
std::string *v29; // x23
__int64 v30; // x8
char *v31; // x24
std::string *v32; // x0
char *v33; // x0
signed __int64 v34; // x23
std::string *v35; // x0
int v36; // w24
std::string *v37; // x23
char *v38; // x24
std::string *v39; // x0
char *v40; // x0
signed __int64 v41; // x23
std::string *v42; // x0
int v43; // w24
void *v44; // x25
float v45; // s8
std::string *v46; // x0
__int64 v47; // x24
__int64 v48; // x1
char v49; // w26
__int64 v50; // x25
__int64 v51; // x27
std::string *v52; // x0
__int64 v53; // x8
std::string *v54; // x24
char *v55; // x25
std::string *v56; // x0
char *v57; // x0
void *v58; // x25
std::string *v59; // x0
__int64 v60; // x8
std::string *v61; // x25
char *v62; // x26
std::string *v63; // x0
char *v64; // x0
signed __int64 v65; // x24
std::string *v66; // x0
void *v67; // x25
std::string *v68; // x0
int v69; // w25
void *v70; // x27
std::string *v71; // x0
__int64 v72; // x8
std::string *v73; // x26
char *v74; // x27
std::string *v75; // x0
char *v76; // x0
signed __int64 v77; // x25
float v78; // s8
std::string *v79; // x0
signed __int64 v80; // x26
std::string *v81; // x0
__int64 v82; // x1
__int64 v83; // x26
__int64 v84; // x0
__int64 v85; // x1
std::string *p_a; // x0
int v87; // w26
std::string *v88; // x0
int v89; // w8
std::string::size_type v90; // x27
char v91; // w25
std::string *v92; // x0
int v93; // w26
void *v94; // x27
std::string *v95; // x0
int v96; // w25
__n128 result; // q0
int v98; // [xsp+Ch] [xbp-134h]
int v99; // [xsp+10h] [xbp-130h]
int v100; // [xsp+18h] [xbp-128h]
int v101; // [xsp+20h] [xbp-120h]
int v102; // [xsp+24h] [xbp-11Ch]
std::string v105; // [xsp+40h] [xbp-100h] BYREF
std::string v106; // [xsp+58h] [xbp-E8h] BYREF
std::string v107; // [xsp+70h] [xbp-D0h] BYREF
std::string __a; // [xsp+88h] [xbp-B8h] BYREF
std::string v109; // [xsp+A0h] [xbp-A0h] BYREF
std::string v110; // [xsp+B8h] [xbp-88h] BYREF
std::allocator v111; // [xsp+D7h] [xbp-69h] BYREF
LABEL_1:
v4 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( v4 < 0 )
{
v5 = (std::string *)__s->__r_.__value_.__r.__words[0];
size = __s->__r_.__value_.__l.__size_;
}
else
{
v5 = __s;
size = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
}
if ( size >= 2 )
{
v7 = (char *)v5 + size;
v8 = v5;
do
{
v9 = (char *)memchr(v8, 60, size - 1);
if ( !v9 )
break;
if ( *(_WORD *)v9 == 25404 )
{
if ( v9 == v7 )
break;
v10 = v9 - (char *)v5;
if ( v10 == -1 )
break;
if ( (v4 & 0x80000000) != 0 )
v4 = __s->__r_.__value_.__l.__size_;
if ( v4 >= (unsigned __int64)((int)v10 + 4LL) )
{
v11 = v10 << 32;
v12 = ((v10 << 32) + 0x200000000LL) >> 32;
v13 = std::string::at(__s, v12);
v14 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( (v14 & 0x8000000000000000LL) != 0 )
v14 = __s->__r_.__value_.__l.__size_;
v102 = (unsigned __int8)*v13;
if ( v14 >= (int)v10 + 12LL && *std::string::at(__s, (v11 + 0xB00000000LL) >> 32) == 62 )
{
v15 = 2;
while ( *std::string::at(__s, (int)v10 + v15) >= 48 )
{
v16 = *std::string::at(__s, (int)v10 + v15);
if ( v16 > 57 || v15++ >= 0xA )
{
if ( v16 >= 58 )
break;
std::string::basic_string(&v110, __s, v12, 3u, (std::allocator *)&__a);
if ( (v110.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v18 = &v110;
else
v18 = (std::string *)v110.__r_.__value_.__r.__words[0];
v101 = atoi((const char *)v18);
if ( v101 > 255 )
{
v20 = 255;
}
else
{
std::string::basic_string(&v109, __s, v12, 3u, (std::allocator *)&__a);
if ( (v109.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v19 = &v109;
else
v19 = (std::string *)v109.__r_.__value_.__r.__words[0];
v20 = (unsigned __int8)atoi((const char *)v19);
}
v100 = v20;
std::string::basic_string(&__a, __s, (v11 + 0x500000000LL) >> 32, 3u, (std::allocator *)&v106);
if ( (__a.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_a = &__a;
else
p_a = (std::string *)__a.__r_.__value_.__r.__words[0];
v87 = atoi((const char *)p_a);
if ( v87 > 255 )
{
v89 = 65280;
}
else
{
std::string::basic_string(&v107, __s, (v11 + 0x500000000LL) >> 32, 3u, (std::allocator *)&v106);
if ( (v107.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v88 = &v107;
else
v88 = (std::string *)v107.__r_.__value_.__r.__words[0];
v89 = (unsigned __int8)atoi((const char *)v88) << 8;
}
v99 = v89;
v90 = (v11 + 0x800000000LL) >> 32;
std::string::basic_string(&v106, __s, v90, 3u, (std::allocator *)&v105);
v91 = HIBYTE(v106.__r_.__value_.__r.__words[2]);
if ( (v106.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v92 = &v106;
else
v92 = (std::string *)v106.__r_.__value_.__r.__words[0];
if ( atoi((const char *)v92) > 255 )
{
LODWORD(v51) = v100 | v99 | 0xFF0000;
}
else
{
v98 = v87;
std::string::basic_string(&v105, __s, v90, 3u, &v111);
v93 = SHIBYTE(v105.__r_.__value_.__r.__words[2]);
v94 = (void *)v105.__r_.__value_.__r.__words[0];
if ( (v105.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v95 = &v105;
else
v95 = (std::string *)v105.__r_.__value_.__r.__words[0];
v96 = atoi((const char *)v95);
if ( v93 < 0 )
operator delete(v94);
LODWORD(v51) = v100 | (v96 << 16) | v99;
v91 = HIBYTE(v106.__r_.__value_.__r.__words[2]);
v87 = v98;
}
if ( v91 < 0 )
operator delete(v106.__r_.__value_.__l.__data_);
if ( v87 <= 255 && SHIBYTE(v107.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v107.__r_.__value_.__l.__data_);
if ( SHIBYTE(__a.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__a.__r_.__value_.__l.__data_);
if ( v101 <= 255 && SHIBYTE(v109.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v109.__r_.__value_.__l.__data_);
if ( SHIBYTE(v110.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v110.__r_.__value_.__l.__data_);
v50 = 12;
v49 = 1;
goto LABEL_81;
}
}
}
v49 = 0;
v50 = 4;
LODWORD(v51) = 255;
LABEL_81:
v52 = std::string::replace(__s, (int)v10, (unsigned int)v50, "");
std::string::operator=(__s, v52);
sub_1002D2174(a3, v10, v50);
v53 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( v53 < 0 )
{
v54 = (std::string *)__s->__r_.__value_.__r.__words[0];
v53 = __s->__r_.__value_.__l.__size_;
}
else
{
v54 = __s;
}
if ( v53 >= 4 )
{
v55 = (char *)v54 + v53;
v56 = v54;
while ( 1 )
{
v57 = (char *)memchr(v56, 60, v53 - 3);
if ( !v57 )
break;
if ( *(_DWORD *)v57 == 1046687548 )
{
if ( v57 == v55 )
goto LABEL_160;
v65 = v57 - (char *)v54;
if ( v65 == -1 )
goto LABEL_160;
v66 = std::string::replace(__s, (int)v65, 4u, "");
std::string::operator=(__s, v66);
sub_1002D2174(a3, v65, 4);
if ( (v49 & 1) == 0 )
{
if ( (unsigned int)(v102 - 97) > 0x18 )
LODWORD(v51) = 255;
else
v51 = qword_100763938[(unsigned __int8)(v102 - 97)];
}
v85 = (unsigned int)(v65 - 1);
v47 = *(_QWORD *)(a3 + 632);
v48 = sub_1002D2298(v10, v85, 1);
*(_BYTE *)(v48 + 70) = BYTE2(v51);
*(_WORD *)(v48 + 68) = v51;
LABEL_79:
sub_1002E74E0(v47, v48);
goto LABEL_1;
}
v56 = (std::string *)(v57 + 1);
v53 = v55 - (char *)v56;
if ( v55 - (char *)v56 < 4 )
goto LABEL_160;
}
}
}
goto LABEL_160;
}
v8 = (std::string *)(v9 + 1);
size = v7 - (char *)v8;
}
while ( v7 - (char *)v8 >= 2 );
}
if ( (v4 & 0x80000000) != 0 )
{
v21 = (std::string *)__s->__r_.__value_.__r.__words[0];
v22 = __s->__r_.__value_.__l.__size_;
}
else
{
v21 = __s;
v22 = v4;
}
if ( v22 >= 2 )
{
v23 = (char *)v21 + v22;
v24 = v21;
do
{
v25 = (char *)memchr(v24, 60, v22 - 1);
if ( !v25 )
break;
if ( *(_WORD *)v25 == 26940 )
{
if ( v25 == v23 )
break;
v26 = v25 - (char *)v21;
if ( v26 == -1 )
break;
v27 = std::string::basic_string(
&v110,
__s,
((v26 << 32) + 0x200000000LL) >> 32,
3u,
(std::allocator *)&__a);
if ( SHIBYTE(v110.__r_.__value_.__r.__words[2]) < 0 )
{
v58 = (void *)v110.__r_.__value_.__r.__words[0];
v28 = atoi(v110.__r_.__value_.__l.__data_);
operator delete(v58);
}
else
{
v28 = atoi((const char *)v27);
}
v59 = std::string::replace(__s, (int)v26, 6u, "");
std::string::operator=(__s, v59);
sub_1002D2174(a3, v26, 6);
v60 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( v60 < 0 )
{
v61 = (std::string *)__s->__r_.__value_.__r.__words[0];
v60 = __s->__r_.__value_.__l.__size_;
}
else
{
v61 = __s;
}
if ( v60 >= 4 )
{
v62 = (char *)v61 + v60;
v63 = v61;
while ( 1 )
{
v64 = (char *)memchr(v63, 60, v60 - 3);
if ( !v64 )
break;
if ( *(_DWORD *)v64 == 1047080764 )
{
if ( v64 != v62 )
{
v77 = v64 - (char *)v61;
if ( v77 != -1 )
{
v78 = (float)v28 / 100.0;
v79 = std::string::replace(__s, (int)v77, 4u, "");
std::string::operator=(__s, v79);
sub_1002D2174(a3, v77, 4);
v47 = *(_QWORD *)(a3 + 632);
v48 = sub_1002D2298(v26, (unsigned int)(v77 - 1), 2);
*(float *)(v48 + 72) = v78;
goto LABEL_79;
}
}
goto LABEL_160;
}
v63 = (std::string *)(v64 + 1);
v60 = v62 - (char *)v63;
if ( v62 - (char *)v63 < 4 )
goto LABEL_160;
}
}
goto LABEL_160;
}
v24 = (std::string *)(v25 + 1);
v22 = v23 - (char *)v24;
}
while ( v23 - (char *)v24 >= 2 );
}
if ( (v4 & 0x80000000) != 0 )
{
v29 = (std::string *)__s->__r_.__value_.__r.__words[0];
v30 = __s->__r_.__value_.__l.__size_;
}
else
{
v29 = __s;
v30 = v4;
}
if ( v30 >= 2 )
{
v31 = (char *)v29 + v30;
v32 = v29;
do
{
v33 = (char *)memchr(v32, 60, v30 - 1);
if ( !v33 )
break;
if ( *(_WORD *)v33 == 29500 )
{
if ( v33 == v31 )
break;
v34 = v33 - (char *)v29;
if ( v34 == -1 )
break;
if ( (v4 & 0x80000000) != 0 )
v4 = __s->__r_.__value_.__l.__size_;
if ( v4 >= (unsigned __int64)((int)v34 + 6LL) )
{
v35 = std::string::basic_string(
&v110,
__s,
((v34 << 32) + 0x200000000LL) >> 32,
1u,
(std::allocator *)&__a);
if ( SHIBYTE(v110.__r_.__value_.__r.__words[2]) < 0 )
{
v67 = (void *)v110.__r_.__value_.__r.__words[0];
v36 = atoi(v110.__r_.__value_.__l.__data_);
operator delete(v67);
}
else
{
v36 = atoi((const char *)v35);
}
v68 = std::string::basic_string(
&v110,
__s,
((v34 << 32) + 0x300000000LL) >> 32,
2u,
(std::allocator *)&__a);
if ( SHIBYTE(v110.__r_.__value_.__r.__words[2]) < 0 )
{
v70 = (void *)v110.__r_.__value_.__r.__words[0];
v69 = atoi(v110.__r_.__value_.__l.__data_);
operator delete(v70);
}
else
{
v69 = atoi((const char *)v68);
}
v71 = std::string::replace(__s, (int)v34, 6u, "");
std::string::operator=(__s, v71);
sub_1002D2174(a3, v34, 6);
v72 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( v72 < 0 )
{
v73 = (std::string *)__s->__r_.__value_.__r.__words[0];
v72 = __s->__r_.__value_.__l.__size_;
}
else
{
v73 = __s;
}
if ( v72 >= 4 )
{
v74 = (char *)v73 + v72;
v75 = v73;
while ( 1 )
{
v76 = (char *)memchr(v75, 60, v72 - 3);
if ( !v76 )
break;
if ( *(_DWORD *)v76 == 1047736124 )
{
if ( v76 != v74 )
{
v80 = v76 - (char *)v73;
if ( v80 != -1 )
{
v81 = std::string::replace(__s, (int)v80, 4u, "");
std::string::operator=(__s, v81);
sub_1002D2174(a3, v80, 4);
v82 = (unsigned int)(v80 - 1);
v83 = *(_QWORD *)(a3 + 632);
v84 = sub_1002D2298(v34, v82, 3);
*(_DWORD *)(v84 + 80) = v36;
*(_DWORD *)(v84 + 84) = v69;
sub_1002E74E0(v83, v84);
goto LABEL_1;
}
}
goto LABEL_160;
}
v75 = (std::string *)(v76 + 1);
v72 = v74 - (char *)v75;
if ( v74 - (char *)v75 < 4 )
goto LABEL_160;
}
}
}
goto LABEL_160;
}
v32 = (std::string *)(v33 + 1);
v30 = v31 - (char *)v32;
}
while ( v31 - (char *)v32 >= 2 );
}
if ( (v4 & 0x80000000) != 0 )
{
v37 = (std::string *)__s->__r_.__value_.__r.__words[0];
v4 = __s->__r_.__value_.__l.__size_;
}
else
{
v37 = __s;
}
if ( v4 >= 2 )
{
v38 = (char *)v37 + v4;
v39 = v37;
do
{
v40 = (char *)memchr(v39, 60, v4 - 1);
if ( !v40 )
break;
if ( *(_WORD *)v40 == 25660 )
{
if ( v40 == v38 )
break;
v41 = v40 - (char *)v37;
if ( v41 == -1 )
break;
v42 = std::string::basic_string(
&v110,
__s,
((v41 << 32) + 0x200000000LL) >> 32,
3u,
(std::allocator *)&__a);
if ( SHIBYTE(v110.__r_.__value_.__r.__words[2]) < 0 )
{
v44 = (void *)v110.__r_.__value_.__r.__words[0];
v43 = atoi(v110.__r_.__value_.__l.__data_);
operator delete(v44);
}
else
{
v43 = atoi((const char *)v42);
}
v45 = (float)v43 / 100.0;
v46 = std::string::replace(__s, (int)v41, 6u, "");
std::string::operator=(__s, v46);
sub_1002D2174(a3, v41, 6);
v47 = *(_QWORD *)(a3 + 632);
v48 = sub_1002D2298(v41, 0xFFFFFFFFLL, 4);
*(float *)(v48 + 76) = v45;
goto LABEL_79;
}
v39 = (std::string *)(v40 + 1);
v4 = v38 - (char *)v39;
}
while ( v38 - (char *)v39 >= 2 );
}
LABEL_160:
result = *(__n128 *)&__s->__r_.__value_.__l.__data_;
*(_OWORD *)a1 = *(_OWORD *)&__s->__r_.__value_.__l.__data_;
a1[2] = __s->__r_.__value_.__r.__words[2];
__s->__r_.__value_.__l.__size_ = 0;
__s->__r_.__value_.__r.__words[2] = 0;
__s->__r_.__value_.__r.__words[0] = 0;
return result;
}