//
// GJSmartTemplate::flipKey from 0x100425bc0 to 0x100425dc2 (514 bytes)
//
// 4 xrefs:
// > GJSmartTemplate::scanForPrefab @ 0x100423fb8
// > GJSmartTemplate::scanForPrefab @ 0x1004240e1
// > GJSmartTemplate::scanForPrefab @ 0x100424210
// > GJSmartTemplate::scanForPrefab @ 0x100424226
//
// 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
//
std::string *__fastcall GJSmartTemplate::flipKey(std::string *a1, std::string *a2, bool a3, bool a4)
{
SmartBlockType v6; // r12d
SmartBlockType v7; // ebx
SmartBlockType v8; // eax
SmartBlockType v9; // r13d
SmartBlockType v10; // ecx
SmartBlockType v11; // ebx
std::string::value_type v13; // r13
std::string::value_type v14; // bl
std::string::value_type v15; // r12
std::string::value_type v16; // al
std::string::value_type v17; // [rsp+14h] [rbp-4Ch]
SmartBlockType v18; // [rsp+18h] [rbp-48h]
std::string::value_type v19; // [rsp+18h] [rbp-48h]
SmartBlockType v20; // [rsp+20h] [rbp-40h]
SmartBlockType v21; // [rsp+24h] [rbp-3Ch]
SmartBlockType v22; // [rsp+28h] [rbp-38h]
std::string::value_type v23; // [rsp+28h] [rbp-38h]
SmartBlockType v24; // [rsp+2Ch] [rbp-34h]
std::string::value_type v25; // [rsp+2Ch] [rbp-34h]
SmartBlockType v26; // [rsp+30h] [rbp-30h]
std::string::value_type v27; // [rsp+30h] [rbp-30h]
SmartBlockType v28; // [rsp+34h] [rbp-2Ch]
SmartBlockType v29; // [rsp+34h] [rbp-2Ch]
if ( a4 || a3 )
{
v22 = *std::string::at(a2, 0);
v6 = *std::string::at(a2, 1u);
v28 = *std::string::at(a2, 2u);
v24 = *std::string::at(a2, 3u);
v18 = *std::string::at(a2, 4u);
v20 = *std::string::at(a2, 5u);
v21 = *std::string::at(a2, 6u);
v7 = *std::string::at(a2, 7u);
v8 = *std::string::at(a2, 8u);
if ( a3 )
{
v9 = v28;
v26 = v18;
v18 = v24;
v29 = v21;
v10 = v20;
v20 = v8;
v21 = v7;
v11 = v10;
}
else
{
v9 = v6;
v6 = v28;
v26 = v24;
v29 = v7;
v11 = v8;
}
v23 = GJSmartTemplate::flipBlockType(v22, a3, a4);
v25 = GJSmartTemplate::flipBlockType(v6, a3, a4);
v17 = GJSmartTemplate::flipBlockType(v9, a3, a4);
v27 = GJSmartTemplate::flipBlockType(v26, a3, a4);
v13 = GJSmartTemplate::flipBlockType(v18, a3, a4);
v19 = GJSmartTemplate::flipBlockType(v29, a3, a4);
v14 = GJSmartTemplate::flipBlockType(v11, a3, a4);
v15 = GJSmartTemplate::flipBlockType(v20, a3, a4);
v16 = GJSmartTemplate::flipBlockType(v21, a3, a4);
GJSmartTemplate::keyFromNeighbors_1(a1, v23, v25, v17, v27, v13, v19, v14, v15, v16);
return a1;
}
else
{
a1->__r_.__value_.__r.__words[2] = a2->__r_.__value_.__r.__words[2];
*(_OWORD *)&a1->__r_.__value_.__l.0 = *(_OWORD *)&a2->__r_.__value_.__l.0;
*(_OWORD *)&a2->__r_.__value_.__l.0 = 0;
a2->__r_.__value_.__r.__words[2] = 0;
return a1;
}
}