//
// OBB2D::orderCorners from 0x14007b790 to 0x14007bb6e (990 bytes)
//
// 2 xrefs:
// > OBB2D::calculateWithCenter @ 0x14007b759
// > ??> @ 0x140911db0
//
// 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:25:53 +0000
//
double __fastcall OBB2D::orderCorners(float *a1)
{
__int64 v2; // rax
float v3; // xmm0_4
float *v4; // rcx
float v5; // xmm1_4
float v6; // xmm0_4
float *v7; // rdx
float *v8; // rcx
float v9; // xmm0_4
float *v10; // rdx
float *v11; // rcx
float v12; // xmm0_4
float *v13; // rdx
float *v14; // rcx
float *v15; // rcx
float *v16; // rdx
__int64 v17; // rax
float v18; // xmm2_4
float *v19; // rcx
float v20; // xmm1_4
float v21; // xmm2_4
float *v22; // rdx
float *v23; // rcx
float v24; // xmm2_4
float *v25; // rdx
float *v26; // rcx
float v27; // xmm2_4
float *v28; // rdx
float *v29; // rcx
float *v30; // rcx
float *v31; // rdx
float v33; // [rsp+50h] [rbp+28h] BYREF
float v34; // [rsp+54h] [rbp+2Ch]
float v35; // [rsp+58h] [rbp+30h] BYREF
float v36; // [rsp+5Ch] [rbp+34h]
float v37; // [rsp+60h] [rbp+38h] BYREF
float v38; // [rsp+64h] [rbp+3Ch]
float v39; // [rsp+68h] [rbp+40h] BYREF
float v40; // [rsp+6Ch] [rbp+44h]
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v33);
cocos2d::CCPoint::operator=(&v33, a1 + 80);
cocos2d::CCPoint::operator=(&v37, v2);
v3 = a1[81];
if ( v3 > v38 )
{
cocos2d::CCPoint::operator=(&v33, &v37);
v4 = &v37;
LABEL_7:
cocos2d::CCPoint::operator=(v4, a1 + 80);
v5 = v34;
goto LABEL_8;
}
v5 = v34;
if ( v3 > v34 || v3 == v34 && v33 > a1[80] )
{
v4 = &v33;
goto LABEL_7;
}
LABEL_8:
v6 = a1[83];
if ( v6 > v38 )
{
cocos2d::CCPoint::operator=(&v33, &v37);
v7 = a1 + 82;
v8 = &v37;
LABEL_16:
cocos2d::CCPoint::operator=(v8, v7);
v5 = v34;
goto LABEL_17;
}
if ( v6 > v5 )
{
v7 = a1 + 82;
LABEL_15:
v8 = &v33;
goto LABEL_16;
}
if ( v6 == v5 )
{
v7 = a1 + 82;
if ( v33 > a1[82] )
goto LABEL_15;
}
LABEL_17:
v9 = a1[85];
if ( v9 > v38 )
{
cocos2d::CCPoint::operator=(&v33, &v37);
v10 = a1 + 84;
v11 = &v37;
LABEL_25:
cocos2d::CCPoint::operator=(v11, v10);
v5 = v34;
goto LABEL_26;
}
if ( v9 > v5 )
{
v10 = a1 + 84;
LABEL_24:
v11 = &v33;
goto LABEL_25;
}
if ( v9 == v5 )
{
v10 = a1 + 84;
if ( v33 > a1[84] )
goto LABEL_24;
}
LABEL_26:
v12 = a1[87];
if ( v12 <= v38 )
{
if ( v12 > v5 )
{
v13 = a1 + 86;
}
else
{
if ( v12 != v5 )
goto LABEL_35;
v13 = a1 + 86;
if ( v33 <= a1[86] )
goto LABEL_35;
}
v14 = &v33;
}
else
{
cocos2d::CCPoint::operator=(&v33, &v37);
v13 = a1 + 86;
v14 = &v37;
}
cocos2d::CCPoint::operator=(v14, v13);
LABEL_35:
v15 = a1 + 88;
if ( v37 <= v33 )
{
cocos2d::CCPoint::operator=(v15, &v37);
v16 = &v33;
}
else
{
cocos2d::CCPoint::operator=(v15, &v33);
v16 = &v37;
}
cocos2d::CCPoint::operator=(a1 + 90, v16);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v35);
cocos2d::CCPoint::operator=(&v35, a1 + 80);
cocos2d::CCPoint::operator=(&v39, v17);
v18 = a1[81];
if ( v40 > v18 )
{
cocos2d::CCPoint::operator=(&v35, &v39);
v19 = &v39;
LABEL_44:
cocos2d::CCPoint::operator=(v19, a1 + 80);
v20 = v36;
goto LABEL_45;
}
v20 = v36;
if ( v36 > v18 || v18 == v36 && a1[80] > v35 )
{
v19 = &v35;
goto LABEL_44;
}
LABEL_45:
v21 = a1[83];
if ( v40 > v21 )
{
cocos2d::CCPoint::operator=(&v35, &v39);
v22 = a1 + 82;
v23 = &v39;
LABEL_53:
cocos2d::CCPoint::operator=(v23, v22);
v20 = v36;
goto LABEL_54;
}
if ( v20 > v21 )
{
v22 = a1 + 82;
LABEL_52:
v23 = &v35;
goto LABEL_53;
}
if ( v21 == v20 )
{
v22 = a1 + 82;
if ( a1[82] > v35 )
goto LABEL_52;
}
LABEL_54:
v24 = a1[85];
if ( v40 > v24 )
{
cocos2d::CCPoint::operator=(&v35, &v39);
v25 = a1 + 84;
v26 = &v39;
LABEL_62:
cocos2d::CCPoint::operator=(v26, v25);
v20 = v36;
goto LABEL_63;
}
if ( v20 > v24 )
{
v25 = a1 + 84;
LABEL_61:
v26 = &v35;
goto LABEL_62;
}
if ( v24 == v20 )
{
v25 = a1 + 84;
if ( a1[84] > v35 )
goto LABEL_61;
}
LABEL_63:
v27 = a1[87];
if ( v40 <= v27 )
{
if ( v20 > v27 )
{
v28 = a1 + 86;
}
else
{
if ( v27 != v20 )
goto LABEL_72;
v28 = a1 + 86;
if ( a1[86] <= v35 )
goto LABEL_72;
}
v29 = &v35;
}
else
{
cocos2d::CCPoint::operator=(&v35, &v39);
v28 = a1 + 86;
v29 = &v39;
}
cocos2d::CCPoint::operator=(v29, v28);
LABEL_72:
v30 = a1 + 92;
if ( v39 <= v35 )
{
cocos2d::CCPoint::operator=(v30, &v35);
v31 = &v39;
}
else
{
cocos2d::CCPoint::operator=(v30, &v39);
v31 = &v35;
}
return cocos2d::CCPoint::operator=(a1 + 94, v31);
}