//
// jinit_d_post_controller from 0xc151a8 to 0xc15288 (224 bytes)
//
// 2 xrefs:
// > jinit_master_decompress @ 0xc14040
// > ??> @ 0x8ef68
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 (__fastcall *(__fastcall *__fastcall jinit_d_post_controller(__int64 a1, int a2))(
__int64 (__fastcall *result)(),
int a2))()
{
__int64 v4; // x20
int v5; // w1
__int64 (__fastcall *(__fastcall *result)(__int64 (__fastcall *)(), int))(); // x0
unsigned int v7; // w3
__int64 v8; // x4
__int64 (__fastcall *v9)(__int64, __int64, _QWORD, __int64, __int64, _QWORD); // x21
__int64 v10; // x0
__int64 v11; // [xsp+38h] [xbp+38h]
v4 = (**(__int64 (***)(void))(a1 + 8))();
*(_QWORD *)(a1 + 600) = v4;
v5 = *(_DWORD *)(a1 + 108);
*(_QWORD *)(v4 + 16) = 0;
result = sub_C14E0C;
*(_QWORD *)(v4 + 24) = 0;
*(_QWORD *)v4 = sub_C14E0C;
if ( v5 )
{
v7 = *(_DWORD *)(a1 + 420);
*(_DWORD *)(v4 + 32) = v7;
v8 = *(_QWORD *)(a1 + 8);
if ( a2 )
{
v9 = *(__int64 (__fastcall **)(__int64, __int64, _QWORD, __int64, __int64, _QWORD))(v8 + 32);
v11 = (unsigned int)(*(_DWORD *)(a1 + 144) * *(_DWORD *)(a1 + 136));
v10 = jround_up(*(unsigned int *)(a1 + 140), v7);
result = (__int64 (__fastcall *(__fastcall *)(__int64 (__fastcall *)(), int))())v9(
a1,
1,
0,
v11,
v10,
*(unsigned int *)(v4 + 32));
*(_QWORD *)(v4 + 16) = result;
}
else
{
result = (__int64 (__fastcall *(__fastcall *)(__int64 (__fastcall *)(), int))())(*(__int64 (__fastcall **)(__int64, __int64, _QWORD))(v8 + 16))(
a1,
1,
(unsigned int)(*(_DWORD *)(a1 + 144) * *(_DWORD *)(a1 + 136)));
*(_QWORD *)(v4 + 24) = result;
}
}
return result;
}