//
// ReviewChoiceSheet::init from 0x1400ae380 to 0x1400aeb24 (1956 bytes)
//
// 3 xrefs:
// > ReviewChoiceSheet::create @ 0x1400ae33a
// > ??> @ 0x14091349c
// > ??> @ 0x1409134a8
//
// 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:26:10 +0000
//
// Hidden C++ exception states: #wind=1
char __fastcall ReviewChoiceSheet::init(
__int64 a1,
__int64 a2,
int a3,
_BYTE *a4,
__int64 a5,
__int64 *a6,
_QWORD *a7,
char a8,
_BYTE *a9)
{
__int64 *v13; // r12
__int64 v14; // rcx
__int64 v15; // rcx
__int64 v16; // rax
int v17; // r9d
__int64 v18; // rax
__int64 v19; // rcx
float v20; // xmm6_4
float v21; // xmm9_4
float v22; // xmm8_4
unsigned __int64 v23; // r14
size_t v24; // r15
size_t v25; // r8
struct cocos2d::CCSprite *v26; // rax
int v27; // ebx
cocos2d::CCObject *v28; // rsi
__int64 v29; // rdi
__int64 v30; // rbx
__int64 v31; // rax
__int64 v32; // rax
size_t v33; // r8
__int64 v34; // rsi
__int64 v35; // rdi
__int64 v36; // rbx
__int64 v37; // rax
__int64 v38; // rax
float v39; // xmm8_4
__int64 v40; // rbx
const struct cocos2d::CCPoint *v41; // rax
char *v42; // rdi
__int64 v43; // rbx
__int64 v44; // rax
float v45; // xmm8_4
__int64 v46; // rax
__int64 v47; // rdi
__int64 v48; // rbx
__int64 v49; // rax
__int64 v50; // rbx
__int64 v51; // rax
__int64 v52; // rdx
__int64 v53; // rcx
char *InputNode; // rdi
__int64 v55; // rbx
__int64 v56; // rax
__int64 v57; // rcx
__int64 v58; // rcx
__int64 v59; // rcx
__int64 v60; // rcx
__int64 v61; // rcx
__int64 v62; // r15
_QWORD *v63; // rcx
int v64; // eax
cocos2d::CCObject *v65; // rsi
__int64 v66; // rdi
__int64 v67; // rbx
__int64 v68; // rax
__int64 v69; // rax
_QWORD v71[3]; // [rsp+48h] [rbp-B9h] BYREF
__int64 v72; // [rsp+60h] [rbp-A1h]
_BYTE v73[40]; // [rsp+68h] [rbp-99h] BYREF
__int128 v74; // [rsp+90h] [rbp-71h] BYREF
__int64 v75; // [rsp+A0h] [rbp-61h]
__int64 v76; // [rsp+A8h] [rbp-59h]
__int128 *v77; // [rsp+150h] [rbp+4Fh] BYREF
_BYTE *v78; // [rsp+160h] [rbp+5Fh]
v78 = a4;
if ( !a2 )
return 0;
v13 = a6;
v14 = a6[1];
if ( *a6 == v14 )
return 0;
v15 = (a7[1] - *a7) ^ ((v14 - *a6) >> 2);
if ( (v15 & 0xFFFFFFFFFFFFFFF8uLL) != 0 )
return 0;
v16 = cocos2d::CCDirector::sharedDirector(v15);
cocos2d::CCDirector::getWinSize(v16, v71);
v18 = 132;
if ( a8 )
v18 = 179;
v19 = v18 + 38 * (((v13[1] - *v13) >> 5) - 1);
v20 = v19 < 0
? (float)(v19 & 1 | (unsigned int)((unsigned __int64)v19 >> 1))
+ (float)(v19 & 1 | (unsigned int)((unsigned __int64)v19 >> 1))
: (float)(int)v19;
if ( !(unsigned __int8)SetupTriggerPopup::init(a1, 0, 0, v17, LODWORD(v20), 1, 0) )
return 0;
*(_QWORD *)(a1 + 1000) = a2;
*(_DWORD *)(a1 + 1008) = a3;
v21 = *(float *)v71 * 0.5;
v22 = (float)((float)(*((float *)v71 + 1) * 0.5) + 0.0) + (float)(v20 * 0.5);
*(_OWORD *)&v71[1] = 0;
v23 = 0;
v72 = 0;
*(_QWORD *)v73 = 0;
v24 = -1;
v25 = -1;
do
++v25;
while ( a4[v25] );
sub_14003D230(&v71[1], a4, v25);
SetupTriggerPopup::addTitle(a1, &v71[1]);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v27 = (int)v26;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v26 + 160LL))(v26);
v28 = CCMenuItemSpriteExtra::create(v27, 0, a1, (__int64)sub_14009D628);
*((_DWORD *)v28 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v28);
v29 = *(_QWORD *)v28;
v30 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, (float)(v21 - 160.0) + 6.0, v22 - 10.0);
cocos2d::CCNode::convertToNodeSpace(v30, &v71[1], v31);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v29 + 184))(v28, v32);
if ( a9 && *a9 )
{
v77 = (__int128 *)&v73[8];
memset(&v73[8], 0, 32);
v33 = -1;
do
++v33;
while ( a9[v33] );
sub_14003D230(&v73[8], a9, v33);
v74 = 0;
v75 = 0;
v76 = 0;
do
++v24;
while ( v78[v24] );
sub_14003D230(&v74, v78, v24);
v34 = InfoAlertButton::create(&v74, &v73[8]);
*(_DWORD *)(v34 + 584) = 1061997773;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v34);
v35 = *(_QWORD *)v34;
v36 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, (float)(v21 + 160.0) - 22.0, v22 - 22.0);
cocos2d::CCNode::convertToNodeSpace(v36, &v71[1], v37);
(*(void (__fastcall **)(__int64, __int64))(v35 + 184))(v34, v38);
}
v39 = v22 - 52.0;
v77 = &v74;
v40 = sub_14003F4F0((__int64)&v74, a5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v71[1], 0.5, 0.5);
v42 = TextArea::create(v40, "chatFont.fnt", 1.0, 350.0, v41, 1101004800, 0, 0);
(*(void (__fastcall **)(char *))(*(_QWORD *)v42 + 160LL))(v42);
v43 = *(_QWORD *)v42;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v21, v39);
(*(void (__fastcall **)(char *, __int64))(v43 + 184))(v42, v44);
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v42, 1);
v45 = v39 - 40.0;
if ( a8 )
{
v46 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v71[1], 0.0, 0.0, 40.0, 40.0);
v47 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v46);
v48 = *(_QWORD *)v47;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v77, 280.0, 26.0);
(*(void (__fastcall **)(__int64, __int64))(v48 + 312))(v47, v49);
LOWORD(v77) = 13405;
BYTE2(v77) = 31;
(**(void (__fastcall ***)(__int64, __int128 **))(v47 + 320))(v47 + 320, &v77);
v50 = *(_QWORD *)v47;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v21, v45 - 6.0);
(*(void (__fastcall **)(__int64, __int64))(v50 + 184))(v47, v51);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v47, 0);
InputNode = GameToolbox::createInputNode(v53, v52, (__int64)"Case note (optional)", 255);
*(_QWORD *)(a1 + 1016) = InputNode;
v55 = *(_QWORD *)InputNode;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v21, v45 - 6.0);
(*(void (__fastcall **)(char *, __int64))(v55 + 184))(InputNode, v56);
v57 = *(_QWORD *)(a1 + 1016);
*(_DWORD *)(v57 + 564) = 1063675494;
CCTextInputNode::refreshLabel(v57);
v58 = *(_QWORD *)(a1 + 1016);
*(_DWORD *)(v58 + 560) = 1132724224;
CCTextInputNode::refreshLabel(v58);
*(_OWORD *)&v71[1] = 0;
v72 = 0;
*(_QWORD *)v73 = 0;
v71[1] = sub_14003D460(0x50u);
v72 = 75;
*(_QWORD *)v73 = 79;
strcpy((char *)v71[1], "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,!?'\"-:;()/");
CCTextInputNode::setAllowedChars(*(_QWORD *)(a1 + 1016), (void **)&v71[1]);
v59 = *(_QWORD *)(a1 + 1016);
*(_DWORD *)(v59 + 568) = 1061997773;
CCTextInputNode::refreshLabel(v59);
v60 = a1 + 544;
if ( !a1 )
v60 = 0;
*(_QWORD *)(*(_QWORD *)(a1 + 1016) + 600LL) = v60;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 1016),
5);
v45 = v45 + -47.0;
}
v61 = *v13;
if ( (v13[1] - *v13) >> 5 )
{
v62 = 0;
do
{
v63 = (_QWORD *)(v62 + v61);
if ( v63[3] > 0xFu )
v63 = (_QWORD *)*v63;
v64 = (unsigned int)ButtonSprite::create_1(
(int)v63,
240,
0,
0.55000001,
1,
(__int64)&qword_140704F78,
*(_QWORD *)(*a7 + 8 * v23),
1106247680);
v65 = CCMenuItemSpriteExtra::create(v64, 0, a1, (__int64)ReviewChoiceSheet::onChoice);
*((_DWORD *)v65 + 93) = 1066192077;
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v65 + 64LL))(v65, (unsigned int)v23);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v65);
v66 = *(_QWORD *)v65;
v67 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v21, v45);
cocos2d::CCNode::convertToNodeSpace(v67, &v71[1], v68);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v66 + 184))(v65, v69);
v45 = v45 + -38.0;
++v23;
v62 += 32;
v61 = *v13;
}
while ( v23 < (v13[1] - *v13) >> 5 );
}
return 1;
}