/* Generated from ./test.asn1 */
/* Do not edit */

#if defined(_WIN32) && !defined(ASN1_LIB)
# error "ASN1_LIB must be defined"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <krb5-types.h>
#include "test_template_asn1.h"
#include "test_template_asn1-priv.h"
#include <asn1_err.h>
#include <der.h>
#include <asn1-template.h>

#include <parse_units.h>

static const struct asn1_type_func asn1_extern_HEIM_ANY = {
	(asn1_type_encode)encode_HEIM_ANY,
	(asn1_type_decode)decode_HEIM_ANY,
	(asn1_type_length)length_HEIM_ANY,
	(asn1_type_copy)copy_HEIM_ANY,
	(asn1_type_release)free_HEIM_ANY,
	(asn1_type_print)print_HEIM_ANY,
	sizeof(HEIM_ANY)
};
extern const struct asn1_template asn1_TESTOutOfOrderFoo[];
extern const struct asn1_template asn1_TESTOutOfOrderBar[];
extern const struct asn1_template asn1_TESTCircular[];
extern const struct asn1_template asn1_TESTDefault[];
extern const struct asn1_template asn1_TESTuint32[];
extern const struct asn1_template asn1_TESTuint32[];
extern const struct asn1_template asn1_TESTuint64[];
extern const struct asn1_template asn1_TESTuint64[];
extern const struct asn1_template asn1_TESTint64[];
extern const struct asn1_template asn1_TESTint64[];
extern const struct asn1_template asn1_TESTLargeTag[];
extern const struct asn1_template asn1_TESTSeq[];
extern const struct asn1_template asn1_TESTChoice1[];
extern const struct asn1_template asn1_TESTChoice2[];
extern const struct asn1_template asn1_TESTInteger[];
extern const struct asn1_template asn1_TESTInteger[];
extern const struct asn1_template asn1_TESTInteger2[];
extern const struct asn1_template asn1_TESTInteger2[];
extern const struct asn1_template asn1_TESTInteger3[];
extern const struct asn1_template asn1_TESTInteger3[];
extern const struct asn1_template asn1_TESTImplicit[];
extern const struct asn1_template asn1_TESTImplicit2[];
extern const struct asn1_template asn1_TESTImplicit3[];
extern const struct asn1_template asn1_TESTImplicit4[];
extern const struct asn1_template asn1_TESTAllocInner[];
extern const struct asn1_template asn1_TESTAlloc[];
extern const struct asn1_template asn1_TESTOptional[];
extern const struct asn1_template asn1_TESTCONTAINING[];
extern const struct asn1_template asn1_TESTCONTAINING[];
extern const struct asn1_template asn1_TESTENCODEDBY[];
extern const struct asn1_template asn1_TESTENCODEDBY[];
static unsigned oid_testDer_variable_num[4] =  { 2, 1, 2, 1};
const heim_oid asn1_oid_testDer = { 4, oid_testDer_variable_num };

extern const struct asn1_template asn1_testContainingEncodedBy[];
extern const struct asn1_template asn1_testContainingEncodedBy[];
extern const struct asn1_template asn1_testContainingEncodedBy2[];
extern const struct asn1_template asn1_testContainingEncodedBy2[];
extern const struct asn1_template asn1_testUserConstrained[];
extern const struct asn1_template asn1_testUserConstrained[];
extern const struct asn1_template asn1_TESTSeqOf[];
extern const struct asn1_template asn1_TESTSeqSizeOf1[];
extern const struct asn1_template asn1_TESTSeqSizeOf2[];
extern const struct asn1_template asn1_TESTSeqSizeOf3[];
extern const struct asn1_template asn1_TESTSeqSizeOf4[];
extern const struct asn1_template asn1_TESTOSSize1[];
extern const struct asn1_template asn1_TESTOSSize1[];
extern const struct asn1_template asn1_TESTSeqOfSeq[];
extern const struct asn1_template asn1_TESTSeqOfSeq2[];
extern const struct asn1_template asn1_TESTSeqOfSeq3[];
extern const struct asn1_template asn1_TESTSeqOf2[];
extern const struct asn1_template asn1_TESTSeqOf3[];
extern const struct asn1_template asn1_TESTSeqOf4[];
extern const struct asn1_template asn1_TESTSeqOf5[];
extern const struct asn1_template asn1_TESTPreserve[];
extern const struct asn1_template asn1_TESTBitString[];
extern const struct asn1_template asn1_TESTBitString[];
extern const struct asn1_template asn1_TESTBitString64[];
extern const struct asn1_template asn1_TESTBitString64[];
extern const struct asn1_template asn1_TESTLargeBitString[];
extern const struct asn1_template asn1_TESTLargeBitString[];
extern const struct asn1_template asn1_TESTMechType[];
extern const struct asn1_template asn1_TESTMechType[];
extern const struct asn1_template asn1_TESTMechTypeList[];
static unsigned oid_id_test_default_variable_num[4] =  { 1, 2, 3, 4};
const heim_oid asn1_oid_id_test_default = { 4, oid_id_test_default_variable_num };

extern const struct asn1_template asn1_TestExtensions[];
extern const struct asn1_template asn1_TESTExtension[];
extern const struct asn1_template asn1_TESTExtensible[];
extern const struct asn1_template asn1_TESTDecorated[];
extern const struct asn1_template asn1_TESTNotDecorated[];
extern const struct asn1_template asn1_TESTDecoratedChoice[];
extern const struct asn1_template asn1_TESTNotDecoratedChoice[];
/* template_members: TESTOutOfOrderBar exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTOutOfOrderBar exp exp */
/* generate_template_type: TESTOutOfOrderBar_tag_aMember_1 */
const struct asn1_template asn1_TESTOutOfOrderBar_tag_aMember_1[] = {
/* 0 */ { 0, sizeof(heim_integer), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_HEIM_INTEGER), 0, NULL }
};
/* generate_template_type: TESTOutOfOrderBar_tag__0 */
const struct asn1_template asn1_TESTOutOfOrderBar_tag__0[] = {
/* 0 */ { 0, sizeof(struct TESTOutOfOrderBar), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), offsetof(struct TESTOutOfOrderBar, aMember), asn1_TESTOutOfOrderBar_tag_aMember_1 },
/* 2 */ { A1_OP_NAME, 0, "TESTOutOfOrderBar" },
/* 3 */ { A1_OP_NAME, 0, "aMember" }
};
/* generate_template_type: TESTOutOfOrderBar */
const struct asn1_template asn1_TESTOutOfOrderBar[] = {
/* 0 */ { 0, sizeof(TESTOutOfOrderBar), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTOutOfOrderBar_tag__0 }
};

int ASN1CALL
decode_TESTOutOfOrderBar(const unsigned char *p, size_t len, TESTOutOfOrderBar *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTOutOfOrderBar, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTOutOfOrderBar(unsigned char *p, size_t len, const TESTOutOfOrderBar *data, size_t *size)
{
    return _asn1_encode(asn1_TESTOutOfOrderBar, p, len, data, size);
}


size_t ASN1CALL
length_TESTOutOfOrderBar(const TESTOutOfOrderBar *data)
{
    return _asn1_length(asn1_TESTOutOfOrderBar, data);
}


void ASN1CALL
free_TESTOutOfOrderBar(TESTOutOfOrderBar *data)
{
    _asn1_free_top(asn1_TESTOutOfOrderBar, data);
}


int ASN1CALL
copy_TESTOutOfOrderBar(const TESTOutOfOrderBar *from, TESTOutOfOrderBar *to)
{
    return _asn1_copy_top(asn1_TESTOutOfOrderBar, from, to);
}


char * ASN1CALL
print_TESTOutOfOrderBar(const TESTOutOfOrderBar *data, int flags)
{
    return _asn1_print_top(asn1_TESTOutOfOrderBar, flags, data);
}

/* template_members: TESTOutOfOrderFoo exp exp */
/* tsequence: members isstruct: 1 */
/* generate_template_type: TESTOutOfOrderFoo_tag__2 */
const struct asn1_template asn1_TESTOutOfOrderFoo_tag__2[] = {
/* 0 */ { 0, sizeof(struct TESTOutOfOrderFoo), ((void *)(uintptr_t)3) },
/* 1 */ { A1_OP_TYPE , offsetof(struct TESTOutOfOrderFoo, bar), asn1_TESTOutOfOrderBar },
/* 2 */ { A1_OP_NAME, 0, "TESTOutOfOrderFoo" },
/* 3 */ { A1_OP_NAME, 0, "bar" }
};
/* generate_template_type: TESTOutOfOrderFoo */
const struct asn1_template asn1_TESTOutOfOrderFoo[] = {
/* 0 */ { 0, sizeof(TESTOutOfOrderFoo), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTOutOfOrderFoo_tag__2 }
};

int ASN1CALL
decode_TESTOutOfOrderFoo(const unsigned char *p, size_t len, TESTOutOfOrderFoo *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTOutOfOrderFoo, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTOutOfOrderFoo(unsigned char *p, size_t len, const TESTOutOfOrderFoo *data, size_t *size)
{
    return _asn1_encode(asn1_TESTOutOfOrderFoo, p, len, data, size);
}


size_t ASN1CALL
length_TESTOutOfOrderFoo(const TESTOutOfOrderFoo *data)
{
    return _asn1_length(asn1_TESTOutOfOrderFoo, data);
}


void ASN1CALL
free_TESTOutOfOrderFoo(TESTOutOfOrderFoo *data)
{
    _asn1_free_top(asn1_TESTOutOfOrderFoo, data);
}


int ASN1CALL
copy_TESTOutOfOrderFoo(const TESTOutOfOrderFoo *from, TESTOutOfOrderFoo *to)
{
    return _asn1_copy_top(asn1_TESTOutOfOrderFoo, from, to);
}


char * ASN1CALL
print_TESTOutOfOrderFoo(const TESTOutOfOrderFoo *data, int flags)
{
    return _asn1_print_top(asn1_TESTOutOfOrderFoo, flags, data);
}

/* template_members: TESTCircular exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTCircular exp exp */
/* generate_template_type: TESTCircular_tag_name_4 */
const struct asn1_template asn1_TESTCircular_tag_name_4[] = {
/* 0 */ { 0, sizeof(heim_utf8_string), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_UTF8_STRING), 0, NULL }
};
/* generate_template_type: TESTCircular_tag__3 */
const struct asn1_template asn1_TESTCircular_tag__3[] = {
/* 0 */ { 0, sizeof(struct TESTCircular), ((void *)(uintptr_t)5) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_UTF8String), offsetof(struct TESTCircular, name), asn1_TESTCircular_tag_name_4 },
/* 2 */ { A1_OP_TYPE |A1_FLAG_OPTIONAL, offsetof(struct TESTCircular, next), asn1_TESTCircular },
/* 3 */ { A1_OP_NAME, 0, "TESTCircular" },
/* 4 */ { A1_OP_NAME, 0, "name" },
/* 5 */ { A1_OP_NAME, 0, "next" }
};
/* generate_template_type: TESTCircular */
const struct asn1_template asn1_TESTCircular[] = {
/* 0 */ { 0, sizeof(TESTCircular), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTCircular_tag__3 }
};

int ASN1CALL
decode_TESTCircular(const unsigned char *p, size_t len, TESTCircular *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTCircular, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTCircular(unsigned char *p, size_t len, const TESTCircular *data, size_t *size)
{
    return _asn1_encode(asn1_TESTCircular, p, len, data, size);
}


size_t ASN1CALL
length_TESTCircular(const TESTCircular *data)
{
    return _asn1_length(asn1_TESTCircular, data);
}


void ASN1CALL
free_TESTCircular(TESTCircular *data)
{
    _asn1_free_top(asn1_TESTCircular, data);
}


int ASN1CALL
copy_TESTCircular(const TESTCircular *from, TESTCircular *to)
{
    return _asn1_copy_top(asn1_TESTCircular, from, to);
}


char * ASN1CALL
print_TESTCircular(const TESTCircular *data, int flags)
{
    return _asn1_print_top(asn1_TESTCircular, flags, data);
}

/* template_members: TESTuint32 exp exp */
/* generate_template_type: TESTuint32_tag__5 */
const struct asn1_template asn1_TESTuint32_tag__5[] = {
/* 0 */ { 0, sizeof(unsigned), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_UNSIGNED), 0, NULL }
};
/* generate_template_type: TESTuint32 */
const struct asn1_template asn1_TESTuint32[] = {
/* 0 */ { 0, sizeof(TESTuint32), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), 0, asn1_TESTuint32_tag__5 }
};

int ASN1CALL
decode_TESTuint32(const unsigned char *p, size_t len, TESTuint32 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTuint32, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTuint32(unsigned char *p, size_t len, const TESTuint32 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTuint32, p, len, data, size);
}


size_t ASN1CALL
length_TESTuint32(const TESTuint32 *data)
{
    return _asn1_length(asn1_TESTuint32, data);
}


void ASN1CALL
free_TESTuint32(TESTuint32 *data)
{
    _asn1_free_top(asn1_TESTuint32, data);
}


int ASN1CALL
copy_TESTuint32(const TESTuint32 *from, TESTuint32 *to)
{
    return _asn1_copy_top(asn1_TESTuint32, from, to);
}


char * ASN1CALL
print_TESTuint32(const TESTuint32 *data, int flags)
{
    return _asn1_print_top(asn1_TESTuint32, flags, data);
}

/* template_members: TESTuint64 exp exp */
/* generate_template_type: TESTuint64_tag__6 */
const struct asn1_template asn1_TESTuint64_tag__6[] = {
/* 0 */ { 0, sizeof(uint64_t), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_UNSIGNED64), 0, NULL }
};
/* generate_template_type: TESTuint64 */
const struct asn1_template asn1_TESTuint64[] = {
/* 0 */ { 0, sizeof(TESTuint64), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), 0, asn1_TESTuint64_tag__6 }
};

int ASN1CALL
decode_TESTuint64(const unsigned char *p, size_t len, TESTuint64 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTuint64, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTuint64(unsigned char *p, size_t len, const TESTuint64 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTuint64, p, len, data, size);
}


size_t ASN1CALL
length_TESTuint64(const TESTuint64 *data)
{
    return _asn1_length(asn1_TESTuint64, data);
}


void ASN1CALL
free_TESTuint64(TESTuint64 *data)
{
    _asn1_free_top(asn1_TESTuint64, data);
}


int ASN1CALL
copy_TESTuint64(const TESTuint64 *from, TESTuint64 *to)
{
    return _asn1_copy_top(asn1_TESTuint64, from, to);
}


char * ASN1CALL
print_TESTuint64(const TESTuint64 *data, int flags)
{
    return _asn1_print_top(asn1_TESTuint64, flags, data);
}

