//
// sub_F41864 from 0xf41864 to 0xf41ab4 (592 bytes)
//
// 6 xrefs:
// > android_getCpuFamily @ 0xf41ab8
// > android_getCpuFamily @ 0xf41acc
// > android_getCpuFeatures @ 0xf41aec
// > android_getCpuFeatures @ 0xf41b00
// > android_getCpuCount @ 0xf41b20
// > android_getCpuCount @ 0xf41b34
//
// 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 13:13:07 +0000
//
void sub_F41864()
{
int v0; // w20
int v1; // w19
int v2; // w0
bool v3; // zf
void *v4; // x20
int v5; // w0
void *v6; // x0
void *v7; // x21
__int64 (__fastcall *v8)(__int64); // x1
int v9; // w19
_BYTE buf[256]; // [xsp+48h] [xbp+48h] BYREF
qword_1564058 = 0;
dword_1564054 = 4;
dword_1564060 = 1;
dword_1564050 = 1;
v0 = open("/proc/cpuinfo", 0);
if ( (v0 & 0x80000000) == 0 )
{
v1 = 0;
while ( 1 )
{
v2 = read(v0, buf, 0x100u);
v3 = v2 == 0;
if ( v2 >= 0 )
break;
LABEL_6:
if ( *(_DWORD *)__errno() != 4 )
goto LABEL_7;
}
while ( !v3 )
{
v1 += v2;
v2 = read(v0, buf, 0x100u);
v3 = v2 == 0;
if ( v2 < 0 )
goto LABEL_6;
}
LABEL_7:
close(v0);
v4 = malloc(v1);
if ( v4 )
{
if ( (sub_F41540("/proc/cpuinfo", (__int64)v4, v1) & 0x80000000) == 0 )
{
v5 = sub_F417B8();
dword_1564060 = v5 ? v5 : 1;
dlerror();
v6 = dlopen("libc.so", 2);
v7 = v6;
if ( v6 )
{
v8 = (__int64 (__fastcall *)(__int64))dlsym(v6, "getauxval");
if ( v8 )
{
v9 = v8(16);
dlclose(v7);
if ( v9 )
{
if ( (v9 & 1) != 0 )
qword_1564058 |= 1uLL;
if ( (v9 & 2) != 0 )
qword_1564058 |= 2uLL;
if ( (v9 & 8) != 0 )
qword_1564058 |= 4uLL;
if ( (v9 & 0x10) != 0 )
qword_1564058 |= 8uLL;
if ( (v9 & 0x20) != 0 )
qword_1564058 |= 0x10uLL;
if ( (v9 & 0x40) != 0 )
qword_1564058 |= 0x20uLL;
if ( (v9 & 0x80) != 0 )
qword_1564058 |= 0x40uLL;
}
}
else
{
dlclose(v7);
}
}
}
free(v4);
}
}
}