//
// RateStarsModLayer::init from 0x100962930 to 0x10096379c (3692 bytes)
//
// 1 xrefs:
// > RateStarsModLayer::create @ 0x1009628c9
//
// 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:46 +0000
//
__int64 __fastcall RateStarsModLayer::init(__int64 a1, int a2, char a3)
{
unsigned int inited; // r12d
__int64 v6; // rax
void *v7; // r14
const std::string::value_type *v8; // rsi
std::string::pointer data; // rdi
void *v10; // rbx
void *v11; // rax
void *v12; // rax
__int64 v13; // rdi
int v14; // edx
int v15; // ecx
int v16; // r8d
int v17; // r9d
__int64 v18; // rax
double v19; // xmm0_8
char *v20; // rax
void *v21; // rbx
__int64 v22; // r14
__int64 v23; // rbx
char *v24; // rax
__int64 CString; // rax
char *v26; // rax
_DWORD *v27; // r14
__int64 v28; // rbx
char *v29; // rax
__int64 v30; // rax
char *v31; // rax
_DWORD *v32; // r14
__int64 v33; // rbx
char *v34; // rax
__int64 v35; // rax
char *v36; // rax
_DWORD *v37; // r14
__int64 v38; // rbx
char *v39; // rax
__int64 v40; // rax
char *v41; // rax
_DWORD *v42; // r14
__int64 v43; // rbx
char *v44; // rax
__int64 v45; // rax
char *v46; // rax
_DWORD *v47; // r14
__int64 v48; // r14
unsigned int i; // r13d
__int64 v50; // rbx
char *v51; // rax
__int64 v52; // rax
char *v53; // rax
_DWORD *v54; // r15
__int64 v55; // rbx
__int64 v56; // r15
__int64 v57; // rbx
double v58; // xmm0_8
_QWORD *v59; // rax
void *v60; // rbx
void *v61; // rbx
double v62; // xmm0_8
char *v63; // rax
__int64 v64; // rax
char *v65; // rbx
void *v66; // rbx
char *v67; // rax
__int64 v68; // rax
char *v69; // rbx
void *v70; // rbx
char *v71; // rax
__int64 v72; // rax
char *v73; // rbx
void *v74; // rbx
char *v75; // rax
__int64 v76; // rax
char *v77; // rbx
void *v78; // rbx
char *v79; // rax
__int64 v80; // rax
char *v81; // rbx
void *v82; // rbx
__int64 v83; // rbx
__int64 v84; // rax
void *v85; // rbx
__int64 v86; // rax
void *v87; // rax
__int64 v88; // rbx
void *v90; // [rsp+0h] [rbp-80h]
unsigned int v91; // [rsp+8h] [rbp-78h] BYREF
std::string v92; // [rsp+10h] [rbp-70h] BYREF
void *v93; // [rsp+28h] [rbp-58h]
unsigned int v94; // [rsp+34h] [rbp-4Ch] BYREF
unsigned __int64 v95[2]; // [rsp+3Ch] [rbp-44h] BYREF
unsigned __int8 v96; // [rsp+4Fh] [rbp-31h]
__int64 v97; // [rsp+50h] [rbp-30h] BYREF
inited = FLAlertLayer::init_1((_BYTE *)a1, 75);
if ( (_BYTE)inited )
{
*(_DWORD *)(a1 + 712) = a2;
*(_DWORD *)(a1 + 716) = -1;
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v97, v6);
sub_100278270((__int64)&v92, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v7 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"GJ_square01.png", (unsigned __int64 *)&v92);
sub_100278260((float *)&v92, 380.0, 250.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v7 + 320LL))(v7, &v92);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v7,
0xFFFFFFFFLL);
sub_100278250((float *)&v92, *(float *)&v97 * 0.5, *((float *)&v97 + 1) * 0.5);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v7 + 184LL))(v7, &v92);
strcpy((char *)&v92, "\"Advisor: Suggest ");
v8 = "Stars";
if ( a3 )
v8 = "Moons";
std::string::append(&v92, v8);
if ( (*(_BYTE *)&v92.__r_.__value_.__s.0 & 1) != 0 )
data = v92.__r_.__value_.__l.__data_;
else
data = v92.__r_.__value_.__s.__data_;
v10 = cocos2d::CCLabelBMFont::create_3((__int64)data, (__int64)"bigFont.fnt");
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v10 + 160LL))(v10, 0.64999998);
sub_100278250((float *)v95, *(float *)&v97 * 0.5, (float)((float)(*((float *)&v97 + 1) * 0.5) + 125.0) + -22.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v10 + 184LL))(v10, v95);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v10);
v11 = sub_1007FE900();
*(_QWORD *)(a1 + 696) = v11;
cocos2d::CCObject::retain((__int64)v11);
v12 = sub_1007FE900();
*(_QWORD *)(a1 + 704) = v12;
v13 = (__int64)v12;
cocos2d::CCObject::retain((__int64)v12);
v93 = sub_1007FE900();
v90 = sub_1007FE900();
v18 = cocos2d::CCMenu::create(v13, (__int64)v10, v14, v15, v16, v17);
*(_QWORD *)(a1 + 552) = v18;
v19 = (*(double (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v18,
10);
v20 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_coinsIcon2_001.png", v19);
*(_QWORD *)(a1 + 728) = v20;
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v20 + 160LL))(v20, 1.2);
v21 = CCMenuItemSpriteExtra::create(*(_QWORD *)(a1 + 728), 0, a1, (__int64)sub_1009637F0, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v21);
v22 = *(_QWORD *)(a1 + 552);
sub_100278250(
(float *)&v94,
(float)((float)(*(float *)&v97 * 0.5) + -190.0) + 23.0,
(float)((float)(0.5 * *((float *)&v97 + 1)) + 125.0) + -23.0);
cocos2d::CCNode::convertToNodeSpace((double *)v95, v22, &v94);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v21 + 184LL))(v21, v95);
*(_BYTE *)(a1 + 720) = 1;
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 728) + 960LL))(*(_QWORD *)(a1 + 728), &unk_100A14688);
v96 = inited;
v23 = *(_QWORD *)(a1 + 552);
v24 = sub_10088E820("%i", 1);
CString = cocos2d::CCString::getCString((__int64)v24);
v26 = ButtonSprite::create_1(CString, 0x14u, 0, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 0.5, 30.0);
v27 = CCMenuItemSpriteExtra::create((__int64)v26, 0, a1, (__int64)sub_100963910, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v27 + 160LL))(v27, 1.0);
v27[101] = 1065353216;
if ( v23 )
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v23 + 456LL))(v23, v27);
sub_1007FEBF0(*(_QWORD *)(a1 + 696), (__int64)v27);
(*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v27 + 72LL))(v27, 1);
sub_1007FEBF0((__int64)v93, (__int64)v27);
v28 = *(_QWORD *)(a1 + 552);
v29 = sub_10088E820("%i", 2);
v30 = cocos2d::CCString::getCString((__int64)v29);
v31 = ButtonSprite::create_1(v30, 0x14u, 0, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 0.5, 30.0);
v32 = CCMenuItemSpriteExtra::create((__int64)v31, 0, a1, (__int64)sub_100963910, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v32 + 160LL))(v32, 1.0);
v32[101] = 1065353216;
if ( v28 )
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v28 + 456LL))(v28, v32);
sub_1007FEBF0(*(_QWORD *)(a1 + 696), (__int64)v32);
(*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v32 + 72LL))(v32, 2);
sub_1007FEBF0((__int64)v93, (__int64)v32);
v33 = *(_QWORD *)(a1 + 552);
v34 = sub_10088E820("%i", 3);
v35 = cocos2d::CCString::getCString((__int64)v34);
v36 = ButtonSprite::create_1(v35, 0x14u, 0, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 0.5, 30.0);
v37 = CCMenuItemSpriteExtra::create((__int64)v36, 0, a1, (__int64)sub_100963910, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v37 + 160LL))(v37, 1.0);
v37[101] = 1065353216;
if ( v33 )
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v33 + 456LL))(v33, v37);
sub_1007FEBF0(*(_QWORD *)(a1 + 696), (__int64)v37);
(*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v37 + 72LL))(v37, 3);
sub_1007FEBF0((__int64)v93, (__int64)v37);
v38 = *(_QWORD *)(a1 + 552);
v39 = sub_10088E820("%i", 4);
v40 = cocos2d::CCString::getCString((__int64)v39);
v41 = ButtonSprite::create_1(v40, 0x14u, 0, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 0.5, 30.0);
v42 = CCMenuItemSpriteExtra::create((__int64)v41, 0, a1, (__int64)sub_100963910, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v42 + 160LL))(v42, 1.0);
v42[101] = 1065353216;
if ( v38 )
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v38 + 456LL))(v38, v42);
sub_1007FEBF0(*(_QWORD *)(a1 + 696), (__int64)v42);
(*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v42 + 72LL))(v42, 4);
sub_1007FEBF0((__int64)v93, (__int64)v42);
v43 = *(_QWORD *)(a1 + 552);
v44 = sub_10088E820("%i", 5);
v45 = cocos2d::CCString::getCString((__int64)v44);
v46 = ButtonSprite::create_1(v45, 0x14u, 0, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 0.5, 30.0);
v47 = CCMenuItemSpriteExtra::create((__int64)v46, 0, a1, (__int64)sub_100963910, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v47 + 160LL))(v47, 1.0);
v47[101] = 1065353216;
if ( v43 )
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v43 + 456LL))(v43, v47);
sub_1007FEBF0(*(_QWORD *)(a1 + 696), (__int64)v47);
(*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v47 + 72LL))(v47, 5);
sub_1007FEBF0((__int64)v93, (__int64)v47);
v48 = a1;
for ( i = 6; i != 11; ++i )
{
v50 = *(_QWORD *)(v48 + 552);
v51 = sub_10088E820("%i", i);
v52 = cocos2d::CCString::getCString((__int64)v51);
v53 = ButtonSprite::create_1(v52, 0x14u, 0, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 0.5, 30.0);
v54 = CCMenuItemSpriteExtra::create((__int64)v53, 0, v48, (__int64)sub_100963910, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v54 + 160LL))(v54, 1.0);
v54[101] = 1065353216;
if ( v50 )
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v50 + 456LL))(v50, v54);
sub_1007FEBF0(*(_QWORD *)(v48 + 696), (__int64)v54);
(*(void (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v54 + 72LL))(v54, i);
sub_1007FEBF0((__int64)v90, (__int64)v54);
}
v55 = *(_QWORD *)(v48 + 552);
sub_100278250(
(float *)&v94,
(float)(*(float *)&v97 * 0.5) + -30.0,
(float)((float)(*((float *)&v97 + 1) * 0.5) + 23.0) + 34.0);
v56 = (__int64)v93;
cocos2d::CCNode::convertToNodeSpace((double *)v95, v55, &v94);
GameToolbox::alignItemsHorisontally(v56, v95, 0, (__m128)0x41900000u);
v57 = *(_QWORD *)(v48 + 552);
sub_100278250(
(float *)&v94,
(float)(*(float *)&v97 * 0.5) + -30.0,
(float)((float)(*((float *)&v97 + 1) * 0.5) + -23.0) + 34.0);
inited = v96;
cocos2d::CCNode::convertToNodeSpace((double *)v95, v57, &v94);
GameToolbox::alignItemsHorisontally((__int64)v90, v95, 0, (__m128)0x41900000u);
*(_QWORD *)&v58 = (unsigned int)v97;
*(float *)&v58 = (float)((float)(*(float *)&v97 * 0.5) + -30.0) + 172.0;
sub_100278250((float *)&v94, *(float *)&v58, (float)((float)(*((float *)&v97 + 1) * 0.5) + 34.0) + 2.0);
v59 = GJDifficultySprite::create(v58);
*(_QWORD *)(v48 + 744) = v59;
(*(void (__fastcall **)(_QWORD *, __int64, float))(*v59 + 160LL))(v59, 1, 1.2);
v60 = CCMenuItemSpriteExtra::create(*(_QWORD *)(v48 + 744), 0, v48, (__int64)sub_100963A90, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v60);
cocos2d::CCNode::convertToNodeSpace((double *)v95, *(_QWORD *)(v48 + 552), &v94);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v60 + 184LL))(v60, v95);
sub_1007FF190(v56);
sub_100278270((__int64)v95, 0.0, 0.0, (__m128)0x42200000u, (__m128)0x42200000u);
v61 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"square02_small.png", v95);
sub_100278260((float *)v95, 280.0, 56.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v61 + 320LL))(v61, v95);
*(_QWORD *)&v62 = (unsigned int)v97;
*(float *)&v62 = *(float *)&v97 * 0.5;
sub_100278250((float *)v95, *(float *)&v97 * 0.5, (float)(*((float *)&v97 + 1) * 0.5) + -45.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v61 + 184LL))(v61, v95);
(*(void (__fastcall **)(void *, void *))(*(_QWORD *)v61 + 960LL))(v61, &unk_100A1468B);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v61 + 912LL))(v61, 35);
(*(void (__fastcall **)(_QWORD, void *, _QWORD))(**(_QWORD **)(v48 + 584) + 464LL))(*(_QWORD *)(v48 + 584), v61, 0);
v63 = sub_10088E820("difficulty_%02d_btn2_001.png", 7);
v64 = cocos2d::CCString::getCString((__int64)v63);
v65 = cocos2d::CCSprite::createWithSpriteFrameName(v64, v62);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v65 + 160LL))(v65, 0.85000002);
v66 = CCMenuItemSpriteExtra::create((__int64)v65, 0, v48, (__int64)sub_100963AC0, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v66);
sub_1007FEBF0(*(_QWORD *)(v48 + 704), (__int64)v66);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v66 + 72LL))(v66, 1);
sub_1007FEBF0(v56, (__int64)v66);
v67 = sub_10088E820("difficulty_%02d_btn2_001.png", 8);
v68 = cocos2d::CCString::getCString((__int64)v67);
v69 = cocos2d::CCSprite::createWithSpriteFrameName(v68, COERCE_DOUBLE(1062836634));
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v69 + 160LL))(v69, 0.85000002);
v70 = CCMenuItemSpriteExtra::create((__int64)v69, 0, v48, (__int64)sub_100963AC0, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v70);
sub_1007FEBF0(*(_QWORD *)(v48 + 704), (__int64)v70);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v70 + 72LL))(v70, 2);
sub_1007FEBF0(v56, (__int64)v70);
v71 = sub_10088E820("difficulty_%02d_btn2_001.png", 6);
v72 = cocos2d::CCString::getCString((__int64)v71);
v73 = cocos2d::CCSprite::createWithSpriteFrameName(v72, COERCE_DOUBLE(1062836634));
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v73 + 160LL))(v73, 0.85000002);
v74 = CCMenuItemSpriteExtra::create((__int64)v73, 0, v48, (__int64)sub_100963AC0, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v74);
sub_1007FEBF0(*(_QWORD *)(v48 + 704), (__int64)v74);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v74 + 72LL))(v74, 3);
sub_1007FEBF0(v56, (__int64)v74);
v75 = sub_10088E820("difficulty_%02d_btn2_001.png", 9);
v76 = cocos2d::CCString::getCString((__int64)v75);
v77 = cocos2d::CCSprite::createWithSpriteFrameName(v76, COERCE_DOUBLE(1062836634));
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v77 + 160LL))(v77, 0.85000002);
v78 = CCMenuItemSpriteExtra::create((__int64)v77, 0, v48, (__int64)sub_100963AC0, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v78);
sub_1007FEBF0(*(_QWORD *)(v48 + 704), (__int64)v78);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v78 + 72LL))(v78, 4);
sub_1007FEBF0(v56, (__int64)v78);
v79 = sub_10088E820("difficulty_%02d_btn2_001.png", 10);
v80 = cocos2d::CCString::getCString((__int64)v79);
v81 = cocos2d::CCSprite::createWithSpriteFrameName(v80, COERCE_DOUBLE(1062836634));
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v81 + 160LL))(v81, 0.85000002);
v82 = CCMenuItemSpriteExtra::create((__int64)v81, 0, v48, (__int64)sub_100963AC0, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v82);
sub_1007FEBF0(*(_QWORD *)(v48 + 704), (__int64)v82);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v82 + 72LL))(v82, 5);
sub_1007FEBF0(v56, (__int64)v82);
v83 = *(_QWORD *)(v48 + 552);
sub_100278250((float *)&v91, *(float *)&v97 * 0.5, (float)(*((float *)&v97 + 1) * 0.5) + -42.0);
cocos2d::CCNode::convertToNodeSpace((double *)v95, v83, &v91);
GameToolbox::alignItemsHorisontally(v56, v95, 0, (__m128)0x41900000u);
sub_1007FF190(v56);
v84 = sub_100059E00((__int64)"Cancel");
v85 = CCMenuItemSpriteExtra::create(v84, 0, v48, (__int64)sub_100963B80, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v85);
sub_1007FEBF0(v56, (__int64)v85);
v86 = sub_100059E00((__int64)"Submit");
v87 = CCMenuItemSpriteExtra::create(v86, 0, v48, (__int64)sub_100963BD0, 0);
*(_QWORD *)(v48 + 688) = v87;
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v48 + 552) + 456LL))(*(_QWORD *)(v48 + 552), v87);
sub_1007FEBF0(v56, *(_QWORD *)(v48 + 688));
v88 = *(_QWORD *)(v48 + 552);
sub_100278250((float *)&v91, *(float *)&v97 * 0.5, (float)((float)(0.5 * *((float *)&v97 + 1)) + -125.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace((double *)v95, v88, &v91);
GameToolbox::alignItemsHorisontally(v56, v95, 0, (__m128)0x41700000u);
sub_100963910(v48, 0);
if ( (*(_BYTE *)&v92.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v92.__r_.__value_.__l.__data_);
}
return inited;
}