//
// sub_9B9714 from 0x9b9714 to 0x9b994c (568 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::addGuideArt @ 0x9b9a7c
// > GJBaseGameLayer::addGuideArt @ 0x9b9c00
// > GJBaseGameLayer::addGuideArt @ 0x9b9cec
// > GJBaseGameLayer::addGuideArt @ 0x9b9e38
// > GJBaseGameLayer::addGuideArt @ 0x9b9f24
//
// 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:58:24 +0000
//
__int64 *__usercall sub_9B9714@(char *a1@, char *a2@, char *a3@, __int64 *a4@)
{
__int64 v8; // x1
size_t v9; // x0
size_t v10; // x0
size_t v11; // x0
size_t i; // x0
unsigned __int8 v13; // w3
char *v14; // x26
unsigned __int64 v15; // x1
unsigned __int8 *v16; // x2
unsigned __int64 v17; // x3
size_t v19; // x20
size_t v20; // x2
char *v21; // x3
size_t v22; // x4
__int64 v23; // x0
char *v24; // x19
__int64 v25; // x0
__int64 v26; // [xsp+58h] [xbp+58h] BYREF
size_t v27; // [xsp+60h] [xbp+60h]
void *v28; // [xsp+68h] [xbp+68h]
__int64 v29; // [xsp+70h] [xbp+70h] BYREF
size_t v30; // [xsp+78h] [xbp+78h]
void *v31; // [xsp+80h] [xbp+80h]
__int64 v32; // [xsp+88h] [xbp+88h]
a4[1] = 0;
v8 = _stack_chk_guard;
a4[2] = 0;
*a4 = 0;
v32 = v8;
v9 = strlen(a1);
std::string::__init(a4, a1, v9);
v26 = 0;
v27 = 0;
v28 = nullptr;
v10 = strlen(a2);
std::string::__init(&v26, a2, v10);
v29 = 0;
v30 = 0;
v31 = nullptr;
v11 = strlen(a3);
std::string::__init(&v29, a3, v11);
for ( i = 0; ; i = v23 + v19 )
{
if ( (*(_BYTE *)a4 & 1) != 0 )
{
v13 = v26;
v14 = (char *)a4[2];
v15 = a4[1];
if ( (v26 & 1) != 0 )
goto LABEL_4;
}
else
{
v13 = v26;
v14 = (char *)a4 + 1;
v15 = *(_BYTE *)a4 >> 1;
if ( (v26 & 1) != 0 )
{
LABEL_4:
v16 = (unsigned __int8 *)v28;
v17 = v27;
if ( i > v15 )
goto LABEL_5;
goto LABEL_12;
}
}
v17 = v13 >> 1;
v16 = (unsigned __int8 *)&v26 + 1;
if ( i > v15 )
goto LABEL_5;
LABEL_12:
if ( v15 - i < v17 )
goto LABEL_5;
v19 = i;
if ( v17 )
break;
LABEL_14:
if ( v19 == -1 )
goto LABEL_5;
v20 = (unsigned __int8)v26 >> 1;
if ( (v26 & 1) != 0 )
v20 = v27;
if ( (v29 & 1) != 0 )
{
v21 = (char *)v31;
v22 = v30;
}
else
{
v22 = (unsigned __int8)v29 >> 1;
v21 = (char *)&v29 + 1;
}
std::string::replace(a4, v19, v20, v21, v22);
v23 = (unsigned __int8)v29 >> 1;
if ( (v29 & 1) != 0 )
v23 = v30;
}
v24 = &v14[v15];
v25 = std::__search(
(__int64)&v14[i],
(__int64)&v14[v15],
v16,
&v16[v17],
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq);
if ( v24 != (char *)v25 )
{
v19 = v25 - (_QWORD)v14;
goto LABEL_14;
}
LABEL_5:
if ( (v29 & 1) != 0 )
operator delete(v31);
if ( (v26 & 1) != 0 )
operator delete(v28);
return a4;
}