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	AAESENC,
	AAESENCLAST,
	AAESIMC,
	AAESKEYGENASSIST,
	ABLENDPD,
	ABLENDPS,
	ABLENDVPD,
	ABLENDVPS,
	ACRC32L,
	ADPPD,
	ADPPS,
	AEXTRACTPS,
	AINSERTPS,
	AMOVNTDQA,
	AMPSADBW,
	APABSB,
	APABSL,
	APABSW,
	APACKUSDW,
	APALIGNR,
	APBLENDVB,
	APBLENDW,
	APCLMULHQHQDQ,
	APCLMULHQLQDQ,
	APCLMULLQHQDQ,
	APCLMULLQLQDQ,
	APCLMULQDQ,
	APCMPEQQ,
	APCMPESTRI,
	APCMPESTRM,
	APCMPGTQ,
	APCMPISTRI,
	APCMPISTRM,
	APEXTRB,
	APEXTRL,
	APHADDL,
	APHADDSW,
	APHADDW,
	APHMINPOSUW,
	APHSUBL,
	APHSUBSW,
	APHSUBW,
	APINSRB,
	APINSRL,
	APMADDUBSW,
	APMAXSB,
	APMAXSL,
	APMAXUL,
	APMAXUW,
	APMINSB,
	APMINSL,
	APMINUL,
	APMINUW,
	APMOVSXBL,
	APMOVSXBQ,
	APMOVSXBW,
	APMOVSXLQ,
	APMOVSXWL,
	APMOVSXWQ,
	APMOVZXBL,
	APMOVZXBQ,
	APMOVZXBW,
	APMOVZXLQ,
	APMOVZXWL,
	APMOVZXWQ,
	APMULHRSW,
	APMULLL,
	APMULLQ,
	APSHUFB,
	APSIGNB,
	APSIGNL,
	APSIGNW,
	APTEST,
	AROUNDPD,
	AROUNDPS,
	AROUNDSD,
	AROUNDSS,
	AVBROADCASTF128,
	AVBROADCASTSL,
	AVBROADCASTSS,
	AVMASKMOVPD,
	AVMASKMOVPS,
	AVPERMILPD,
	AVPERMILPS,
	AVTESTPD,
	AVTESTPS,
	AXSAVE,
	AXSAVEOPT,
	AXRSTOR,
	ACRC32B,
	ACRC32W,
	ARDRANDW,
	ARDRANDL,
	ACRC32Q,
	APEXTRQ,
	APINSRQ,
	ARDRANDQ,
	AMOVDQA,
	APOPCNTW,
	APOPCNTL,
	APOPCNTQ,
	AMOVQL,
	APAUSE,
	ACMPXCHG16B,

	ALAST
};

enum
{

	D_AL		= 0,
	D_CL,
	D_DL,
	D_BL,
	D_SPB,
	D_BPB,
	D_SIB,
	D_DIB,
	D_R8B,
	D_R9B,
	D_R10B,
	D_R11B,
	D_R12B,
	D_R13B,
	D_R14B,
	D_R15B,

	D_AX		= 16,
	D_CX,
	D_DX,
	D_BX,
	D_SP,
	D_BP,
	D_SI,
	D_DI,
	D_R8,
	D_R9,
	D_R10,
	D_R11,
	D_R12,
	D_R13,
	D_R14,
	D_R15,

	D_AH		= 32,
	D_CH,
	D_DH,
	D_BH,

	D_Y0		= 36,
	D_Y15		= D_Y0+15,

	D_X0		= 52,
	D_X15		= D_X0+15,

	D_CS		= 68,
	D_SS,
	D_DS,
	D_ES,
	D_FS,
	D_GS,

	D_GDTR,		/* global descriptor table register */
	D_IDTR,		/* interrupt descriptor table register */
	D_LDTR,		/* local descriptor table register */
	D_MSW,		/* machine status word */
	D_TASK,		/* task register */

	D_CR		= 79,
	D_DR		= 95,
	D_TR		= 103,

	D_NONE		= 111,

	D_BRANCH	= 112,
	D_EXTERN	= 113,
	D_STATIC		= 114,
	D_AUTO		= 115,
	D_PARAM		= 116,
	D_CONST		= 117,
	D_FCONST	= 118,
	D_SCONST	= 119,
	D_ADDR		= 120,

	D_FILE,
	D_FILE1,

	D_INDIR,	/* additive */
	D_CONST2 = D_INDIR+D_INDIR,
	D_SIZE,

	D_M0,
	D_M7		= D_M0+7,
	D_F0		= D_M0,
	D_F7		= D_F0+7,
	D_XREG,

	T_TYPE		= 1<<0,
	T_INDEX		= 1<<1,
	T_OFFSET	= 1<<2,
	T_FCONST	= 1<<3,
	T_SYM		= 1<<4,
	T_SCONST	= 1<<5,
	T_64	= 1<<6,

	REGARG		= D_BP,	/* MIGHT CHANGE */
	REGRET		= D_AX,
	FREGRET		= D_X0,
	REGSP		= D_SP,
	REGTMP		= D_DI,
	REGEXT		= D_R15,	/* compiler allocates external registers R15 down */
	FREGMIN		= D_X0+5,	/* first register variable */
	FREGEXT		= D_X0+7	/* first external register */
};

/*
 * this is the ranlib header
 */
#define	SYMDEF	"__.SYMDEF"

/*
 * this is the simulated IEEE floating point
 */
typedef	struct	ieee	Ieee;
struct	ieee
{
	long	l;	/* contains ls-man	0xffffffff */
	long	h;	/* contains sign	0x80000000
				    exp		0x7ff00000
				    ms-man	0x000fffff */
};
