//
// ThreadViewPopup::onAutoRefresh from 0x1400dd7c0 to 0x1400dd9de (542 bytes)
//
// 6 xrefs:
// > ThreadViewPopup::init @ 0x1400d97af
// > ThreadViewPopup::setPollInterval @ 0x1400db4c1
// > ThreadViewPopup::setPollInterval @ 0x1400db4e3
// > ThreadViewPopup::threadMessagesFinished @ 0x1400deff4
// > ThreadViewPopup::threadMessagesFinished @ 0x1400df012
// > ??> @ 0x1409149f0
//
// 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:29 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall ThreadViewPopup::onAutoRefresh(__int64 a1)
{
__int64 v2; // rcx
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // r9
int v6; // eax
void *v7; // rcx
void *v8; // [rsp+40h] [rbp-38h]
void *v9; // [rsp+40h] [rbp-38h]
void *v10; // [rsp+40h] [rbp-38h]
void *Block[2]; // [rsp+48h] [rbp-30h] BYREF
__int64 v12; // [rsp+58h] [rbp-20h]
unsigned __int64 v13; // [rsp+60h] [rbp-18h]
if ( *(_BYTE *)(a1 + 781) && !*(_BYTE *)(a1 + 782) && !*(_BYTE *)(a1 + 1104) && !*(_BYTE *)(a1 + 1176) )
{
v2 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v8 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v8);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v2 = *(_QWORD *)&qword_14090BFB0;
}
v3 = *(_QWORD *)(v2 + 1392);
if ( !v3
|| (v4 = _RTDynamicCast(
v3,
0,
&ThreadMessageDelegate `RTTI Type Descriptor',
&MessageThreadsPage `RTTI Type Descriptor',
0),
v2 = *(_QWORD *)&qword_14090BFB0,
v4) )
{
if ( !v2 )
{
v9 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v9);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v2 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v2 + 1392) = a1 + 672;
}
if ( !v2 )
{
v10 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v10);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v2 = *(_QWORD *)&qword_14090BFB0;
}
if ( *(_QWORD *)(v2 + 1392) == a1 + 672 )
{
*(_OWORD *)Block = 0;
v12 = 0;
v13 = 15;
LOBYTE(Block[0]) = 0;
v5 = *(_QWORD *)(a1 + 768);
v6 = v5 <= 0 ? -1 : *(_DWORD *)(a1 + 928);
GameLevelManager::getThreadMessages(v2, *(_DWORD *)(*(_QWORD *)(a1 + 744) + 56LL), 0, v5, v6, 0, (__int64)Block);
if ( v13 > 0xF )
{
v7 = Block[0];
if ( v13 + 1 >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
}
}
}