//
// FontPreviewCell::loadFromIndex from 0x10096f8b0 to 0x10096fbfd (845 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x1002283ca
//
// 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 12:38:52 +0000
//
__int64 __fastcall FontPreviewCell::loadFromIndex(__int64 a1, unsigned int a2, int a3)
{
char *v5; // rax
const char *CString; // r12
__int64 v7; // rax
__int64 v8; // rax
void *v9; // r12
double v10; // xmm0_8
char *v11; // rax
__int64 v12; // rax
const char *v13; // rdi
char *v14; // r12
void *v15; // r12
__int64 v16; // r15
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 result; // rax
int v22; // ecx
unsigned int v23; // [rsp+4h] [rbp-4Ch] BYREF
float v24; // [rsp+Ch] [rbp-44h]
float v25[3]; // [rsp+10h] [rbp-40h]
double v26; // [rsp+1Ch] [rbp-34h] BYREF
float v27; // [rsp+24h] [rbp-2Ch]
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 584LL))(*(_QWORD *)(a1 + 536), 1);
*(_DWORD *)(a1 + 552) = a2;
v24 = *(float *)(a1 + 520);
v27 = *(float *)(a1 + 524);
v5 = sub_10088E820("font%02dPreview.png", a2);
CString = (const char *)cocos2d::CCString::getCString((__int64)v5);
v7 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v8 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v7, CString);
if ( v8 )
{
v9 = cocos2d::CCSprite::createWithSpriteFrame(v8);
sub_100278250((float *)&v26, 0.0, 0.5);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v9 + 296LL))(v9, &v26);
sub_100278250((float *)&v26, 8.0, 0.5 * v27);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v9 + 184LL))(v9, &v26);
v25[0] = v27 + -4.0;
*(_QWORD *)&v10 = *(unsigned int *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v9 + 328LL))(v9) + 4);
if ( *(float *)&v10 > v25[0] )
{
*(_QWORD *)&v10 = LODWORD(v25[0]);
*(float *)&v10 = v25[0] / *(float *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v9 + 328LL))(v9) + 4);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v9 + 160LL))(v9, *(float *)&v10);
}
if ( a2 == a3 )
{
BYTE2(v26) = -106;
LOWORD(v26) = -256;
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v9 + 960LL))(v9, &v26);
}
}
else
{
v11 = sub_10088E820("Font %i", a2 + 1);
v12 = cocos2d::CCString::getCString((__int64)v11);
v9 = cocos2d::CCLabelBMFont::create_3(v12, (__int64)"bigFont.fnt");
sub_100278250((float *)&v26, 0.0, 0.5);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v9 + 296LL))(v9, &v26);
sub_100278250((float *)&v26, 8.0, v27 * 0.5);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v9 + 184LL))(v9, &v26);
*(_QWORD *)&v10 = 1056964608;
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v9 + 160LL))(v9, 0.5);
}
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 536) + 456LL))(*(_QWORD *)(a1 + 536), v9);
v13 = "GJ_selectSongBtn_001.png";
if ( a2 == a3 )
v13 = "GJ_selectSongOnBtn_001.png";
v14 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v13, v10);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v14 + 160LL))(v14, 0.64999998);
v15 = CCMenuItemSpriteExtra::create((__int64)v14, 0, a1, (__int64)sub_10096FC00, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v15, 1.1);
if ( a2 == a3 )
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v15 + 1056LL))(v15, 0);
*(_QWORD *)v25 = a2;
v16 = sub_1008735E0((__int64)v15, 0);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v16, 3);
v17 = cocos2d::CCDirector::sharedDirector();
v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v17 + 160LL))(v17);
if ( cocos2d::CCTouchDispatcher::isUsingForcePrio(v18) )
{
v19 = cocos2d::CCDirector::sharedDirector();
v20 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 160LL))(v19);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v16 + 1024LL))(v16, (unsigned int)(*(_DWORD *)(v20 + 128) - 1));
}
sub_100278250((float *)&v23, v24 + -18.0, v27 * 0.5);
cocos2d::CCNode::convertToNodeSpace(&v26, v16, &v23);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v15 + 184LL))(v15, &v26);
result = 4281096353LL;
v22 = -12684606;
if ( (LOBYTE(v25[0]) & 1) == 0 )
v22 = -13870943;
*(_DWORD *)(a1 + 548) = v22;
return result;
}