/* template_members: TESTDefault exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTDefault exp exp */
/* generate_template_type: TESTDefault_tag_name_8 */
/* template_members: TESTDefault exp exp */
/* generate_template_type: TESTDefault_tag_version_9 */
const struct asn1_template asn1_TESTDefault_tag_version_9[] = {
/* 0 */ { 0, sizeof(TESTuint32), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTuint32 }
};
/* template_members: TESTDefault exp exp */
/* generate_template_type: TESTDefault_tag_works_10 */
const struct asn1_template asn1_TESTDefault_tag_works_10[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_BOOLEAN), 0, NULL }
};
/* generate_template_type: TESTDefault_tag__7 */
const struct asn1_template asn1_TESTDefault_tag__7[] = {
/* 0 */ { 0, sizeof(struct TESTDefault), ((void *)(uintptr_t)13) },
/* 1 */ { A1_OP_DEFVAL|A1_DV_UTF8STRING, ~0, (void *)(uintptr_t)"Heimdal" },
/* 2 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_UTF8String)|A1_FLAG_DEFAULT, offsetof(struct TESTDefault, name), asn1_TESTCircular_tag_name_4 },
/* 3 */ { A1_OP_DEFVAL|A1_DV_INTEGER32, ~0, (void *)(uintptr_t)8 },
/* 4 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0)|A1_FLAG_DEFAULT, offsetof(struct TESTDefault, version), asn1_TESTDefault_tag_version_9 },
/* 5 */ { A1_OP_DEFVAL|A1_DV_INTEGER64, ~0, (void *)(uintptr_t)9223372036854775807 },
/* 6 */ { A1_OP_TYPE |A1_FLAG_DEFAULT, offsetof(struct TESTDefault, maxint), asn1_TESTuint64 },
/* 7 */ { A1_OP_DEFVAL|A1_DV_BOOLEAN, ~0, (void *)(uintptr_t)1 },
/* 8 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Boolean)|A1_FLAG_DEFAULT, offsetof(struct TESTDefault, works), asn1_TESTDefault_tag_works_10 },
/* 9 */ { A1_OP_NAME, 0, "TESTDefault" },
/* 10 */ { A1_OP_NAME, 0, "name" },
/* 11 */ { A1_OP_NAME, 0, "version" },
/* 12 */ { A1_OP_NAME, 0, "maxint" },
/* 13 */ { A1_OP_NAME, 0, "works" }
};
/* generate_template_type: TESTDefault */
const struct asn1_template asn1_TESTDefault[] = {
/* 0 */ { 0, sizeof(TESTDefault), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTDefault_tag__7 }
};

int ASN1CALL
decode_TESTDefault(const unsigned char *p, size_t len, TESTDefault *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTDefault, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTDefault(unsigned char *p, size_t len, const TESTDefault *data, size_t *size)
{
    return _asn1_encode(asn1_TESTDefault, p, len, data, size);
}


size_t ASN1CALL
length_TESTDefault(const TESTDefault *data)
{
    return _asn1_length(asn1_TESTDefault, data);
}


void ASN1CALL
free_TESTDefault(TESTDefault *data)
{
    _asn1_free_top(asn1_TESTDefault, data);
}


int ASN1CALL
copy_TESTDefault(const TESTDefault *from, TESTDefault *to)
{
    return _asn1_copy_top(asn1_TESTDefault, from, to);
}


char * ASN1CALL
print_TESTDefault(const TESTDefault *data, int flags)
{
    return _asn1_print_top(asn1_TESTDefault, flags, data);
}

/* template_members: TESTint64 exp exp */
/* generate_template_type: TESTint64_tag__11 */
const struct asn1_template asn1_TESTint64_tag__11[] = {
/* 0 */ { 0, sizeof(int64_t), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_INTEGER64), 0, NULL }
};
/* generate_template_type: TESTint64 */
const struct asn1_template asn1_TESTint64[] = {
/* 0 */ { 0, sizeof(TESTint64), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), 0, asn1_TESTint64_tag__11 }
};

int ASN1CALL
decode_TESTint64(const unsigned char *p, size_t len, TESTint64 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTint64, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTint64(unsigned char *p, size_t len, const TESTint64 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTint64, p, len, data, size);
}


size_t ASN1CALL
length_TESTint64(const TESTint64 *data)
{
    return _asn1_length(asn1_TESTint64, data);
}


void ASN1CALL
free_TESTint64(TESTint64 *data)
{
    _asn1_free_top(asn1_TESTint64, data);
}


int ASN1CALL
copy_TESTint64(const TESTint64 *from, TESTint64 *to)
{
    return _asn1_copy_top(asn1_TESTint64, from, to);
}


char * ASN1CALL
print_TESTint64(const TESTint64 *data, int flags)
{
    return _asn1_print_top(asn1_TESTint64, flags, data);
}

/* template_members: TESTLargeTag exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTLargeTag exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_foo_14 */
const struct asn1_template asn1_int_tag_foo_14[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_INTEGER), 0, NULL }
};
/* generate_template_type: TESTLargeTag_tag_foo_13 */
const struct asn1_template asn1_TESTLargeTag_tag_foo_13[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), 0, asn1_int_tag_foo_14 }
};
/* template_members: TESTLargeTag exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_bar_16 */
/* generate_template_type: TESTLargeTag_tag_bar_15 */
/* generate_template_type: TESTLargeTag_tag__12 */
const struct asn1_template asn1_TESTLargeTag_tag__12[] = {
/* 0 */ { 0, sizeof(struct TESTLargeTag), ((void *)(uintptr_t)5) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,127), offsetof(struct TESTLargeTag, foo), asn1_TESTLargeTag_tag_foo_13 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,128), offsetof(struct TESTLargeTag, bar), asn1_TESTLargeTag_tag_foo_13 },
/* 3 */ { A1_OP_NAME, 0, "TESTLargeTag" },
/* 4 */ { A1_OP_NAME, 0, "foo" },
/* 5 */ { A1_OP_NAME, 0, "bar" }
};
/* generate_template_type: TESTLargeTag */
const struct asn1_template asn1_TESTLargeTag[] = {
/* 0 */ { 0, sizeof(TESTLargeTag), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTLargeTag_tag__12 }
};

int ASN1CALL
decode_TESTLargeTag(const unsigned char *p, size_t len, TESTLargeTag *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTLargeTag, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTLargeTag(unsigned char *p, size_t len, const TESTLargeTag *data, size_t *size)
{
    return _asn1_encode(asn1_TESTLargeTag, p, len, data, size);
}


size_t ASN1CALL
length_TESTLargeTag(const TESTLargeTag *data)
{
    return _asn1_length(asn1_TESTLargeTag, data);
}


void ASN1CALL
free_TESTLargeTag(TESTLargeTag *data)
{
    _asn1_free_top(asn1_TESTLargeTag, data);
}


int ASN1CALL
copy_TESTLargeTag(const TESTLargeTag *from, TESTLargeTag *to)
{
    return _asn1_copy_top(asn1_TESTLargeTag, from, to);
}


char * ASN1CALL
print_TESTLargeTag(const TESTLargeTag *data, int flags)
{
    return _asn1_print_top(asn1_TESTLargeTag, flags, data);
}

/* template_members: TESTSeq exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeq exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_tag0_19 */
/* generate_template_type: TESTSeq_tag_tag0_18 */
/* template_members: TESTSeq exp exp */
/* generate_template_type: TESTSeq_tag_tag1_20 */
const struct asn1_template asn1_TESTSeq_tag_tag1_20[] = {
/* 0 */ { 0, sizeof(TESTLargeTag), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTLargeTag }
};
/* template_members: TESTSeq exp exp */
/* generate_template_type: TESTSeq_tag_tagless_21 */
/* template_members: TESTSeq exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_tag3_23 */
/* generate_template_type: TESTSeq_tag_tag3_22 */
/* generate_template_type: TESTSeq_tag__17 */
const struct asn1_template asn1_TESTSeq_tag__17[] = {
/* 0 */ { 0, sizeof(struct TESTSeq), ((void *)(uintptr_t)9) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0), offsetof(struct TESTSeq, tag0), asn1_TESTLargeTag_tag_foo_13 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,1), offsetof(struct TESTSeq, tag1), asn1_TESTSeq_tag_tag1_20 },
/* 3 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), offsetof(struct TESTSeq, tagless), asn1_int_tag_foo_14 },
/* 4 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,2), offsetof(struct TESTSeq, tag3), asn1_TESTLargeTag_tag_foo_13 },
/* 5 */ { A1_OP_NAME, 0, "TESTSeq" },
/* 6 */ { A1_OP_NAME, 0, "tag0" },
/* 7 */ { A1_OP_NAME, 0, "tag1" },
/* 8 */ { A1_OP_NAME, 0, "tagless" },
/* 9 */ { A1_OP_NAME, 0, "tag3" }
};
/* generate_template_type: TESTSeq */
const struct asn1_template asn1_TESTSeq[] = {
/* 0 */ { 0, sizeof(TESTSeq), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeq_tag__17 }
};

int ASN1CALL
decode_TESTSeq(const unsigned char *p, size_t len, TESTSeq *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeq, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeq(unsigned char *p, size_t len, const TESTSeq *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeq, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeq(const TESTSeq *data)
{
    return _asn1_length(asn1_TESTSeq, data);
}


void ASN1CALL
free_TESTSeq(TESTSeq *data)
{
    _asn1_free_top(asn1_TESTSeq, data);
}


int ASN1CALL
copy_TESTSeq(const TESTSeq *from, TESTSeq *to)
{
    return _asn1_copy_top(asn1_TESTSeq, from, to);
}


char * ASN1CALL
print_TESTSeq(const TESTSeq *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeq, flags, data);
}

/* template_members: int exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag__25 */
/* generate_template_type: int_tag__24 */
/* generate_template_type: TESTChoice1_choice_i1 */
const struct asn1_template asn1_TESTChoice1_choice_i1[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,1), 0, asn1_TESTLargeTag_tag_foo_13 }
};
/* template_members: int exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag__27 */
/* generate_template_type: int_tag__26 */
/* generate_template_type: TESTChoice1_choice_i2 */
const struct asn1_template asn1_TESTChoice1_choice_i2[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,2), 0, asn1_TESTLargeTag_tag_foo_13 }
};
static const struct asn1_template asn1_choice_TESTChoice1_0[] = {
/* 0 */ { offsetof(TESTChoice1, u.asn1_ellipsis), offsetof(TESTChoice1, element), ((void *)(uintptr_t)5) },
/* 1 */ { choice_TESTChoice1_i1, offsetof(TESTChoice1, u.i1), asn1_TESTChoice1_choice_i1 },
/* 2 */ { choice_TESTChoice1_i2, offsetof(TESTChoice1, u.i2), asn1_TESTChoice1_choice_i2 },
/* 3 */ { 0, 0, "i1" },
/* 4 */ { 0, 0, "i2" },
/* 5 */ { 0, 0, "..." }
};
/* generate_template_type: TESTChoice1 */
const struct asn1_template asn1_TESTChoice1[] = {
/* 0 */ { 0, sizeof(TESTChoice1), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_CHOICE, 0, asn1_choice_TESTChoice1_0 }
};

int ASN1CALL
decode_TESTChoice1(const unsigned char *p, size_t len, TESTChoice1 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTChoice1, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTChoice1(unsigned char *p, size_t len, const TESTChoice1 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTChoice1, p, len, data, size);
}


size_t ASN1CALL
length_TESTChoice1(const TESTChoice1 *data)
{
    return _asn1_length(asn1_TESTChoice1, data);
}


void ASN1CALL
free_TESTChoice1(TESTChoice1 *data)
{
    _asn1_free_top(asn1_TESTChoice1, data);
}


int ASN1CALL
copy_TESTChoice1(const TESTChoice1 *from, TESTChoice1 *to)
{
    return _asn1_copy_top(asn1_TESTChoice1, from, to);
}


char * ASN1CALL
print_TESTChoice1(const TESTChoice1 *data, int flags)
{
    return _asn1_print_top(asn1_TESTChoice1, flags, data);
}

/* template_members: int exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag__29 */
/* generate_template_type: int_tag__28 */
/* generate_template_type: TESTChoice2_choice_i1 */
static const struct asn1_template asn1_choice_TESTChoice2_1[] = {
/* 0 */ { offsetof(TESTChoice2, u.asn1_ellipsis), offsetof(TESTChoice2, element), ((void *)(uintptr_t)3) },
/* 1 */ { choice_TESTChoice2_i1, offsetof(TESTChoice2, u.i1), asn1_TESTChoice1_choice_i1 },
/* 2 */ { 0, 0, "i1" },
/* 3 */ { 0, 0, "..." }
};
/* generate_template_type: TESTChoice2 */
const struct asn1_template asn1_TESTChoice2[] = {
/* 0 */ { 0, sizeof(TESTChoice2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_CHOICE, 0, asn1_choice_TESTChoice2_1 }
};

int ASN1CALL
decode_TESTChoice2(const unsigned char *p, size_t len, TESTChoice2 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTChoice2, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTChoice2(unsigned char *p, size_t len, const TESTChoice2 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTChoice2, p, len, data, size);
}


size_t ASN1CALL
length_TESTChoice2(const TESTChoice2 *data)
{
    return _asn1_length(asn1_TESTChoice2, data);
}


void ASN1CALL
free_TESTChoice2(TESTChoice2 *data)
{
    _asn1_free_top(asn1_TESTChoice2, data);
}


int ASN1CALL
copy_TESTChoice2(const TESTChoice2 *from, TESTChoice2 *to)
{
    return _asn1_copy_top(asn1_TESTChoice2, from, to);
}


char * ASN1CALL
print_TESTChoice2(const TESTChoice2 *data, int flags)
{
    return _asn1_print_top(asn1_TESTChoice2, flags, data);
}

/* template_members: TESTInteger exp exp */
/* generate_template_type: TESTInteger_tag__30 */
/* generate_template_type: TESTInteger */
const struct asn1_template asn1_TESTInteger[] = {
/* 0 */ { 0, sizeof(TESTInteger), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), 0, asn1_int_tag_foo_14 }
};

