//
// GJOptionsLayer::getToggleButton from 0x14039af90 to 0x14039b036 (166 bytes)
//
// 4 xrefs:
// > GameLevelOptionsLayer::didToggle @ 0x1403aa7c6
// > GameLevelOptionsLayer::didToggle @ 0x1403aa7e6
// > GameLevelOptionsLayer::didToggle @ 0x1403aa98a
// > GameLevelOptionsLayer::FLAlert_Clicked @ 0x1403aa9e6
//
// 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 11:31:14 +0000
//
__int64 __fastcall GJOptionsLayer::getToggleButton(_QWORD *a1, int a2)
{
__int64 v2; // r8
__int64 *v3; // rcx
__int64 v4; // rax
__int64 v5; // rcx
v2 = a1[135];
v3 = (__int64 *)(a1[137]
+ 16
* (a1[140]
& (0x100000001B3LL
* ((0x100000001B3LL
* (BYTE2(a2)
^ (0x100000001B3LL
* (BYTE1(a2) ^ (0x100000001B3LL * ((unsigned __int8)a2 ^ 0xCBF29CE484222325uLL))))))
^ HIBYTE(a2)))));
v4 = v3[1];
if ( v4 != v2 )
{
v5 = *v3;
if ( a2 == *(_DWORD *)(v4 + 16) )
goto LABEL_7;
while ( v4 != v5 )
{
v4 = *(_QWORD *)(v4 + 8);
if ( a2 == *(_DWORD *)(v4 + 16) )
goto LABEL_7;
}
}
v4 = 0;
LABEL_7:
if ( !v4 )
v4 = v2;
if ( v4 == v2 )
return 0;
else
return *(_QWORD *)(v4 + 24);
}