//
// CommentCell::onLike from 0x1401548c0 to 0x140154a90 (464 bytes)
//
// 2 xrefs:
// > CommentCell::loadFromComment @ 0x140154003
// > ??> @ 0x1409178ac
//
// 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:27:19 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall CommentCell::onLike(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rcx
__int64 result; // rax
unsigned int v6; // ebx
unsigned int v7; // esi
__int64 v8; // rcx
__int64 v9; // rcx
unsigned int *v10; // rdx
__int64 v11; // r9
_QWORD *v12; // rax
void *v13; // [rsp+40h] [rbp+18h]
void *v14; // [rsp+40h] [rbp+18h]
v2 = GJAccountManager::sharedState(a1);
if ( *(_DWORD *)(v2 + 360) - *(_DWORD *)(v2 + 364) <= 0 )
{
GJAccountManager::sharedState(v3);
return GJAccountManager::showAccountNeededAlert(v4, "like comments");
}
result = *(_QWORD *)(a1 + 592);
if ( !result )
goto LABEL_10;
if ( *(_DWORD *)(result + 460) != 3 )
{
if ( *(_DWORD *)(result + 460) == 4 )
{
v6 = 7;
goto LABEL_13;
}
if ( *(_DWORD *)(result + 460) == 5 )
{
v6 = 8;
goto LABEL_13;
}
LABEL_10:
if ( *(_BYTE *)(a1 + 600) )
{
v6 = 3;
v7 = *(_DWORD *)(result + 404);
goto LABEL_14;
}
v6 = 2;
LABEL_13:
v7 = *(_DWORD *)(result + 396);
LABEL_14:
if ( !result )
return result;
goto LABEL_15;
}
v6 = 6;
v7 = 0;
LABEL_15:
v8 = *(_QWORD *)&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);
v8 = *(_QWORD *)&qword_14090BFB0;
}
result = GameLevelManager::hasLikedItemFullCheck(v8, v6, *(unsigned int *)(*(_QWORD *)(a1 + 592) + 384LL), v7);
if ( !(_BYTE)result )
{
v9 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v14 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v9 = qword_14090BFD0;
}
v10 = *(unsigned int **)(a1 + 592);
result = (unsigned int)(*(_DWORD *)(v9 + 692) - *(_DWORD *)(v9 + 696));
if ( v10[97] != (_DWORD)result )
{
if ( !v10[101]
|| (v11 = GJAccountManager::sharedState(v9),
v10 = *(unsigned int **)(a1 + 592),
result = (unsigned int)(*(_DWORD *)(v11 + 360) - *(_DWORD *)(v11 + 364)),
v10[101] != (_DWORD)result) )
{
v12 = (_QWORD *)LikeItemLayer::create(v6, v10[96], v7);
v12[85] = a1 + 560;
return (*(__int64 (__fastcall **)(_QWORD *))(*v12 + 1064LL))(v12);
}
}
}
return result;
}