//
// CMS_RecipientInfo_kari_get0_orig_id from 0xa89164 to 0xa89274 (272 bytes)
//
// 5 xrefs:
// > sub_9F3D50 @ 0x9f3dcc
// > sub_9F3D50 @ 0x9f41c0
// > sub_9F8980 @ 0x9f8ae4
// > sub_9F8980 @ 0x9f8ec8
// > ??> @ 0x7a3ec
//
// 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:08:53 +0000
//
int __fastcall CMS_RecipientInfo_kari_get0_orig_id(int *a1, _DWORD *a2, _DWORD *a3, _DWORD *a4, _DWORD *a5, _DWORD *a6)
{
int v6; // r5
int result; // r0
int v9; // r4
int *v10; // r4
int v11; // r5
result = *a1;
if ( result == 1 )
{
v9 = a1[1];
if ( a5 )
v6 = 0;
v10 = *(int **)(v9 + 4);
if ( a5 )
*a5 = v6;
if ( a6 )
*a6 = 0;
if ( a4 )
*a4 = 0;
if ( a2 )
*a2 = 0;
if ( a3 )
*a3 = 0;
v11 = *v10;
if ( *v10 )
{
if ( v11 == 1 )
{
if ( a4 )
{
*a4 = v10[1];
return 1;
}
}
else if ( v11 == 2 )
{
if ( a2 )
*a2 = *(_DWORD *)v10[1];
if ( a3 )
*a3 = *(_DWORD *)(v10[1] + 4);
}
else
{
return 0;
}
}
else
{
if ( a5 )
*a5 = *(_DWORD *)v10[1];
if ( a6 )
*a6 = *(_DWORD *)(v10[1] + 4);
}
}
else
{
ERR_put_error(46, 173, 181, (int)"crypto/cms/cms_kari.c", 61);
return 0;
}
return result;
}