int ASN1CALL
decode_TESTInteger(const unsigned char *p, size_t len, TESTInteger *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTInteger, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTInteger(unsigned char *p, size_t len, const TESTInteger *data, size_t *size)
{
    return _asn1_encode(asn1_TESTInteger, p, len, data, size);
}


size_t ASN1CALL
length_TESTInteger(const TESTInteger *data)
{
    return _asn1_length(asn1_TESTInteger, data);
}


void ASN1CALL
free_TESTInteger(TESTInteger *data)
{
    _asn1_free_top(asn1_TESTInteger, data);
}


int ASN1CALL
copy_TESTInteger(const TESTInteger *from, TESTInteger *to)
{
    return _asn1_copy_top(asn1_TESTInteger, from, to);
}


char * ASN1CALL
print_TESTInteger(const TESTInteger *data, int flags)
{
    return _asn1_print_top(asn1_TESTInteger, flags, data);
}

/* template_members: TESTInteger2 imp imp */
/* generate_template_type: TESTInteger2_tag__31 */
const struct asn1_template asn1_TESTInteger2_tag__31[] = {
/* 0 */ { 0, sizeof(TESTInteger), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTInteger }
};
/* generate_template_type: TESTInteger2 */
const struct asn1_template asn1_TESTInteger2[] = {
/* 0 */ { 0, sizeof(TESTInteger2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,4)|A1_FLAG_IMPLICIT, 0, asn1_TESTInteger2_tag__31 }
};

int ASN1CALL
decode_TESTInteger2(const unsigned char *p, size_t len, TESTInteger2 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTInteger2, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTInteger2(unsigned char *p, size_t len, const TESTInteger2 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTInteger2, p, len, data, size);
}


size_t ASN1CALL
length_TESTInteger2(const TESTInteger2 *data)
{
    return _asn1_length(asn1_TESTInteger2, data);
}


void ASN1CALL
free_TESTInteger2(TESTInteger2 *data)
{
    _asn1_free_top(asn1_TESTInteger2, data);
}


int ASN1CALL
copy_TESTInteger2(const TESTInteger2 *from, TESTInteger2 *to)
{
    return _asn1_copy_top(asn1_TESTInteger2, from, to);
}


char * ASN1CALL
print_TESTInteger2(const TESTInteger2 *data, int flags)
{
    return _asn1_print_top(asn1_TESTInteger2, flags, data);
}

/* template_members: TESTInteger3 imp imp */
/* generate_template_type: TESTInteger3_tag__32 */
const struct asn1_template asn1_TESTInteger3_tag__32[] = {
/* 0 */ { 0, sizeof(TESTInteger2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTInteger2 }
};
/* generate_template_type: TESTInteger3 */
const struct asn1_template asn1_TESTInteger3[] = {
/* 0 */ { 0, sizeof(TESTInteger3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,5)|A1_FLAG_IMPLICIT, 0, asn1_TESTInteger3_tag__32 }
};

int ASN1CALL
decode_TESTInteger3(const unsigned char *p, size_t len, TESTInteger3 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTInteger3, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTInteger3(unsigned char *p, size_t len, const TESTInteger3 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTInteger3, p, len, data, size);
}


size_t ASN1CALL
length_TESTInteger3(const TESTInteger3 *data)
{
    return _asn1_length(asn1_TESTInteger3, data);
}


void ASN1CALL
free_TESTInteger3(TESTInteger3 *data)
{
    _asn1_free_top(asn1_TESTInteger3, data);
}


int ASN1CALL
copy_TESTInteger3(const TESTInteger3 *from, TESTInteger3 *to)
{
    return _asn1_copy_top(asn1_TESTInteger3, from, to);
}


char * ASN1CALL
print_TESTInteger3(const TESTInteger3 *data, int flags)
{
    return _asn1_print_top(asn1_TESTInteger3, flags, data);
}

/* template_members: TESTImplicit exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTImplicit exp imp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_ti1_35 */
/* generate_template_type: TESTImplicit_tag_ti1_34 */
/* template_members: TESTImplicit exp imp */
/* template_members: TESTImplicit exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTImplicit_ti2 exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_foo_39 */
/* generate_template_type: TESTImplicit_ti2_tag_foo_38 */
/* generate_template_type: TESTImplicit_tag_ti2_37 */
const struct asn1_template asn1_TESTImplicit_tag_ti2_37[] = {
/* 0 */ { 0, sizeof(struct TESTImplicit_ti2), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,127), offsetof(struct TESTImplicit_ti2, foo), asn1_TESTLargeTag_tag_foo_13 },
/* 2 */ { A1_OP_NAME, 0, "TESTImplicit" },
/* 3 */ { A1_OP_NAME, 0, "foo" }
};
/* generate_template_type: TESTImplicit_tag_ti2_36 */
const struct asn1_template asn1_TESTImplicit_tag_ti2_36[] = {
/* 0 */ { 0, sizeof(struct TESTImplicit_ti2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTImplicit_tag_ti2_37 }
};
/* template_members: TESTImplicit exp imp */
/* template_members: int imp imp */
/* template_members: int imp imp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_ti3_43 */
/* generate_template_type: int_tag_ti3_42 */
/* generate_template_type: int_tag_ti3_41 */
const struct asn1_template asn1_int_tag_ti3_41[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,4)|A1_FLAG_IMPLICIT, 0, asn1_TESTLargeTag_tag_foo_13 }
};
/* generate_template_type: TESTImplicit_tag_ti3_40 */
const struct asn1_template asn1_TESTImplicit_tag_ti3_40[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,5)|A1_FLAG_IMPLICIT, 0, asn1_int_tag_ti3_41 }
};
/* generate_template_type: TESTImplicit_tag__33 */
const struct asn1_template asn1_TESTImplicit_tag__33[] = {
/* 0 */ { 0, sizeof(struct TESTImplicit), ((void *)(uintptr_t)7) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,0)|A1_FLAG_IMPLICIT, offsetof(struct TESTImplicit, ti1), asn1_TESTLargeTag_tag_foo_13 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,1)|A1_FLAG_IMPLICIT, offsetof(struct TESTImplicit, ti2), asn1_TESTImplicit_tag_ti2_36 },
/* 3 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,2)|A1_FLAG_IMPLICIT, offsetof(struct TESTImplicit, ti3), asn1_TESTImplicit_tag_ti3_40 },
/* 4 */ { A1_OP_NAME, 0, "TESTImplicit" },
/* 5 */ { A1_OP_NAME, 0, "ti1" },
/* 6 */ { A1_OP_NAME, 0, "ti2" },
/* 7 */ { A1_OP_NAME, 0, "ti3" }
};
/* generate_template_type: TESTImplicit */
const struct asn1_template asn1_TESTImplicit[] = {
/* 0 */ { 0, sizeof(TESTImplicit), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTImplicit_tag__33 }
};

int ASN1CALL
decode_TESTImplicit(const unsigned char *p, size_t len, TESTImplicit *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTImplicit, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTImplicit(unsigned char *p, size_t len, const TESTImplicit *data, size_t *size)
{
    return _asn1_encode(asn1_TESTImplicit, p, len, data, size);
}


size_t ASN1CALL
length_TESTImplicit(const TESTImplicit *data)
{
    return _asn1_length(asn1_TESTImplicit, data);
}


void ASN1CALL
free_TESTImplicit(TESTImplicit *data)
{
    _asn1_free_top(asn1_TESTImplicit, data);
}


int ASN1CALL
copy_TESTImplicit(const TESTImplicit *from, TESTImplicit *to)
{
    return _asn1_copy_top(asn1_TESTImplicit, from, to);
}


char * ASN1CALL
print_TESTImplicit(const TESTImplicit *data, int flags)
{
    return _asn1_print_top(asn1_TESTImplicit, flags, data);
}

/* template_members: TESTImplicit2 exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTImplicit2 exp imp */
/* generate_template_type: TESTImplicit2_tag_ti1_45 */
/* template_members: TESTImplicit2 exp imp */
/* generate_template_type: TESTImplicit2_tag_ti3_46 */
const struct asn1_template asn1_TESTImplicit2_tag_ti3_46[] = {
/* 0 */ { 0, sizeof(TESTInteger3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTInteger3 }
};
/* template_members: TESTImplicit2 exp imp */
/* generate_template_type: TESTImplicit2_tag_ti4_47 */
/* generate_template_type: TESTImplicit2_tag__44 */
const struct asn1_template asn1_TESTImplicit2_tag__44[] = {
/* 0 */ { 0, sizeof(struct TESTImplicit2), ((void *)(uintptr_t)7) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,0)|A1_FLAG_IMPLICIT, offsetof(struct TESTImplicit2, ti1), asn1_TESTInteger2_tag__31 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,2)|A1_FLAG_IMPLICIT, offsetof(struct TESTImplicit2, ti3), asn1_TESTImplicit2_tag_ti3_46 },
/* 3 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,51)|A1_FLAG_OPTIONAL|A1_FLAG_IMPLICIT, offsetof(struct TESTImplicit2, ti4), asn1_TESTInteger2_tag__31 },
/* 4 */ { A1_OP_NAME, 0, "TESTImplicit2" },
/* 5 */ { A1_OP_NAME, 0, "ti1" },
/* 6 */ { A1_OP_NAME, 0, "ti3" },
/* 7 */ { A1_OP_NAME, 0, "ti4" }
};
/* generate_template_type: TESTImplicit2 */
const struct asn1_template asn1_TESTImplicit2[] = {
/* 0 */ { 0, sizeof(TESTImplicit2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTImplicit2_tag__44 }
};

int ASN1CALL
decode_TESTImplicit2(const unsigned char *p, size_t len, TESTImplicit2 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTImplicit2, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTImplicit2(unsigned char *p, size_t len, const TESTImplicit2 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTImplicit2, p, len, data, size);
}


size_t ASN1CALL
length_TESTImplicit2(const TESTImplicit2 *data)
{
    return _asn1_length(asn1_TESTImplicit2, data);
}


void ASN1CALL
free_TESTImplicit2(TESTImplicit2 *data)
{
    _asn1_free_top(asn1_TESTImplicit2, data);
}


int ASN1CALL
copy_TESTImplicit2(const TESTImplicit2 *from, TESTImplicit2 *to)
{
    return _asn1_copy_top(asn1_TESTImplicit2, from, to);
}


char * ASN1CALL
print_TESTImplicit2(const TESTImplicit2 *data, int flags)
{
    return _asn1_print_top(asn1_TESTImplicit2, flags, data);
}

/* template_members: int imp imp */
/* template_members: int exp exp */
/* generate_template_type: int_tag__49 */
/* generate_template_type: int_tag__48 */
/* generate_template_type: TESTImplicit3_choice_ti1 */
const struct asn1_template asn1_TESTImplicit3_choice_ti1[] = {
/* 0 */ { 0, sizeof(int), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,PRIM,0)|A1_FLAG_IMPLICIT, 0, asn1_TESTLargeTag_tag_foo_13 }
};
/* template_members: TESTImplicit3_ti2 exp exp */
/* template_members: int exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag__52 */
/* generate_template_type: int_tag__51 */
/* generate_template_type: TESTImplicit3_ti2_choice_i1 */
static const struct asn1_template asn1_choice_TESTImplicit3_ti2_3[] = {
/* 0 */ { 0, offsetof(struct TESTImplicit3_ti2, element), ((void *)(uintptr_t)2) },
/* 1 */ { choice_TESTImplicit3_ti2_i1, offsetof(struct TESTImplicit3_ti2, u.i1), asn1_TESTChoice1_choice_i1 },
/* 2 */ { 0, 0, "i1" }
};
/* generate_template_type: TESTImplicit3_ti2_tag__50 */
const struct asn1_template asn1_TESTImplicit3_ti2_tag__50[] = {
/* 0 */ { 0, sizeof(struct TESTImplicit3_ti2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_CHOICE, 0, asn1_choice_TESTImplicit3_ti2_3 }
};
/* generate_template_type: TESTImplicit3_choice_ti2 */
const struct asn1_template asn1_TESTImplicit3_choice_ti2[] = {
/* 0 */ { 0, sizeof(struct TESTImplicit3_ti2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,5), 0, asn1_TESTImplicit3_ti2_tag__50 }
};
static const struct asn1_template asn1_choice_TESTImplicit3_2[] = {
/* 0 */ { 0, offsetof(TESTImplicit3, element), ((void *)(uintptr_t)4) },
/* 1 */ { choice_TESTImplicit3_ti1, offsetof(TESTImplicit3, u.ti1), asn1_TESTImplicit3_choice_ti1 },
/* 2 */ { choice_TESTImplicit3_ti2, offsetof(TESTImplicit3, u.ti2), asn1_TESTImplicit3_choice_ti2 },
/* 3 */ { 0, 0, "ti1" },
/* 4 */ { 0, 0, "ti2" }
};
/* generate_template_type: TESTImplicit3 */
const struct asn1_template asn1_TESTImplicit3[] = {
/* 0 */ { 0, sizeof(TESTImplicit3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_CHOICE, 0, asn1_choice_TESTImplicit3_2 }
};

int ASN1CALL
decode_TESTImplicit3(const unsigned char *p, size_t len, TESTImplicit3 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTImplicit3, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTImplicit3(unsigned char *p, size_t len, const TESTImplicit3 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTImplicit3, p, len, data, size);
}


size_t ASN1CALL
length_TESTImplicit3(const TESTImplicit3 *data)
{
    return _asn1_length(asn1_TESTImplicit3, data);
}


void ASN1CALL
free_TESTImplicit3(TESTImplicit3 *data)
{
    _asn1_free_top(asn1_TESTImplicit3, data);
}


int ASN1CALL
copy_TESTImplicit3(const TESTImplicit3 *from, TESTImplicit3 *to)
{
    return _asn1_copy_top(asn1_TESTImplicit3, from, to);
}


char * ASN1CALL
print_TESTImplicit3(const TESTImplicit3 *data, int flags)
{
    return _asn1_print_top(asn1_TESTImplicit3, flags, data);
}

/* template_members: int imp imp */
/* template_members: int exp exp */
/* generate_template_type: int_tag__54 */
/* generate_template_type: int_tag__53 */
/* generate_template_type: TESTImplicit4_choice_ti1 */
/* template_members: TESTChoice2 exp exp */
/* generate_template_type: TESTChoice2_tag__55 */
const struct asn1_template asn1_TESTChoice2_tag__55[] = {
/* 0 */ { 0, sizeof(TESTChoice2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTChoice2 }
};
/* generate_template_type: TESTImplicit4_choice_ti2 */
const struct asn1_template asn1_TESTImplicit4_choice_ti2[] = {
/* 0 */ { 0, sizeof(TESTChoice2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,5), 0, asn1_TESTChoice2_tag__55 }
};
static const struct asn1_template asn1_choice_TESTImplicit4_4[] = {
/* 0 */ { 0, offsetof(TESTImplicit4, element), ((void *)(uintptr_t)4) },
/* 1 */ { choice_TESTImplicit4_ti1, offsetof(TESTImplicit4, u.ti1), asn1_TESTImplicit3_choice_ti1 },
/* 2 */ { choice_TESTImplicit4_ti2, offsetof(TESTImplicit4, u.ti2), asn1_TESTImplicit4_choice_ti2 },
/* 3 */ { 0, 0, "ti1" },
/* 4 */ { 0, 0, "ti2" }
};
/* generate_template_type: TESTImplicit4 */
const struct asn1_template asn1_TESTImplicit4[] = {
/* 0 */ { 0, sizeof(TESTImplicit4), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_CHOICE, 0, asn1_choice_TESTImplicit4_4 }
};

int ASN1CALL
decode_TESTImplicit4(const unsigned char *p, size_t len, TESTImplicit4 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTImplicit4, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTImplicit4(unsigned char *p, size_t len, const TESTImplicit4 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTImplicit4, p, len, data, size);
}


size_t ASN1CALL
length_TESTImplicit4(const TESTImplicit4 *data)
{
    return _asn1_length(asn1_TESTImplicit4, data);
}


void ASN1CALL
free_TESTImplicit4(TESTImplicit4 *data)
{
    _asn1_free_top(asn1_TESTImplicit4, data);
}


int ASN1CALL
copy_TESTImplicit4(const TESTImplicit4 *from, TESTImplicit4 *to)
{
    return _asn1_copy_top(asn1_TESTImplicit4, from, to);
}


char * ASN1CALL
print_TESTImplicit4(const TESTImplicit4 *data, int flags)
{
    return _asn1_print_top(asn1_TESTImplicit4, flags, data);
}

/* template_members: TESTAllocInner exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTAllocInner exp exp */
/* generate_template_type: TESTAllocInner_tag_ai_57 */
/* generate_template_type: TESTAllocInner_tag__56 */
const struct asn1_template asn1_TESTAllocInner_tag__56[] = {
/* 0 */ { 0, sizeof(struct TESTAllocInner), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0), offsetof(struct TESTAllocInner, ai), asn1_TESTInteger2_tag__31 },
/* 2 */ { A1_OP_NAME, 0, "TESTAllocInner" },
/* 3 */ { A1_OP_NAME, 0, "ai" }
};
/* generate_template_type: TESTAllocInner */
const struct asn1_template asn1_TESTAllocInner[] = {
/* 0 */ { 0, sizeof(TESTAllocInner), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTAllocInner_tag__56 }
};

int ASN1CALL
decode_TESTAllocInner(const unsigned char *p, size_t len, TESTAllocInner *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTAllocInner, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTAllocInner(unsigned char *p, size_t len, const TESTAllocInner *data, size_t *size)
{
    return _asn1_encode(asn1_TESTAllocInner, p, len, data, size);
}


size_t ASN1CALL
length_TESTAllocInner(const TESTAllocInner *data)
{
    return _asn1_length(asn1_TESTAllocInner, data);
}


void ASN1CALL
free_TESTAllocInner(TESTAllocInner *data)
{
    _asn1_free_top(asn1_TESTAllocInner, data);
}


int ASN1CALL
copy_TESTAllocInner(const TESTAllocInner *from, TESTAllocInner *to)
{
    return _asn1_copy_top(asn1_TESTAllocInner, from, to);
}


char * ASN1CALL
print_TESTAllocInner(const TESTAllocInner *data, int flags)
{
    return _asn1_print_top(asn1_TESTAllocInner, flags, data);
}

/* template_members: TESTAlloc exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTAlloc exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_three_60 */
/* generate_template_type: TESTAlloc_tag_three_59 */
/* generate_template_type: TESTAlloc_tag__58 */
const struct asn1_template asn1_TESTAlloc_tag__58[] = {
/* 0 */ { 0, sizeof(struct TESTAlloc), ((void *)(uintptr_t)7) },
/* 1 */ { A1_OP_TYPE |A1_FLAG_OPTIONAL, offsetof(struct TESTAlloc, tagless), asn1_TESTAllocInner },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,1), offsetof(struct TESTAlloc, three), asn1_TESTLargeTag_tag_foo_13 },
/* 3 */ { A1_OP_TYPE_EXTERN |A1_FLAG_OPTIONAL, offsetof(struct TESTAlloc, tagless2), &asn1_extern_HEIM_ANY},
/* 4 */ { A1_OP_NAME, 0, "TESTAlloc" },
/* 5 */ { A1_OP_NAME, 0, "tagless" },
/* 6 */ { A1_OP_NAME, 0, "three" },
/* 7 */ { A1_OP_NAME, 0, "tagless2" }
};
/* generate_template_type: TESTAlloc */
const struct asn1_template asn1_TESTAlloc[] = {
/* 0 */ { 0, sizeof(TESTAlloc), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTAlloc_tag__58 }
};

int ASN1CALL
decode_TESTAlloc(const unsigned char *p, size_t len, TESTAlloc *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTAlloc, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTAlloc(unsigned char *p, size_t len, const TESTAlloc *data, size_t *size)
{
    return _asn1_encode(asn1_TESTAlloc, p, len, data, size);
}


size_t ASN1CALL
length_TESTAlloc(const TESTAlloc *data)
{
    return _asn1_length(asn1_TESTAlloc, data);
}


void ASN1CALL
free_TESTAlloc(TESTAlloc *data)
{
    _asn1_free_top(asn1_TESTAlloc, data);
}


int ASN1CALL
copy_TESTAlloc(const TESTAlloc *from, TESTAlloc *to)
{
    return _asn1_copy_top(asn1_TESTAlloc, from, to);
}


char * ASN1CALL
print_TESTAlloc(const TESTAlloc *data, int flags)
{
    return _asn1_print_top(asn1_TESTAlloc, flags, data);
}

/* template_members: TESTOptional exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTOptional exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_zero_63 */
/* generate_template_type: TESTOptional_tag_zero_62 */
/* template_members: TESTOptional exp exp */
/* template_members: int exp exp */
/* generate_template_type: int_tag_one_65 */
/* generate_template_type: TESTOptional_tag_one_64 */
/* generate_template_type: TESTOptional_tag__61 */
const struct asn1_template asn1_TESTOptional_tag__61[] = {
/* 0 */ { 0, sizeof(struct TESTOptional), ((void *)(uintptr_t)5) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0)|A1_FLAG_OPTIONAL, offsetof(struct TESTOptional, zero), asn1_TESTLargeTag_tag_foo_13 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,1)|A1_FLAG_OPTIONAL, offsetof(struct TESTOptional, one), asn1_TESTLargeTag_tag_foo_13 },
/* 3 */ { A1_OP_NAME, 0, "TESTOptional" },
/* 4 */ { A1_OP_NAME, 0, "zero" },
/* 5 */ { A1_OP_NAME, 0, "one" }
};
/* generate_template_type: TESTOptional */
const struct asn1_template asn1_TESTOptional[] = {
/* 0 */ { 0, sizeof(TESTOptional), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTOptional_tag__61 }
};

