//
// GJGarageLayer::onArrow from 0x8c0b7c to 0x8c0c70 (244 bytes)
//
// 4 xrefs:
// > ??> @ 0xd41b8
// > GJGarageLayer::setupIconSelect @ 0x8c16d8
// > GJGarageLayer::setupIconSelect @ 0x8c17a0
// > ??> @ 0x15464e0
//
// This function is hookable on this platform (idp: arm, 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:56:30 +0000
//
__int64 __fastcall GJGarageLayer::onArrow(GJGarageLayer *this, cocos2d::CCObject *a2)
{
GameManager *v3; // x0
int v4; // w22
_DWORD *v5; // x0
GameManager *active; // x0
__int64 v7; // x0
int v8; // w21
int v9; // w1
int v10; // w1
_DWORD *v12; // [xsp+40h] [xbp+40h] BYREF
v3 = (GameManager *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
v4 = (int)v3;
v5 = (_DWORD *)GameManager::sharedState(v3);
active = (GameManager *)GameManager::activeIconForType(v5, *((_DWORD *)this + 129));
v7 = GameManager::sharedState(active);
v8 = GameManager::countForType(v7, *((_DWORD *)this + 129));
v12 = (_DWORD *)((char *)this + 516);
v9 = *(_DWORD *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)this + 65,
(int *)this + 129,
(__int64)&unk_114CA08,
&v12)
+ 32);
if ( v4 != 1 )
{
v10 = v9 - 1;
if ( (v10 & 0x80000000) == 0 )
goto LABEL_3;
LABEL_7:
v10 = v8 / 36;
goto LABEL_5;
}
v10 = v9 + 1;
if ( v10 < 0 )
goto LABEL_7;
LABEL_3:
if ( v10 > v8 / 36 )
v10 = 0;
LABEL_5:
GJGarageLayer::setupPage((__int64)this, v10, *((_DWORD *)this + 129));
return _stack_chk_guard;
}