//
// sub_100706BE8 from 0x100706be8 to 0x100706e34 (588 bytes)
//
// 2 xrefs:
// > sub_100706E34 @ 0x100706e4c
// > sub_1007086C0 @ 0x1007086c8
//
// 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:12:51 +0000
//
__int64 sub_100706BE8()
{
int *v0; // x19
__int64 *v1; // x20
__int64 v2; // t1
__int64 *v3; // x20
__int64 v4; // t1
__int64 i; // x8
int *v6; // x19
__int64 v7; // x0
__int64 v8; // x3
__int64 v9; // x19
char **v10; // x23
char *v11; // x20
char *v12; // x8
char *v13; // x8
__int64 result; // x0
__int64 v15; // x8
__int64 *v16; // x19
__int64 v17; // t1
if ( !qword_100A0CD78 )
{
sub_1006AE2F8(9, 1, (__int64)"err.c", 295);
if ( !qword_100A0CD78 )
qword_100A0CD78 = (__int64)off_1009BEE90;
sub_1006AE2F8(10, 1, (__int64)"err.c", 298);
}
v0 = &dword_1009E9350;
v1 = &qword_1009E9408;
if ( qword_1009E9408 )
{
do
{
(*(void (__fastcall **)(__int64 *))(qword_100A0CD78 + 24))(v1);
v2 = v1[2];
v1 += 2;
}
while ( v2 );
}
if ( qword_1009E95D8 )
{
v3 = &qword_1009E95D8;
do
{
(*(void (__fastcall **)(__int64 *))(qword_100A0CD78 + 24))(v3);
v4 = v3[2];
v3 += 2;
}
while ( v4 );
}
for ( i = qword_1009E9358; i; v0 = v6 + 2 )
{
*((_QWORD *)v0 + 1) = i | 0x2000000;
v6 = v0 + 2;
(*(void (__fastcall **)(int *))(qword_100A0CD78 + 24))(v6);
i = *((_QWORD *)v6 + 2);
}
sub_1006AE2F8(5, 1, (__int64)"err.c", 583);
if ( byte_100A0CD70 == 1 )
{
v7 = 6;
v8 = 585;
}
else
{
v9 = 1;
sub_1006AE2F8(6, 1, (__int64)"err.c", 589);
sub_1006AE2F8(9, 1, (__int64)"err.c", 590);
if ( byte_100A0CD70 == 1 )
{
v7 = 10;
v8 = 592;
}
else
{
v10 = (char **)&unk_100A0D0F0;
v11 = (char *)&unk_100A0D8F0;
do
{
*(v10 - 1) = (char *)v9;
if ( !*v10 )
{
v12 = strerror(v9);
if ( v12 )
{
strncpy(v11, v12, 0x20u);
v11[31] = 0;
*v10 = v11;
v13 = v11;
}
else
{
v13 = *v10;
}
if ( !v13 )
*v10 = "unknown";
}
++v9;
v11 += 32;
v10 += 2;
}
while ( v9 != 128 );
byte_100A0CD70 = 1;
v7 = 10;
v8 = 620;
}
}
result = sub_1006AE2F8(v7, 1, (__int64)"err.c", v8);
v15 = qword_100A0D0E8;
if ( qword_100A0D0E8 )
{
v16 = &qword_100A0D0E8;
do
{
*v16 = v15 | 0x2000000;
result = (*(__int64 (__fastcall **)(__int64 *))(qword_100A0CD78 + 24))(v16);
v17 = v16[2];
v16 += 2;
v15 = v17;
}
while ( v17 );
}
return result;
}