//
// AutoBackupOptionsPopup::refreshStats from 0x1400ce400 to 0x1400ce640 (576 bytes)
//
// 3 xrefs:
// > AutoBackupOptionsPopup::init @ 0x1400cdee2
// > AutoBackupOptionsPopup::FLAlert_Clicked @ 0x1400cf43e
// > ??> @ 0x140914138
//
// 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 11:26:24 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall AutoBackupOptionsPopup::refreshStats(__int64 a1)
{
__int128 *p_Src; // rax
__int128 *v3; // rax
void *v4; // rcx
_QWORD *v5; // rax
_QWORD *v6; // rdx
char *v7; // r8
char *v8; // rdi
char *v9; // rbx
char *v10; // rax
void *v11[2]; // [rsp+38h] [rbp-11h] BYREF
__int64 v12; // [rsp+48h] [rbp-1h]
__int128 Src; // [rsp+50h] [rbp+7h] BYREF
__int64 v14; // [rsp+60h] [rbp+17h]
unsigned __int64 v15; // [rsp+68h] [rbp+1Fh]
void *Block[2]; // [rsp+70h] [rbp+27h] BYREF
__m128i si128; // [rsp+80h] [rbp+37h]
*(_OWORD *)v11 = 0;
v12 = 0;
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
AutoSaveSettingsLayer::getBackupDirectory(&Src);
if ( v14 )
{
p_Src = &Src;
if ( v15 > 0xF )
p_Src = (__int128 *)Src;
if ( *((_BYTE *)p_Src + v14 - 1) != 47 )
{
v3 = &Src;
if ( v15 > 0xF )
v3 = (__int128 *)Src;
if ( *((_BYTE *)v3 + v14 - 1) != 92 )
sub_140044D80(&Src, "/", 1u);
}
}
sub_1400CCDF0((const void **)&Src, v11, (size_t *)Block);
sub_14003D310((__int64)&Src);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v4 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v4 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v4 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v4);
}
v5 = sub_1400CCB90(Block, (__int64 *)v11);
v6 = v5;
if ( v5[3] > 0xFu )
v6 = (_QWORD *)*v5;
(**(void (__fastcall ***)(__int64, _QWORD *))(*(_QWORD *)(a1 + 1016) + 360LL))(*(_QWORD *)(a1 + 1016) + 360LL, v6);
sub_14003D310((__int64)Block);
v7 = (char *)v11[0];
if ( v11[0] )
{
v8 = (char *)v11[1];
if ( v11[0] != v11[1] )
{
v9 = (char *)v11[0] + 96;
do
{
sub_14003D310((__int64)(v9 + 32));
sub_14003D310((__int64)v9);
sub_14003D310((__int64)(v9 - 32));
sub_14003D310((__int64)(v9 - 64));
sub_14003D310((__int64)(v9 - 96));
v9 += 168;
}
while ( v9 - 96 != v8 );
v7 = (char *)v11[0];
}
v10 = v7;
if ( (unsigned __int64)(168 * ((v12 - (__int64)v7) / 168)) >= 0x1000 )
{
v7 = *((char **)v7 - 1);
if ( (unsigned __int64)(v10 - v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
}