//
// GameToolbox::highestChildZ from 0x14006da80 to 0x14006db0d (141 bytes)
//
// 8 xrefs:
// > CCTextInputNode::openEditMenu @ 0x14005957d
// > FLAlertLayer::show @ 0x14005b987
// > FLAlertLayer::show @ 0x14005b9a2
// > FLAlertLayer::show @ 0x14005ba5a
// > FLAlertLayer::show @ 0x14005ba75
// > ??> @ 0x140889774
// > ??> @ 0x1408897cc
// > ??> @ 0x140911648
//
// 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:25:48 +0000
//
__int64 __fastcall GameToolbox::highestChildZ(__int64 a1)
{
int v1; // esi
__int64 v2; // rax
unsigned int *v3; // rbx
__int64 v4; // rax
_QWORD *v5; // rbx
_QWORD *i; // rbp
__int64 v7; // rdi
v1 = 0;
if ( !a1 )
return 0;
v2 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 480LL))(a1);
if ( !v2 )
return 0;
v3 = *(unsigned int **)(v2 + 56);
v4 = *v3;
if ( (_DWORD)v4 )
{
v5 = *((_QWORD **)v3 + 2);
for ( i = &v5[v4 - 1]; v5 <= i; ++v5 )
{
v7 = *v5;
if ( !*v5 )
break;
if ( v1 <= (*(int (__fastcall **)(_QWORD))(*(_QWORD *)v7 + 96LL))(*v5) )
v1 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 96LL))(v7);
}
}
return (unsigned int)v1;
}