
/*** <<< INCLUDES [T] >>> ***/

#include <NativeInteger.h>
#include <INTEGER.h>
#include <constr_SEQUENCE.h>

/*** <<< TYPE-DECLS [T] >>> ***/

typedef struct T {
	long	 unsigned8;
	long	 unsigned16;
	long	 unsigned16stack;
	long	 unsigned16stack_ext;
	INTEGER_t	 unsigned33;
	long	*minmax	/* OPTIONAL */;
	/*
	 * This type is extensible,
	 * possible extensions are below.
	 */
	long	*signed8	/* DEFAULT 3 */;
	long	*signed16;
	long	*signed16stack;
	long	*signed16stack_ext;
	long	*signed32;
	INTEGER_t	*signed33ext;
	
	/* Context for parsing across buffer boundaries */
	asn_struct_ctx_t _asn_ctx;
} T_t;

/*** <<< FUNC-DECLS [T] >>> ***/

extern asn_TYPE_descriptor_t asn_DEF_T;

/*** <<< CODE [T] >>> ***/

static int
memb_unsigned8_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= 0 && value <= 255)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_unsigned16_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= 0 && value <= 65535)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_unsigned16stack_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= 0 && value <= 255)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_unsigned16stack_ext_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= 0 && value <= 255)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_unsigned33_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	const INTEGER_t *st = (const INTEGER_t *)sptr;
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	if(asn_INTEGER2long(st, &value)) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value too large (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	if((value >= 0 && value <= 5000000000)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_minmax_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	
	if(1 /* No applicable constraints whatsoever */) {
		/* Nothing is here. See below */
	}
	
	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
}

static int
memb_signed8_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= -128 && value <= 127)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_signed16_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= -32768 && value <= 32767)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_signed16stack_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= -128 && value <= 127)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_signed16stack_ext_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= -128 && value <= 127)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_signed32_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	value = *(const long *)sptr;
	
	if((value >= -2000000000 && value <= 2000000000)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}

