//
// sub_10003474C from 0x10003474c to 0x1000347e8 (156 bytes)
//
// 1 xrefs:
// > sub_10003443C @ 0x100034544
//
// 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:32 +0000
//
__int64 __fastcall sub_10003474C(__int64 result, __int64 a2, __int64 (__fastcall **a3)(__int64, __int64), __int64 a4)
{
unsigned __int64 v4; // x8
__int64 v6; // x20
unsigned __int64 v7; // x23
__int64 *v8; // x24
__int64 *v9; // x21
__int64 v10; // x22
__int64 *v11; // x25
v4 = a4 - 2;
if ( a4 >= 2 )
{
v6 = result;
v7 = v4 >> 1;
v8 = (__int64 *)(result + 8 * (v4 >> 1));
v9 = (__int64 *)(a2 - 8);
result = (*a3)(*v8, *(_QWORD *)(a2 - 8));
if ( (_DWORD)result )
{
v10 = *v9;
do
{
v11 = v8;
*v9 = *v8;
if ( !v7 )
break;
v7 = (v7 - 1) >> 1;
v8 = (__int64 *)(v6 + 8 * v7);
result = (*a3)(*v8, v10);
v9 = v11;
}
while ( (result & 1) != 0 );
*v11 = v10;
}
}
return result;
}