//
// sub_1003A9A88 from 0x1003a9a88 to 0x1003a9dbc (820 bytes)
//
// 1 xrefs:
// > SecretLayer2::onSubmit @ 0x1003a8364
//
// This function is hookable on this platform (idp: arm, 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:03:51 +0000
//
void __usercall sub_1003A9A88(__int64 a1@, _QWORD *a2@)
{
__int64 v2; // x20
int v4; // w8
int v5; // w8
char *v6; // x1
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
void **v10; // x8
void *v11; // x0
char *CString; // x0
void **v13; // x8
void *v14; // x0
char *v15; // x0
void **v16; // x8
void *v17; // x0
char *v18; // x0
void *__p[2]; // [xsp+10h] [xbp-30h] BYREF
__int64 v20; // [xsp+20h] [xbp-20h]
v2 = a1;
v4 = *(_DWORD *)(a1 + 452);
if ( v4 < 0 )
{
a1 = rand();
v5 = llroundf(vcvts_n_f32_s32(a1, 0x1Fu) * 30.0);
}
else
{
v5 = v4 + 1;
}
if ( v5 > 29 )
v5 = 0;
*(_DWORD *)(v2 + 452) = v5;
switch ( v5 )
{
case 0:
v6 = "No, just no";
goto LABEL_41;
case 1:
v6 = "Swing and a miss!";
goto LABEL_41;
case 2:
v6 = "I told you, it wont work...";
goto LABEL_41;
case 3:
v6 = "Door is now open. Oh wait, no it's not.";
goto LABEL_41;
case 4:
v6 = "Is that actually your guess?";
goto LABEL_41;
case 5:
v7 = GameManager::sharedState(a1);
if ( *(char *)(v7 + 655) < 0 )
{
sub_1000097D0(__p, *(void **)(v7 + 632), *(_QWORD *)(v7 + 640));
}
else
{
*(_OWORD *)__p = *(_OWORD *)(v7 + 632);
v20 = *(_QWORD *)(v7 + 648);
}
v10 = __p;
if ( v20 < 0 )
v10 = (void **)__p[0];
v11 = sub_1003065B0("Go home %s.", (const char *)v10);
CString = (char *)cocos2d::CCString::getCString((__int64)v11);
sub_100009900(a2, CString);
goto LABEL_54;
case 6:
v6 = "Nope";
goto LABEL_41;
case 7:
v6 = "Give up, please";
goto LABEL_41;
case 8:
v6 = "Door is still locked";
goto LABEL_41;
case 9:
v6 = "That tickles!";
goto LABEL_41;
case 10:
v6 = "Try harder please";
goto LABEL_41;
case 11:
v6 = "Don't make me angry";
goto LABEL_41;
case 12:
v6 = "You won't like me when im angry...";
goto LABEL_41;
case 13:
v6 = "Oh no, you just unlocked... NOTHING";
goto LABEL_41;
case 14:
v6 = "Only 3 attempts left!";
goto LABEL_41;
case 15:
v6 = "Only 2 attempts left!";
goto LABEL_41;
case 16:
v6 = "LAST ATTEMPT!";
goto LABEL_41;
case 17:
v6 = "Just kidding, unlimited attempts";
goto LABEL_41;
case 18:
v6 = "Maybe you should do something else?";
goto LABEL_41;
case 19:
v6 = "This is getting ridiculus...";
goto LABEL_41;
case 20:
v6 = "Go collect some stars";
goto LABEL_41;
case 21:
v6 = "How about no?";
goto LABEL_41;
case 22:
v8 = GameManager::sharedState(a1);
if ( *(char *)(v8 + 655) < 0 )
{
sub_1000097D0(__p, *(void **)(v8 + 632), *(_QWORD *)(v8 + 640));
}
else
{
*(_OWORD *)__p = *(_OWORD *)(v8 + 632);
v20 = *(_QWORD *)(v8 + 648);
}
v13 = __p;
if ( v20 < 0 )
v13 = (void **)__p[0];
v14 = sub_1003065B0("%s, please give up...", (const char *)v13);
v15 = (char *)cocos2d::CCString::getCString((__int64)v14);
sub_100009900(a2, v15);
goto LABEL_54;
case 23:
v6 = "Error, error. Bad answers.";
goto LABEL_41;
case 24:
v6 = "Failure";
goto LABEL_41;
case 25:
v6 = "May I suggest thinking?";
goto LABEL_41;
case 26:
v6 = "WRONG";
goto LABEL_41;
case 27:
v6 = "You're hopeless...";
goto LABEL_41;
case 28:
v6 = "Really, still here?";
goto LABEL_41;
case 29:
v9 = GameManager::sharedState(a1);
if ( *(char *)(v9 + 655) < 0 )
{
sub_1000097D0(__p, *(void **)(v9 + 632), *(_QWORD *)(v9 + 640));
}
else
{
*(_OWORD *)__p = *(_OWORD *)(v9 + 632);
v20 = *(_QWORD *)(v9 + 648);
}
v16 = __p;
if ( v20 < 0 )
v16 = (void **)__p[0];
v17 = sub_1003065B0("What kind of name is %s anyway?", (const char *)v16);
v18 = (char *)cocos2d::CCString::getCString((__int64)v17);
sub_100009900(a2, v18);
LABEL_54:
if ( SHIBYTE(v20) < 0 )
operator delete(__p[0]);
break;
default:
v6 = "Don't touch that!";
LABEL_41:
sub_100009900(a2, v6);
break;
}
}