//
// GJRotationControl::init from 0x100640880 to 0x100640c98 (1048 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b81338
//
// 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:34:43 +0000
//
bool __fastcall GJRotationControl::init(__int64 a1)
{
bool result; // al
double v3; // xmm0_8
char *v4; // rax
double v5; // xmm0_8
char *v6; // rax
void *v7; // rax
__int64 v8; // r12
void *v9; // r12
__int64 v10; // rdi
void *v11; // r12
double v12; // xmm0_8
char *v13; // r12
void *v14; // r12
__int64 v15; // rdx
__int64 v16; // rcx
__int64 v17; // r12
std::string v18; // [rsp+8h] [rbp-58h] BYREF
unsigned __int64 v19[2]; // [rsp+24h] [rbp-3Ch] BYREF
bool v20; // [rsp+37h] [rbp-29h]
result = cocos2d::CCLayer::init((_WORD *)a1);
if ( result )
{
v20 = result;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1000LL))(a1, 1);
sub_100278250((float *)v19, 60.0, 0.0);
sub_100278300((_QWORD *)(a1 + 412), v19);
v3 = (*(double (__fastcall **)(__int64, void *))(*(_QWORD *)a1 + 296LL))(a1, &unk_100BE5AE8);
v4 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_rotationControlBtn01_001.png", v3);
*(_QWORD *)(a1 + 424) = v4;
v5 = (*(double (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v4, 1);
v6 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"warpLockOffBtn_001.png", v5);
v7 = CCMenuItemSpriteExtra::create((__int64)v6, 0, a1, (__int64)GJRotationControl::onToggleLockRotation, 0);
*(_QWORD *)(a1 + 448) = v7;
v8 = cocos2d::CCMenu::createWithItem(v7);
sub_100278250((float *)v19, 110.0, 35.0);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v8 + 184LL))(v8, v19);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v8, 3);
sub_100640520((void **)(a1 + 480), v8);
v9 = CCTextInputNode::create((__int64)" ", (__int64)"Thonburi", 0x18u, (__int64)"bigFont.fnt", 48.0, 19.200001);
*(_QWORD *)(a1 + 464) = v9;
sub_100278250((float *)v19, 110.0, 0.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v9 + 184LL))(v9, v19);
CCTextInputNode::setMaxLabelScale(*(_QWORD *)(a1 + 464), 0.48000002);
CCTextInputNode::setMaxLabelWidth(*(_QWORD *)(a1 + 464), 48.0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 464) + 576LL) + 344LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 464) + 576LL),
0);
v10 = *(_QWORD *)(a1 + 464);
*(_DWORD *)(v10 + 592) = 7;
*(_QWORD *)(v10 + 700) = 0x200000001LL;
v18.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)24;
strcpy(v18.__r_.__value_.__s.__data_, "0123456789.-");
CCTextInputNode::setAllowedChars(v10, &v18);
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v18.__r_.__value_.__l.__data_);
*(_BYTE *)(*(_QWORD *)(a1 + 464) + 424LL) = 1;
sub_100278270((__int64)v19, 0.0, 0.0, (__m128)0x42200000u, (__m128)0x42200000u);
v11 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"square02_small.png", v19);
sub_100278260((float *)v19, 80.0, 32.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v11 + 320LL))(v11, v19);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v11 + 160LL))(v11, 0.625);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v11 + 912LL))(v11, 90);
(*(void (__fastcall **)(void *, double, float))(*(_QWORD *)v11 + 248LL))(v11, 0.0, -0.5);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 464) + 464LL))(
*(_QWORD *)(a1 + 464),
v11,
0xFFFFFFFFLL);
v12 = (*(double (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 464LL))(a1, *(_QWORD *)(a1 + 464), 2);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_updateBtn_001.png", v12);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v13 + 160LL))(v13, 0.40000001);
v14 = CCMenuItemSpriteExtra::create((__int64)v13, 0, a1, (__int64)sub_100640D20, 0);
*(_QWORD *)(a1 + 472) = v14;
sub_100278250((float *)v19, 151.0, 0.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v14 + 184LL))(v14, v19);
v17 = cocos2d::CCMenu::create(v14, v19, v15, v16);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v17 + 184LL))(v17, &unk_100BE5AE8);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v17 + 320LL))(v17, &unk_100BE5AF0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v17 + 456LL))(v17, *(_QWORD *)(a1 + 472));
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v17, 3);
sub_100640520((void **)(a1 + 480), v17);
*(_QWORD *)(a1 + 432) = 0;
sub_100278250((float *)v19, 60.0, -0.0);
sub_100278300((_QWORD *)(a1 + 412), v19);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 424) + 184LL))(*(_QWORD *)(a1 + 424), a1 + 412);
sub_100640FB0(a1, *(float *)(a1 + 436));
return v20;
}
return result;
}