//
// DeathMarkerLayer::setFlipped from 0xc9feb4 to 0xc9ffd4 (288 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::syncDeathMarkerFlip @ 0x9a4238
// > GJBaseGameLayer::syncDeathMarkerFlip @ 0x9a4250
// > ??> @ 0x57130
//
// This function is hookable on this platform (idp: arm, 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 13:05:58 +0000
//
__int64 __fastcall DeathMarkerLayer::setFlipped(__int64 this, unsigned __int8 a2)
{
int v2; // w21
__int64 v3; // x1
__int64 v4; // x20
__int64 *v5; // x19
__int64 v6; // x2
__int64 v7; // x0
__int64 v8; // x20
long double v9; // q0
unsigned __int64 i; // x20
v2 = a2;
if ( *(unsigned __int8 *)(this + 449) != a2 )
{
v3 = *(_QWORD *)(this + 416);
*(_BYTE *)(this + 449) = v2;
if ( v3 )
{
v4 = this;
this = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 488LL))(v3);
if ( this )
{
this = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v4 + 416) + 488LL))(*(_QWORD *)(v4 + 416));
if ( this )
{
this = **(unsigned int **)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v4 + 416) + 488LL))(*(_QWORD *)(v4 + 416))
+ 56);
if ( (_DWORD)this )
{
v5 = *(__int64 **)(*(_QWORD *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v4 + 416) + 488LL))(*(_QWORD *)(v4 + 416))
+ 56)
+ 16LL);
v6 = *(_QWORD *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v4 + 416) + 488LL))(*(_QWORD *)(v4 + 416))
+ 56);
v7 = *(_QWORD *)(v4 + 416);
v8 = *(_QWORD *)(v6 + 16);
this = **(unsigned int **)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 488LL))(v7) + 56);
for ( i = v8 + 8LL * (unsigned int)this - 8;
i >= (unsigned __int64)v5;
this = (*(__int64 (__fastcall **)(__int64, long double))(*(_QWORD *)this + 128LL))(this, v9) )
{
this = *v5;
if ( !*v5 )
break;
LODWORD(v9) = -0.5;
if ( !v2 )
LODWORD(v9) = 0.5;
++v5;
}
}
}
}
}
}
return this;
}