//
// ParentalGateLayer::generateChallenge from 0x1404d3d00 to 0x1404d3ed4 (468 bytes)
//
// 3 xrefs:
// > ParentalGateLayer::init @ 0x1404d3ce9
// > ParentalGateLayer::onDone @ 0x1404d3f4f
// > ??> @ 0x14092984c
//
// 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:33:01 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall ParentalGateLayer::generateChallenge(__int64 a1)
{
int v2; // edi
int i; // ebx
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // r8
void **v7; // rdx
void *Src[2]; // [rsp+20h] [rbp-28h] BYREF
size_t Size; // [rsp+30h] [rbp-18h]
unsigned __int64 v10; // [rsp+38h] [rbp-10h]
v2 = rand() % 88 + 12;
for ( i = rand() % 88 + 12; v2 == 10 * (v2 / 10); v2 = rand() % 88 + 12 )
;
for ( ; i == 10 * (i / 10); i = rand() % 88 + 12 )
;
*(_DWORD *)(a1 + 768) = v2 * i;
v4 = cocos2d::CCString::createWithFormat("%i x %i = ", v2, i);
CString = cocos2d::CCString::getCString(v4);
*(_OWORD *)Src = 0;
Size = 0;
v10 = 0;
v6 = -1;
do
++v6;
while ( CString[v6] );
sub_14003D230(Src, CString, v6);
if ( (void **)(a1 + 696) != Src )
{
v7 = Src;
if ( v10 > 0xF )
v7 = (void **)Src[0];
sub_1400405A0((void **)(a1 + 696), v7, Size);
}
sub_14003D310((__int64)Src);
sub_1400405A0((void **)(a1 + 728), &byte_1406ED6E0, 0);
NumberInputLayer::updateNumberState(a1);
}