int ASN1CALL
decode_TESTOptional(const unsigned char *p, size_t len, TESTOptional *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTOptional, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTOptional(unsigned char *p, size_t len, const TESTOptional *data, size_t *size)
{
    return _asn1_encode(asn1_TESTOptional, p, len, data, size);
}


size_t ASN1CALL
length_TESTOptional(const TESTOptional *data)
{
    return _asn1_length(asn1_TESTOptional, data);
}


void ASN1CALL
free_TESTOptional(TESTOptional *data)
{
    _asn1_free_top(asn1_TESTOptional, data);
}


int ASN1CALL
copy_TESTOptional(const TESTOptional *from, TESTOptional *to)
{
    return _asn1_copy_top(asn1_TESTOptional, from, to);
}


char * ASN1CALL
print_TESTOptional(const TESTOptional *data, int flags)
{
    return _asn1_print_top(asn1_TESTOptional, flags, data);
}

/* template_members: TESTCONTAINING exp exp */
/* generate_template_type: TESTCONTAINING_tag__66 */
const struct asn1_template asn1_TESTCONTAINING_tag__66[] = {
/* 0 */ { 0, sizeof(heim_octet_string), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_OCTET_STRING), 0, NULL }
};
/* generate_template_type: TESTCONTAINING */
const struct asn1_template asn1_TESTCONTAINING[] = {
/* 0 */ { 0, sizeof(TESTCONTAINING), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), 0, asn1_TESTCONTAINING_tag__66 }
};

int ASN1CALL
decode_TESTCONTAINING(const unsigned char *p, size_t len, TESTCONTAINING *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTCONTAINING, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTCONTAINING(unsigned char *p, size_t len, const TESTCONTAINING *data, size_t *size)
{
    return _asn1_encode(asn1_TESTCONTAINING, p, len, data, size);
}


size_t ASN1CALL
length_TESTCONTAINING(const TESTCONTAINING *data)
{
    return _asn1_length(asn1_TESTCONTAINING, data);
}


void ASN1CALL
free_TESTCONTAINING(TESTCONTAINING *data)
{
    _asn1_free_top(asn1_TESTCONTAINING, data);
}


int ASN1CALL
copy_TESTCONTAINING(const TESTCONTAINING *from, TESTCONTAINING *to)
{
    return _asn1_copy_top(asn1_TESTCONTAINING, from, to);
}


char * ASN1CALL
print_TESTCONTAINING(const TESTCONTAINING *data, int flags)
{
    return _asn1_print_top(asn1_TESTCONTAINING, flags, data);
}

/* template_members: TESTENCODEDBY exp exp */
/* generate_template_type: TESTENCODEDBY_tag__67 */
/* generate_template_type: TESTENCODEDBY */
const struct asn1_template asn1_TESTENCODEDBY[] = {
/* 0 */ { 0, sizeof(TESTENCODEDBY), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), 0, asn1_TESTCONTAINING_tag__66 }
};

int ASN1CALL
decode_TESTENCODEDBY(const unsigned char *p, size_t len, TESTENCODEDBY *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTENCODEDBY, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTENCODEDBY(unsigned char *p, size_t len, const TESTENCODEDBY *data, size_t *size)
{
    return _asn1_encode(asn1_TESTENCODEDBY, p, len, data, size);
}


size_t ASN1CALL
length_TESTENCODEDBY(const TESTENCODEDBY *data)
{
    return _asn1_length(asn1_TESTENCODEDBY, data);
}


void ASN1CALL
free_TESTENCODEDBY(TESTENCODEDBY *data)
{
    _asn1_free_top(asn1_TESTENCODEDBY, data);
}


int ASN1CALL
copy_TESTENCODEDBY(const TESTENCODEDBY *from, TESTENCODEDBY *to)
{
    return _asn1_copy_top(asn1_TESTENCODEDBY, from, to);
}


char * ASN1CALL
print_TESTENCODEDBY(const TESTENCODEDBY *data, int flags)
{
    return _asn1_print_top(asn1_TESTENCODEDBY, flags, data);
}

/* template_members: testContainingEncodedBy exp exp */
/* generate_template_type: testContainingEncodedBy_tag__68 */
/* generate_template_type: testContainingEncodedBy */
const struct asn1_template asn1_testContainingEncodedBy[] = {
/* 0 */ { 0, sizeof(testContainingEncodedBy), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), 0, asn1_TESTCONTAINING_tag__66 }
};

int ASN1CALL
decode_testContainingEncodedBy(const unsigned char *p, size_t len, testContainingEncodedBy *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_testContainingEncodedBy, 0|0, p, len, data, size);
}


int ASN1CALL
encode_testContainingEncodedBy(unsigned char *p, size_t len, const testContainingEncodedBy *data, size_t *size)
{
    return _asn1_encode(asn1_testContainingEncodedBy, p, len, data, size);
}


size_t ASN1CALL
length_testContainingEncodedBy(const testContainingEncodedBy *data)
{
    return _asn1_length(asn1_testContainingEncodedBy, data);
}


void ASN1CALL
free_testContainingEncodedBy(testContainingEncodedBy *data)
{
    _asn1_free_top(asn1_testContainingEncodedBy, data);
}


int ASN1CALL
copy_testContainingEncodedBy(const testContainingEncodedBy *from, testContainingEncodedBy *to)
{
    return _asn1_copy_top(asn1_testContainingEncodedBy, from, to);
}


char * ASN1CALL
print_testContainingEncodedBy(const testContainingEncodedBy *data, int flags)
{
    return _asn1_print_top(asn1_testContainingEncodedBy, flags, data);
}

/* template_members: testContainingEncodedBy2 exp exp */
/* generate_template_type: testContainingEncodedBy2_tag__69 */
/* generate_template_type: testContainingEncodedBy2 */
const struct asn1_template asn1_testContainingEncodedBy2[] = {
/* 0 */ { 0, sizeof(testContainingEncodedBy2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), 0, asn1_TESTCONTAINING_tag__66 }
};

int ASN1CALL
decode_testContainingEncodedBy2(const unsigned char *p, size_t len, testContainingEncodedBy2 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_testContainingEncodedBy2, 0|0, p, len, data, size);
}


int ASN1CALL
encode_testContainingEncodedBy2(unsigned char *p, size_t len, const testContainingEncodedBy2 *data, size_t *size)
{
    return _asn1_encode(asn1_testContainingEncodedBy2, p, len, data, size);
}


size_t ASN1CALL
length_testContainingEncodedBy2(const testContainingEncodedBy2 *data)
{
    return _asn1_length(asn1_testContainingEncodedBy2, data);
}


void ASN1CALL
free_testContainingEncodedBy2(testContainingEncodedBy2 *data)
{
    _asn1_free_top(asn1_testContainingEncodedBy2, data);
}


int ASN1CALL
copy_testContainingEncodedBy2(const testContainingEncodedBy2 *from, testContainingEncodedBy2 *to)
{
    return _asn1_copy_top(asn1_testContainingEncodedBy2, from, to);
}


char * ASN1CALL
print_testContainingEncodedBy2(const testContainingEncodedBy2 *data, int flags)
{
    return _asn1_print_top(asn1_testContainingEncodedBy2, flags, data);
}

/* template_members: testUserConstrained exp exp */
/* generate_template_type: testUserConstrained_tag__70 */
/* generate_template_type: testUserConstrained */
const struct asn1_template asn1_testUserConstrained[] = {
/* 0 */ { 0, sizeof(testUserConstrained), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), 0, asn1_TESTCONTAINING_tag__66 }
};

int ASN1CALL
decode_testUserConstrained(const unsigned char *p, size_t len, testUserConstrained *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_testUserConstrained, 0|0, p, len, data, size);
}


int ASN1CALL
encode_testUserConstrained(unsigned char *p, size_t len, const testUserConstrained *data, size_t *size)
{
    return _asn1_encode(asn1_testUserConstrained, p, len, data, size);
}


size_t ASN1CALL
length_testUserConstrained(const testUserConstrained *data)
{
    return _asn1_length(asn1_testUserConstrained, data);
}


void ASN1CALL
free_testUserConstrained(testUserConstrained *data)
{
    _asn1_free_top(asn1_testUserConstrained, data);
}


int ASN1CALL
copy_testUserConstrained(const testUserConstrained *from, testUserConstrained *to)
{
    return _asn1_copy_top(asn1_testUserConstrained, from, to);
}


char * ASN1CALL
print_testUserConstrained(const testUserConstrained *data, int flags)
{
    return _asn1_print_top(asn1_testUserConstrained, flags, data);
}

/* template_members: TESTSeqOf exp exp */
/* generate_template_type: TESTInteger_seofTstruct_0 */
/* generate_template_type: TESTSeqOf_tag__71 */
const struct asn1_template asn1_TESTSeqOf_tag__71[] = {
/* 0 */ { 0, sizeof(TESTInteger), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTInteger2_tag__31 }
};
/* generate_template_type: TESTSeqOf */
const struct asn1_template asn1_TESTSeqOf[] = {
/* 0 */ { 0, sizeof(TESTSeqOf), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf_tag__71 }
};

