//
// AutoBackupPopup::textChanged from 0x100980e00 to 0x100980fc0 (448 bytes)
//
// 2 xrefs:
// > sub_100981010 @ 0x10098101c
// > ??> @ 0x100bd3088
//
// 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:39:00 +0000
//
void __fastcall AutoBackupPopup::textChanged(__int64 a1, __int64 a2)
{
__int64 v3; // rsi
__int64 v5; // rdi
__int64 v6; // rax
std::string::pointer data; // r14
std::string::size_type i; // r15
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v9; // al
std::string::pointer v10; // rcx
char v11; // al
std::string::pointer v12; // rcx
char v13; // r15
size_t size; // rdx
unsigned int v15; // eax
__int128 v16; // [rsp+8h] [rbp-48h] BYREF
void *v17; // [rsp+18h] [rbp-38h]
std::string __s1[2]; // [rsp+20h] [rbp-30h] BYREF
v3 = *(_QWORD *)(a1 + 920);
if ( v3 != a2 )
return;
CCTextInputNode::getString(&v16, v3);
v5 = *(_QWORD *)(a1 + 928);
if ( v5 )
{
if ( (v16 & 1) != 0 )
v6 = *((_QWORD *)&v16 + 1);
else
v6 = (unsigned __int8)v16 >> 1;
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v5 + 344LL))(v5, v6 != 0);
}
if ( (v16 & 1) != 0 )
{
sub_10001AD30(__s1, v17, *((unsigned __int64 *)&v16 + 1));
}
else
{
__s1[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v17;
*(_OWORD *)&__s1[0].__r_.__value_.__l.0 = v16;
}
data = __s1[0].__r_.__value_.__s.__data_;
for ( i = 0; ; ++i )
{
v9 = __s1[0].__r_.__value_.__s.0;
if ( (*(_BYTE *)&__s1[0].__r_.__value_.__s.0 & 1) != 0 )
break;
if ( i >= *(_BYTE *)&__s1[0].__r_.__value_.__l.0 >> 1 )
{
if ( *(_BYTE *)&__s1[0].__r_.__value_.__s.0 < 4u )
{
*(_WORD *)&__s1[0].__r_.__value_.__l.0 = 0;
v9 = 0;
}
goto LABEL_24;
}
LABEL_16:
v10 = __s1[0].__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__s1[0].__r_.__value_.__s.0 & 1) != 0 )
v10 = __s1[0].__r_.__value_.__l.__data_;
v11 = __tolower((unsigned __int8)v10[i]);
v12 = __s1[0].__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__s1[0].__r_.__value_.__s.0 & 1) != 0 )
v12 = __s1[0].__r_.__value_.__l.__data_;
v12[i] = v11;
}
if ( i < __s1[0].__r_.__value_.__l.__size_ )
goto LABEL_16;
if ( SLODWORD(__s1[0].__r_.__value_.__r.__words[1]) < 2 )
{
*__s1[0].__r_.__value_.__l.__data_ = 0;
__s1[0].__r_.__value_.__l.__size_ = 0;
v9 = __s1[0].__r_.__value_.__s.0;
}
LABEL_24:
v13 = *(_BYTE *)&v9 & 1;
if ( (*(_BYTE *)&v9 & 1) != 0 )
{
size = __s1[0].__r_.__value_.__l.__size_;
v15 = *(unsigned __int8 *)(a1 + 872);
if ( (v15 & 1) == 0 )
goto LABEL_26;
LABEL_29:
if ( size == *(_QWORD *)(a1 + 880) )
goto LABEL_30;
LABEL_36:
std::string::operator=((std::string *)(a1 + 872), __s1);
sub_10097E2F0(a1);
v13 = *(_BYTE *)&__s1[0].__r_.__value_.__s.0 & 1;
}
else
{
size = *(unsigned __int8 *)&v9 >> 1;
v15 = *(unsigned __int8 *)(a1 + 872);
if ( (v15 & 1) != 0 )
goto LABEL_29;
LABEL_26:
if ( size != v15 >> 1 )
goto LABEL_36;
LABEL_30:
if ( v13 )
data = __s1[0].__r_.__value_.__l.__data_;
if ( (v15 & 1) != 0 )
{
if ( memcmp(data, *(const void **)(a1 + 888), size) )
goto LABEL_36;
}
else if ( memcmp(data, (const void *)(a1 + 873), size) )
{
goto LABEL_36;
}
}
if ( v13 )
operator delete(__s1[0].__r_.__value_.__l.__data_);
if ( (v16 & 1) != 0 )
operator delete(v17);
}