//
// AchievementsLayer::customSetup from 0x1004a42cc to 0x1004a4570 (676 bytes)
//
// 1 xrefs:
// > ??> @ 0x10097e6d8
//
// 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 11:06:04 +0000
//
__int64 __fastcall AchievementsLayer::customSetup(__int64 *a1)
{
__int64 v2; // x0
int isControllerConnected; // w20
__int64 v4; // x21
float v5; // s8
__int64 v6; // x1
float v7; // s9
const char *v8; // x0
const char *v9; // x22
void *v10; // x0
void *v11; // x0
__int64 v12; // x23
__int64 v13; // x0
float v14; // s0
unsigned __int8 *v15; // x0
__int64 v16; // x22
void *v17; // x0
__int64 v18; // x22
__int64 v19; // x0
float v20; // s0
void *v21; // x0
__int64 v22; // x21
__int64 v23; // x0
float v24; // s8
__int64 v25; // x0
__int64 v26; // x1
__int64 v27; // x0
float v28; // s0
float v29; // s8
__int64 v30; // x0
float v31; // s0
__int64 v32; // x21
__int64 result; // x0
float v34; // [xsp+8h] [xbp-58h] BYREF
__int64 v35; // [xsp+10h] [xbp-50h] BYREF
__int64 v36; // [xsp+18h] [xbp-48h] BYREF
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2, &v36);
isControllerConnected = PlatformToolbox::isControllerConnected();
v4 = cocos2d::CCMenu::create();
v5 = *((float *)&v36 + 1) * 0.5;
if ( *(_BYTE *)(AppDelegate::get(v4, v6) + 37) )
v7 = 49.0;
else
v7 = 24.0;
if ( isControllerConnected )
v8 = "controllerBtn_DPad_Left_001.png";
else
v8 = "GJ_arrow_01_001.png";
if ( isControllerConnected )
v9 = "controllerBtn_DPad_Right_001.png";
else
v9 = "GJ_arrow_01_001.png";
v10 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v8);
v11 = CCMenuItemSpriteExtra::create((__int64)v10, 0, (__int64)a1, (__int64)sub_1004A4570, 0);
a1[77] = (__int64)v11;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v4 + 456LL))(v4, v11);
v12 = a1[77];
v13 = cocos2d::CCDirector::sharedDirector();
v14 = sub_100207EA8(v13);
sub_1000262BC(&v34, v7 + v14, v5);
cocos2d::CCNode::convertToNodeSpace(v4, (__int64)&v34, &v35);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL))(v12, &v35);
v15 = (unsigned __int8 *)cocos2d::CCSprite::createWithSpriteFrameName((__int64)v9);
v16 = (__int64)v15;
if ( (isControllerConnected & 1) == 0 )
cocos2d::CCSprite::setFlipX(v15, 1);
v17 = CCMenuItemSpriteExtra::create(v16, 0, (__int64)a1, (__int64)sub_1004A457C, 0);
a1[76] = (__int64)v17;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v4 + 456LL))(v4, v17);
v18 = a1[76];
v19 = cocos2d::CCDirector::sharedDirector();
v20 = sub_100207EB0(v19);
sub_1000262BC(&v34, v20 - v7, v5);
cocos2d::CCNode::convertToNodeSpace(v4, (__int64)&v34, &v35);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v18 + 184LL))(v18, &v35);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1[72] + 464LL))(a1[72], v4, 10);
v21 = cocos2d::CCLabelBMFont::create_1(" ", "goldFont.fnt");
a1[78] = (__int64)v21;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)a1[72] + 456LL))(a1[72], v21);
v22 = a1[78];
v23 = cocos2d::CCDirector::sharedDirector();
v24 = sub_100207EB0(v23) + -7.0;
v27 = AppDelegate::get(v25, v26);
v28 = 0.0;
if ( *(_BYTE *)(v27 + 37) )
v28 = 10.0;
v29 = v24 - v28;
v30 = cocos2d::CCDirector::sharedDirector();
v31 = sub_100207E98(v30);
sub_1000262BC((float *)&v35, v29, v31 + -4.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v22 + 184LL))(v22, &v35);
v32 = a1[78];
sub_1000262BC((float *)&v35, 1.0, 1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v32 + 296LL))(v32, &v35);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1[78] + 160LL))(a1[78], 0.6);
result = sub_1004A4588(a1, 0);
if ( isControllerConnected )
return GameToolbox::addRThumbScrollButton(a1[72]);
return result;
}