int ASN1CALL
decode_TESTSeqOf(const unsigned char *p, size_t len, TESTSeqOf *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOf, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOf(unsigned char *p, size_t len, const TESTSeqOf *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOf, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOf(const TESTSeqOf *data)
{
    return _asn1_length(asn1_TESTSeqOf, data);
}


void ASN1CALL
free_TESTSeqOf(TESTSeqOf *data)
{
    _asn1_free_top(asn1_TESTSeqOf, data);
}


int ASN1CALL
copy_TESTSeqOf(const TESTSeqOf *from, TESTSeqOf *to)
{
    return _asn1_copy_top(asn1_TESTSeqOf, from, to);
}


char * ASN1CALL
print_TESTSeqOf(const TESTSeqOf *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOf, flags, data);
}

int ASN1CALL
add_TESTSeqOf(TESTSeqOf *data, const TESTInteger *element)
{
int ret;
void *ptr;

ptr = realloc(data->val, 
	(data->len + 1) * sizeof(data->val[0]));
if (ptr == NULL) return ENOMEM;
data->val = ptr;

ret = copy_TESTInteger(element, &data->val[data->len]);
if (ret) return ret;
data->len++;
return 0;
}

int ASN1CALL
remove_TESTSeqOf(TESTSeqOf *data, unsigned int element)
{
void *ptr;

if (data->len == 0 || element >= data->len)
	return ASN1_OVERRUN;
free_TESTInteger(&data->val[element]);
data->len--;
if (element < data->len)
	memmove(&data->val[element], &data->val[element + 1], 
		sizeof(data->val[0]) * (data->len - element));
ptr = realloc(data->val, data->len * sizeof(data->val[0]));
if (ptr != NULL || data->len == 0) data->val = ptr;
return 0;
}

/* template_members: TESTSeqSizeOf1 exp exp */
/* generate_template_type: TESTInteger_seofTstruct_1 */
/* generate_template_type: TESTSeqSizeOf1_tag__72 */
/* generate_template_type: TESTSeqSizeOf1 */
const struct asn1_template asn1_TESTSeqSizeOf1[] = {
/* 0 */ { 0, sizeof(TESTSeqSizeOf1), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf_tag__71 }
};

int ASN1CALL
decode_TESTSeqSizeOf1(const unsigned char *p, size_t len, TESTSeqSizeOf1 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqSizeOf1, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqSizeOf1(unsigned char *p, size_t len, const TESTSeqSizeOf1 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqSizeOf1, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqSizeOf1(const TESTSeqSizeOf1 *data)
{
    return _asn1_length(asn1_TESTSeqSizeOf1, data);
}


void ASN1CALL
free_TESTSeqSizeOf1(TESTSeqSizeOf1 *data)
{
    _asn1_free_top(asn1_TESTSeqSizeOf1, data);
}


int ASN1CALL
copy_TESTSeqSizeOf1(const TESTSeqSizeOf1 *from, TESTSeqSizeOf1 *to)
{
    return _asn1_copy_top(asn1_TESTSeqSizeOf1, from, to);
}


char * ASN1CALL
print_TESTSeqSizeOf1(const TESTSeqSizeOf1 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqSizeOf1, flags, data);
}

/* template_members: TESTSeqSizeOf2 exp exp */
/* generate_template_type: TESTInteger_seofTstruct_2 */
/* generate_template_type: TESTSeqSizeOf2_tag__73 */
/* generate_template_type: TESTSeqSizeOf2 */
const struct asn1_template asn1_TESTSeqSizeOf2[] = {
/* 0 */ { 0, sizeof(TESTSeqSizeOf2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf_tag__71 }
};

int ASN1CALL
decode_TESTSeqSizeOf2(const unsigned char *p, size_t len, TESTSeqSizeOf2 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqSizeOf2, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqSizeOf2(unsigned char *p, size_t len, const TESTSeqSizeOf2 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqSizeOf2, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqSizeOf2(const TESTSeqSizeOf2 *data)
{
    return _asn1_length(asn1_TESTSeqSizeOf2, data);
}


void ASN1CALL
free_TESTSeqSizeOf2(TESTSeqSizeOf2 *data)
{
    _asn1_free_top(asn1_TESTSeqSizeOf2, data);
}


int ASN1CALL
copy_TESTSeqSizeOf2(const TESTSeqSizeOf2 *from, TESTSeqSizeOf2 *to)
{
    return _asn1_copy_top(asn1_TESTSeqSizeOf2, from, to);
}


char * ASN1CALL
print_TESTSeqSizeOf2(const TESTSeqSizeOf2 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqSizeOf2, flags, data);
}

/* template_members: TESTSeqSizeOf3 exp exp */
/* generate_template_type: TESTInteger_seofTstruct_3 */
/* generate_template_type: TESTSeqSizeOf3_tag__74 */
/* generate_template_type: TESTSeqSizeOf3 */
const struct asn1_template asn1_TESTSeqSizeOf3[] = {
/* 0 */ { 0, sizeof(TESTSeqSizeOf3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf_tag__71 }
};

int ASN1CALL
decode_TESTSeqSizeOf3(const unsigned char *p, size_t len, TESTSeqSizeOf3 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqSizeOf3, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqSizeOf3(unsigned char *p, size_t len, const TESTSeqSizeOf3 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqSizeOf3, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqSizeOf3(const TESTSeqSizeOf3 *data)
{
    return _asn1_length(asn1_TESTSeqSizeOf3, data);
}


void ASN1CALL
free_TESTSeqSizeOf3(TESTSeqSizeOf3 *data)
{
    _asn1_free_top(asn1_TESTSeqSizeOf3, data);
}


int ASN1CALL
copy_TESTSeqSizeOf3(const TESTSeqSizeOf3 *from, TESTSeqSizeOf3 *to)
{
    return _asn1_copy_top(asn1_TESTSeqSizeOf3, from, to);
}


char * ASN1CALL
print_TESTSeqSizeOf3(const TESTSeqSizeOf3 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqSizeOf3, flags, data);
}

/* template_members: TESTSeqSizeOf4 exp exp */
/* generate_template_type: TESTInteger_seofTstruct_4 */
/* generate_template_type: TESTSeqSizeOf4_tag__75 */
/* generate_template_type: TESTSeqSizeOf4 */
const struct asn1_template asn1_TESTSeqSizeOf4[] = {
/* 0 */ { 0, sizeof(TESTSeqSizeOf4), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf_tag__71 }
};

int ASN1CALL
decode_TESTSeqSizeOf4(const unsigned char *p, size_t len, TESTSeqSizeOf4 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqSizeOf4, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqSizeOf4(unsigned char *p, size_t len, const TESTSeqSizeOf4 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqSizeOf4, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqSizeOf4(const TESTSeqSizeOf4 *data)
{
    return _asn1_length(asn1_TESTSeqSizeOf4, data);
}


void ASN1CALL
free_TESTSeqSizeOf4(TESTSeqSizeOf4 *data)
{
    _asn1_free_top(asn1_TESTSeqSizeOf4, data);
}


int ASN1CALL
copy_TESTSeqSizeOf4(const TESTSeqSizeOf4 *from, TESTSeqSizeOf4 *to)
{
    return _asn1_copy_top(asn1_TESTSeqSizeOf4, from, to);
}


char * ASN1CALL
print_TESTSeqSizeOf4(const TESTSeqSizeOf4 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqSizeOf4, flags, data);
}

/* template_members: TESTOSSize1 exp exp */
/* generate_template_type: TESTOSSize1_tag__76 */
/* generate_template_type: TESTOSSize1 */
const struct asn1_template asn1_TESTOSSize1[] = {
/* 0 */ { 0, sizeof(TESTOSSize1), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), 0, asn1_TESTCONTAINING_tag__66 }
};

int ASN1CALL
decode_TESTOSSize1(const unsigned char *p, size_t len, TESTOSSize1 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTOSSize1, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTOSSize1(unsigned char *p, size_t len, const TESTOSSize1 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTOSSize1, p, len, data, size);
}


size_t ASN1CALL
length_TESTOSSize1(const TESTOSSize1 *data)
{
    return _asn1_length(asn1_TESTOSSize1, data);
}


void ASN1CALL
free_TESTOSSize1(TESTOSSize1 *data)
{
    _asn1_free_top(asn1_TESTOSSize1, data);
}


int ASN1CALL
copy_TESTOSSize1(const TESTOSSize1 *from, TESTOSSize1 *to)
{
    return _asn1_copy_top(asn1_TESTOSSize1, from, to);
}


char * ASN1CALL
print_TESTOSSize1(const TESTOSSize1 *data, int flags)
{
    return _asn1_print_top(asn1_TESTOSSize1, flags, data);
}

/* template_members: TESTSeqOfSeq exp exp */
/* template_members: TESTSeqOfSeq_val exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOfSeq_val exp exp */
/* generate_template_type: TESTSeqOfSeq_val_tag_zero_79 */
/* generate_template_type: TESTSeqOfSeq_val_tag__78 */
const struct asn1_template asn1_TESTSeqOfSeq_val_tag__78[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOfSeq_val), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0), offsetof(struct TESTSeqOfSeq_val, zero), asn1_TESTInteger2_tag__31 },
/* 2 */ { A1_OP_NAME, 0, "TESTSeqOfSeq_val" },
/* 3 */ { A1_OP_NAME, 0, "zero" }
};
/* generate_template_type: TESTSeqOfSeq_seofTstruct_5 */
const struct asn1_template asn1_TESTSeqOfSeq_seofTstruct_5[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOfSeq_val), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOfSeq_val_tag__78 }
};
/* generate_template_type: TESTSeqOfSeq_tag__77 */
const struct asn1_template asn1_TESTSeqOfSeq_tag__77[] = {
/* 0 */ { 0, sizeof(TESTSeqOfSeq), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOfSeq_seofTstruct_5 }
};
/* generate_template_type: TESTSeqOfSeq */
const struct asn1_template asn1_TESTSeqOfSeq[] = {
/* 0 */ { 0, sizeof(TESTSeqOfSeq), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOfSeq_tag__77 }
};

int ASN1CALL
decode_TESTSeqOfSeq(const unsigned char *p, size_t len, TESTSeqOfSeq *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOfSeq, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOfSeq(unsigned char *p, size_t len, const TESTSeqOfSeq *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOfSeq, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOfSeq(const TESTSeqOfSeq *data)
{
    return _asn1_length(asn1_TESTSeqOfSeq, data);
}


void ASN1CALL
free_TESTSeqOfSeq(TESTSeqOfSeq *data)
{
    _asn1_free_top(asn1_TESTSeqOfSeq, data);
}


int ASN1CALL
copy_TESTSeqOfSeq(const TESTSeqOfSeq *from, TESTSeqOfSeq *to)
{
    return _asn1_copy_top(asn1_TESTSeqOfSeq, from, to);
}


char * ASN1CALL
print_TESTSeqOfSeq(const TESTSeqOfSeq *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOfSeq, flags, data);
}

/* template_members: TESTSeqOfSeq2 exp exp */
/* template_members: TESTSeqOfSeq2_val exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOfSeq2_val exp exp */
/* template_members: heim_general_string exp exp */
/* generate_template_type: heim_general_string_tag_string_83 */
const struct asn1_template asn1_heim_general_string_tag_string_83[] = {
/* 0 */ { 0, sizeof(heim_general_string), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_GENERAL_STRING), 0, NULL }
};
/* generate_template_type: TESTSeqOfSeq2_val_tag_string_82 */
const struct asn1_template asn1_TESTSeqOfSeq2_val_tag_string_82[] = {
/* 0 */ { 0, sizeof(heim_general_string), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_GeneralString), 0, asn1_heim_general_string_tag_string_83 }
};
/* generate_template_type: TESTSeqOfSeq2_val_tag__81 */
const struct asn1_template asn1_TESTSeqOfSeq2_val_tag__81[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOfSeq2_val), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0), offsetof(struct TESTSeqOfSeq2_val, string), asn1_TESTSeqOfSeq2_val_tag_string_82 },
/* 2 */ { A1_OP_NAME, 0, "TESTSeqOfSeq2_val" },
/* 3 */ { A1_OP_NAME, 0, "string" }
};
/* generate_template_type: TESTSeqOfSeq2_seofTstruct_6 */
const struct asn1_template asn1_TESTSeqOfSeq2_seofTstruct_6[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOfSeq2_val), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOfSeq2_val_tag__81 }
};
/* generate_template_type: TESTSeqOfSeq2_tag__80 */
const struct asn1_template asn1_TESTSeqOfSeq2_tag__80[] = {
/* 0 */ { 0, sizeof(TESTSeqOfSeq2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOfSeq2_seofTstruct_6 }
};
/* generate_template_type: TESTSeqOfSeq2 */
const struct asn1_template asn1_TESTSeqOfSeq2[] = {
/* 0 */ { 0, sizeof(TESTSeqOfSeq2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOfSeq2_tag__80 }
};

int ASN1CALL
decode_TESTSeqOfSeq2(const unsigned char *p, size_t len, TESTSeqOfSeq2 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOfSeq2, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOfSeq2(unsigned char *p, size_t len, const TESTSeqOfSeq2 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOfSeq2, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOfSeq2(const TESTSeqOfSeq2 *data)
{
    return _asn1_length(asn1_TESTSeqOfSeq2, data);
}


void ASN1CALL
free_TESTSeqOfSeq2(TESTSeqOfSeq2 *data)
{
    _asn1_free_top(asn1_TESTSeqOfSeq2, data);
}


int ASN1CALL
copy_TESTSeqOfSeq2(const TESTSeqOfSeq2 *from, TESTSeqOfSeq2 *to)
{
    return _asn1_copy_top(asn1_TESTSeqOfSeq2, from, to);
}


char * ASN1CALL
print_TESTSeqOfSeq2(const TESTSeqOfSeq2 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOfSeq2, flags, data);
}

/* template_members: TESTSeqOfSeq3 exp exp */
/* template_members: TESTSeqOfSeq3_val exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOfSeq3_val exp exp */
/* generate_template_type: TESTSeqOfSeq3_val_tag_zero_86 */
/* template_members: TESTSeqOfSeq3_val exp exp */
/* template_members: heim_general_string exp exp */
/* generate_template_type: heim_general_string_tag_string_88 */
/* generate_template_type: TESTSeqOfSeq3_val_tag_string_87 */
/* generate_template_type: TESTSeqOfSeq3_val_tag__85 */
const struct asn1_template asn1_TESTSeqOfSeq3_val_tag__85[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOfSeq3_val), ((void *)(uintptr_t)5) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0), offsetof(struct TESTSeqOfSeq3_val, zero), asn1_TESTInteger2_tag__31 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0), offsetof(struct TESTSeqOfSeq3_val, string), asn1_TESTSeqOfSeq2_val_tag_string_82 },
/* 3 */ { A1_OP_NAME, 0, "TESTSeqOfSeq3_val" },
/* 4 */ { A1_OP_NAME, 0, "zero" },
/* 5 */ { A1_OP_NAME, 0, "string" }
};
/* generate_template_type: TESTSeqOfSeq3_seofTstruct_7 */
const struct asn1_template asn1_TESTSeqOfSeq3_seofTstruct_7[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOfSeq3_val), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOfSeq3_val_tag__85 }
};
/* generate_template_type: TESTSeqOfSeq3_tag__84 */
const struct asn1_template asn1_TESTSeqOfSeq3_tag__84[] = {
/* 0 */ { 0, sizeof(TESTSeqOfSeq3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOfSeq3_seofTstruct_7 }
};
/* generate_template_type: TESTSeqOfSeq3 */
const struct asn1_template asn1_TESTSeqOfSeq3[] = {
/* 0 */ { 0, sizeof(TESTSeqOfSeq3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOfSeq3_tag__84 }
};

int ASN1CALL
decode_TESTSeqOfSeq3(const unsigned char *p, size_t len, TESTSeqOfSeq3 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOfSeq3, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOfSeq3(unsigned char *p, size_t len, const TESTSeqOfSeq3 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOfSeq3, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOfSeq3(const TESTSeqOfSeq3 *data)
{
    return _asn1_length(asn1_TESTSeqOfSeq3, data);
}


void ASN1CALL
free_TESTSeqOfSeq3(TESTSeqOfSeq3 *data)
{
    _asn1_free_top(asn1_TESTSeqOfSeq3, data);
}


int ASN1CALL
copy_TESTSeqOfSeq3(const TESTSeqOfSeq3 *from, TESTSeqOfSeq3 *to)
{
    return _asn1_copy_top(asn1_TESTSeqOfSeq3, from, to);
}


char * ASN1CALL
print_TESTSeqOfSeq3(const TESTSeqOfSeq3 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOfSeq3, flags, data);
}

/* template_members: TESTSeqOf2 exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf2 exp exp */
/* template_members: heim_general_string exp exp */
/* generate_template_type: heim_general_string_tag__91 */
/* generate_template_type: TESTSeqOf2_strings_8 */
/* generate_template_type: TESTSeqOf2_tag_strings_90 */
const struct asn1_template asn1_TESTSeqOf2_tag_strings_90[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf2_strings), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOfSeq2_val_tag_string_82 }
};
/* generate_template_type: TESTSeqOf2_tag__89 */
const struct asn1_template asn1_TESTSeqOf2_tag__89[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf2), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), offsetof(struct TESTSeqOf2, strings), asn1_TESTSeqOf2_tag_strings_90 },
/* 2 */ { A1_OP_NAME, 0, "TESTSeqOf2" },
/* 3 */ { A1_OP_NAME, 0, "strings" }
};
/* generate_template_type: TESTSeqOf2 */
const struct asn1_template asn1_TESTSeqOf2[] = {
/* 0 */ { 0, sizeof(TESTSeqOf2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf2_tag__89 }
};

int ASN1CALL
decode_TESTSeqOf2(const unsigned char *p, size_t len, TESTSeqOf2 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOf2, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOf2(unsigned char *p, size_t len, const TESTSeqOf2 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOf2, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOf2(const TESTSeqOf2 *data)
{
    return _asn1_length(asn1_TESTSeqOf2, data);
}


void ASN1CALL
free_TESTSeqOf2(TESTSeqOf2 *data)
{
    _asn1_free_top(asn1_TESTSeqOf2, data);
}


int ASN1CALL
copy_TESTSeqOf2(const TESTSeqOf2 *from, TESTSeqOf2 *to)
{
    return _asn1_copy_top(asn1_TESTSeqOf2, from, to);
}


char * ASN1CALL
print_TESTSeqOf2(const TESTSeqOf2 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOf2, flags, data);
}

/* template_members: TESTSeqOf3 exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf3 exp exp */
/* template_members: heim_general_string exp exp */
/* generate_template_type: heim_general_string_tag__94 */
/* generate_template_type: TESTSeqOf3_strings_9 */
/* generate_template_type: TESTSeqOf3_tag_strings_93 */
const struct asn1_template asn1_TESTSeqOf3_tag_strings_93[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf3_strings), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOfSeq2_val_tag_string_82 }
};
/* generate_template_type: TESTSeqOf3_tag__92 */
const struct asn1_template asn1_TESTSeqOf3_tag__92[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf3), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence)|A1_FLAG_OPTIONAL, offsetof(struct TESTSeqOf3, strings), asn1_TESTSeqOf3_tag_strings_93 },
/* 2 */ { A1_OP_NAME, 0, "TESTSeqOf3" },
/* 3 */ { A1_OP_NAME, 0, "strings" }
};
/* generate_template_type: TESTSeqOf3 */
const struct asn1_template asn1_TESTSeqOf3[] = {
/* 0 */ { 0, sizeof(TESTSeqOf3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf3_tag__92 }
};

int ASN1CALL
decode_TESTSeqOf3(const unsigned char *p, size_t len, TESTSeqOf3 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOf3, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOf3(unsigned char *p, size_t len, const TESTSeqOf3 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOf3, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOf3(const TESTSeqOf3 *data)
{
    return _asn1_length(asn1_TESTSeqOf3, data);
}


void ASN1CALL
free_TESTSeqOf3(TESTSeqOf3 *data)
{
    _asn1_free_top(asn1_TESTSeqOf3, data);
}


int ASN1CALL
copy_TESTSeqOf3(const TESTSeqOf3 *from, TESTSeqOf3 *to)
{
    return _asn1_copy_top(asn1_TESTSeqOf3, from, to);
}


char * ASN1CALL
print_TESTSeqOf3(const TESTSeqOf3 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOf3, flags, data);
}

/* template_members: TESTSeqOf4 exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf4 exp exp */
/* template_members: TESTSeqOf4 exp exp */
/* template_members: TESTSeqOf4_b1_val exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf4_b1_val exp exp */
/* generate_template_type: TESTSeqOf4_b1_val_tag_s1_99 */
/* template_members: TESTSeqOf4_b1_val exp exp */
/* generate_template_type: TESTSeqOf4_b1_val_tag_s2_100 */
/* generate_template_type: TESTSeqOf4_b1_val_tag__98 */
const struct asn1_template asn1_TESTSeqOf4_b1_val_tag__98[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b1_val), ((void *)(uintptr_t)9) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b1_val, s1), asn1_TESTCONTAINING_tag__66 },
/* 2 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b1_val, s2), asn1_TESTCONTAINING_tag__66 },
/* 3 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b1_val, u1), asn1_TESTuint64 },
/* 4 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b1_val, u2), asn1_TESTuint64 },
/* 5 */ { A1_OP_NAME, 0, "TESTSeqOf4_b1_val" },
/* 6 */ { A1_OP_NAME, 0, "s1" },
/* 7 */ { A1_OP_NAME, 0, "s2" },
/* 8 */ { A1_OP_NAME, 0, "u1" },
/* 9 */ { A1_OP_NAME, 0, "u2" }
};
/* generate_template_type: TESTSeqOf4_seofTstruct_10 */
const struct asn1_template asn1_TESTSeqOf4_seofTstruct_10[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b1_val), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_b1_val_tag__98 }
};
/* generate_template_type: TESTSeqOf4_tag_b1_97 */
const struct asn1_template asn1_TESTSeqOf4_tag_b1_97[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b1), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOf4_seofTstruct_10 }
};
/* generate_template_type: TESTSeqOf4_tag_b1_96 */
const struct asn1_template asn1_TESTSeqOf4_tag_b1_96[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b1), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_tag_b1_97 }
};
/* template_members: TESTSeqOf4 exp imp */
/* template_members: TESTSeqOf4 exp exp */
/* template_members: TESTSeqOf4_b2_val exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf4_b2_val exp exp */
/* generate_template_type: TESTSeqOf4_b2_val_tag_s1_104 */
/* template_members: TESTSeqOf4_b2_val exp exp */
/* generate_template_type: TESTSeqOf4_b2_val_tag_s2_105 */
/* template_members: TESTSeqOf4_b2_val exp exp */
/* generate_template_type: TESTSeqOf4_b2_val_tag_s3_106 */
/* generate_template_type: TESTSeqOf4_b2_val_tag__103 */
const struct asn1_template asn1_TESTSeqOf4_b2_val_tag__103[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b2_val), ((void *)(uintptr_t)13) },
/* 1 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b2_val, u1), asn1_TESTuint64 },
/* 2 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b2_val, u2), asn1_TESTuint64 },
/* 3 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b2_val, u3), asn1_TESTuint64 },
/* 4 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b2_val, s1), asn1_TESTCONTAINING_tag__66 },
/* 5 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b2_val, s2), asn1_TESTCONTAINING_tag__66 },
/* 6 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b2_val, s3), asn1_TESTCONTAINING_tag__66 },
/* 7 */ { A1_OP_NAME, 0, "TESTSeqOf4_b2_val" },
/* 8 */ { A1_OP_NAME, 0, "u1" },
/* 9 */ { A1_OP_NAME, 0, "u2" },
/* 10 */ { A1_OP_NAME, 0, "u3" },
/* 11 */ { A1_OP_NAME, 0, "s1" },
/* 12 */ { A1_OP_NAME, 0, "s2" },
/* 13 */ { A1_OP_NAME, 0, "s3" }
};
/* generate_template_type: TESTSeqOf4_seofTstruct_11 */
const struct asn1_template asn1_TESTSeqOf4_seofTstruct_11[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b2_val), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_b2_val_tag__103 }
};
/* generate_template_type: TESTSeqOf4_tag_b2_102 */
const struct asn1_template asn1_TESTSeqOf4_tag_b2_102[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOf4_seofTstruct_11 }
};
/* generate_template_type: TESTSeqOf4_tag_b2_101 */
const struct asn1_template asn1_TESTSeqOf4_tag_b2_101[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b2), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_tag_b2_102 }
};
/* template_members: TESTSeqOf4 exp imp */
/* template_members: TESTSeqOf4 exp exp */
/* template_members: TESTSeqOf4_b3_val exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf4_b3_val exp exp */
/* generate_template_type: TESTSeqOf4_b3_val_tag_s1_110 */
/* template_members: TESTSeqOf4_b3_val exp exp */
/* generate_template_type: TESTSeqOf4_b3_val_tag_s2_111 */
/* template_members: TESTSeqOf4_b3_val exp exp */
/* generate_template_type: TESTSeqOf4_b3_val_tag_s3_112 */
/* template_members: TESTSeqOf4_b3_val exp exp */
/* generate_template_type: TESTSeqOf4_b3_val_tag_s4_113 */
/* generate_template_type: TESTSeqOf4_b3_val_tag__109 */
const struct asn1_template asn1_TESTSeqOf4_b3_val_tag__109[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b3_val), ((void *)(uintptr_t)17) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b3_val, s1), asn1_TESTCONTAINING_tag__66 },
/* 2 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b3_val, u1), asn1_TESTuint64 },
/* 3 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b3_val, s2), asn1_TESTCONTAINING_tag__66 },
/* 4 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b3_val, u2), asn1_TESTuint64 },
/* 5 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b3_val, s3), asn1_TESTCONTAINING_tag__66 },
/* 6 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b3_val, u3), asn1_TESTuint64 },
/* 7 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf4_b3_val, s4), asn1_TESTCONTAINING_tag__66 },
/* 8 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf4_b3_val, u4), asn1_TESTuint64 },
/* 9 */ { A1_OP_NAME, 0, "TESTSeqOf4_b3_val" },
/* 10 */ { A1_OP_NAME, 0, "s1" },
/* 11 */ { A1_OP_NAME, 0, "u1" },
/* 12 */ { A1_OP_NAME, 0, "s2" },
/* 13 */ { A1_OP_NAME, 0, "u2" },
/* 14 */ { A1_OP_NAME, 0, "s3" },
/* 15 */ { A1_OP_NAME, 0, "u3" },
/* 16 */ { A1_OP_NAME, 0, "s4" },
/* 17 */ { A1_OP_NAME, 0, "u4" }
};
/* generate_template_type: TESTSeqOf4_seofTstruct_12 */
const struct asn1_template asn1_TESTSeqOf4_seofTstruct_12[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b3_val), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_b3_val_tag__109 }
};
/* generate_template_type: TESTSeqOf4_tag_b3_108 */
const struct asn1_template asn1_TESTSeqOf4_tag_b3_108[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOf4_seofTstruct_12 }
};
/* generate_template_type: TESTSeqOf4_tag_b3_107 */
const struct asn1_template asn1_TESTSeqOf4_tag_b3_107[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4_b3), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_tag_b3_108 }
};
/* generate_template_type: TESTSeqOf4_tag__95 */
const struct asn1_template asn1_TESTSeqOf4_tag__95[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf4), ((void *)(uintptr_t)7) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0)|A1_FLAG_OPTIONAL, offsetof(struct TESTSeqOf4, b1), asn1_TESTSeqOf4_tag_b1_96 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,1)|A1_FLAG_OPTIONAL|A1_FLAG_IMPLICIT, offsetof(struct TESTSeqOf4, b2), asn1_TESTSeqOf4_tag_b2_101 },
/* 3 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,2)|A1_FLAG_OPTIONAL|A1_FLAG_IMPLICIT, offsetof(struct TESTSeqOf4, b3), asn1_TESTSeqOf4_tag_b3_107 },
/* 4 */ { A1_OP_NAME, 0, "TESTSeqOf4" },
/* 5 */ { A1_OP_NAME, 0, "b1" },
/* 6 */ { A1_OP_NAME, 0, "b2" },
/* 7 */ { A1_OP_NAME, 0, "b3" }
};
/* generate_template_type: TESTSeqOf4 */
const struct asn1_template asn1_TESTSeqOf4[] = {
/* 0 */ { 0, sizeof(TESTSeqOf4), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_tag__95 }
};

