//
// sub_1009A3A20 from 0x1009a3a20 to 0x1009a3b0f (239 bytes)
//
// 2 xrefs:
// > AccountReviewPopup::FLAlert_Clicked @ 0x1009a3382
// > AccountReviewPopup::FLAlert_Clicked @ 0x1009a3530
//
// 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 12:39:18 +0000
//
char __fastcall sub_1009A3A20(__int64 a1, signed int a2)
{
__int64 v2; // rax
char result; // al
__int64 v4; // rax
__int64 v5; // rcx
unsigned int v6; // edx
int v7; // esi
__int64 v8; // r14
__int64 v9; // rbx
__int64 v10; // rax
int v11; // edx
if ( *(_DWORD *)(a1 + 1236) != 1 )
return 0;
v2 = *(_QWORD *)(a1 + 1312);
if ( v2 == 0 || a2 < 0 )
return 0;
if ( (int)sub_1007FEF90(v2) <= a2 )
return 0;
v4 = sub_1007FEFE0(*(_QWORD *)(a1 + 1312), a2);
if ( *(_DWORD *)(v4 + 60) != 3 || *(int *)(v4 + 164) <= 0 || *(_BYTE *)(v4 + 172) != 1 )
return 0;
v5 = v4;
v6 = *(_DWORD *)(v4 + 56);
result = 0;
if ( v6 <= 7 )
{
v7 = 152;
if ( _bittest(&v7, v6) )
{
v8 = v5;
*(_QWORD *)(GameLevelManager::sharedState() + 1248) = a1 + 784;
v9 = v8;
LODWORD(v8) = *(_DWORD *)(v8 + 56);
v10 = GameLevelManager::sharedState();
if ( (_DWORD)v8 == 4 )
{
GameLevelManager::deleteAccountComment(v10, *(_DWORD *)(v9 + 168), *(_DWORD *)(v9 + 164));
}
else
{
v11 = 6;
if ( *(_DWORD *)(v9 + 56) != 7 )
v11 = 0;
GameLevelManager::deleteComment(v10, *(_DWORD *)(v9 + 164), v11, *(_DWORD *)(v9 + 168));
}
*(_BYTE *)(v9 + 172) = 0;
return 1;
}
}
return result;
}