//
// sub_A00A8C from 0xa00a8c to 0xa00d78 (748 bytes)
//
// 3 xrefs:
// > timerItemFromString @ 0xa00e08
// > timerItemFromString @ 0xa00f9c
// > GJEffectManager::loadPersistentStateString @ 0xa12b7c
//
// 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 12:59:19 +0000
//
__int64 __fastcall sub_A00A8C(unsigned __int8 *a1, char *a2, __int64 *a3)
{
int v6; // w26
unsigned __int8 *v7; // x23
__int64 v8; // x24
size_t v9; // x0
__int64 v10; // x23
unsigned __int64 v11; // x27
int v12; // w28
size_t v13; // x1
__int64 *v14; // x0
char v15; // w1
size_t v16; // x3
unsigned __int8 *v17; // x23
unsigned __int64 v18; // x26
size_t v19; // x0
unsigned __int8 *v20; // x4
unsigned __int8 *v21; // x26
char *v22; // x0
int v23; // w3
char *v24; // x1
int v26; // w20
size_t v27; // x0
char *v28; // x0
__int64 v29; // x4
unsigned __int8 *v30; // x3
int v31; // w2
char *v32; // x20
__int64 v33; // [xsp+60h] [xbp+60h] BYREF
size_t v34; // [xsp+68h] [xbp+68h]
void *v35; // [xsp+70h] [xbp+70h]
v6 = *a1;
if ( (v6 & 1) != 0 )
{
v7 = *((unsigned __int8 **)a1 + 2);
v8 = *((_QWORD *)a1 + 1);
v9 = strlen(a2);
if ( !v9 || !v8 || (v29 = (__int64)&v7[v8], v28 = &a2[v9], v7 == &v7[v8]) )
{
LABEL_4:
v10 = -1;
goto LABEL_5;
}
}
else
{
v26 = v6 >> 1;
v27 = strlen(a2);
v8 = v6 >> 1;
if ( !v27 || !v26 )
goto LABEL_4;
v7 = a1 + 1;
v28 = &a2[v27];
v29 = (__int64)&a1[v26 + 1];
if ( a1 + 1 == (unsigned __int8 *)v29 )
{
v10 = -1;
goto LABEL_57;
}
}
v30 = v7;
while ( a2 == v28 )
{
LABEL_49:
if ( (unsigned __int8 *)v29 == ++v30 )
{
v10 = -1;
goto LABEL_54;
}
}
v31 = *v30;
if ( (unsigned __int8)*a2 != v31 )
{
v32 = a2;
while ( v28 != ++v32 )
{
if ( (unsigned __int8)*v32 == v31 )
goto LABEL_53;
}
goto LABEL_49;
}
LABEL_53:
v10 = v30 - v7;
LABEL_54:
v26 = v6 >> 1;
if ( (v6 & 1) != 0 )
{
v8 = *((_QWORD *)a1 + 1);
goto LABEL_5;
}
LABEL_57:
v8 = v26;
LABEL_5:
v11 = 0;
LABEL_6:
while ( 2 )
{
std::string::basic_string(&v33, (__int64)a1, v11, v10 - v11);
v12 = v33 & 1;
v13 = (unsigned __int8)v33 >> 1;
if ( (v33 & 1) != 0 )
v13 = v34;
if ( !v13 && v11 == v8 )
{
LABEL_16:
if ( v10 == -1 )
break;
goto LABEL_17;
}
v14 = (__int64 *)a3[1];
if ( v14 != (__int64 *)a3[2] )
{
if ( v14 )
{
*v14 = 0;
v14[1] = 0;
v15 = v33;
v14[2] = 0;
if ( (v15 & 1) != 0 )
{
std::string::__init(v14, v35, v34);
}
else
{
v16 = v34;
*v14 = v33;
v14[1] = v16;
v14[2] = (__int64)v35;
}
v14 = (__int64 *)a3[1];
v12 = v33 & 1;
}
a3[1] = (__int64)(v14 + 3);
goto LABEL_16;
}
std::vector::__push_back_slow_path(a3, &v33);
v12 = v33 & 1;
if ( v10 != -1 )
{
LABEL_17:
v11 = v10 + 1;
if ( (*a1 & 1) != 0 )
{
v17 = *((unsigned __int8 **)a1 + 2);
v18 = *((_QWORD *)a1 + 1);
}
else
{
v17 = a1 + 1;
v18 = *a1 >> 1;
}
v19 = strlen(a2);
if ( v19 )
{
if ( v11 < v18 )
{
v20 = &v17[v11];
v21 = &v17[v18];
v22 = &a2[v19];
if ( &v17[v11] != v21 )
{
while ( 1 )
{
if ( a2 != v22 )
{
v23 = *v20;
if ( (unsigned __int8)*a2 == v23 )
{
LABEL_33:
v10 = v20 - v17;
if ( v12 )
goto LABEL_23;
goto LABEL_6;
}
v24 = a2;
while ( v22 != ++v24 )
{
if ( (unsigned __int8)*v24 == v23 )
goto LABEL_33;
}
}
if ( v21 == ++v20 )
{
v10 = -1;
goto LABEL_22;
}
}
}
}
}
v10 = -1;
LABEL_22:
if ( v12 )
LABEL_23:
operator delete(v35);
continue;
}
break;
}
if ( v12 )
operator delete(v35);
return _stack_chk_guard;
}