int ASN1CALL
decode_TESTSeqOf4(const unsigned char *p, size_t len, TESTSeqOf4 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOf4, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOf4(unsigned char *p, size_t len, const TESTSeqOf4 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOf4, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOf4(const TESTSeqOf4 *data)
{
    return _asn1_length(asn1_TESTSeqOf4, data);
}


void ASN1CALL
free_TESTSeqOf4(TESTSeqOf4 *data)
{
    _asn1_free_top(asn1_TESTSeqOf4, data);
}


int ASN1CALL
copy_TESTSeqOf4(const TESTSeqOf4 *from, TESTSeqOf4 *to)
{
    return _asn1_copy_top(asn1_TESTSeqOf4, from, to);
}


char * ASN1CALL
print_TESTSeqOf4(const TESTSeqOf4 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOf4, flags, data);
}

/* template_members: TESTSeqOf5 exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf5 exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf5_outer exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s0_117 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s1_118 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s2_119 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s3_120 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s4_121 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s5_122 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s6_123 */
/* template_members: TESTSeqOf5_outer_inner exp exp */
/* generate_template_type: TESTSeqOf5_outer_inner_tag_s7_124 */
/* generate_template_type: TESTSeqOf5_outer_tag_inner_116 */
const struct asn1_template asn1_TESTSeqOf5_outer_tag_inner_116[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf5_outer_inner), ((void *)(uintptr_t)33) },
/* 1 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u0), asn1_TESTuint64 },
/* 2 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s0), asn1_TESTCONTAINING_tag__66 },
/* 3 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u1), asn1_TESTuint64 },
/* 4 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s1), asn1_TESTCONTAINING_tag__66 },
/* 5 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u2), asn1_TESTuint64 },
/* 6 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s2), asn1_TESTCONTAINING_tag__66 },
/* 7 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u3), asn1_TESTuint64 },
/* 8 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s3), asn1_TESTCONTAINING_tag__66 },
/* 9 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u4), asn1_TESTuint64 },
/* 10 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s4), asn1_TESTCONTAINING_tag__66 },
/* 11 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u5), asn1_TESTuint64 },
/* 12 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s5), asn1_TESTCONTAINING_tag__66 },
/* 13 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u6), asn1_TESTuint64 },
/* 14 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s6), asn1_TESTCONTAINING_tag__66 },
/* 15 */ { A1_OP_TYPE , offsetof(struct TESTSeqOf5_outer_inner, u7), asn1_TESTuint64 },
/* 16 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTSeqOf5_outer_inner, s7), asn1_TESTCONTAINING_tag__66 },
/* 17 */ { A1_OP_NAME, 0, "TESTSeqOf5_outer" },
/* 18 */ { A1_OP_NAME, 0, "u0" },
/* 19 */ { A1_OP_NAME, 0, "s0" },
/* 20 */ { A1_OP_NAME, 0, "u1" },
/* 21 */ { A1_OP_NAME, 0, "s1" },
/* 22 */ { A1_OP_NAME, 0, "u2" },
/* 23 */ { A1_OP_NAME, 0, "s2" },
/* 24 */ { A1_OP_NAME, 0, "u3" },
/* 25 */ { A1_OP_NAME, 0, "s3" },
/* 26 */ { A1_OP_NAME, 0, "u4" },
/* 27 */ { A1_OP_NAME, 0, "s4" },
/* 28 */ { A1_OP_NAME, 0, "u5" },
/* 29 */ { A1_OP_NAME, 0, "s5" },
/* 30 */ { A1_OP_NAME, 0, "u6" },
/* 31 */ { A1_OP_NAME, 0, "s6" },
/* 32 */ { A1_OP_NAME, 0, "u7" },
/* 33 */ { A1_OP_NAME, 0, "s7" }
};
/* generate_template_type: TESTSeqOf5_tag_outer_115 */
const struct asn1_template asn1_TESTSeqOf5_tag_outer_115[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf5_outer), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), offsetof(struct TESTSeqOf5_outer, inner), asn1_TESTSeqOf5_outer_tag_inner_116 },
/* 2 */ { A1_OP_NAME, 0, "TESTSeqOf5" },
/* 3 */ { A1_OP_NAME, 0, "inner" }
};
/* generate_template_type: TESTSeqOf5_tag__114 */
const struct asn1_template asn1_TESTSeqOf5_tag__114[] = {
/* 0 */ { 0, sizeof(struct TESTSeqOf5), ((void *)(uintptr_t)3) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence)|A1_FLAG_OPTIONAL, offsetof(struct TESTSeqOf5, outer), asn1_TESTSeqOf5_tag_outer_115 },
/* 2 */ { A1_OP_NAME, 0, "TESTSeqOf5" },
/* 3 */ { A1_OP_NAME, 0, "outer" }
};
/* generate_template_type: TESTSeqOf5 */
const struct asn1_template asn1_TESTSeqOf5[] = {
/* 0 */ { 0, sizeof(TESTSeqOf5), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf5_tag__114 }
};

