//
// OptionsCell::loadFromObject from 0x140151100 to 0x140151511 (1041 bytes)
//
// 3 xrefs:
// > CustomListView::loadCell @ 0x140145b7d
// > CustomListView::reloadAll @ 0x140147026
// > ??> @ 0x140917834
//
// 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:27:17 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall OptionsCell::loadFromObject(__int64 a1, __int64 a2)
{
__int64 v2; // rdi
signed int v4; // r15d
const char *v5; // rcx
struct cocos2d::CCLabelBMFont *v6; // rsi
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rbx
__int64 v10; // rax
int v11; // eax
void **v12; // rax
void *v13; // rdx
void **v14; // rcx
struct cocos2d::CCLabelBMFont *v15; // rdi
__int64 v16; // rbx
__int64 v17; // rax
__int64 v18; // rdx
float v19; // xmm6_4
double v20; // xmm0_8
__int64 v21; // rax
__int64 v22; // rbx
__int64 v23; // rax
void *v24; // rcx
__int64 v25; // rax
__int64 v26; // rax
const char *v27; // rcx
struct cocos2d::CCSprite *v28; // rax
int v29; // ebx
cocos2d::CCObject *v30; // rax
struct cocos2d::CCMenu *v31; // rdi
__int64 v32; // rbx
__int64 v33; // rax
__int16 v35; // [rsp+38h] [rbp-49h] BYREF
char v36; // [rsp+3Ah] [rbp-47h]
_BYTE v37[8]; // [rsp+3Ch] [rbp-45h] BYREF
_BYTE v38[12]; // [rsp+44h] [rbp-3Dh] BYREF
void *Block[2]; // [rsp+50h] [rbp-31h] BYREF
__m128i si128; // [rsp+60h] [rbp-21h]
_QWORD v41[4]; // [rsp+70h] [rbp-11h] BYREF
v2 = a2;
*(_QWORD *)(a1 + 560) = a2;
LOBYTE(a2) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 544) + 576LL))(*(_QWORD *)(a1 + 544), a2);
v4 = *(_DWORD *)(v2 + 108);
v5 = (const char *)(v2 + 64);
if ( *(_QWORD *)(v2 + 88) > 0xFu )
v5 = *(const char **)v5;
v6 = cocos2d::CCLabelBMFont::create(v5, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(
*(_QWORD *)(a1 + 544),
v6,
2);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 160LL))(v6);
v7 = *(_QWORD *)v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v7 + 288))(v6, v8);
v9 = *(_QWORD *)v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, 40.0, *(float *)(a1 + 532) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v9 + 184))(v6, v10);
v11 = *(_DWORD *)(v2 + 104);
if ( v11 )
{
if ( v11 == 1 )
{
v25 = *(_QWORD *)(v2 + 112);
if ( v25 )
{
v26 = *(_QWORD *)(v25 + 1856);
if ( *(_BYTE *)(v26 + 473) )
{
v35 = -1;
v36 = -106;
}
else
{
if ( !*(_BYTE *)(v26 + 472) )
goto LABEL_23;
v35 = -17991;
v36 = -46;
}
goto LABEL_22;
}
}
}
else
{
if ( !v4 )
{
v35 = -26986;
v36 = -106;
LABEL_22:
(**((void (__fastcall ***)(__int64, __int16 *))v6 + 46))((__int64)v6 + 368, &v35);
goto LABEL_23;
}
if ( v4 > 0 )
{
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_140836530);
strcpy((char *)Block, "[ ");
v12 = (void **)GameToolbox::intToString(v41, v4);
v13 = v12;
if ( (unsigned __int64)v12[3] > 0xF )
v13 = *v12;
sub_140044D80(Block, v13, (size_t)v12[2]);
sub_14003D310((__int64)v41);
sub_140044D80(Block, " ]", 2u);
v14 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v14 = (void **)Block[0];
v15 = cocos2d::CCLabelBMFont::create((const char *)v14, "chatFont.fnt");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(
*(_QWORD *)(a1 + 544),
v15,
2);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v15 + 160LL))(v15);
v16 = *(_QWORD *)v15;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v16 + 288))(v15, v17);
(**((void (__fastcall ***)(__int64, __int16 *))v15 + 46))((__int64)v15 + 368, &word_140702F60);
LOBYTE(v18) = -81;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v15 + 46) + 40LL))((__int64)v15 + 368, v18);
v19 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 320LL))(v6);
v20 = (*(double (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 168LL))(v6);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, (float)(*(float *)&v20 * v19) + 8.0, 0.0);
v22 = v21;
v23 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 200LL))(v6);
cocos2d::CCPoint::operator+(v23, v37, v22);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v15 + 184LL))(v15, v37);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v24 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v24 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v24 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v24);
}
}
}
LABEL_23:
v27 = "GJ_checkOff_001.png";
if ( *(_BYTE *)(*(_QWORD *)(a1 + 560) + 60LL) )
v27 = "GJ_checkOn_001.png";
v28 = cocos2d::CCSprite::createWithSpriteFrameName(v27);
v29 = (int)v28;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v28 + 160LL))(v28);
v30 = CCMenuItemSpriteExtra::create(v29, 0, a1, (__int64)OptionsCell::onToggleOption);
*((_DWORD *)v30 + 93) = 1069547520;
v31 = cocos2d::CCMenu::create(v30, 0);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCMenu *, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(
*(_QWORD *)(a1 + 544),
v31,
3);
v32 = *(_QWORD *)v31;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, 20.0, *(float *)(a1 + 532) * 0.5);
return (*(__int64 (__fastcall **)(struct cocos2d::CCMenu *, __int64))(v32 + 184))(v31, v33);
}