//
// GJSmartTemplate::rotateKey from 0x66fe68 to 0x66ffce (358 bytes)
//
// 1 xrefs:
// > GJSmartTemplate::scanForPrefab @ 0x671da0
//
// 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:50 +0000
//
int *__fastcall GJSmartTemplate::rotateKey(int *a1, int a2, int a3)
{
int v6; // r0
int v7; // r1
int v8; // r2
int v9; // t0
int v10; // r9
int v11; // r10
int v12; // r7
int v13; // r6
int v14; // r8
unsigned __int8 *v15; // r0
int v16; // r3
int v17; // r2
int v18; // r5
int v19; // r1
int v20; // r1
int v21; // r1
int v22; // r1
char v23; // r10
char v24; // r9
char v25; // r8
char v26; // r7
char v27; // r5
char v28; // r0
int v30; // [sp+18h] [bp-14h]
int v31; // [sp+18h] [bp-14h]
int v32; // [sp+1Ch] [bp-10h]
char v33; // [sp+1Ch] [bp-10h]
int v34; // [sp+20h] [bp-Ch]
char v35; // [sp+20h] [bp-Ch]
int v36; // [sp+24h] [bp-8h]
if ( a3 )
{
v34 = *std::string::at((unsigned __int8 *)a2, 0);
v10 = *std::string::at((unsigned __int8 *)a2, 1u);
v11 = *std::string::at((unsigned __int8 *)a2, 2u);
v32 = *std::string::at((unsigned __int8 *)a2, 3u);
v30 = *std::string::at((unsigned __int8 *)a2, 4u);
v12 = *std::string::at((unsigned __int8 *)a2, 5u);
v13 = *std::string::at((unsigned __int8 *)a2, 6u);
v14 = *std::string::at((unsigned __int8 *)a2, 7u);
v15 = std::string::at((unsigned __int8 *)a2, 8u);
v16 = v30;
v17 = v32;
v18 = *v15;
if ( a3 != 90 )
{
if ( a3 == 180 )
{
v22 = v14;
v14 = *v15;
v18 = v13;
v13 = v12;
v12 = v22;
v17 = v11;
v11 = v30;
v16 = v10;
v10 = v32;
}
else if ( a3 == 270 )
{
v19 = v12;
v12 = *v15;
v18 = v19;
v20 = v14;
v14 = v13;
v13 = v20;
v21 = v11;
v11 = v10;
v10 = v21;
v17 = v30;
v16 = v32;
}
else
{
v13 = 0;
v14 = 0;
v18 = 0;
v12 = 0;
v10 = 0;
v11 = 0;
v16 = 0;
v17 = 0;
}
}
v36 = v16;
v31 = v17;
v35 = GJSmartTemplate::rotateBlockType(v34, a3);
v33 = GJSmartTemplate::rotateBlockType(v31, a3);
LOBYTE(v31) = GJSmartTemplate::rotateBlockType(v36, a3);
v23 = GJSmartTemplate::rotateBlockType(v11, a3);
v24 = GJSmartTemplate::rotateBlockType(v10, a3);
v25 = GJSmartTemplate::rotateBlockType(v14, a3);
v26 = GJSmartTemplate::rotateBlockType(v12, a3);
v27 = GJSmartTemplate::rotateBlockType(v18, a3);
v28 = GJSmartTemplate::rotateBlockType(v13, a3);
GJSmartTemplate::keyFromNeighbors(a1, v35, v33, v31, v23, v24, v25, v26, v27, v28);
}
else
{
v6 = *(_DWORD *)a2;
v9 = a2 + 4;
v7 = *(_DWORD *)(a2 + 4);
v8 = *(_DWORD *)(v9 + 4);
*a1 = v6;
a1[1] = v7;
a1[2] = v8;
*(_DWORD *)a2 = 0;
*(_DWORD *)(a2 + 4) = 0;
*(_DWORD *)(a2 + 8) = 0;
}
return a1;
}