//
// GJGarageLayer::onArrow from 0x14037e740 to 0x14037e848 (264 bytes)
//
// 2 xrefs:
// > GJGarageLayer::setupIconSelect @ 0x14037e4d6
// > ??> @ 0x140922844
//
// 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:31:04 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall GJGarageLayer::onArrow(__int64 a1, __int64 a2)
{
__int64 v3; // rcx
int v4; // ebp
int v5; // ebx
_DWORD *v6; // r8
int v7; // r9d
int v8; // edx
int v9; // edx
void *v11; // [rsp+30h] [rbp+8h]
void *v12; // [rsp+30h] [rbp+8h]
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
if ( !qword_14090BFD0 )
{
v11 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
if ( !qword_14090BFD0 )
{
v12 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
}
}
v5 = GameManager::countForType(v3, *(_DWORD *)(a1 + 516));
v6 = (_DWORD *)sub_14010ECC0((__int64 *)(a1 + 520), (int *)(a1 + 516));
v7 = v5 / 36;
v8 = 1;
if ( v4 != 1 )
v8 = -1;
v9 = *v6 + v8;
if ( v9 >= 0 )
{
if ( v9 > v7 )
v9 = 0;
v7 = v9;
}
return GJGarageLayer::setupPage(a1, (unsigned int)v7, *(unsigned int *)(a1 + 516));
}