int ASN1CALL
decode_TESTSeqOf5(const unsigned char *p, size_t len, TESTSeqOf5 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTSeqOf5, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTSeqOf5(unsigned char *p, size_t len, const TESTSeqOf5 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTSeqOf5, p, len, data, size);
}


size_t ASN1CALL
length_TESTSeqOf5(const TESTSeqOf5 *data)
{
    return _asn1_length(asn1_TESTSeqOf5, data);
}


void ASN1CALL
free_TESTSeqOf5(TESTSeqOf5 *data)
{
    _asn1_free_top(asn1_TESTSeqOf5, data);
}


int ASN1CALL
copy_TESTSeqOf5(const TESTSeqOf5 *from, TESTSeqOf5 *to)
{
    return _asn1_copy_top(asn1_TESTSeqOf5, from, to);
}


char * ASN1CALL
print_TESTSeqOf5(const TESTSeqOf5 *data, int flags)
{
    return _asn1_print_top(asn1_TESTSeqOf5, flags, data);
}

/* template_members: TESTPreserve exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTPreserve exp exp */
/* generate_template_type: TESTPreserve_tag_zero_126 */
/* template_members: TESTPreserve exp exp */
/* generate_template_type: TESTPreserve_tag_one_127 */
/* generate_template_type: TESTPreserve_tag__125 */
const struct asn1_template asn1_TESTPreserve_tag__125[] = {
/* 0 */ { 0, sizeof(struct TESTPreserve), ((void *)(uintptr_t)5) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,0), offsetof(struct TESTPreserve, zero), asn1_TESTInteger2_tag__31 },
/* 2 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,1), offsetof(struct TESTPreserve, one), asn1_TESTInteger2_tag__31 },
/* 3 */ { A1_OP_NAME, 0, "TESTPreserve" },
/* 4 */ { A1_OP_NAME, 0, "zero" },
/* 5 */ { A1_OP_NAME, 0, "one" }
};
/* generate_template_type: TESTPreserve */
const struct asn1_template asn1_TESTPreserve[] = {
/* 0 */ { 0, sizeof(TESTPreserve), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTPreserve_tag__125 }
};

int ASN1CALL
decode_TESTPreserve(const unsigned char *p, size_t len, TESTPreserve *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTPreserve, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTPreserve(unsigned char *p, size_t len, const TESTPreserve *data, size_t *size)
{
    return _asn1_encode(asn1_TESTPreserve, p, len, data, size);
}


size_t ASN1CALL
length_TESTPreserve(const TESTPreserve *data)
{
    return _asn1_length(asn1_TESTPreserve, data);
}


void ASN1CALL
free_TESTPreserve(TESTPreserve *data)
{
    _asn1_free_top(asn1_TESTPreserve, data);
}


int ASN1CALL
copy_TESTPreserve(const TESTPreserve *from, TESTPreserve *to)
{
    return _asn1_copy_top(asn1_TESTPreserve, from, to);
}


char * ASN1CALL
print_TESTPreserve(const TESTPreserve *data, int flags)
{
    return _asn1_print_top(asn1_TESTPreserve, flags, data);
}

/* template_members: TESTBitString exp exp */
static const struct asn1_template asn1_TESTBitString_bmember__0[] = {
/* 0 */ { 0, sizeof(TESTBitString), ((void *)(uintptr_t)3) },
/* 1 */ { 0, 0, "zero" },
/* 2 */ { 0, 8, "eight" },
/* 3 */ { 0, 31, "thirtyone" }
};
/* generate_template_type: TESTBitString_tag__128 */
const struct asn1_template asn1_TESTBitString_tag__128[] = {
/* 0 */ { 0, sizeof(TESTBitString), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_BMEMBER, 0, asn1_TESTBitString_bmember__0 }
};
/* generate_template_type: TESTBitString */
const struct asn1_template asn1_TESTBitString[] = {
/* 0 */ { 0, sizeof(TESTBitString), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_BitString), 0, asn1_TESTBitString_tag__128 }
};

int ASN1CALL
decode_TESTBitString(const unsigned char *p, size_t len, TESTBitString *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTBitString, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTBitString(unsigned char *p, size_t len, const TESTBitString *data, size_t *size)
{
    return _asn1_encode(asn1_TESTBitString, p, len, data, size);
}


size_t ASN1CALL
length_TESTBitString(const TESTBitString *data)
{
    return _asn1_length(asn1_TESTBitString, data);
}


void ASN1CALL
free_TESTBitString(TESTBitString *data)
{
    _asn1_free_top(asn1_TESTBitString, data);
}


int ASN1CALL
copy_TESTBitString(const TESTBitString *from, TESTBitString *to)
{
    return _asn1_copy_top(asn1_TESTBitString, from, to);
}


char * ASN1CALL
print_TESTBitString(const TESTBitString *data, int flags)
{
    return _asn1_print_top(asn1_TESTBitString, flags, data);
}

uint64_t TESTBitString2int(TESTBitString f)
{
uint64_t r = 0;
if(f.zero) r |= (1ULL << 0);
if(f.eight) r |= (1ULL << 8);
if(f.thirtyone) r |= (1ULL << 31);
return r;
}

TESTBitString int2TESTBitString(uint64_t n)
{
	TESTBitString flags;

	memset(&flags, 0, sizeof(flags));

	flags.zero = (n >> 0) & 1;
	flags.eight = (n >> 8) & 1;
	flags.thirtyone = (n >> 31) & 1;
	return flags;
}

static struct units TESTBitString_units[] = {
	{"thirtyone",	1ULL << 31},
	{"eight",	1ULL << 8},
	{"zero",	1ULL << 0},
	{NULL,	0}
};

const struct units * asn1_TESTBitString_units(void){
return TESTBitString_units;
}

/* template_members: TESTBitString64 exp exp */
static const struct asn1_template asn1_TESTBitString64_bmember__1[] = {
/* 0 */ { 0, sizeof(TESTBitString64), ((void *)(uintptr_t)5) },
/* 1 */ { 0, 0, "zero" },
/* 2 */ { 0, 8, "eight" },
/* 3 */ { 0, 31, "thirtyone" },
/* 4 */ { 0, 32, "thirtytwo" },
/* 5 */ { 0, 63, "sixtythree" }
};
/* generate_template_type: TESTBitString64_tag__129 */
const struct asn1_template asn1_TESTBitString64_tag__129[] = {
/* 0 */ { 0, sizeof(TESTBitString64), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_BMEMBER, 0, asn1_TESTBitString64_bmember__1 }
};
/* generate_template_type: TESTBitString64 */
const struct asn1_template asn1_TESTBitString64[] = {
/* 0 */ { 0, sizeof(TESTBitString64), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_BitString), 0, asn1_TESTBitString64_tag__129 }
};

int ASN1CALL
decode_TESTBitString64(const unsigned char *p, size_t len, TESTBitString64 *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTBitString64, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTBitString64(unsigned char *p, size_t len, const TESTBitString64 *data, size_t *size)
{
    return _asn1_encode(asn1_TESTBitString64, p, len, data, size);
}


size_t ASN1CALL
length_TESTBitString64(const TESTBitString64 *data)
{
    return _asn1_length(asn1_TESTBitString64, data);
}


void ASN1CALL
free_TESTBitString64(TESTBitString64 *data)
{
    _asn1_free_top(asn1_TESTBitString64, data);
}


int ASN1CALL
copy_TESTBitString64(const TESTBitString64 *from, TESTBitString64 *to)
{
    return _asn1_copy_top(asn1_TESTBitString64, from, to);
}


char * ASN1CALL
print_TESTBitString64(const TESTBitString64 *data, int flags)
{
    return _asn1_print_top(asn1_TESTBitString64, flags, data);
}

uint64_t TESTBitString642int(TESTBitString64 f)
{
uint64_t r = 0;
if(f.zero) r |= (1ULL << 0);
if(f.eight) r |= (1ULL << 8);
if(f.thirtyone) r |= (1ULL << 31);
if(f.thirtytwo) r |= (1ULL << 32);
if(f.sixtythree) r |= (1ULL << 63);
return r;
}

TESTBitString64 int2TESTBitString64(uint64_t n)
{
	TESTBitString64 flags;

	memset(&flags, 0, sizeof(flags));

	flags.zero = (n >> 0) & 1;
	flags.eight = (n >> 8) & 1;
	flags.thirtyone = (n >> 31) & 1;
	flags.thirtytwo = (n >> 32) & 1;
	flags.sixtythree = (n >> 63) & 1;
	return flags;
}

static struct units TESTBitString64_units[] = {
	{"sixtythree",	1ULL << 63},
	{"thirtytwo",	1ULL << 32},
	{"thirtyone",	1ULL << 31},
	{"eight",	1ULL << 8},
	{"zero",	1ULL << 0},
	{NULL,	0}
};

const struct units * asn1_TESTBitString64_units(void){
return TESTBitString64_units;
}

/* template_members: TESTLargeBitString exp exp */
static const struct asn1_template asn1_TESTLargeBitString_bmember__2[] = {
/* 0 */ { 0, sizeof(TESTLargeBitString), ((void *)(uintptr_t)4) },
/* 1 */ { 0, 0, "zero" },
/* 2 */ { 0, 8, "eight" },
/* 3 */ { 0, 31, "thirtyone" },
/* 4 */ { 0, 120, "onehundredtwenty" }
};
/* generate_template_type: TESTLargeBitString_tag__130 */
const struct asn1_template asn1_TESTLargeBitString_tag__130[] = {
/* 0 */ { 0, sizeof(TESTLargeBitString), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_BMEMBER, 0, asn1_TESTLargeBitString_bmember__2 }
};
/* generate_template_type: TESTLargeBitString */
const struct asn1_template asn1_TESTLargeBitString[] = {
/* 0 */ { 0, sizeof(TESTLargeBitString), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_BitString), 0, asn1_TESTLargeBitString_tag__130 }
};

int ASN1CALL
decode_TESTLargeBitString(const unsigned char *p, size_t len, TESTLargeBitString *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTLargeBitString, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTLargeBitString(unsigned char *p, size_t len, const TESTLargeBitString *data, size_t *size)
{
    return _asn1_encode(asn1_TESTLargeBitString, p, len, data, size);
}


size_t ASN1CALL
length_TESTLargeBitString(const TESTLargeBitString *data)
{
    return _asn1_length(asn1_TESTLargeBitString, data);
}


void ASN1CALL
free_TESTLargeBitString(TESTLargeBitString *data)
{
    _asn1_free_top(asn1_TESTLargeBitString, data);
}


int ASN1CALL
copy_TESTLargeBitString(const TESTLargeBitString *from, TESTLargeBitString *to)
{
    return _asn1_copy_top(asn1_TESTLargeBitString, from, to);
}


char * ASN1CALL
print_TESTLargeBitString(const TESTLargeBitString *data, int flags)
{
    return _asn1_print_top(asn1_TESTLargeBitString, flags, data);
}

/* template_members: TESTMechType exp exp */
/* generate_template_type: TESTMechType_tag__131 */
const struct asn1_template asn1_TESTMechType_tag__131[] = {
/* 0 */ { 0, sizeof(heim_oid), ((void *)(uintptr_t)1) },
/* 1 */ { A1_PARSE_T(A1T_OID), 0, NULL }
};
/* generate_template_type: TESTMechType */
const struct asn1_template asn1_TESTMechType[] = {
/* 0 */ { 0, sizeof(TESTMechType), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OID), 0, asn1_TESTMechType_tag__131 }
};

