//
// GJSmartTemplate::smartObjectToType from 0x66ebbc to 0x66ed5e (418 bytes)
//
// 11 xrefs:
// > EditorUI::addObjectsToSmartTemplate @ 0x4883f6
// > GJSmartTemplate::offsetForObject @ 0x66ed9c
// > GJSmartTemplate::keyFromNeighbors @ 0x66f8ea
// > GJSmartTemplate::keyFromNeighbors @ 0x66f916
// > GJSmartTemplate::keyFromNeighbors @ 0x66f938
// > GJSmartTemplate::keyFromNeighbors @ 0x66f95c
// > GJSmartTemplate::keyFromNeighbors @ 0x66f980
// > GJSmartTemplate::keyFromNeighbors @ 0x66f9a4
// > GJSmartTemplate::keyFromNeighbors @ 0x66f9c8
// > GJSmartTemplate::keyFromNeighbors @ 0x66f9ec
// > GJSmartTemplate::keyFromNeighbors @ 0x66fa0c
//
// 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:55:49 +0000
//
int __fastcall GJSmartTemplate::smartObjectToType(_DWORD *a1, cocos2d::CCPoint *this)
{
int v4; // r3
int v5; // r4
float v6; // s15
_BOOL4 v7; // r3
float v8; // s16
float v9; // s16
float v10; // s16
float v11; // s16
if ( a1 )
{
v4 = a1[223];
switch ( v4 )
{
case 2896:
switch ( a1[237] )
{
case 0:
case 7:
v5 = 50;
break;
case 1:
case 5:
v5 = 52;
break;
case 2:
case 4:
v5 = 51;
break;
case 3:
case 6:
v5 = 53;
break;
default:
goto LABEL_28;
}
break;
case 2897:
v6 = fabsf((*(float (__fastcall **)(_DWORD *))(*a1 + 184))(a1));
v7 = v6 == 90.0 || v6 == 270.0;
switch ( a1[237] )
{
case 0:
case 7:
if ( v7 )
v5 = 69;
else
v5 = 54;
break;
case 1:
case 5:
if ( v7 )
v5 = 73;
else
v5 = 65;
break;
case 2:
case 4:
if ( v7 )
v5 = 71;
else
v5 = 56;
break;
case 3:
case 6:
if ( v7 )
v5 = 75;
else
v5 = 67;
break;
default:
goto LABEL_28;
}
break;
case 2895:
v5 = 49;
break;
default:
v5 = 48;
break;
}
}
else
{
LABEL_28:
v5 = 48;
}
if ( !cocos2d::CCPoint::equals(this, (const cocos2d::CCPoint *)&unk_D2D218) )
{
switch ( v5 )
{
case '6':
case 'A':
v8 = *(float *)this;
if ( v8 > *(float *)(*(int (__fastcall **)(_DWORD *))(*a1 + 96))(a1) )
{
if ( v5 == 54 )
{
v5 = 55;
}
else if ( v5 == 65 )
{
v5 = 66;
}
}
break;
case '8':
case 'C':
v9 = *(float *)this;
if ( v9 < *(float *)(*(int (__fastcall **)(_DWORD *))(*a1 + 96))(a1) )
{
if ( v5 == 56 )
{
v5 = 57;
}
else if ( v5 == 67 )
{
v5 = 68;
}
}
break;
case 'E':
case 'G':
v10 = *((float *)this + 1);
if ( v10 < *(float *)((*(int (__fastcall **)(_DWORD *))(*a1 + 96))(a1) + 4) )
{
if ( v5 == 69 )
{
v5 = 70;
}
else if ( v5 == 71 )
{
v5 = 72;
}
}
break;
case 'I':
case 'K':
v11 = *((float *)this + 1);
if ( v11 > *(float *)((*(int (__fastcall **)(_DWORD *))(*a1 + 96))(a1) + 4) )
{
if ( v5 == 73 )
{
v5 = 74;
}
else if ( v5 == 75 )
{
v5 = 76;
}
}
break;
default:
return v5;
}
}
return v5;
}