//
// sub_100632D28 from 0x100632d28 to 0x100632e9c (372 bytes)
//
// 2 xrefs:
// > sub_100618EA8 @ 0x100618eac
// > sub_10062EE44 @ 0x10062ee48
//
// 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:10:29 +0000
//
__int64 __fastcall sub_100632D28(__int16 *a1, char *__dst, int *a3, unsigned int *a4, signed int a5)
{
__int64 v5; // x8
int v6; // w12
unsigned int v7; // w9
signed int v8; // w13
const void *v9; // x8
__int64 v10; // x10
__int64 v11; // x11
__int64 v12; // x13
char *v13; // x15
__int64 i; // x17
__int64 v15; // x3
if ( !__dst )
{
if ( !((unsigned __int64)a3 | (unsigned __int64)a4) )
return 31;
if ( a3 )
*a3 = a1[1];
if ( !a4 )
return 0;
v5 = 0;
*a4 = *a1;
return v5;
}
v5 = 31;
if ( !a3 || !a4 )
return v5;
v6 = *a3;
if ( !*a3 )
{
v6 = a1[1];
*a3 = v6;
v7 = *a4;
if ( *a4 )
goto LABEL_6;
LABEL_23:
v7 = *a1;
*a4 = v7;
v6 = *a3;
goto LABEL_6;
}
v7 = *a4;
if ( !*a4 )
goto LABEL_23;
LABEL_6:
v5 = 31;
if ( v6 <= 32 && v7 <= 0x20 && (v6 & 0x80000000) == 0 )
{
if ( a5 )
v8 = a5;
else
v8 = v7;
v9 = *((const void **)a1 + 1);
if ( v9 && v6 == a1[1] && v8 == *a1 )
{
memcpy(__dst, v9, 4LL * v7 * v6);
}
else if ( v6 )
{
v10 = 0;
v11 = v8;
v12 = 4LL * v8;
v13 = __dst;
do
{
if ( v7 )
{
for ( i = 0; i != v7; ++i )
{
if ( v9 || v10 != i )
{
if ( v9 && v10 < a1[1] && (v15 = *a1, i < v15) )
*(_DWORD *)&v13[4 * i] = *((_DWORD *)v9 + i + v10 * v15);
else
*(_DWORD *)&v13[4 * i] = 0;
}
else
{
*(_DWORD *)&__dst[4 * v10 + 4 * v10 * v11] = 1065353216;
}
}
}
++v10;
v13 += v12;
}
while ( v10 != v6 );
}
return 0;
}
return v5;
}