//
// png_read_rows from 0xbd5650 to 0xbd5738 (232 bytes)
//
// 1 xrefs:
// > ??> @ 0x603c0
//
// 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_read_rows(__int64 result, void **a2, void **a3, int a4)
{
__int64 v4; // x22
void **v5; // x20
void **v6; // x23
__int64 v7; // x19
__int64 v8; // x21
void *v9; // x1
void *v10; // x2
void **v11; // x19
void *v12; // t1
void **v13; // x19
void *v14; // t1
v4 = result;
v5 = a2;
v6 = a3;
if ( result )
{
result = a2 != nullptr;
if ( a2 )
{
if ( a3 )
{
if ( a4 )
{
v7 = 0;
v8 = (unsigned int)(a4 - 1) + 1LL;
do
{
v9 = v5[v7];
v10 = v6[v7++];
result = png_read_row(v4, v9, v10);
}
while ( v7 != v8 );
}
}
else if ( a4 )
{
v11 = &a2[(unsigned int)(a4 - 1) + 1];
do
{
v12 = *v5++;
result = png_read_row(v4, v12, nullptr);
}
while ( v5 != v11 );
}
}
else if ( a3 && a4 )
{
v13 = &a3[(unsigned int)(a4 - 1) + 1];
do
{
v14 = *v6++;
result = png_read_row(v4, nullptr, v14);
}
while ( v6 != v13 );
}
}
return result;
}