//
// KeybindingsLayer::buildControllerGlyph from 0x100023f58 to 0x1000241dc (644 bytes)
//
// 2 xrefs:
// > KeybindingsLayer::buildContentForTab @ 0x1000249e8
// > ControllerInputNode::refreshVisuals @ 0x1004ab358
//
// 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 10:57:24 +0000
//
__int64 __fastcall KeybindingsLayer::buildControllerGlyph(int a1, _BYTE *a2)
{
__int64 v2; // x19
unsigned int v3; // w8
_BOOL4 v5; // w9
unsigned int v6; // w9
float v7; // s10
float v8; // s9
const char *v9; // x0
const char *v10; // x8
float v11; // s8
int v12; // w8
__int64 v14; // x0
__int64 v15; // x20
__int64 v16; // x0
float v17; // s11
__n128 v18; // q0
__n128 v19; // q1
__n128 v20; // q0
__int64 v21; // [xsp+0h] [xbp-40h] BYREF
float v22; // [xsp+8h] [xbp-38h] BYREF
float v23; // [xsp+Ch] [xbp-34h]
v2 = 0;
v3 = a1 - 1001;
v5 = (a1 & 1) == 0 && v3 < 0x2C;
*a2 = v5;
v6 = v3 - v5;
v7 = -1.0;
v8 = 0.0;
v9 = "controllerBtn_LThumb_001.png";
v10 = "controllerBtn_A_001.png";
v11 = 0.0;
switch ( v6 )
{
case 0u:
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 2u:
v10 = "controllerBtn_B_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 4u:
v10 = "controllerBtn_Y_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 6u:
v10 = "controllerBtn_X_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 8u:
v10 = "controllerBtn_Start_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0xAu:
v10 = "controllerBtn_Back_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0xCu:
v10 = "controllerBtn_RB_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0xEu:
v10 = "controllerBtn_LB_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0x10u:
v10 = "controllerBtn_RT_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0x12u:
v10 = "controllerBtn_LT_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0x14u:
v10 = "controllerBtn_DPad_Up_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0x16u:
v10 = "controllerBtn_DPad_Down_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0x18u:
v10 = "controllerBtn_DPad_Left_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0x1Au:
v10 = "controllerBtn_DPad_Right_001.png";
return cocos2d::CCSprite::createWithSpriteFrameName(v10);
case 0x1Cu:
v8 = 1.0;
v7 = 0.0;
goto LABEL_21;
case 0x1Eu:
v8 = -1.0;
v7 = 0.0;
goto LABEL_30;
case 0x20u:
goto LABEL_32;
case 0x22u:
v7 = 1.0;
goto LABEL_28;
case 0x24u:
v8 = 1.0;
v7 = 0.0;
v9 = "controllerBtn_RThumb_001.png";
LABEL_21:
v12 = 1119092736;
goto LABEL_31;
case 0x26u:
v8 = -1.0;
v7 = 0.0;
v9 = "controllerBtn_RThumb_001.png";
LABEL_30:
v12 = 1132920832;
goto LABEL_31;
case 0x28u:
v9 = "controllerBtn_RThumb_001.png";
goto LABEL_32;
case 0x2Au:
v7 = 1.0;
v9 = "controllerBtn_RThumb_001.png";
LABEL_28:
v12 = 1127481344;
LABEL_31:
v11 = *(float *)&v12;
LABEL_32:
v2 = cocos2d::CCSprite::createWithSpriteFrameName(v9);
if ( v2 )
{
v14 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
if ( v14 )
{
v15 = v14;
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 328LL))(v2);
sub_100026438(&v22, v16);
v17 = (float)((float)(v23 + v23) / 26.0) + (float)(v22 * 0.3);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v15 + 360LL))(v15, v11);
v18 = ((__n128 (__fastcall *)(__int64, float))*(_QWORD *)(*(_QWORD *)v15 + 160LL))(v15, 0.378);
v18.n128_f32[0] = (float)(v22 * 0.5) + (float)(v7 * v17);
v19.n128_f32[0] = (float)(v23 * 0.5) + (float)(v8 * v17);
v20 = sub_1000262BC(&v21, v18, v19);
(*(void (__fastcall **)(__int64, __int64 *, __n128))(*(_QWORD *)v15 + 184LL))(v15, &v21, v20);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v2 + 464LL))(v2, v15, 1);
}
}
break;
default:
return v2;
}
return v2;
}