//
// png_safe_execute from 0xe436d8 to 0xe4377c (164 bytes)
//
// 13 xrefs:
// > png_image_free @ 0xe42a14
// > png_read_row @ 0xe4a440
// > sub_E4B034 @ 0xe4b1f0
// > png_image_begin_read_from_stdio @ 0xe4c390
// > png_image_begin_read_from_file @ 0xe4c450
// > png_image_begin_read_from_memory @ 0xe4c54c
// > png_image_finish_read @ 0xe4c61c
// > png_image_finish_read @ 0xe4c680
// > png_image_finish_read @ 0xe4c6c8
// > sub_E5EAE4 @ 0xe5ecb0
// > sub_E5EAE4 @ 0xe5ee08
// > png_image_write_to_stdio @ 0xe5f2e8
// > ??> @ 0xe6170
//
// 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:04 +0000
//
__int64 __fastcall png_safe_execute(__int64 a1, __int64 (__fastcall *a2)(__int64), __int64 a3)
{
unsigned int v6; // [xsp+3Ch] [xbp+3Ch]
__int64 v8; // [xsp+48h] [xbp+48h]
jmp_buf env; // [xsp+50h] [xbp+50h] BYREF
v8 = *(_QWORD *)(*(_QWORD *)a1 + 16LL);
v6 = setjmp(env) == 0;
if ( v6 )
{
*(_QWORD *)(*(_QWORD *)a1 + 16LL) = env;
v6 = a2(a3);
}
*(_QWORD *)(*(_QWORD *)a1 + 16LL) = v8;
if ( !v6 )
png_image_free(a1);
return v6;
}