//
// CCScrollLayerExt::CCScrollLayerExt from 0x100300760 to 0x100300a94 (820 bytes)
//
// 1 xrefs:
// > TableView::TableView @ 0x1002fe798
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
CCScrollLayerExt *__fastcall CCScrollLayerExt::CCScrollLayerExt(CCScrollLayerExt *a1, cocos2d::CCRect a2)
{
__int64 v2; // x1
__int64 v3; // x21
_QWORD *v5; // x0
float *v6; // x20
CCContentLayer *v7; // x22
__n128 v8; // q0
__n128 v9; // q1
float v10; // s8
__int64 v11; // x0
cocos2d::CCLayerColor *v12; // x21
float v13; // s8
float v14; // s9
__int64 v15; // x0
__n128 v16; // q0
__n128 v17; // q1
float v18; // s8
float *v19; // x0
cocos2d::CCLayerColor *v20; // x20
__n128 v21; // q0
__n128 v22; // q1
int v24; // [xsp+0h] [xbp-40h] BYREF
float v25; // [xsp+8h] [xbp-38h] BYREF
float v26; // [xsp+Ch] [xbp-34h]
cocos2d::SEL_SCHEDULE v27; // 0:x1.16
v3 = v2;
v5 = (_QWORD *)cocos2d::CCLayer::CCLayer((__int64)a1);
*v5 = &off_1007EB618;
v5[40] = off_1007EBAA8;
v5[41] = &off_1007EBB18;
v5[42] = off_1007EBB30;
v5[43] = &off_1007EBB50;
v5[44] = off_1007EBB70;
sub_1000229B0(v5 + 52);
sub_1000229B0(&a1->m_touchStartPosition);
a1->m_cutContent = 1;
a1->m_disableMovement = 0;
((void (__fastcall *)(CCScrollLayerExt *, __int64))a1->setTouchEnabled)(a1, 1);
*(_WORD *)&a1->m_disableHorizontal = 0;
v6 = (float *)(v3 + 8);
((void (__fastcall *)(CCScrollLayerExt *, __int64))a1->setContentSize)(a1, v3 + 8);
((void (__fastcall *)(CCScrollLayerExt *, __int64))a1->setPosition)(a1, v3);
*(_WORD *)&a1->m_vScrollbarVisible = 0;
a1->m_delegate = nullptr;
*(_OWORD *)&a1->m_scrollLimitTop = xmmword_100644CC0;
a1->m_touch = nullptr;
sub_1000229D0(&a1->m_touchPosition, &dbl_10086DEE0);
sub_1000229D0(&a1->m_touchStartPosition, &dbl_10086DEE0);
*(_WORD *)&a1->m_touchDown = 0;
v25 = 1.1801e-38;
v7 = CCContentLayer::create((const cocos2d::ccColor4B *)&v25, *(float *)(v3 + 8), 0.0);
a1->m_contentLayer = v7;
v8.n128_u32[0] = 0;
v9.n128_u32[0] = 0;
sub_100022980(v8, v9, &v25);
((void (__fastcall *)(CCContentLayer *, float *))v7->setAnchorPoint)(v7, &v25);
((void (__fastcall *)(CCScrollLayerExt *, CCContentLayer *))a1->addChild)(a1, a1->m_contentLayer);
a1->m_verticalScrollbar = nullptr;
v10 = *(float *)(v3 + 12);
v11 = ((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_100022988(&v25, 4.0, (float)(v10 * v10) / *(float *)(v11 + 4));
v24 = -1271778766;
v12 = cocos2d::CCLayerColor::create((const cocos2d::ccColor4B *)&v24, v25, v26);
a1->m_verticalScrollbar = v12;
v13 = *(float *)((__int64 (__fastcall *)(CCScrollLayerExt *))a1->getContentSize)(a1);
v14 = v25;
v15 = ((__int64 (__fastcall *)(CCScrollLayerExt *))a1->getContentSize)(a1);
v16.n128_f64[0] = v13 - v14 * 0.5;
v16.n128_f32[0] = v16.n128_f64[0];
v17.n128_f64[0] = *(float *)(v15 + 4) - v26 * 0.5;
v17.n128_f32[0] = v17.n128_f64[0];
sub_100022980(v16, v17, &v24);
((void (__fastcall *)(cocos2d::CCLayerColor *, int *))v12->setPosition)(v12, &v24);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_verticalScrollbar->setTouchEnabled)(
a1->m_verticalScrollbar,
0);
((void (__fastcall *)(CCScrollLayerExt *, cocos2d::CCLayerColor *))a1->addChild)(a1, a1->m_verticalScrollbar);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_verticalScrollbar->setVisible)(
a1->m_verticalScrollbar,
0);
a1->m_horizontalScrollbar = nullptr;
v18 = *v6;
v19 = (float *)((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_100022988(&v25, (float)(v18 * v18) / *v19, 4.0);
v24 = -1271778766;
v20 = cocos2d::CCLayerColor::create((const cocos2d::ccColor4B *)&v24, v25, v26);
a1->m_horizontalScrollbar = v20;
v21.n128_f32[0] = v25 * 0.5;
v22.n128_f32[0] = v26 * 0.5;
sub_100022980(v21, v22, &v24);
((void (__fastcall *)(cocos2d::CCLayerColor *, int *))v20->setPosition)(v20, &v24);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_horizontalScrollbar->setTouchEnabled)(
a1->m_horizontalScrollbar,
0);
((void (__fastcall *)(CCScrollLayerExt *, cocos2d::CCLayerColor *))a1->addChild)(a1, a1->m_horizontalScrollbar);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_horizontalScrollbar->setVisible)(
a1->m_horizontalScrollbar,
0);
v27.ptr = (void (__cdecl *)(float))CCScrollLayerExt::updateIndicators;
v27.adj = 0;
cocos2d::CCNode::schedule_1(a1, v27);
return a1;
}