//
// CCTextInputNode::scrollWheel from 0x10006d040 to 0x10006d60c (1484 bytes)
//
// 2 xrefs:
// > sub_10006D640 @ 0x10006d64c
// > ??> @ 0x100aba2f0
//
// 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:19:46 +0000
//
char __fastcall CCTextInputNode::scrollWheel(_QWORD *a1, _BOOL8 a2, __m128 a3)
{
int v4; // eax
__int64 v5; // rax
__int64 v6; // r14
__int64 v7; // rax
__int64 v8; // r15
__int64 v9; // r14
__int64 v10; // rax
double v11; // xmm1_8
double v12; // xmm0_8
__int64 v13; // rax
_QWORD *v14; // rsi
__int64 v15; // rdi
__int64 Handler_1; // rax
__int64 v17; // rdi
int Priority; // r14d
__int64 v19; // rdi
__m128 v20; // xmm0
const char *v21; // r15
size_t v22; // rax
size_t v23; // r14
char *v24; // r12
unsigned int v25; // eax
size_t v26; // rcx
_BYTE *v27; // rdx
size_t v28; // r13
bool v29; // r14
char v30; // di
__int64 v31; // rdi
__int64 v33; // rax
const char *v34; // r15
size_t v35; // rax
size_t v36; // r14
char *v37; // r12
size_t v38; // r13
__m128 v39; // xmm2
double v40; // xmm0_8
void *v41; // r14
float v42; // xmm0_4
float v43; // xmm1_4
float v44; // xmm0_4
int v45; // eax
int v46; // ecx
size_t v47; // rax
size_t v48; // r14
char *v49; // r15
size_t v50; // r12
_BYTE v51[16]; // [rsp+8h] [rbp-B8h] BYREF
char v52[8]; // [rsp+18h] [rbp-A8h] BYREF
char v53[8]; // [rsp+20h] [rbp-A0h] BYREF
float v54; // [rsp+28h] [rbp-98h] BYREF
float v55; // [rsp+2Ch] [rbp-94h]
__m128 v56; // [rsp+30h] [rbp-90h]
_QWORD v57[2]; // [rsp+48h] [rbp-78h] BYREF
void *v58; // [rsp+58h] [rbp-68h]
__m128 v59; // [rsp+60h] [rbp-60h]
__int64 __dst; // [rsp+70h] [rbp-50h] BYREF
size_t v61; // [rsp+78h] [rbp-48h]
void *__p; // [rsp+80h] [rbp-40h]
v4 = *((_DWORD *)a1 + 175);
if ( (unsigned int)(v4 - 1) < 3 )
goto LABEL_2;
if ( v4 != 5 )
return 0;
v59 = a3;
v21 = (const char *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[72] + 1248LL))(a1[72]);
v22 = strlen(v21);
if ( v22 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v23 = v22;
if ( v22 >= 0x17 )
{
v28 = 26;
if ( (v22 | 7) != 0x17 )
v28 = (v22 | 7) + 1;
v24 = (char *)operator new(v28);
__p = v24;
__dst = v28 + 1;
v61 = v23;
}
else
{
LOBYTE(__dst) = 2 * v22;
v24 = (char *)&__dst + 1;
if ( !v22 )
{
BYTE1(__dst) = 0;
v25 = (unsigned __int8)__dst;
if ( (__dst & 1) != 0 )
goto LABEL_19;
goto LABEL_26;
}
}
a2 = (_BOOL8)v21;
memmove(v24, v21, v23);
v24[v23] = 0;
v25 = (unsigned __int8)__dst;
if ( (__dst & 1) != 0 )
{
LABEL_19:
v26 = v61;
a3 = v59;
if ( v61 )
goto LABEL_20;
goto LABEL_27;
}
LABEL_26:
v26 = v25 >> 1;
a3 = v59;
if ( v25 >> 1 )
{
LABEL_20:
if ( (v25 & 1) != 0 )
v27 = __p;
else
v27 = (char *)&__dst + 1;
a2 = (unsigned __int8)(*v27 - 58) < 0xF6u;
v30 = 4;
if ( *v27 != 45 )
v30 = (unsigned __int8)(*v27 - 58) < 0xF6u;
if ( (v30 & 1) == 0 )
{
a2 = 0;
if ( v26 != 1 )
{
v31 = 1;
while ( (unsigned __int8)(v27[v31] - 58) >= 0xF6u )
{
if ( v26 == ++v31 )
goto LABEL_39;
}
a2 = 1;
}
}
LABEL_39:
v29 = !a2;
if ( (v25 & 1) != 0 )
goto LABEL_40;
goto LABEL_41;
}
LABEL_27:
v29 = 0;
if ( (v25 & 1) != 0 )
{
LABEL_40:
operator delete(__p);
a3 = v59;
}
LABEL_41:
if ( !v29 )
return 0;
LABEL_2:
v59 = a3;
if ( !(*(unsigned __int8 (__fastcall **)(_QWORD *))(*a1 + 352LL))(a1) )
return 0;
v5 = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 512LL))(a1);
if ( v5 )
{
v6 = v5;
while ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v6 + 352LL))(v6) )
{
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 512LL))(v6);
if ( !v6 )
goto LABEL_7;
}
return 0;
}
LABEL_7:
if ( !(*(unsigned __int8 (__fastcall **)(_QWORD *))(*a1 + 992LL))(a1) )
return 0;
v7 = cocos2d::CCEGLView::sharedOpenGLView();
if ( !v7 )
return 0;
v8 = v7;
v9 = cocos2d::CCDirector::sharedDirector(a1, a2);
(*(void (__fastcall **)(__int64 *, __int64))(*(_QWORD *)v8 + 184LL))(&__dst, v8);
cocos2d::CCDirector::convertToGL(v52, v9, &__dst);
cocos2d::CCNode::convertToNodeSpace(v53, a1, v52);
v10 = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1);
sub_100278630(&v54, v10);
HIDWORD(v11) = 0;
*(_QWORD *)&v12 = LODWORD(v54);
*(float *)&v12 = v54 * -0.5;
*(float *)&v11 = -0.5 * v55;
sub_100278270(
v51,
v12,
v11,
COERCE_DOUBLE((unsigned __int64)LODWORD(v54)),
COERCE_DOUBLE((unsigned __int64)LODWORD(v55)));
if ( !(unsigned __int8)sub_100278940(v51, v53) )
return 0;
v13 = cocos2d::CCDirector::sharedDirector(v51, v53);
v14 = a1 + 40;
v15 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 160LL))(v13);
Handler_1 = cocos2d::CCTouchDispatcher::findHandler_1(v15, a1 + 40);
if ( Handler_1 )
{
v17 = Handler_1;
Priority = cocos2d::CCTouchHandler::getPriority(Handler_1);
v15 = cocos2d::CCDirector::sharedDirector(v17, v14);
if ( Priority > *(_DWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 160LL))(v15) + 128) )
return 0;
}
v19 = cocos2d::CCDirector::sharedDirector(v15, v14);
if ( *(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 192LL))(v19) + 128) )
{
v20 = (__m128)0x41200000u;
}
else
{
v33 = cocos2d::CCDirector::sharedDirector(v19, v14);
if ( *(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v33 + 192LL))(v33) + 129) == 1 )
v20 = (__m128)*((unsigned int *)&unk_100A04070 + (*((_DWORD *)a1 + 175) == 1));
else
v20 = (__m128)0x3F800000u;
}
v56 = v20;
v34 = (const char *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[72] + 1248LL))(a1[72]);
v35 = strlen(v34);
if ( v35 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v36 = v35;
if ( v35 >= 0x17 )
{
v38 = 26;
if ( (v35 | 7) != 0x17 )
v38 = (v35 | 7) + 1;
v37 = (char *)operator new(v38);
__p = v37;
__dst = v38 | 1;
v61 = v36;
goto LABEL_53;
}
LOBYTE(__dst) = 2 * v35;
v37 = (char *)&__dst + 1;
if ( v35 )
LABEL_53:
memmove(v37, v34, v36);
v39 = _mm_cmplt_ss(v59, (__m128)0LL);
v59 = _mm_or_ps(_mm_andnot_ps(v39, _mm_xor_ps((__m128)xmmword_100A035F0, v56)), _mm_and_ps(v56, v39));
v37[v36] = 0;
if ( (__dst & 1) != 0 )
{
v41 = __p;
v56.i64[0] = atof((const char *)__p);
operator delete(v41);
v40 = *(double *)v56.i64;
}
else
{
v40 = atof((const char *)&__dst + 1);
}
v42 = v40;
v43 = v59.f32[0] + v42;
if ( *((_BYTE *)a1 + 660) == 1 )
{
v44 = fmaxf(*((float *)a1 + 166), v43);
v43 = *((float *)a1 + 167);
if ( v44 <= v43 )
v43 = v44;
}
v45 = *((_DWORD *)a1 + 175);
if ( v45 == 1 )
{
snprintf((char *)&__dst, 0x20u, "%.*f", *((_DWORD *)a1 + 176), v43);
}
else
{
v46 = (int)v43;
if ( (v45 == 3 || v45 == 5) && v46 < 0 )
v46 = 0;
snprintf((char *)&__dst, 0x20u, "%d", v46);
}
v47 = strlen((const char *)&__dst);
if ( v47 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v48 = v47;
if ( v47 >= 0x17 )
{
v50 = 26;
if ( (v47 | 7) != 0x17 )
v50 = (v47 | 7) + 1;
v49 = (char *)operator new(v50);
v58 = v49;
v57[0] = v50 | 1;
v57[1] = v48;
}
else
{
LOBYTE(v57[0]) = 2 * v47;
v49 = (char *)v57 + 1;
if ( !v47 )
goto LABEL_75;
}
memcpy(v49, &__dst, v48);
LABEL_75:
v49[v48] = 0;
CCTextInputNode::setString(a1, (__int64)v57);
if ( (v57[0] & 1) != 0 )
operator delete(v58);
return 1;
}