//
// sub_1006B1B34 from 0x1006b1b34 to 0x1006b1c54 (288 bytes)
//
// 1 xrefs:
// > sub_100704898 @ 0x1007048fc
//
// 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:11:50 +0000
//
__int64 __fastcall sub_1006B1B34(
__int64 a1,
__int64 a2,
__int64 a3,
int a4,
__int64 (__fastcall *a5)(__int64, __int64),
char a6)
{
__int64 v9; // x25
__int64 v12; // x23
int v13; // w26
__int64 v14; // x27
int v15; // w0
int v16; // w8
bool v17; // w9
__int64 v18; // x24
__int64 v19; // x23
int v20; // w26
bool v21; // vf
int v22; // w0
v9 = a3;
v12 = 0;
if ( (_DWORD)a3 )
{
v13 = 0;
LODWORD(v14) = 0;
v15 = 0;
LABEL_4:
v16 = v14;
v14 = v9;
while ( 1 )
{
v9 = v14;
if ( v13 >= (int)v14 )
break;
v14 = (unsigned int)(((int)v14 + v13) / 2);
v12 = a2 + (int)v14 * a4;
v15 = a5(a1, v12);
v16 = v14;
if ( (v15 & 0x80000000) == 0 )
{
if ( v15 >= 1 )
{
v13 = v14 + 1;
goto LABEL_4;
}
v17 = 0;
v16 = v14;
goto LABEL_12;
}
}
v17 = v15 != 0;
if ( (a6 & 1) == 0 && v15 )
return 0;
LABEL_12:
if ( (a6 & 2) != 0 && !v17 )
{
v18 = v16;
v19 = a2 + (v16 - 1LL) * a4;
do
{
v20 = v18;
v21 = __OFSUB__(v18--, 1);
if ( v18 < 0 != v21 )
break;
v22 = a5(a1, v19);
v19 -= a4;
}
while ( !v22 );
return a2 + v20 * a4;
}
}
return v12;
}