//
// ThreadViewPopup::requestMessages from 0x1400da6d0 to 0x1400da85c (396 bytes)
//
// 6 xrefs:
// > ThreadViewPopup::init @ 0x1400da677
// > ThreadViewPopup::onRefresh @ 0x1400db740
// > ThreadViewPopup::onLoadEarlier @ 0x1400db8b2
// > ThreadViewPopup::onLoadNewer @ 0x1400db8d7
// > ThreadViewPopup::jumpToLatest @ 0x1400dbcd5
// > ??> @ 0x140914870
//
// 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:28 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall ThreadViewPopup::requestMessages(__int64 a1, int a2, __int64 a3)
{
int v3; // esi
int v6; // edi
int v7; // ecx
char ThreadMessages; // di
void *v9; // r8
__int64 v11; // rbx
__int64 v12; // rax
void *v13; // [rsp+40h] [rbp-48h]
void *v14; // [rsp+40h] [rbp-48h]
void *Block[2]; // [rsp+48h] [rbp-40h] BYREF
__int64 v16; // [rsp+58h] [rbp-30h]
unsigned __int64 v17; // [rsp+60h] [rbp-28h]
v3 = a3;
*(_OWORD *)Block = 0;
v16 = 0;
v17 = 15;
LOBYTE(Block[0]) = 0;
if ( a3 <= 0 )
v6 = -1;
else
v6 = *(_DWORD *)(a1 + 928);
v7 = qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v13 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v13);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v7 = qword_14090BFB0;
}
ThreadMessages = GameLevelManager::getThreadMessages(
v7,
*(_DWORD *)(*(_QWORD *)(a1 + 744) + 56LL),
a2,
v3,
v6,
0,
(__int64)Block);
if ( v17 > 0xF )
{
v9 = Block[0];
if ( v17 + 1 >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v9);
}
if ( !ThreadMessages )
return 0;
v11 = a1 + 672;
v12 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v14 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v14);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v12 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v12 + 1392) = v11;
return 1;
}