//
// GENERAL_NAME_cmp from 0x856db8 to 0x856e54 (156 bytes)
//
// 2 xrefs:
// > sub_843150 @ 0x843640
// > ??> @ 0x6755c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall GENERAL_NAME_cmp(int a1, int a2)
{
bool v2; // zf
int result; // r0
v2 = a2 == 0;
if ( a2 )
v2 = a1 == 0;
if ( v2 || *(_DWORD *)a1 != *(_DWORD *)a2 )
return -1;
switch ( *(_DWORD *)a1 )
{
case 0:
result = OTHERNAME_cmp(*(int **)(a1 + 4), *(int **)(a2 + 4));
break;
case 1:
case 2:
case 6:
result = ASN1_STRING_cmp(*(_DWORD *)(a1 + 4), *(_DWORD *)(a2 + 4));
break;
case 3:
case 5:
result = ASN1_TYPE_cmp(*(_DWORD *)(a1 + 4), *(_DWORD *)(a2 + 4));
break;
case 4:
result = X509_NAME_cmp(*(_DWORD *)(a1 + 4), *(_DWORD *)(a2 + 4));
break;
case 7:
result = ASN1_OCTET_STRING_cmp(*(_DWORD *)(a1 + 4), *(_DWORD *)(a2 + 4));
break;
case 8:
result = OBJ_cmp(*(_DWORD *)(a1 + 4), *(_DWORD *)(a2 + 4));
break;
default:
return -1;
}
return result;
}