//
// cocos2d::CCDirector::convertToUI from 0x100478870 to 0x10047897e (270 bytes)
//
// 1 xrefs:
// > cocos2d::CCNode::convertToWindowSpace @ 0x100261355
//
// 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:30:36 +0000
//
float *__fastcall cocos2d::CCDirector::convertToUI(float *a1, __int64 a2, __int64 *a3)
{
_QWORD *v4; // rax
float v5; // xmm0_4
float v6; // xmm1_4
float *v7; // rbx
__m128 v9[4]; // [rsp+8h] [rbp-F8h] BYREF
__m128 v10[4]; // [rsp+48h] [rbp-B8h] BYREF
__int64 v11; // [rsp+88h] [rbp-78h] BYREF
int v12; // [rsp+90h] [rbp-70h]
float *v13; // [rsp+C8h] [rbp-38h]
__int64 v14; // [rsp+D0h] [rbp-30h] BYREF
v13 = a1;
kmGLGetMatrix(5889, (__int64)v10);
kmGLGetMatrix(5888, (__int64)&v11);
kmMat4Multiply(v9, v10, (unsigned int *)&v11);
v11 = *a3;
v12 = 0;
kmVec3TransformCoord(v10, &v11, v9);
v4 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a2 + 192) + 88LL))(*(_QWORD *)(a2 + 192));
sub_100278630(&v14, v4);
v5 = (v10[0].f32[0] * 0.5 + 0.5) * *(float *)&v14;
v6 = (0.5 - v10[0].f32[1] * 0.5) * *((float *)&v14 + 1);
v7 = v13;
sub_100278250(v13, v5, v6);
return v7;
}