//
// CMS_RecipientInfo_kari_get0_orig_id from 0x874564 to 0x874674 (272 bytes)
//
// 5 xrefs:
// > sub_7DF150 @ 0x7df1cc
// > sub_7DF150 @ 0x7df5c0
// > sub_7E3D80 @ 0x7e3ee4
// > sub_7E3D80 @ 0x7e42c8
// > ??> @ 0x6096c
//
// 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 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;
}