int ASN1CALL
decode_TESTMechType(const unsigned char *p, size_t len, TESTMechType *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTMechType, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTMechType(unsigned char *p, size_t len, const TESTMechType *data, size_t *size)
{
    return _asn1_encode(asn1_TESTMechType, p, len, data, size);
}


size_t ASN1CALL
length_TESTMechType(const TESTMechType *data)
{
    return _asn1_length(asn1_TESTMechType, data);
}


void ASN1CALL
free_TESTMechType(TESTMechType *data)
{
    _asn1_free_top(asn1_TESTMechType, data);
}


int ASN1CALL
copy_TESTMechType(const TESTMechType *from, TESTMechType *to)
{
    return _asn1_copy_top(asn1_TESTMechType, from, to);
}


char * ASN1CALL
print_TESTMechType(const TESTMechType *data, int flags)
{
    return _asn1_print_top(asn1_TESTMechType, flags, data);
}

/* template_members: TESTMechTypeList exp exp */
/* generate_template_type: TESTMechType_seofTstruct_13 */
const struct asn1_template asn1_TESTMechType_seofTstruct_13[] = {
/* 0 */ { 0, sizeof(TESTMechType), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTMechType }
};
/* generate_template_type: TESTMechTypeList_tag__132 */
const struct asn1_template asn1_TESTMechTypeList_tag__132[] = {
/* 0 */ { 0, sizeof(TESTMechType), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTMechType_seofTstruct_13 }
};
/* generate_template_type: TESTMechTypeList */
const struct asn1_template asn1_TESTMechTypeList[] = {
/* 0 */ { 0, sizeof(TESTMechTypeList), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTMechTypeList_tag__132 }
};

int ASN1CALL
decode_TESTMechTypeList(const unsigned char *p, size_t len, TESTMechTypeList *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTMechTypeList, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTMechTypeList(unsigned char *p, size_t len, const TESTMechTypeList *data, size_t *size)
{
    return _asn1_encode(asn1_TESTMechTypeList, p, len, data, size);
}


size_t ASN1CALL
length_TESTMechTypeList(const TESTMechTypeList *data)
{
    return _asn1_length(asn1_TESTMechTypeList, data);
}


void ASN1CALL
free_TESTMechTypeList(TESTMechTypeList *data)
{
    _asn1_free_top(asn1_TESTMechTypeList, data);
}


int ASN1CALL
copy_TESTMechTypeList(const TESTMechTypeList *from, TESTMechTypeList *to)
{
    return _asn1_copy_top(asn1_TESTMechTypeList, from, to);
}


char * ASN1CALL
print_TESTMechTypeList(const TESTMechTypeList *data, int flags)
{
    return _asn1_print_top(asn1_TESTMechTypeList, flags, data);
}

/* template_members: TESTExtension exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTExtension exp exp */
/* generate_template_type: TESTExtension_tag_extnID_134 */
/* template_members: TESTExtension exp exp */
/* generate_template_type: TESTExtension_tag_critical_135 */
/* template_members: TESTExtension exp exp */
/* generate_template_type: TESTExtension_tag_extnValue_136 */
const struct asn1_template asn1_TestExtensions[] = {
/* 0 */ { 0, 0, ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_NAME, 0, "TestExtensions" },
/* 2 */ { A1_OP_NAME, 0, "testext-TESTDefault" },
/* 3 */ { A1_OP_OPENTYPE_ID, 0, (const void *)&asn1_oid_id_test_default },
/* 4 */ { A1_OP_OPENTYPE, sizeof(TESTDefault), (const void *)&asn1_TESTDefault }
};
/* generate_template_type: TESTExtension_tag__133 */
const struct asn1_template asn1_TESTExtension_tag__133[] = {
/* 0 */ { 0, sizeof(struct TESTExtension), ((void *)(uintptr_t)9) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OID), offsetof(struct TESTExtension, extnID), asn1_TESTMechType_tag__131 },
/* 2 */ { A1_OP_DEFVAL|A1_DV_BOOLEAN, ~0, (void *)(uintptr_t)0 },
/* 3 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Boolean)|A1_FLAG_DEFAULT, offsetof(struct TESTExtension, critical), asn1_TESTDefault_tag_works_10 },
/* 4 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_OctetString), offsetof(struct TESTExtension, extnValue), asn1_TESTCONTAINING_tag__66 },
/* 5 */ { A1_OP_OPENTYPE_OBJSET | A1_OS_IS_SORTED |0 | (2 << 10) | 0, offsetof(TESTExtension, _ioschoice_extnValue), asn1_TestExtensions },
/* 6 */ { A1_OP_NAME, 0, "TESTExtension" },
/* 7 */ { A1_OP_NAME, 0, "extnID" },
/* 8 */ { A1_OP_NAME, 0, "critical" },
/* 9 */ { A1_OP_NAME, 0, "extnValue" }
};
/* generate_template_type: TESTExtension */
const struct asn1_template asn1_TESTExtension[] = {
/* 0 */ { 0, sizeof(TESTExtension), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTExtension_tag__133 }
};

int ASN1CALL
decode_TESTExtension(const unsigned char *p, size_t len, TESTExtension *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTExtension, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTExtension(unsigned char *p, size_t len, const TESTExtension *data, size_t *size)
{
    return _asn1_encode(asn1_TESTExtension, p, len, data, size);
}


size_t ASN1CALL
length_TESTExtension(const TESTExtension *data)
{
    return _asn1_length(asn1_TESTExtension, data);
}


void ASN1CALL
free_TESTExtension(TESTExtension *data)
{
    _asn1_free_top(asn1_TESTExtension, data);
}


int ASN1CALL
copy_TESTExtension(const TESTExtension *from, TESTExtension *to)
{
    return _asn1_copy_top(asn1_TESTExtension, from, to);
}


char * ASN1CALL
print_TESTExtension(const TESTExtension *data, int flags)
{
    return _asn1_print_top(asn1_TESTExtension, flags, data);
}

/* template_members: TESTExtensible exp exp */
/* tsequence: members isstruct: 1 */
/* template_members: TESTExtensible exp exp */
/* generate_template_type: TESTExtensible_tag_version_138 */
/* template_members: TESTExtensible exp exp */
/* generate_template_type: TESTExtensible_extensions_14 */
const struct asn1_template asn1_TESTExtensible_extensions_14[] = {
/* 0 */ { 0, sizeof(TESTExtension), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_TYPE , 0, asn1_TESTExtension }
};
/* generate_template_type: TESTExtensible_tag_extensions_139 */
const struct asn1_template asn1_TESTExtensible_tag_extensions_139[] = {
/* 0 */ { 0, sizeof(struct TESTExtensible_extensions), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTExtensible_extensions_14 }
};
/* generate_template_type: TESTExtensible_tag__137 */
const struct asn1_template asn1_TESTExtensible_tag__137[] = {
/* 0 */ { 0, sizeof(struct TESTExtensible), ((void *)(uintptr_t)5) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,PRIM,UT_Integer), offsetof(struct TESTExtensible, version), asn1_TESTOutOfOrderBar_tag_aMember_1 },
/* 2 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), offsetof(struct TESTExtensible, extensions), asn1_TESTExtensible_tag_extensions_139 },
/* 3 */ { A1_OP_NAME, 0, "TESTExtensible" },
/* 4 */ { A1_OP_NAME, 0, "version" },
/* 5 */ { A1_OP_NAME, 0, "extensions" }
};
/* generate_template_type: TESTExtensible */
const struct asn1_template asn1_TESTExtensible[] = {
/* 0 */ { 0, sizeof(TESTExtensible), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTExtensible_tag__137 }
};

int ASN1CALL
decode_TESTExtensible(const unsigned char *p, size_t len, TESTExtensible *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTExtensible, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTExtensible(unsigned char *p, size_t len, const TESTExtensible *data, size_t *size)
{
    return _asn1_encode(asn1_TESTExtensible, p, len, data, size);
}


size_t ASN1CALL
length_TESTExtensible(const TESTExtensible *data)
{
    return _asn1_length(asn1_TESTExtensible, data);
}


void ASN1CALL
free_TESTExtensible(TESTExtensible *data)
{
    _asn1_free_top(asn1_TESTExtensible, data);
}


int ASN1CALL
copy_TESTExtensible(const TESTExtensible *from, TESTExtensible *to)
{
    return _asn1_copy_top(asn1_TESTExtensible, from, to);
}


char * ASN1CALL
print_TESTExtensible(const TESTExtensible *data, int flags)
{
    return _asn1_print_top(asn1_TESTExtensible, flags, data);
}

static const struct asn1_type_func asn1_extern_TESTDecorated_version3 = {
	(asn1_type_encode)0,
	(asn1_type_decode)0,
	(asn1_type_length)0,
	(asn1_type_copy)my_copy_vers,
	(asn1_type_release)my_free_vers,
	(asn1_type_print)0,
	sizeof(my_vers)
};
static const struct asn1_type_func asn1_extern_TESTDecorated_privthing = {
	(asn1_type_encode)0,
	(asn1_type_decode)0,
	(asn1_type_length)0,
	(asn1_type_copy)0,
	(asn1_type_release)0,
	(asn1_type_print)0,
	sizeof(void *)
};
/* template_members: TESTDecorated exp exp */
/* tsequence: members isstruct: 1 */
/* generate_template_type: TESTDecorated_tag__140 */
const struct asn1_template asn1_TESTDecorated_tag__140[] = {
/* 0 */ { 0, sizeof(struct TESTDecorated), ((void *)(uintptr_t)6) },
/* 1 */ { A1_OP_TYPE , offsetof(struct TESTDecorated, version), asn1_TESTuint32 },
/* 2 */ { A1_OP_TYPE_DECORATE |A1_FLAG_OPTIONAL, offsetof(struct TESTDecorated, version2), asn1_TESTuint32 },
/* 3 */ { A1_OP_TYPE_DECORATE_EXTERN , offsetof(struct TESTDecorated, version3), &asn1_extern_TESTDecorated_version3 },
/* 4 */ { A1_OP_TYPE_DECORATE_EXTERN , offsetof(struct TESTDecorated, privthing), &asn1_extern_TESTDecorated_privthing },
/* 5 */ { A1_OP_NAME, 0, "TESTDecorated" },
/* 6 */ { A1_OP_NAME, 0, "version" }
};
/* generate_template_type: TESTDecorated */
const struct asn1_template asn1_TESTDecorated[] = {
/* 0 */ { 0, sizeof(TESTDecorated), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTDecorated_tag__140 }
};

int ASN1CALL
decode_TESTDecorated(const unsigned char *p, size_t len, TESTDecorated *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTDecorated, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTDecorated(unsigned char *p, size_t len, const TESTDecorated *data, size_t *size)
{
    return _asn1_encode(asn1_TESTDecorated, p, len, data, size);
}


size_t ASN1CALL
length_TESTDecorated(const TESTDecorated *data)
{
    return _asn1_length(asn1_TESTDecorated, data);
}


void ASN1CALL
free_TESTDecorated(TESTDecorated *data)
{
    _asn1_free_top(asn1_TESTDecorated, data);
}


int ASN1CALL
copy_TESTDecorated(const TESTDecorated *from, TESTDecorated *to)
{
    return _asn1_copy_top(asn1_TESTDecorated, from, to);
}


char * ASN1CALL
print_TESTDecorated(const TESTDecorated *data, int flags)
{
    return _asn1_print_top(asn1_TESTDecorated, flags, data);
}

/* template_members: TESTNotDecorated exp exp */
/* tsequence: members isstruct: 1 */
/* generate_template_type: TESTNotDecorated_tag__141 */
const struct asn1_template asn1_TESTNotDecorated_tag__141[] = {
/* 0 */ { 0, sizeof(struct TESTNotDecorated), ((void *)(uintptr_t)3) },
/* 1 */ { A1_OP_TYPE , offsetof(struct TESTNotDecorated, version), asn1_TESTuint32 },
/* 2 */ { A1_OP_NAME, 0, "TESTNotDecorated" },
/* 3 */ { A1_OP_NAME, 0, "version" }
};
/* generate_template_type: TESTNotDecorated */
const struct asn1_template asn1_TESTNotDecorated[] = {
/* 0 */ { 0, sizeof(TESTNotDecorated), ((void *)(uintptr_t)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTNotDecorated_tag__141 }
};

int ASN1CALL
decode_TESTNotDecorated(const unsigned char *p, size_t len, TESTNotDecorated *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTNotDecorated, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTNotDecorated(unsigned char *p, size_t len, const TESTNotDecorated *data, size_t *size)
{
    return _asn1_encode(asn1_TESTNotDecorated, p, len, data, size);
}


size_t ASN1CALL
length_TESTNotDecorated(const TESTNotDecorated *data)
{
    return _asn1_length(asn1_TESTNotDecorated, data);
}


void ASN1CALL
free_TESTNotDecorated(TESTNotDecorated *data)
{
    _asn1_free_top(asn1_TESTNotDecorated, data);
}


int ASN1CALL
copy_TESTNotDecorated(const TESTNotDecorated *from, TESTNotDecorated *to)
{
    return _asn1_copy_top(asn1_TESTNotDecorated, from, to);
}


char * ASN1CALL
print_TESTNotDecorated(const TESTNotDecorated *data, int flags)
{
    return _asn1_print_top(asn1_TESTNotDecorated, flags, data);
}

static const struct asn1_type_func asn1_extern_TESTDecoratedChoice_version3 = {
	(asn1_type_encode)0,
	(asn1_type_decode)0,
	(asn1_type_length)0,
	(asn1_type_copy)my_copy_vers,
	(asn1_type_release)my_free_vers,
	(asn1_type_print)0,
	sizeof(my_vers)
};
static const struct asn1_type_func asn1_extern_TESTDecoratedChoice_privthing = {
	(asn1_type_encode)0,
	(asn1_type_decode)0,
	(asn1_type_length)0,
	(asn1_type_copy)0,
	(asn1_type_release)0,
	(asn1_type_print)0,
	sizeof(void *)
};
/* generate_template_type: TESTDecoratedChoice_choice_version */
static const struct asn1_template asn1_choice_TESTDecoratedChoice_5[] = {
/* 0 */ { 0, offsetof(TESTDecoratedChoice, element), ((void *)(uintptr_t)2) },
/* 1 */ { choice_TESTDecoratedChoice_version, offsetof(TESTDecoratedChoice, u.version), asn1_TESTDefault_tag_version_9 },
/* 2 */ { 0, 0, "version" }
};
/* generate_template_type: TESTDecoratedChoice */
const struct asn1_template asn1_TESTDecoratedChoice[] = {
/* 0 */ { 0, sizeof(TESTDecoratedChoice), ((void *)(uintptr_t)4) },
/* 1 */ { A1_OP_CHOICE, 0, asn1_choice_TESTDecoratedChoice_5 },
/* 2 */ { A1_OP_TYPE_DECORATE |A1_FLAG_OPTIONAL, offsetof(TESTDecoratedChoice, version2), asn1_TESTuint32 },
/* 3 */ { A1_OP_TYPE_DECORATE_EXTERN , offsetof(TESTDecoratedChoice, version3), &asn1_extern_TESTDecoratedChoice_version3 },
/* 4 */ { A1_OP_TYPE_DECORATE_EXTERN , offsetof(TESTDecoratedChoice, privthing), &asn1_extern_TESTDecoratedChoice_privthing }
};

int ASN1CALL
decode_TESTDecoratedChoice(const unsigned char *p, size_t len, TESTDecoratedChoice *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTDecoratedChoice, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTDecoratedChoice(unsigned char *p, size_t len, const TESTDecoratedChoice *data, size_t *size)
{
    return _asn1_encode(asn1_TESTDecoratedChoice, p, len, data, size);
}


size_t ASN1CALL
length_TESTDecoratedChoice(const TESTDecoratedChoice *data)
{
    return _asn1_length(asn1_TESTDecoratedChoice, data);
}


void ASN1CALL
free_TESTDecoratedChoice(TESTDecoratedChoice *data)
{
    _asn1_free_top(asn1_TESTDecoratedChoice, data);
}


int ASN1CALL
copy_TESTDecoratedChoice(const TESTDecoratedChoice *from, TESTDecoratedChoice *to)
{
    return _asn1_copy_top(asn1_TESTDecoratedChoice, from, to);
}


char * ASN1CALL
print_TESTDecoratedChoice(const TESTDecoratedChoice *data, int flags)
{
    return _asn1_print_top(asn1_TESTDecoratedChoice, flags, data);
}

/* generate_template_type: TESTNotDecoratedChoice_choice_version */
static const struct asn1_template asn1_choice_TESTNotDecoratedChoice_6[] = {
/* 0 */ { 0, offsetof(TESTNotDecoratedChoice, element), ((void *)(uintptr_t)2) },
/* 1 */ { choice_TESTNotDecoratedChoice_version, offsetof(TESTNotDecoratedChoice, u.version), asn1_TESTDefault_tag_version_9 },
/* 2 */ { 0, 0, "version" }
};
/* generate_template_type: TESTNotDecoratedChoice */
const struct asn1_template asn1_TESTNotDecoratedChoice[] = {
/* 0 */ { 0, sizeof(TESTNotDecoratedChoice), ((void *)(uintptr_t)1) },
/* 1 */ { A1_OP_CHOICE, 0, asn1_choice_TESTNotDecoratedChoice_6 }
};

int ASN1CALL
decode_TESTNotDecoratedChoice(const unsigned char *p, size_t len, TESTNotDecoratedChoice *data, size_t *size)
{
    memset(data, 0, sizeof(*data));
    return _asn1_decode_top(asn1_TESTNotDecoratedChoice, 0|0, p, len, data, size);
}


int ASN1CALL
encode_TESTNotDecoratedChoice(unsigned char *p, size_t len, const TESTNotDecoratedChoice *data, size_t *size)
{
    return _asn1_encode(asn1_TESTNotDecoratedChoice, p, len, data, size);
}


size_t ASN1CALL
length_TESTNotDecoratedChoice(const TESTNotDecoratedChoice *data)
{
    return _asn1_length(asn1_TESTNotDecoratedChoice, data);
}


void ASN1CALL
free_TESTNotDecoratedChoice(TESTNotDecoratedChoice *data)
{
    _asn1_free_top(asn1_TESTNotDecoratedChoice, data);
}


int ASN1CALL
copy_TESTNotDecoratedChoice(const TESTNotDecoratedChoice *from, TESTNotDecoratedChoice *to)
{
    return _asn1_copy_top(asn1_TESTNotDecoratedChoice, from, to);
}


char * ASN1CALL
print_TESTNotDecoratedChoice(const TESTNotDecoratedChoice *data, int flags)
{
    return _asn1_print_top(asn1_TESTNotDecoratedChoice, flags, data);
}

