//
// jpeg_core_output_dimensions from 0xe8495c to 0xe84e20 (1220 bytes)
//
// 3 xrefs:
// > jpeg_calc_output_dimensions @ 0xe89428
// > jpeg_read_coefficients @ 0xe8bf30
// > ??> @ 0xe90b0
//
// 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:10:48 +0000
//
__int64 __fastcall jpeg_core_output_dimensions(__int64 a1)
{
int v1; // w1
unsigned int v3; // w2
unsigned int v4; // w0
bool v5; // cc
__int64 v6; // x0
int v7; // w1
int v8; // w2
__int64 result; // x0
__int64 v10; // x2
unsigned int v11; // w0
unsigned int v12; // w20
int v13; // w0
v1 = *(_DWORD *)(a1 + 556);
v3 = *(_DWORD *)(a1 + 72);
v4 = v1 * *(_DWORD *)(a1 + 68);
if ( v4 <= v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(*(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(*(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 1;
v7 = 1;
*(_DWORD *)(a1 + 428) = 1;
goto LABEL_18;
}
if ( v4 <= 2 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(2LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(2LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 2;
v7 = 2;
*(_DWORD *)(a1 + 428) = 2;
goto LABEL_18;
}
if ( v4 <= 3 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(3LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(3LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 3;
v7 = 3;
*(_DWORD *)(a1 + 428) = 3;
goto LABEL_18;
}
if ( v4 <= 4 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(4LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(4LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 4;
v7 = 4;
*(_DWORD *)(a1 + 428) = 4;
goto LABEL_18;
}
if ( v4 <= 5 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(5LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(5LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 5;
v7 = 5;
*(_DWORD *)(a1 + 428) = 5;
goto LABEL_18;
}
if ( v4 <= 6 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(6LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(6LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 6;
v7 = 6;
*(_DWORD *)(a1 + 428) = 6;
goto LABEL_18;
}
if ( v4 <= 7 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(7LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(7LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 7;
v7 = 7;
*(_DWORD *)(a1 + 428) = 7;
goto LABEL_18;
}
if ( v4 <= 8 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(8LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(8LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 8;
v7 = 8;
*(_DWORD *)(a1 + 428) = 8;
goto LABEL_18;
}
if ( v4 <= 9 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(9LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(9LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 9;
v7 = 9;
*(_DWORD *)(a1 + 428) = 9;
goto LABEL_18;
}
if ( v4 <= 10 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(10LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(10LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 10;
v7 = 10;
*(_DWORD *)(a1 + 428) = 10;
goto LABEL_18;
}
if ( v4 <= 11 * v3 )
{
v11 = *(_DWORD *)(a1 + 48);
v12 = 11;
LABEL_32:
*(_DWORD *)(a1 + 136) = jdiv_round_up(v11 * (unsigned __int64)v12, v1);
v13 = jdiv_round_up(*(unsigned int *)(a1 + 52) * (unsigned __int64)v12, *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = v12;
*(_DWORD *)(a1 + 140) = v13;
v7 = v12;
*(_DWORD *)(a1 + 428) = v12;
goto LABEL_18;
}
if ( v4 <= 12 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(12LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(12LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 12;
v7 = 12;
*(_DWORD *)(a1 + 428) = 12;
goto LABEL_18;
}
if ( v4 <= 13 * v3 )
{
v11 = *(_DWORD *)(a1 + 48);
v12 = 13;
goto LABEL_32;
}
if ( v4 <= 14 * v3 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(14LL * *(unsigned int *)(a1 + 48), v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(14LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 14;
v7 = 14;
*(_DWORD *)(a1 + 428) = 14;
}
else
{
v5 = v4 > 15 * v3;
v6 = *(unsigned int *)(a1 + 48);
if ( v5 )
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(16 * v6, v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(16LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 16;
v7 = 16;
*(_DWORD *)(a1 + 428) = 16;
}
else
{
*(_DWORD *)(a1 + 136) = jdiv_round_up(15 * v6, v1);
*(_DWORD *)(a1 + 140) = jdiv_round_up(15LL * *(unsigned int *)(a1 + 52), *(int *)(a1 + 556));
*(_DWORD *)(a1 + 424) = 15;
v7 = 15;
*(_DWORD *)(a1 + 428) = 15;
}
}
LABEL_18:
v8 = *(_DWORD *)(a1 + 56);
result = *(_QWORD *)(a1 + 304);
if ( v8 > 0 )
{
v10 = result + 96 * ((unsigned int)(v8 - 1) + 1LL);
do
{
*(_DWORD *)(result + 36) = v7;
result += 96;
*(_DWORD *)(result - 56) = v7;
}
while ( result != v10 );
}
return result;
}