//
// sub_100628C00 from 0x100628c00 to 0x100628d6c (364 bytes)
//
// 2 xrefs:
// > sub_100628D6C @ 0x100628e08
// > sub_100628E44 @ 0x100629074
//
// 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:23 +0000
//
__int64 __fastcall sub_100628C00(_QWORD *a1, __int64 a2, int *a3, _DWORD *a4)
{
__int64 result; // x0
__int64 v9; // x23
int8x8_t *v10; // x1
int v11; // w0
int8x8_t *v12; // [xsp+0h] [xbp-60h] BYREF
int8x8_t v13[4]; // [xsp+8h] [xbp-58h] BYREF
v12 = nullptr;
result = sub_1005D0224(a1[46], v13, 1u, 2, nullptr);
if ( !(_DWORD)result )
{
v9 = v13[0].u16[0];
result = (*(__int64 (__fastcall **)(_QWORD, int8x8_t **, _QWORD))(*(_QWORD *)a1[46] + 32LL))(
a1[46],
&v12,
v13[0].u16[0]);
if ( !(_DWORD)result )
{
v10 = v12;
if ( v12
|| (v12 = (int8x8_t *)((char *)&v13[-1] - (((((_DWORD)v9 + 11) & 0x1FFF8) + 15) & 0x3FFF0)),
result = sub_1005D0224(a1[46], v12, 1u, v9, nullptr),
v10 = v12,
*(__int32 *)((char *)v12->i32 + v9) = 0,
!(_DWORD)result) )
{
sub_100621E48((__int64)v13, (__int64)v10, v9);
if ( (unsigned int)sub_100624680((__int64 *)a1[54], (unsigned int **)v13, 1) )
{
return 13;
}
else
{
if ( a2 )
{
v11 = sub_100624490(a1[54], (float *)(a2 + 4LL * (unsigned int)(*(_DWORD *)(a1[1] + 12LL) * *a4)), *a3);
*a4 += v11;
*a3 -= v11;
sub_1006245BC(a1[54], v11);
}
return 0;
}
}
}
}
return result;
}