//
// DS_Dictionary::cleanStringWhiteSpace from 0x5fe414 to 0x5fe520 (268 bytes)
//
// 2 xrefs:
// > DS_Dictionary::rectFromString @ 0x5fe54e
// > DS_Dictionary::vec2FromString @ 0x5fe932
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall DS_Dictionary::cleanStringWhiteSpace(int a1)
{
unsigned __int8 *v2; // r11
int v3; // r8
unsigned __int8 *v4; // r9
int i; // r10
unsigned __int8 *v6; // r5
int v7; // r3
unsigned __int8 *v8; // r4
unsigned __int8 *v9; // r3
unsigned __int8 *v10; // r4
int v11; // r0
int v12; // r3
int (**v14)(int); // [sp+4h] [bp-10h] BYREF
int (**v15)(int); // [sp+8h] [bp-Ch] BYREF
sub_775C20(a1);
v2 = (unsigned __int8 *)sub_7756C4(a1);
v14 = &isspace;
v15 = &isspace;
v3 = sub_7756FC(a1);
v4 = (unsigned __int8 *)v3;
for ( i = (v3 - (int)v2) >> 2; i > 0; --i )
{
if ( __gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v15,
v2) )
{
goto LABEL_19;
}
v6 = v2 + 1;
if ( __gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v15,
v2 + 1)
|| (v6 = v2 + 2,
__gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v15,
v2 + 2))
|| (v6 = v2 + 3,
__gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v15,
v2 + 3)) )
{
v9 = v6;
goto LABEL_21;
}
v2 += 4;
}
v7 = v3 - (_DWORD)v2;
v8 = v2;
if ( v3 - (_DWORD)v2 != 2 )
{
if ( v7 != 3 )
{
if ( v7 != 1 )
goto LABEL_27;
LABEL_16:
if ( !__gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v15,
v8) )
goto LABEL_27;
goto LABEL_20;
}
if ( __gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v15,
v2) )
{
LABEL_19:
v9 = v2;
goto LABEL_21;
}
v8 = v2 + 1;
}
if ( !__gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v15,
v8) )
{
++v8;
goto LABEL_16;
}
LABEL_20:
v9 = v8;
LABEL_21:
if ( v9 != (unsigned __int8 *)v3 )
{
v10 = v9 + 1;
v4 = v9;
while ( v10 != (unsigned __int8 *)v3 )
{
if ( !__gnu_cxx::__ops::_Iter_pred::operator()<__gnu_cxx::__normal_iterator>(
(int (__fastcall **)(_DWORD))&v14,
v10) )
*v4++ = *v10;
++v10;
}
}
LABEL_27:
v11 = sub_7756FC(a1);
sub_775210(a1, v4, v11, v12);
return a1;
}