//
// sub_10044E0 from 0x10044e0 to 0x1004670 (400 bytes)
//
// 2 xrefs:
// > ??> @ 0x13ffc60
// > ??> @ 0x13ffd38
//
// 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:15:55 +0000
//
__int64 __fastcall sub_10044E0(__int64 a1, __int64 a2)
{
__int64 v3; // x20
__int64 v4; // x21
void *v5; // x22
__int64 v6; // x0
unsigned __int64 *v7; // x19
__int64 v8; // x0
unsigned __int64 *v9; // x19
__int64 result; // x0
__int64 v11; // x0
unsigned __int64 *v12; // x19
__int64 v13; // x0
unsigned __int64 *v14; // x19
__int64 v15; // x0
__int64 v16; // x19
__int64 v17; // x0
__int64 v18; // x0
v3 = *(_QWORD *)(a1 + 32);
if ( v3 )
{
v4 = *(_QWORD *)(a2 + 32);
v5 = *(void **)(a2 + 16);
v6 = *(_QWORD *)(v4 + 8);
if ( v6 )
goto LABEL_3;
}
else
{
v15 = DH_new();
*(_QWORD *)(a1 + 32) = v15;
v3 = v15;
if ( !v15 )
return 0;
v4 = *(_QWORD *)(a2 + 32);
v5 = *(void **)(a2 + 16);
v6 = *(_QWORD *)(v4 + 8);
if ( v6 )
{
LABEL_3:
v7 = BN_dup(v6);
if ( !v7 )
return 0;
BN_free(*(_QWORD *)(v3 + 8));
*(_QWORD *)(v3 + 8) = v7;
v8 = *(_QWORD *)(v4 + 16);
if ( v8 )
goto LABEL_5;
LABEL_17:
v9 = (unsigned __int64 *)v8;
goto LABEL_6;
}
}
v16 = v6;
BN_free(*(_QWORD *)(v3 + 8));
*(_QWORD *)(v3 + 8) = v16;
v8 = *(_QWORD *)(v4 + 16);
if ( !v8 )
goto LABEL_17;
LABEL_5:
v9 = BN_dup(v8);
if ( !v9 )
return 0;
LABEL_6:
BN_free(*(_QWORD *)(v3 + 16));
*(_QWORD *)(v3 + 16) = v9;
if ( v5 == &dhx_asn1_meth )
{
v11 = *(_QWORD *)(v4 + 64);
if ( v11 )
{
v12 = BN_dup(v11);
if ( !v12 )
return 0;
}
else
{
v12 = nullptr;
}
BN_free(*(_QWORD *)(v3 + 64));
*(_QWORD *)(v3 + 64) = v12;
v13 = *(_QWORD *)(v4 + 72);
if ( v13 )
{
v14 = BN_dup(v13);
if ( !v14 )
return 0;
}
else
{
v14 = nullptr;
}
BN_free(*(_QWORD *)(v3 + 72));
*(_QWORD *)(v3 + 72) = v14;
CRYPTO_free(*(_QWORD *)(v3 + 80), "crypto/dh/dh_ameth.c", 401);
*(_QWORD *)(v3 + 80) = 0;
*(_DWORD *)(v3 + 88) = 0;
v17 = *(_QWORD *)(v4 + 80);
if ( !v17 )
return 1;
v18 = CRYPTO_memdup(v17, *(int *)(v4 + 88), "crypto/dh/dh_ameth.c", 405);
*(_QWORD *)(v3 + 80) = v18;
if ( v18 )
{
*(_DWORD *)(v3 + 88) = *(_DWORD *)(v4 + 88);
return 1;
}
return 0;
}
result = 1;
*(_QWORD *)(v3 + 24) = *(_QWORD *)(v4 + 24);
return result;
}