//
// GJSmartTemplate::getNoCornerKey from 0x1004102e0 to 0x1004103fd (285 bytes)
//
// 8 xrefs:
// > GJSmartTemplate::saveRemap @ 0x10040f11b
// > GJSmartTemplate::saveRemap @ 0x10040f200
// > GJSmartTemplate::saveRemap @ 0x10040f46c
// > GJSmartTemplate::saveRemap @ 0x10040f6bc
// > GJSmartTemplate::scanForPrefab @ 0x100410a27
// > GJSmartTemplate::getPrefab_1 @ 0x100411fdb
// > GJSmartTemplate::getPrefab_1 @ 0x1004120df
// > GJSmartTemplate::getPrefab_1 @ 0x100412225
//
// 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 12:30:09 +0000
//
std::string *__fastcall GJSmartTemplate::getNoCornerKey(std::string *a1, __int64 a2, unsigned __int8 *a3)
{
std::string *v4; // rbx
unsigned int v5; // eax
unsigned __int64 v6; // rax
const void *v7; // rsi
size_t v8; // r15
std::string::pointer data; // r12
unsigned int v10; // r15d
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v11; // r13
size_t v12; // rbx
unsigned __int128 v13; // kr00_16
size_t v14; // r15
const void *v15; // r14
size_t v16; // rdx
std::string::pointer __p; // [rsp+0h] [rbp-50h]
std::string __dst[2]; // [rsp+10h] [rbp-40h] BYREF
v4 = a1;
v5 = *a3;
if ( (v5 & 1) == 0 )
{
if ( *a3 )
{
v6 = v5 >> 1;
v7 = a3 + 1;
goto LABEL_6;
}
LABEL_11:
*(_WORD *)&a1->__r_.__value_.__l.0 = 0;
return v4;
}
v6 = *((_QWORD *)a3 + 1);
if ( !v6 )
goto LABEL_11;
v7 = *((const void **)a3 + 2);
LABEL_6:
v8 = 5;
if ( v6 < 5 )
v8 = v6;
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v8);
data = __dst[0].__r_.__value_.__s.__data_;
memmove((char *)&__dst[0].__r_.__value_.__l.0 + 1, v7, v8);
*((_BYTE *)&__dst[0].__r_.__value_.__l.0 + v8 + 1) = 0;
std::string::append(__dst, "0000");
v10 = *a3;
v11 = __dst[0].__r_.__value_.__s.0;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
{
v12 = *(_BYTE *)&__dst[0].__r_.__value_.__l.0 >> 1;
__p = __dst[0].__r_.__value_.__l.__data_;
if ( (v10 & 1) == 0 )
goto LABEL_10;
LABEL_13:
v14 = *((_QWORD *)a3 + 1);
v15 = *((const void **)a3 + 2);
goto LABEL_14;
}
data = __dst[0].__r_.__value_.__l.__data_;
v13 = *(_OWORD *)&__dst[0].__r_.__value_.__r.__words[1];
__p = (std::string::pointer)(v13 >> 64);
v12 = v13;
if ( (v10 & 1) != 0 )
goto LABEL_13;
LABEL_10:
v14 = v10 >> 1;
v15 = a3 + 1;
LABEL_14:
v16 = v12;
if ( v14 < v12 )
v16 = v14;
if ( !memcmp(data, v15, v16) && v14 == v12 )
{
v4 = a1;
*(_WORD *)&a1->__r_.__value_.__l.0 = 0;
if ( (*(_BYTE *)&v11 & 1) != 0 )
operator delete(__p);
}
else
{
v4 = a1;
*a1 = __dst[0];
}
return v4;
}