//
// sub_F0F10C from 0xf0f10c to 0xf0f394 (648 bytes)
//
// 2 xrefs:
// > sub_F0F398 @ 0xf0f5e0
// > sub_F0F398 @ 0xf0f620
//
// 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:12:27 +0000
//
__int64 __fastcall sub_F0F10C(
__int64 a1,
unsigned int a2,
unsigned int a3,
int a4,
int a5,
int a6,
int a7,
__int64 a8,
__int64 a9)
{
void (*v11)(void); // x5
char v12; // w25
unsigned __int64 v16; // x19
char v17; // w1
char v18; // w0
__int64 result; // x0
int v20; // w26
__int64 v21; // x0
int v22; // [xsp+68h] [xbp+68h]
int v23; // [xsp+68h] [xbp+68h]
_BYTE v24[4]; // [xsp+78h] [xbp+78h] BYREF
int v25; // [xsp+7Ch] [xbp+7Ch]
__int64 v26; // [xsp+80h] [xbp+80h]
__int64 v27; // [xsp+88h] [xbp+88h]
int v28; // [xsp+98h] [xbp+98h]
float v29[28]; // [xsp+A0h] [xbp+A0h] BYREF
int v30; // [xsp+110h] [xbp+110h] BYREF
unsigned int v31; // [xsp+118h] [xbp+118h]
unsigned int v32; // [xsp+11Ch] [xbp+11Ch]
__int64 v33; // [xsp+158h] [xbp+158h]
unsigned int v34; // [xsp+160h] [xbp+160h]
__int64 v35; // [xsp+190h] [xbp+190h]
v11 = (void (*)(void))qword_1569260[a5];
v12 = a5;
v16 = (int)(a2 * a3);
if ( v11 )
{
v22 = a7;
a1 = a8;
v11();
a7 = v22;
}
if ( !a4 )
goto LABEL_4;
v23 = a7;
if ( (unsigned int)sub_F2D65C(v24, v16 >> 3) )
{
WebPPictureInitInternal(&v30, 521);
v31 = a2;
v32 = a3;
v30 = 1;
v35 = a9 + 56;
if ( (unsigned int)WebPPictureAlloc(&v30) )
{
off_1569030(a1, a2, v31, v32, v33, v34);
WebPConfigInitInternal(v29, 0, 521, 75.0);
LODWORD(v29[0]) = 1;
LODWORD(v29[24]) = 1;
LODWORD(v29[2]) = v23;
v29[1] = (float)v23 * 8.0;
v20 = sub_F2A0F0(v29, &v30, v24);
WebPPictureFree(&v30);
if ( !v20 && !v28 )
{
v21 = sub_F2DA1C(v24);
if ( v16 >= v27 - v26 + ((v25 + 7) >> 3) )
{
v17 = a4;
v16 = v27 - v26 + ((v25 + 7) >> 3);
a1 = v21;
LABEL_5:
v18 = v17 | (4 * v12);
if ( a6 )
v18 |= 0x10u;
LOBYTE(v30) = v18;
sub_F2D278(a9 + 8, v16 + 1);
if ( (unsigned int)sub_F2D52C(a9 + 8, &v30, 1) && (unsigned int)sub_F2D52C(a9 + 8, a1, v16) )
{
if ( a4 )
sub_F2D75C(v24);
if ( !*(_DWORD *)(a9 + 48) )
{
result = 1;
LABEL_16:
*(_QWORD *)a9 = *(_QWORD *)(a9 + 32);
return result;
}
}
else if ( a4 )
{
sub_F2D75C(v24);
}
result = 0;
goto LABEL_16;
}
sub_F2D75C(v24);
LABEL_4:
v17 = 0;
a4 = 0;
goto LABEL_5;
}
sub_F2D75C(v24);
}
}
sub_F2D75C(v24);
return 0;
}