//
// DS_Dictionary::cleanStringWhiteSpace from 0x100158ec0 to 0x10015902b (363 bytes)
//
// 2 xrefs:
// > DS_Dictionary::rectFromString @ 0x100159761
// > DS_Dictionary::vec2FromString @ 0x100159d86
//
// This function is hookable on this platform (idp: pc, 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:25:05 +0000
//
std::string *__fastcall DS_Dictionary::cleanStringWhiteSpace(std::string *a1, __int64 a2, __int64 a3)
{
unsigned int v3; // ebx
std::string::pointer data; // r12
std::string::size_type size; // rbx
std::string::value_type *v6; // r14
std::string::size_type v7; // r13
__int64 v8; // rdi
__uint32_t v9; // eax
char *v10; // r12
char *v11; // r13
std::string::pointer v12; // rcx
char *v13; // rdx
__int64 v15; // rdi
__uint32_t v16; // eax
char *v17; // [rsp+8h] [rbp-38h]
if ( (*(_BYTE *)a3 & 1) != 0 )
{
sub_10001AD30(a1, *(const void **)(a3 + 16), *(_QWORD *)(a3 + 8));
}
else
{
a1->__r_.__value_.__r.__words[2] = *(_QWORD *)(a3 + 16);
*(_OWORD *)&a1->__r_.__value_.__l.0 = *(_OWORD *)a3;
}
v3 = (unsigned int)a1->__r_.__value_.__l.0;
data = a1->__r_.__value_.__s.__data_;
v17 = a1->__r_.__value_.__s.__data_;
if ( (v3 & 1) != 0 )
{
data = a1->__r_.__value_.__l.__data_;
size = a1->__r_.__value_.__l.__size_;
v6 = data;
if ( !size )
goto LABEL_14;
}
else
{
size = v3 >> 1;
v6 = a1->__r_.__value_.__s.__data_;
if ( !size )
goto LABEL_14;
}
v7 = size;
v6 = data;
do
{
v8 = (unsigned int)*v6;
if ( (int)v8 < 0 )
v9 = __maskrune(v8, 0x4000);
else
v9 = _DefaultRuneLocale.__runetype[(unsigned int)v8] & 0x4000;
if ( v9 )
break;
++v6;
--v7;
}
while ( v7 );
LABEL_14:
v10 = &data[size];
v11 = v6 + 1;
if ( v6 != v10 && v6 + 1 != v10 )
{
do
{
v15 = (unsigned int)*v11;
if ( (int)v15 < 0 )
v16 = __maskrune(v15, 0x4000);
else
v16 = _DefaultRuneLocale.__runetype[(unsigned int)v15] & 0x4000;
if ( !v16 )
*v6++ = *v11;
++v11;
}
while ( v11 != v10 );
}
v12 = a1->__r_.__value_.__l.__data_;
v13 = &v17[*(_BYTE *)&a1->__r_.__value_.__l.0 >> 1];
if ( (*(_BYTE *)&a1->__r_.__value_.__s.0 & 1) != 0 )
v13 = &v12[a1->__r_.__value_.__l.__size_];
else
v12 = v17;
std::string::erase(a1, v6 - v12, v13 - v6);
return a1;
}