//
// cocos2d::ccpClamp from 0x100356280 to 0x1003562f3 (115 bytes)
//
// 1 xrefs:
// > cocos2d::CCProgressTimer::setMidpoint @ 0x100606630
//
// 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
//
cocos2d::CCPoint __fastcall cocos2d::ccpClamp(
const cocos2d::CCPoint *a1,
const cocos2d::CCPoint *a2,
const cocos2d::CCPoint *a3)
{
float *v3; // rcx
__m128 v4; // xmm3
float v5; // xmm4_4
float v6; // xmm5_4
__m128 x_low; // xmm6
__m128 v8; // xmm0
__m128 v10; // xmm4
__m128 y_low; // xmm2
__m128 v12; // xmm1
cocos2d::CCPoint result; // 0:xmm0_8.8
v4.i64[0] = *(unsigned int *)v3;
v5 = v3[1];
v6 = fmaxf(a3->x, v4.f32[0]);
v4.f32[0] = fminf(v4.f32[0], a3->x);
x_low = (__m128)LODWORD(a2->x);
x_low.f32[0] = fminf(x_low.f32[0], v6);
v8 = _mm_cmplt_ss((__m128)LODWORD(a2->x), v4);
result = (cocos2d::CCPoint)(_mm_andnot_ps(v8, x_low).u64[0] | v4.i64[0] & v8.i64[0]);
v4.f32[0] = fmaxf(a3->y, v5);
v10.f32[0] = fminf(v5, a3->y);
y_low = (__m128)LODWORD(a2->y);
y_low.f32[0] = fminf(y_low.f32[0], v4.f32[0]);
v12 = _mm_cmplt_ss((__m128)LODWORD(a2->y), v10);
sub_10028CBE0((float *)a1, result.x, COERCE_FLOAT(_mm_andnot_ps(v12, y_low).u32[0] | v10.i32[0] & v12.i32[0]));
return result;
}