//
// sub_E60FC4 from 0xe60fc4 to 0xe61154 (400 bytes)
//
// 6 xrefs:
// > png_write_iCCP @ 0xe62414
// > png_write_sPLT @ 0xe62610
// > png_write_tEXt @ 0xe631bc
// > png_write_zTXt @ 0xe6334c
// > png_write_iTXt @ 0xe63548
// > png_write_pCAL @ 0xe63aac
//
// 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:23 +0000
//
__int64 __fastcall sub_E60FC4(__int64 a1, char *a2, _BYTE *a3)
{
char *v5; // x4
int v6; // w6
int v7; // w3
unsigned int v8; // w5
unsigned int v9; // w0
bool v10; // cc
unsigned __int8 v11; // w1
unsigned int v12; // w19
unsigned int v14; // w19
int v15; // [xsp+38h] [xbp+38h]
_BYTE v16[256]; // [xsp+40h] [xbp+40h] BYREF
if ( a2 )
{
v5 = a2;
v6 = 1;
v7 = 0;
v8 = 0;
LABEL_3:
v9 = (unsigned __int8)*v5;
v10 = v8 > 0x4E;
v11 = v9 - 33;
if ( *v5 )
{
while ( !v10 )
{
++v5;
if ( v11 <= 0x5Du || v9 > 0xA0 )
{
*a3 = v9;
++v8;
++a3;
v6 = 0;
goto LABEL_3;
}
if ( v6 )
{
v6 = 1;
if ( !v7 )
v7 = v9;
goto LABEL_3;
}
*a3 = 32;
if ( v9 != 32 )
v7 = v9;
++v8;
v9 = (unsigned __int8)*v5;
++a3;
v6 = 1;
v10 = v8 > 0x4E;
v11 = v9 - 33;
if ( !*v5 )
break;
}
}
if ( v6 && v8 )
{
--v8;
--a3;
if ( !v7 )
v7 = 32;
}
*a3 = 0;
v12 = 0;
if ( !v8 )
return v12;
if ( *v5 )
{
v14 = v8;
png_warning(a1, "keyword truncated");
return v14;
}
else
{
v12 = v8;
if ( !v7 )
return v12;
v15 = v7;
png_warning_parameter((unsigned __int64)v16, 1, a2);
png_warning_parameter_signed((unsigned __int64)v16, 2, 4, v15);
png_formatted_warning(a1, (__int64)v16, "keyword \"@1\": bad character '0x@2'");
return v12;
}
}
else
{
*a3 = 0;
return 0;
}
}