//
// sub_1004A4B50 from 0x1004a4b50 to 0x1004a4c43 (243 bytes)
//
// 1 xrefs:
// > sub_1004A4C50 @ 0x1004a4cf1
//
// 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:54 +0000
//
double __fastcall sub_1004A4B50(__int64 a1, float *a2, char a3)
{
__int128 *v4; // rdi
const char *v5; // rax
double v6; // xmm0_8
__int64 v7; // r15
float ScaleX; // xmm0_4
float ScaleY; // xmm0_4
unsigned __int64 *ViewPortRect; // rax
double result; // xmm0_8
unsigned __int64 v12; // [rsp+8h] [rbp-58h] BYREF
__int128 v13; // [rsp+10h] [rbp-50h] BYREF
__int128 v14; // [rsp+20h] [rbp-40h]
double v15[2]; // [rsp+30h] [rbp-30h] BYREF
float v16; // [rsp+40h] [rbp-20h]
float v17; // [rsp+44h] [rbp-1Ch]
v4 = *(__int128 **)(a1 + 56);
v5 = (const char *)objc_msgSend(v4, "textField");
if ( v5 )
{
v4 = &v13;
objc_msgSend_stret(&v13, v5, "frame");
v6 = *((double *)&v14 + 1);
}
else
{
v14 = 0;
v13 = 0;
v6 = 0.0;
}
v15[1] = v6;
v7 = cocos2d::CCEGLView::sharedOpenGLView(v4);
v17 = *a2;
ScaleX = cocos2d::CCEGLViewProtocol::getScaleX(v7);
v17 = ScaleX * v17;
v16 = a2[1];
ScaleY = cocos2d::CCEGLViewProtocol::getScaleY(v7);
sub_100278250((float *)&v12, v17, v16 * ScaleY);
ViewPortRect = (unsigned __int64 *)cocos2d::CCEGLViewProtocol::getViewPortRect(v7);
sub_100278350(v15, &v12, ViewPortRect);
result = *(float *)v15;
if ( a3 )
return result * 0.5;
return result;
}