//
// sub_10046BD7C from 0x10046bd7c to 0x10046be4c (208 bytes)
//
// 1 xrefs:
// > OptionsScrollLayer::init @ 0x10046aea8
//
// 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:05:35 +0000
//
void __fastcall sub_10046BD7C(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v6; // x21
unsigned __int64 v7; // x24
void *v8; // x0
unsigned __int64 v9; // x8
bool v10; // cc
void *v11; // x23
v6 = (a2 - a1) >> 3;
if ( v6 < 129 )
{
v11 = nullptr;
v7 = 0;
}
else
{
v7 = (a2 - a1) >> 3;
while ( 1 )
{
v8 = operator new(8 * v7, &std::nothrow);
if ( v8 )
break;
v9 = v7 >> 1;
v10 = v7 > 1;
v7 >>= 1;
if ( !v10 )
{
v11 = nullptr;
v7 = v9;
goto LABEL_8;
}
}
v11 = v8;
}
LABEL_8:
sub_10046BE64(a1, a2, a3, v6, v11, v7);
if ( v11 )
operator delete(v11);
}