static int
memb_signed33ext_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
	const INTEGER_t *st = (const INTEGER_t *)sptr;
	long value;
	
	if(!sptr) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value not given (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	if(asn_INTEGER2long(st, &value)) {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: value too large (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
	
	if((value >= -4000000000 && value <= 4000000000)) {
		/* Constraint check succeeded */
		return 0;
	} else {
		ASN__CTFAIL(app_key, td, sptr,
			"%s: constraint failed (%s:%d)",
			td->name, __FILE__, __LINE__);
		return -1;
	}
}


/*** <<< CTDEFS [T] >>> ***/

static asn_oer_constraints_t asn_OER_memb_unsigned8_constr_2 CC_NOTUSED = {
	{ 1, 1 }	/* (0..255) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_unsigned16_constr_3 CC_NOTUSED = {
	{ 2, 1 }	/* (0..65535) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_unsigned16stack_constr_4 CC_NOTUSED = {
	{ 1, 1 }	/* (0..255) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_unsigned16stack_ext_constr_5 CC_NOTUSED = {
	{ 2, 1 }	/* (0..32767) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_unsigned33_constr_6 CC_NOTUSED = {
	{ 8, 1 }	/* (0..5000000000) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_minmax_constr_7 CC_NOTUSED = {
	{ 0, 0 },
	-1};
static asn_oer_constraints_t asn_OER_memb_signed8_constr_9 CC_NOTUSED = {
	{ 1, 0 }	/* (-128..127) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_signed16_constr_10 CC_NOTUSED = {
	{ 2, 0 }	/* (-32768..32767) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_signed16stack_constr_11 CC_NOTUSED = {
	{ 1, 0 }	/* (-128..127) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_signed16stack_ext_constr_12 CC_NOTUSED = {
	{ 2, 0 }	/* (-32768..32767) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_signed32_constr_13 CC_NOTUSED = {
	{ 4, 0 }	/* (-2000000000..2000000000) */,
	-1};
static asn_oer_constraints_t asn_OER_memb_signed33ext_constr_14 CC_NOTUSED = {
	{ 0, 0 },
	-1};

/*** <<< STAT-DEFS [T] >>> ***/

static int asn_DFL_9_cmp_3(const void *sptr) {
	const long *st = sptr;
	
	if(!st) {
		return -1; /* No value is not a default value */
	}
	
	/* Test default value 3 */
	return (*st != 3);
}
static int asn_DFL_9_set_3(void **sptr) {
	long *st = *sptr;
	
	if(!st) {
		st = (*sptr = CALLOC(1, sizeof(*st)));
		if(!st) return -1;
	}
	
	/* Install default value 3 */
	*st = 3;
	return 0;
}
static asn_TYPE_member_t asn_MBR_T_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct T, unsigned8),
		.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_unsigned8_constr_2, .per_constraints = 0, .general_constraints =  memb_unsigned8_constraint_1 },
		0, 0, /* No default value */
		.name = "unsigned8"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct T, unsigned16),
		.tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_unsigned16_constr_3, .per_constraints = 0, .general_constraints =  memb_unsigned16_constraint_1 },
		0, 0, /* No default value */
		.name = "unsigned16"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct T, unsigned16stack),
		.tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_unsigned16stack_constr_4, .per_constraints = 0, .general_constraints =  memb_unsigned16stack_constraint_1 },
		0, 0, /* No default value */
		.name = "unsigned16stack"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct T, unsigned16stack_ext),
		.tag = (ASN_TAG_CLASS_CONTEXT | (15 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_unsigned16stack_ext_constr_5, .per_constraints = 0, .general_constraints =  memb_unsigned16stack_ext_constraint_1 },
		0, 0, /* No default value */
		.name = "unsigned16stack-ext"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct T, unsigned33),
		.tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_INTEGER,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_unsigned33_constr_6, .per_constraints = 0, .general_constraints =  memb_unsigned33_constraint_1 },
		0, 0, /* No default value */
		.name = "unsigned33"
		},
	{ ATF_POINTER, 7, offsetof(struct T, minmax),
		.tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_minmax_constr_7, .per_constraints = 0, .general_constraints =  memb_minmax_constraint_1 },
		0, 0, /* No default value */
		.name = "minmax"
		},
	{ ATF_POINTER, 6, offsetof(struct T, signed8),
		.tag = (ASN_TAG_CLASS_CONTEXT | (10 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_signed8_constr_9, .per_constraints = 0, .general_constraints =  memb_signed8_constraint_1 },
		.default_value_cmp = &asn_DFL_9_cmp_3,	/* Compare DEFAULT 3 */
		.default_value_set = &asn_DFL_9_set_3,	/* Set DEFAULT 3 */
		.name = "signed8"
		},
	{ ATF_POINTER, 5, offsetof(struct T, signed16),
		.tag = (ASN_TAG_CLASS_CONTEXT | (11 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_signed16_constr_10, .per_constraints = 0, .general_constraints =  memb_signed16_constraint_1 },
		0, 0, /* No default value */
		.name = "signed16"
		},
	{ ATF_POINTER, 4, offsetof(struct T, signed16stack),
		.tag = (ASN_TAG_CLASS_CONTEXT | (12 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_signed16stack_constr_11, .per_constraints = 0, .general_constraints =  memb_signed16stack_constraint_1 },
		0, 0, /* No default value */
		.name = "signed16stack"
		},
	{ ATF_POINTER, 3, offsetof(struct T, signed16stack_ext),
		.tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_signed16stack_ext_constr_12, .per_constraints = 0, .general_constraints =  memb_signed16stack_ext_constraint_1 },
		0, 0, /* No default value */
		.name = "signed16stack-ext"
		},
	{ ATF_POINTER, 2, offsetof(struct T, signed32),
		.tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_NativeInteger,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_signed32_constr_13, .per_constraints = 0, .general_constraints =  memb_signed32_constraint_1 },
		0, 0, /* No default value */
		.name = "signed32"
		},
	{ ATF_POINTER, 1, offsetof(struct T, signed33ext),
		.tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = &asn_DEF_INTEGER,
		.type_selector = 0,
		{ .oer_constraints = &asn_OER_memb_signed33ext_constr_14, .per_constraints = 0, .general_constraints =  memb_signed33ext_constraint_1 },
		0, 0, /* No default value */
		.name = "signed33ext"
		},
};
static const int asn_MAP_T_oms_1[] = { 5, 6, 7, 8, 9, 10, 11 };
static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* unsigned8 */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* unsigned16 */
    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* unsigned16stack */
    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 4, 0, 0 }, /* unsigned33 */
    { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 9, 0, 0 }, /* signed16stack-ext */
    { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 5, 0, 0 }, /* minmax */
    { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 10, 0, 0 }, /* signed32 */
    { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 11, 0, 0 }, /* signed33ext */
    { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 6, 0, 0 }, /* signed8 */
    { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 7, 0, 0 }, /* signed16 */
    { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 8, 0, 0 }, /* signed16stack */
    { (ASN_TAG_CLASS_CONTEXT | (15 << 2)), 3, 0, 0 } /* unsigned16stack-ext */
};
static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
	sizeof(struct T),
	offsetof(struct T, _asn_ctx),
	.tag2el = asn_MAP_T_tag2el_1,
	.tag2el_count = 12,	/* Count of tags in the map */
	asn_MAP_T_oms_1,	/* Optional members */
	1, 6,	/* Root/Additions */
	5,	/* Start extensions */
	13	/* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_T = {
	"T",
	"T",
	&asn_OP_SEQUENCE,
	asn_DEF_T_tags_1,
	sizeof(asn_DEF_T_tags_1)
		/sizeof(asn_DEF_T_tags_1[0]), /* 1 */
	asn_DEF_T_tags_1,	/* Same as above */
	sizeof(asn_DEF_T_tags_1)
		/sizeof(asn_DEF_T_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_T_1,
	12,	/* Elements count */
	&asn_SPC_T_specs_1	/* Additional specs */
};

