//
// png_safecat from 0xe42c64 to 0xe42cb8 (84 bytes)
//
// 39 xrefs:
// > sub_E3B438 @ 0xe3b49c
// > sub_E3B438 @ 0xe3b4b0
// > sub_E3B438 @ 0xe3b4c8
// > sub_E3B438 @ 0xe3b51c
// > sub_E3B438 @ 0xe3b534
// > sub_E3B438 @ 0xe3b548
// > png_user_version_check @ 0xe3ba1c
// > png_user_version_check @ 0xe3ba30
// > png_user_version_check @ 0xe3ba48
// > png_user_version_check @ 0xe3ba60
// > png_convert_to_rfc1123_buffer @ 0xe3c2d4
// > png_convert_to_rfc1123_buffer @ 0xe3c30c
// > png_convert_to_rfc1123_buffer @ 0xe3c34c
// > png_convert_to_rfc1123_buffer @ 0xe3c38c
// > png_convert_to_rfc1123_buffer @ 0xe3c3cc
// > png_convert_to_rfc1123_buffer @ 0xe3c40c
// > png_convert_to_rfc1123_buffer @ 0xe3c424
// > png_icc_check_length @ 0xe3cb28
// > png_icc_check_length @ 0xe3cb3c
// > png_icc_check_length @ 0xe3cb54
// > png_icc_check_length @ 0xe3cb80
// > png_icc_check_length @ 0xe3cb98
// > png_icc_check_length @ 0xe3cbb0
// > png_icc_check_length @ 0xe3cbe4
// > png_icc_check_length @ 0xe3cbf8
// > png_icc_check_length @ 0xe3cc10
// > png_icc_check_length @ 0xe3cc3c
// > png_icc_check_length @ 0xe3cc54
// > png_icc_check_length @ 0xe3cc6c
// > png_image_error @ 0xe42a40
// > png_warning_parameter @ 0xe42f94
// > png_safe_error @ 0xe4363c
// > png_safe_error @ 0xe43678
// > png_safe_error @ 0xe4368c
// > png_safe_warning @ 0xe436bc
// > sub_E54808 @ 0xe54914
// > sub_E54B1C @ 0xe54ca4
// > sub_E60CF0 @ 0xe60ed8
// > ??> @ 0x8f3e0
//
// 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:03 +0000
//
unsigned __int64 __fastcall png_safecat(__int64 a1, unsigned __int64 a2, unsigned __int64 a3, char *a4)
{
char v4; // w4
unsigned __int64 v5; // x1
char *v6; // x3
if ( a1 && a3 < a2 )
{
if ( a4 )
{
v4 = *a4;
if ( *a4 )
{
v5 = a2 - 1;
if ( a3 < v5 )
{
v6 = &a4[-a3];
do
{
++a3;
*(_BYTE *)(a1 + a3 - 1) = v4;
v4 = v6[a3];
}
while ( v4 && a3 < v5 );
}
}
}
*(_BYTE *)(a1 + a3) = 0;
}
return a3;
}