//
// sub_100015640 from 0x100015640 to 0x100015680 (64 bytes)
//
// 9 xrefs:
// > GJBaseGameLayer::activateProgressTrigger @ 0x100285eb8
// > GJBaseGameLayer::activateProgressTrigger @ 0x100285f1c
// > GJBaseGameLayer::testInstantCountTrigger @ 0x100297800
// > GJBaseGameLayer::collectedObject @ 0x1002978c0
// > GJBaseGameLayer::addPickupTrigger @ 0x100297914
// > GJBaseGameLayer::addPickupTrigger @ 0x100297930
// > GJBaseGameLayer::addPickupTrigger @ 0x100297978
// > GJBaseGameLayer::getItemValue @ 0x100297a94
// > GJBaseGameLayer::refreshCounterLabels @ 0x10029886c
//
// 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 10:57:18 +0000
//
__int64 __fastcall sub_100015640(__int64 a1, int a2)
{
int v2; // w8
__int64 result; // x0
int v4; // [xsp+Ch] [xbp-4h] BYREF
v2 = a2 & ~(a2 >> 31);
if ( v2 >= 9999 )
v2 = 9999;
v4 = v2;
result = sub_100019268(a1 + 712, &v4);
if ( result )
return *(unsigned int *)(result + 20);
return result;
}