//
// X509V3_parse_list from 0x1082088 to 0x10824ac (1060 bytes)
//
// 11 xrefs:
// > sub_1078E7C @ 0x1078ed4
// > sub_1079F2C @ 0x1079f74
// > sub_1079F2C @ 0x107a400
// > sub_1079F2C @ 0x107a4fc
// > sub_107A900 @ 0x107a920
// > sub_107B008 @ 0x107b204
// > sub_107B008 @ 0x107b264
// > sub_107B5D0 @ 0x107b728
// > sub_107D9D0 @ 0x107da00
// > sub_108C76C @ 0x108c804
// > ??> @ 0xb9f20
//
// 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:17:10 +0000
//
int *__fastcall X509V3_parse_list(const char *a1)
{
const char *v1; // x0
char *v2; // x23
int v3; // w3
char *v4; // x20
char *v5; // x19
int v6; // w21
const char *v7; // x26
int v8; // w0
int v9; // t1
size_t v10; // x0
char *v11; // x22
const char *v12; // x0
int v13; // w0
int v14; // t1
size_t v15; // x0
char *v16; // x20
int v18; // w0
int v19; // t1
size_t v20; // x0
char *v21; // x21
int v22; // w0
int v23; // w0
int v24; // t1
size_t v25; // x0
char *v26; // x21
char *v27; // x1
const char *v28; // x0
int v29; // w0
int v30; // t1
size_t v31; // x0
char *v32; // x20
int *v33; // [xsp+58h] [xbp+58h] BYREF
v33 = nullptr;
v1 = CRYPTO_strdup(a1, (__int64)"crypto/x509v3/v3_utl.c", 251);
v2 = (char *)v1;
if ( !v1 )
{
ERR_put_error(34, 109, 65, (__int64)"crypto/x509v3/v3_utl.c", 253);
goto LABEL_62;
}
v3 = *(unsigned __int8 *)v1;
if ( !*v1 )
goto LABEL_65;
if ( v3 == 13 || v3 == 10 )
{
v5 = (char *)v1;
v13 = *(unsigned __int8 *)v1;
LABEL_29:
while ( isspace(v13) )
{
v14 = (unsigned __int8)*++v5;
v13 = v14;
if ( !v14 )
goto LABEL_65;
}
v15 = strlen(v5) - 1;
v16 = &v5[v15];
if ( &v5[v15] != v5 )
{
while ( isspace((unsigned __int8)*v16) )
{
if ( --v16 == v5 )
goto LABEL_35;
}
v16[1] = 0;
}
LABEL_35:
if ( *v5 )
{
X509V3_add_value(v5, nullptr, &v33);
goto LABEL_37;
}
LABEL_65:
ERR_put_error(34, 109, 108, (__int64)"crypto/x509v3/v3_utl.c", 316);
goto LABEL_62;
}
v4 = (char *)(v1 + 1);
v5 = (char *)v1;
v6 = 1;
v7 = nullptr;
do
{
if ( v6 != 1 )
{
if ( v3 == 44 )
{
*(v4 - 1) = 0;
v23 = (unsigned __int8)*v5;
if ( !*v5 )
goto LABEL_61;
while ( isspace(v23) )
{
v24 = (unsigned __int8)*++v5;
v23 = v24;
if ( !v24 )
goto LABEL_61;
}
v25 = strlen(v5) - 1;
v26 = &v5[v25];
if ( &v5[v25] != v5 )
{
while ( isspace((unsigned __int8)*v26) )
{
if ( --v26 == v5 )
goto LABEL_59;
}
if ( v5 != v26 )
v26[1] = 0;
}
LABEL_59:
if ( !*v5 )
{
LABEL_61:
ERR_put_error(34, 109, 109, (__int64)"crypto/x509v3/v3_utl.c", 294);
goto LABEL_62;
}
v27 = v5;
v28 = v7;
v5 = v4;
v6 = 1;
v7 = nullptr;
X509V3_add_value(v28, v27, &v33);
}
goto LABEL_7;
}
if ( v3 == 58 )
{
*(v4 - 1) = 0;
v18 = (unsigned __int8)*v5;
if ( !*v5 )
goto LABEL_63;
while ( isspace(v18) )
{
v19 = (unsigned __int8)*++v5;
v18 = v19;
if ( !v19 )
goto LABEL_63;
}
v7 = v5;
v20 = strlen(v5) - 1;
v21 = &v5[v20];
if ( &v5[v20] != v5 )
{
v22 = isspace((unsigned __int8)*v21);
if ( v22 )
{
while ( --v21 != v5 )
{
v22 = isspace((unsigned __int8)*v21);
if ( !v22 )
goto LABEL_46;
}
}
else
{
LABEL_46:
v21[1] = v22;
}
}
if ( !*v5 )
{
LABEL_63:
ERR_put_error(34, 109, 108, (__int64)"crypto/x509v3/v3_utl.c", 270);
goto LABEL_62;
}
v5 = v4;
v6 = 2;
LABEL_7:
v3 = (unsigned __int8)*v4;
if ( !*v4 )
break;
goto LABEL_8;
}
if ( v3 != 44 )
goto LABEL_7;
*(v4 - 1) = 0;
v8 = (unsigned __int8)*v5;
if ( !*v5 )
goto LABEL_64;
while ( isspace(v8) )
{
v9 = (unsigned __int8)*++v5;
v8 = v9;
if ( !v9 )
goto LABEL_64;
}
v7 = v5;
v10 = strlen(v5) - 1;
v11 = &v5[v10];
if ( &v5[v10] != v5 )
{
while ( isspace((unsigned __int8)*v11) )
{
if ( --v11 == v5 )
goto LABEL_23;
}
if ( v11 != v5 )
v11[1] = 0;
}
LABEL_23:
if ( !*v5 )
{
LABEL_64:
ERR_put_error(34, 109, 108, (__int64)"crypto/x509v3/v3_utl.c", 280);
goto LABEL_62;
}
v12 = v5;
v5 = v4;
X509V3_add_value(v12, nullptr, &v33);
v3 = (unsigned __int8)*v4;
if ( !*v4 )
break;
LABEL_8:
++v4;
}
while ( v3 != 10 && v3 != 13 );
if ( v6 != 2 )
{
v13 = (unsigned __int8)*v5;
if ( *v5 )
goto LABEL_29;
goto LABEL_65;
}
v29 = (unsigned __int8)*v5;
if ( !*v5 )
goto LABEL_78;
while ( isspace(v29) )
{
v30 = (unsigned __int8)*++v5;
v29 = v30;
if ( !v30 )
goto LABEL_78;
}
v31 = strlen(v5) - 1;
v32 = &v5[v31];
if ( &v5[v31] != v5 )
{
while ( isspace((unsigned __int8)*v32) )
{
if ( --v32 == v5 )
goto LABEL_76;
}
if ( v5 != v32 )
v32[1] = 0;
}
LABEL_76:
if ( !*v5 )
{
LABEL_78:
ERR_put_error(34, 109, 109, (__int64)"crypto/x509v3/v3_utl.c", 309);
LABEL_62:
CRYPTO_free(v2, (__int64)"crypto/x509v3/v3_utl.c", 325);
OPENSSL_sk_pop_free(v33, (void (__fastcall *)(__int64))X509V3_conf_free);
return nullptr;
}
X509V3_add_value(v7, v5, &v33);
LABEL_37:
CRYPTO_free(v2, (__int64)"crypto/x509v3/v3_utl.c", 321);
return v33;
}