//
// ThreadViewPopup::openAt from 0x1400dbaf0 to 0x1400dbcad (445 bytes)
//
// 3 xrefs:
// > ThreadViewPopup::init @ 0x1400da65e
// > ThreadViewPopup::onJumpToMessage @ 0x1400dbadb
// > ??> @ 0x1409148e8
//
// 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::openAt(__int64 a1, __int64 a2)
{
int v4; // ecx
char ThreadMessages; // si
void *v6; // r8
__int64 v7; // rax
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 ( *(_QWORD *)(a1 + 1040) || *(_BYTE *)(a1 + 782) || a2 <= 0 )
return 0;
*(_OWORD *)Block = 0;
v12 = 0;
v13 = 15;
LOBYTE(Block[0]) = 0;
v4 = qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v9 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v9);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v4 = qword_14090BFB0;
}
ThreadMessages = GameLevelManager::getThreadMessages(
v4,
*(_DWORD *)(*(_QWORD *)(a1 + 744) + 56LL),
0,
0,
-1,
a2,
(__int64)Block);
if ( v13 > 0xF )
{
v6 = Block[0];
if ( v13 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
if ( !ThreadMessages )
return 0;
v7 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v10 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v10);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v7 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v7 + 1392) = a1 + 672;
ThreadViewPopup::exitSearch(a1, 0);
*(_QWORD *)(a1 + 1184) = a2;
*(_QWORD *)(a1 + 1192) = a2;
ThreadViewPopup::showLoading(a1);
return 1;
}