//
// MessagesProfilePage::isCorrect from 0x8f2904 to 0x8f2a24 (288 bytes)
//
// 4 xrefs:
// > MessagesProfilePage::loadMessagesFailed @ 0x8f2a38
// > MessagesProfilePage::loadMessagesFinished @ 0x8f2d20
// > MessagesProfilePage::setupPageInfo @ 0x8f3f5c
// > ??> @ 0x37578
//
// 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
//
bool MessagesProfilePage::isCorrect(MessagesProfilePage *a1, const char *a2)
{
bool v3; // w23
_DWORD *v4; // x21
unsigned __int64 v5; // x22
stl::StringData::Internal *m_data; // x0
unsigned __int64 v7; // x19
size_t v8; // x2
__int64 v9; // x19
char *v10; // x0
unsigned int *v12; // x21
int v13; // w1
void *v14; // [xsp+50h] [xbp+50h] BYREF
v3 = 0;
sub_D153B8((int)&v14, (char *)a2);
v4 = v14;
v5 = *((_QWORD *)v14 - 3);
m_data = a1->m_messageKey.m_data.m_data;
v7 = *((_QWORD *)m_data - 3);
if ( v5 > v7 )
v8 = *((_QWORD *)m_data - 3);
else
v8 = *((_QWORD *)v14 - 3);
if ( !memcmp(m_data, v14, v8) && (v9 = v7 - v5, v9 <= 0x7FFFFFFF) && v9 >= (__int64)0xFFFFFFFF80000000LL )
{
v10 = (char *)(v4 - 6);
v3 = (_DWORD)v9 == 0;
if ( v4 - 6 == (_DWORD *)&qword_124B6B0 )
return v3;
}
else
{
v10 = (char *)(v4 - 6);
if ( v4 - 6 == (_DWORD *)&qword_124B6B0 )
return v3;
}
if ( &pthread_create )
{
v12 = v4 - 2;
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *(v4 - 2);
*(v4 - 2) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v10);
return v3;
}