//
// png_set_scale_16 from 0xbd791c to 0xbd7950 (52 bytes)
//
// 4 xrefs:
// > sub_BD1BEC @ 0xbd1e78
// > png_read_row @ 0xbd412c
// > png_read_png @ 0xbd604c
// > ??> @ 0x45000
//
// 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 png_set_scale_16(__int64 result)
{
__int64 v1; // x1
int v2; // w2
int v3; // w0
v1 = result;
if ( result )
{
v2 = *(_DWORD *)(result + 360);
if ( (v2 & 0x40) != 0 )
{
return png_app_error(result, "invalid after png_start_read_image or png_read_update_info");
}
else
{
v3 = *(_DWORD *)(result + 364);
*(_DWORD *)(v1 + 360) = v2 | 0x4000;
result = v3 | 0x4000000u;
*(_DWORD *)(v1 + 364) = result;
}
}
return result;
}