//
// ASN1_TIME_diff from 0x9d5e98 to 0x9d5fb4 (284 bytes)
//
// 2 xrefs:
// > sub_A57D50 @ 0xa58424
// > ??> @ 0x77f5c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:14 +0000
//
int __fastcall ASN1_TIME_diff(int a1, int a2, int a3, int a4)
{
int v7; // r12
int v9; // r0
int v10; // r3
int v11; // r0
time_t v12; // [sp+4h] [bp-5Ch] BYREF
_BYTE v13[44]; // [sp+8h] [bp-58h] BYREF
time_t timer[11]; // [sp+34h] [bp-2Ch] BYREF
if ( a3 )
{
v7 = *(_DWORD *)(a3 + 4);
if ( v7 == 23 )
{
v9 = asn1_utctime_to_tm(v13, a3);
}
else
{
if ( v7 != 24 )
return 0;
v9 = asn1_generalizedtime_to_tm(v13, a3);
}
}
else
{
time(timer);
v9 = OPENSSL_gmtime(timer, v13) != 0;
}
if ( !v9 )
return 0;
if ( a4 )
{
v10 = *(_DWORD *)(a4 + 4);
if ( v10 == 23 )
{
v11 = asn1_utctime_to_tm(timer, a4);
}
else
{
if ( v10 != 24 )
return 0;
v11 = asn1_generalizedtime_to_tm(timer, a4);
}
}
else
{
time(&v12);
v11 = OPENSSL_gmtime(&v12, timer) != 0;
}
if ( !v11 )
return 0;
return OPENSSL_gmtime_diff(a1, a2, v13, timer);
}