//
// sub_1007395BC from 0x1007395bc to 0x10073971c (352 bytes)
//
// 6 xrefs:
// > sub_100656870 @ 0x1006568a8
// > sub_10065AD98 @ 0x10065add4
// > sub_1006FE2F4 @ 0x1006fe328
// > sub_10071FA68 @ 0x10071fabc
// > sub_10071FA68 @ 0x100720008
// > sub_10072E264 @ 0x10072e2c4
//
// 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:13:16 +0000
//
__int64 __fastcall sub_1007395BC(
char *__s,
int __c,
int a3,
__int64 (__fastcall *a4)(char *, __int64, __int64),
__int64 a5)
{
char *v9; // x23
unsigned __int8 v10; // w8
__uint32_t v11; // w0
int v12; // t1
char *v13; // x0
char *v14; // x24
size_t v15; // x27
char *v16; // x0
__int64 v17; // x1
__int64 v18; // x0
__uint32_t v19; // w0
__int64 result; // x0
v9 = __s;
if ( __s )
{
while ( 1 )
{
if ( a3 )
{
v10 = *v9;
if ( *v9 )
{
do
{
if ( (char)v10 < 0 )
v11 = __maskrune(v10, 0x4000u);
else
v11 = _DefaultRuneLocale.__runetype[v10] & 0x4000;
if ( !v11 )
break;
v12 = (unsigned __int8)*++v9;
v10 = v12;
}
while ( v12 );
}
}
v13 = strchr(v9, __c);
v14 = v13;
if ( v13 == v9 || !*v9 )
{
v16 = nullptr;
v17 = 0;
}
else
{
if ( v13 )
v15 = (size_t)(v13 - 1);
else
v15 = (size_t)&v9[strlen(v9) - 1];
if ( a3 )
{
++v15;
do
{
v18 = *(unsigned __int8 *)(v15 - 1);
if ( *(char *)(v15 - 1) < 0 )
v19 = __maskrune(v18, 0x4000u);
else
v19 = _DefaultRuneLocale.__runetype[v18] & 0x4000;
--v15;
}
while ( v19 );
}
v17 = (unsigned int)(1 - (_DWORD)v9 + v15);
v16 = v9;
}
result = a4(v16, v17, a5);
if ( (int)result < 1 )
break;
v9 = v14 + 1;
if ( !v14 )
return 1;
}
}
else
{
sub_100706FB0(14, 119, 115, (__int64)"conf_mod.c", 567);
return 0;
}
return result;
}