//
// GJSmartTemplate::flipBlockType from 0x100413870 to 0x1004138d6 (102 bytes)
//
// 9 xrefs:
// > GJSmartTemplate::flipKey @ 0x10041296d
// > GJSmartTemplate::flipKey @ 0x10041297e
// > GJSmartTemplate::flipKey @ 0x10041298f
// > GJSmartTemplate::flipKey @ 0x1004129a0
// > GJSmartTemplate::flipKey @ 0x1004129b1
// > GJSmartTemplate::flipKey @ 0x1004129c2
// > GJSmartTemplate::flipKey @ 0x1004129d3
// > GJSmartTemplate::flipKey @ 0x1004129e3
// > GJSmartTemplate::flipKey @ 0x1004129f4
//
// 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:10 +0000
//
__int64 __fastcall GJSmartTemplate::flipBlockType(unsigned int a1, char a2, char a3)
{
__int64 result; // rax
unsigned int v4; // ecx
unsigned int v5; // ecx
result = a1;
if ( !(((a1 & 0xFFFFFFFE) == 48) | (unsigned __int8)(a3 | a2) ^ 1) )
{
if ( a2 )
{
v4 = 51;
if ( a1 - 51 <= 0x19 )
v4 = *(_DWORD *)&a2_6[4 * a1 - 204];
if ( a3 )
goto LABEL_6;
}
else
{
v4 = a1;
if ( a3 )
{
LABEL_6:
v5 = v4 - 51;
result = 52;
if ( v5 <= 0x19 )
return *(unsigned int *)&a5_5[4 * v5];
return result;
}
}
return v4;
}
return result;
}