//
// OBB2D::orderCorners from 0x3d7568 to 0x3d76f0 (392 bytes)
//
// 1 xrefs:
// > OBB2D::calculateWithCenter @ 0x3d7806
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:46:45 +0000
//
int __fastcall OBB2D::orderCorners(OBB2D *this)
{
char *v2; // r10
float *v3; // r9
float *v4; // r5
float *v5; // r6
int v6; // r0
float v7; // s15
float *v8; // r0
char *v9; // r0
char *v10; // r0
float *v11; // r1
int v12; // r0
float v13; // s15
float *v14; // r0
char *v15; // r0
char *v16; // r4
char *v17; // r0
float *v18; // r1
float v20[2]; // [sp+4h] [bp+0h] BYREF
float v21; // [sp+Ch] [bp+8h] BYREF
float v22; // [sp+10h] [bp+Ch]
float v23[2]; // [sp+14h] [bp+10h] BYREF
float v24; // [sp+1Ch] [bp+18h] BYREF
float v25; // [sp+20h] [bp+1Ch]
v2 = (char *)this + 264;
v3 = (float *)((char *)this + 296);
v4 = (float *)((char *)this + 264);
v5 = (float *)((char *)this + 264);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v20);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21);
v6 = cocos2d::CCPoint::operator=(&v21, v2);
cocos2d::CCPoint::operator=(v20, v6);
do
{
v7 = v5[1];
if ( v7 > v20[1] )
{
cocos2d::CCPoint::operator=(&v21, v20);
v8 = v20;
LABEL_8:
cocos2d::CCPoint::operator=(v8, v5);
goto LABEL_9;
}
if ( v7 > v22 || v7 == v22 && *v5 < v21 )
{
v8 = &v21;
goto LABEL_8;
}
LABEL_9:
v5 += 2;
}
while ( v5 != v3 );
v9 = (char *)this + 296;
if ( v20[0] <= v21 )
{
cocos2d::CCPoint::operator=(v9, v20);
v10 = (char *)this + 304;
v11 = &v21;
}
else
{
cocos2d::CCPoint::operator=(v9, &v21);
v10 = (char *)this + 304;
v11 = v20;
}
cocos2d::CCPoint::operator=(v10, v11);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v24);
v12 = cocos2d::CCPoint::operator=(&v24, v2);
cocos2d::CCPoint::operator=(v23, v12);
while ( 2 )
{
v13 = v4[1];
if ( v13 < v23[1] )
{
cocos2d::CCPoint::operator=(&v24, v23);
v14 = v23;
goto LABEL_20;
}
if ( v13 < v25 || v13 == v25 && *v4 > v24 )
{
v14 = &v24;
LABEL_20:
cocos2d::CCPoint::operator=(v14, v4);
}
v4 += 2;
if ( v4 != v3 )
continue;
break;
}
v15 = (char *)this + 312;
v16 = (char *)this + 320;
if ( v23[0] <= v24 )
{
cocos2d::CCPoint::operator=(v15, &v24);
v17 = v16;
v18 = v23;
}
else
{
cocos2d::CCPoint::operator=(v15, v23);
v17 = v16;
v18 = &v24;
}
return cocos2d::CCPoint::operator=(v17, v18);
}