//
// PlayLayer::screenFlipObject from 0x14050f1f0 to 0x14050f410 (544 bytes)
//
// 2 xrefs:
// > PlayLayer::updateVisibility @ 0x14050eadd
// > ??> @ 0x14092aaa0
//
// 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 11:33:30 +0000
//
__int64 __fastcall PlayLayer::screenFlipObject(__int64 a1, unsigned __int8 *a2)
{
float v4; // xmm7_4
__int64 v5; // rax
const struct cocos2d::CCPoint *v6; // rax
__int64 v7; // rbx
__int64 v8; // rax
float v9; // xmm0_4
bool v10; // cl
float v11; // xmm2_4
int v12; // esi
float v13; // xmm0_4
__int64 v14; // rdx
__int64 result; // rax
int v16; // esi
__int64 v18; // rax
int v19; // ebx
__int64 v20; // r8
float v21; // [rsp+60h] [rbp+8h] BYREF
float v22; // [rsp+64h] [rbp+Ch]
float v23; // [rsp+68h] [rbp+10h] BYREF
char v24; // [rsp+70h] [rbp+18h] BYREF
v4 = *(float *)(a1 + 1052);
if ( *(float *)(a1 + 13044) == -1.0 )
v4 = 1.0 - v4;
v5 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v5, &v23);
v6 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(unsigned __int8 *))(*(_QWORD *)a2 + 200LL))(a2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21, v6);
v7 = *(_QWORD *)a2;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v24,
(float)((float)((float)(v23 / *(float *)(a1 + 424))
- (float)((float)(v21 - *(float *)(a1 + 1040)) + (float)(v21 - *(float *)(a1 + 1040))))
* v4)
+ v21,
v22);
(*(void (__fastcall **)(unsigned __int8 *, __int64))(v7 + 184))(a2, v8);
v9 = fabs(COERCE_FLOAT(COERCE_UNSIGNED_INT64((*(double (__fastcall **)(unsigned __int8 *))(*(_QWORD *)a2 + 360LL))(a2))));
v10 = v9 != 90.0 && v9 != 270.0;
v11 = *(float *)(a1 + 13044);
v12 = (int)v9;
v13 = *(float *)(a1 + 1052);
v14 = (unsigned int)(v12 / 90);
result = (unsigned int)(90 * v14);
v16 = v12 - result;
if ( v11 == 1.0 )
{
if ( v13 < 0.5 )
goto LABEL_9;
}
else if ( v13 > 0.5 )
{
LABEL_9:
if ( *(_BYTE *)(a1 + 1056) )
{
if ( !(v11 == 1.0 ? v13 > 0.5 : v13 < 0.5) )
{
v19 = 1;
if ( v11 != 1.0 )
v19 = -1;
v20 = *(_QWORD *)a2;
if ( v10 )
{
LOBYTE(v14) = v19 * a2[1004] != 0;
result = (*(__int64 (__fastcall **)(unsigned __int8 *, __int64))(v20 + 1088))(a2, v14);
}
else
{
LOBYTE(v14) = v19 * a2[1005] != 0;
result = (*(__int64 (__fastcall **)(unsigned __int8 *, __int64))(v20 + 1096))(a2, v14);
}
if ( v16 )
return (*(__int64 (__fastcall **)(unsigned __int8 *))(*(_QWORD *)a2 + 352LL))(a2);
}
}
return result;
}
v18 = *(_QWORD *)a2;
if ( v10 )
{
LOBYTE(v14) = a2[1004] == 0;
result = (*(__int64 (__fastcall **)(unsigned __int8 *, __int64))(v18 + 1088))(a2, v14);
}
else
{
LOBYTE(v14) = a2[1005] == 0;
result = (*(__int64 (__fastcall **)(unsigned __int8 *, __int64))(v18 + 1096))(a2, v14);
}
if ( v16 )
return (*(__int64 (__fastcall **)(unsigned __int8 *))(*(_QWORD *)a2 + 352LL))(a2);
return result;
}