//
// OBB2D::orderCorners from 0x14006dda0 to 0x14006e125 (901 bytes)
//
// 2 xrefs:
// > OBB2D::calculateWithCenter @ 0x14006dd68
// > ??> @ 0x1406c60cc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void OBB2D::orderCorners(OBB2D *a1)
{
std::array *p_m_corners; // rdi
__int64 v3; // rax
float y; // xmm0_4
cocos2d::CCPoint *v5; // rcx
float v6; // xmm1_4
float v7; // xmm0_4
cocos2d::CCPoint *v8; // rcx
float v9; // xmm0_4
cocos2d::CCPoint *v10; // rcx
float v11; // xmm0_4
cocos2d::CCPoint *v12; // rcx
std::array *p_m_positions; // rcx
cocos2d::CCPoint *v14; // rdx
__int64 v15; // rax
float v16; // xmm2_4
cocos2d::CCPoint *v17; // rcx
float v18; // xmm1_4
float v19; // xmm2_4
cocos2d::CCPoint *v20; // rcx
float v21; // xmm2_4
cocos2d::CCPoint *v22; // rcx
float v23; // xmm2_4
cocos2d::CCPoint *v24; // rcx
cocos2d::CCPoint *v25; // rcx
cocos2d::CCPoint *v26; // rdx
cocos2d::CCPoint v27; // [rsp+50h] [rbp+28h] BYREF
cocos2d::CCPoint v28; // [rsp+58h] [rbp+30h] BYREF
cocos2d::CCPoint v29; // [rsp+60h] [rbp+38h] BYREF
cocos2d::CCPoint v30; // [rsp+68h] [rbp+40h] BYREF
cocos2d::CCPoint::CCPoint(&v29);
cocos2d::CCPoint::CCPoint(&v27);
p_m_corners = &a1->m_corners;
cocos2d::CCPoint::operator=(&v27, &a1->m_corners);
cocos2d::CCPoint::operator=(&v29, v3);
y = a1->m_corners._Elems[0].y;
if ( y > v29.y )
{
cocos2d::CCPoint::operator=(&v27, &v29);
v5 = &v29;
LABEL_7:
cocos2d::CCPoint::operator=(v5, &a1->m_corners);
v6 = v27.y;
goto LABEL_8;
}
v6 = v27.y;
if ( y > v27.y || y == v27.y && v27.x > p_m_corners->_Elems[0].x )
{
v5 = &v27;
goto LABEL_7;
}
LABEL_8:
v7 = a1->m_corners._Elems[1].y;
if ( v7 > v29.y )
{
cocos2d::CCPoint::operator=(&v27, &v29);
v8 = &v29;
LABEL_14:
cocos2d::CCPoint::operator=(v8, &a1->m_corners._Elems[1]);
v6 = v27.y;
goto LABEL_15;
}
if ( v7 > v6 || v7 == v6 && v27.x > a1->m_corners._Elems[1].x )
{
v8 = &v27;
goto LABEL_14;
}
LABEL_15:
v9 = a1->m_corners._Elems[2].y;
if ( v9 > v29.y )
{
cocos2d::CCPoint::operator=(&v27, &v29);
v10 = &v29;
LABEL_21:
cocos2d::CCPoint::operator=(v10, &a1->m_corners._Elems[2]);
v6 = v27.y;
goto LABEL_22;
}
if ( v9 > v6 || v9 == v6 && v27.x > a1->m_corners._Elems[2].x )
{
v10 = &v27;
goto LABEL_21;
}
LABEL_22:
v11 = a1->m_corners._Elems[3].y;
if ( v11 <= v29.y )
{
if ( v11 <= v6 && (v11 != v6 || v27.x <= a1->m_corners._Elems[3].x) )
goto LABEL_29;
v12 = &v27;
}
else
{
cocos2d::CCPoint::operator=(&v27, &v29);
v12 = &v29;
}
cocos2d::CCPoint::operator=(v12, &a1->m_corners._Elems[3]);
LABEL_29:
p_m_positions = &a1->m_positions;
if ( v29.x <= v27.x )
{
cocos2d::CCPoint::operator=(p_m_positions, &v29);
v14 = &v27;
}
else
{
cocos2d::CCPoint::operator=(p_m_positions, &v27);
v14 = &v29;
}
cocos2d::CCPoint::operator=(&a1->m_positions._Elems[1], v14);
cocos2d::CCPoint::CCPoint(&v30);
cocos2d::CCPoint::CCPoint(&v28);
cocos2d::CCPoint::operator=(&v28, &a1->m_corners);
cocos2d::CCPoint::operator=(&v30, v15);
v16 = a1->m_corners._Elems[0].y;
if ( v30.y > v16 )
{
cocos2d::CCPoint::operator=(&v28, &v30);
v17 = &v30;
LABEL_38:
cocos2d::CCPoint::operator=(v17, &a1->m_corners);
v18 = v28.y;
goto LABEL_39;
}
v18 = v28.y;
if ( v28.y > v16 || v16 == v28.y && p_m_corners->_Elems[0].x > v28.x )
{
v17 = &v28;
goto LABEL_38;
}
LABEL_39:
v19 = a1->m_corners._Elems[1].y;
if ( v30.y > v19 )
{
cocos2d::CCPoint::operator=(&v28, &v30);
v20 = &v30;
LABEL_45:
cocos2d::CCPoint::operator=(v20, &a1->m_corners._Elems[1]);
v18 = v28.y;
goto LABEL_46;
}
if ( v18 > v19 || v19 == v18 && a1->m_corners._Elems[1].x > v28.x )
{
v20 = &v28;
goto LABEL_45;
}
LABEL_46:
v21 = a1->m_corners._Elems[2].y;
if ( v30.y > v21 )
{
cocos2d::CCPoint::operator=(&v28, &v30);
v22 = &v30;
LABEL_52:
cocos2d::CCPoint::operator=(v22, &a1->m_corners._Elems[2]);
v18 = v28.y;
goto LABEL_53;
}
if ( v18 > v21 || v21 == v18 && a1->m_corners._Elems[2].x > v28.x )
{
v22 = &v28;
goto LABEL_52;
}
LABEL_53:
v23 = a1->m_corners._Elems[3].y;
if ( v30.y <= v23 )
{
if ( v18 <= v23 && (v23 != v18 || a1->m_corners._Elems[3].x <= v28.x) )
goto LABEL_60;
v24 = &v28;
}
else
{
cocos2d::CCPoint::operator=(&v28, &v30);
v24 = &v30;
}
cocos2d::CCPoint::operator=(v24, &a1->m_corners._Elems[3]);
LABEL_60:
v25 = &a1->m_positions._Elems[2];
if ( v30.x <= v28.x )
{
cocos2d::CCPoint::operator=(v25, &v28);
v26 = &v30;
}
else
{
cocos2d::CCPoint::operator=(v25, &v30);
v26 = &v28;
}
cocos2d::CCPoint::operator=(&a1->m_positions._Elems[3], v26);
}