//
// ThreadOptionsPopup::onPinRow from 0x1400f4e20 to 0x1400f4fb8 (408 bytes)
//
// 2 xrefs:
// > ThreadOptionsPopup::init @ 0x1400f4a30
// > ??> @ 0x1409151e8
//
// 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:38 +0000
//
void __fastcall ThreadOptionsPopup::onPinRow(__int64 a1)
{
__int16 *v2; // rdx
size_t v3; // r8
__int64 v4; // rcx
char updated; // bl
void *v6; // r8
__int64 v7; // rax
void *v8; // [rsp+30h] [rbp-38h]
void *v9; // [rsp+30h] [rbp-38h]
void *Block[2]; // [rsp+38h] [rbp-30h] BYREF
__int64 v11; // [rsp+48h] [rbp-20h]
unsigned __int64 v12; // [rsp+50h] [rbp-18h]
v2 = &word_14070D060;
if ( *(_BYTE *)(*(_QWORD *)(a1 + 1016) + 330LL) )
v2 = (__int16 *)"0";
*(_OWORD *)Block = 0;
v11 = 0;
v12 = 0;
v3 = -1;
do
++v3;
while ( *((_BYTE *)v2 + v3) );
sub_14003D230(Block, v2, v3);
v4 = *(_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);
v4 = *(_QWORD *)&qword_14090BFB0;
}
updated = GameLevelManager::updateThread(v4, *(unsigned int *)(*(_QWORD *)(a1 + 1016) + 56LL), 15, Block);
if ( v12 > 0xF )
{
v6 = Block[0];
if ( v12 + 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 ( updated )
{
v7 = *(_QWORD *)&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);
v7 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v7 + 1392) = a1 + 1000;
*(_DWORD *)(a1 + 1032) = 15;
}
}