//
// cocos2d::extension::CCControlSlider::ccTouchBegan from 0x100389d50 to 0x100389ec5 (373 bytes)
//
// 2 xrefs:
// > sub_100389F80 @ 0x100389f8c
// > ??> @ 0x100b2cf78
//
// 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:29:11 +0000
//
char __fastcall cocos2d::extension::CCControlSlider::ccTouchBegan(__int64 a1, __int64 a2)
{
int v3; // xmm0_4
__int64 *v4; // rdi
__int64 v5; // rax
float *v6; // rax
float *v7; // rax
__int64 v9; // [rsp+Ch] [rbp-34h] BYREF
__int64 v10; // [rsp+14h] [rbp-2Ch] BYREF
__int64 v11; // [rsp+1Ch] [rbp-24h] BYREF
float v12; // [rsp+24h] [rbp-1Ch]
if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1352LL))(a1)
&& (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1272LL))(a1)
&& (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 352LL))(a1) )
{
cocos2d::CCTouch::getLocation((__int64)&v11, a2);
cocos2d::CCNode::convertToNodeSpace((double *)&v10, a1, (unsigned int *)&v11);
sub_100278300(&v11, &v10);
v3 = 0;
if ( *(float *)&v11 >= 0.0 )
{
v4 = *(__int64 **)(a1 + 512);
v5 = *v4;
v12 = *(float *)&v11;
v6 = (float *)(*(__int64 (__fastcall **)(__int64 *))(v5 + 328))(v4);
if ( v12 <= *v6 )
{
LABEL_8:
sub_1002782D0(&v9, &v11);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1280LL))(a1, 1);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 496) + 960LL))(
*(_QWORD *)(a1 + 496),
&unk_100A08B1D);
sub_1002782D0(&v10, &v9);
v12 = *(float *)&v10;
v7 = (float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 512) + 328LL))(*(_QWORD *)(a1 + 512));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1 + 1360LL))(
a1,
fmaxf(
*(float *)(a1 + 484),
fminf(
*(float *)(a1 + 488),
(float)((float)(*(float *)(a1 + 480) - *(float *)(a1 + 476)) * (float)(v12 / *v7)) + *(float *)(a1 + 476))));
return 1;
}
v3 = *(_DWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 512) + 328LL))(*(_QWORD *)(a1 + 512));
}
LODWORD(v11) = v3;
goto LABEL_8;
}
return 0;
}