#include "pkginfo.h"

#include <err.h>
#include "package.h"
#include "util.h"

static const int  pkginfo_start  = 125;
static const int  pkginfo_error  = 0;
static const int  pkginfo_en_main  = 125;
void pkginfo_parser_init(struct pkginfo_parser *parser)
{
	*parser = (struct pkginfo_parser){0};
	{
		parser->cs = ( int ) pkginfo_start;
		
	}
}

ssize_t pkginfo_parser_feed(struct pkginfo_parser *parser, struct pkg *pkg,
char *buf, size_t buf_len)
{
	char *p = buf;
	char *pe = p + buf_len;
	
	{
		switch ( parser->cs  ) {
			case 125:
			goto st_case_125;
			case 0:
			goto st_case_0;
			case 1:
			goto st_case_1;
			case 2:
			goto st_case_2;
			case 3:
			goto st_case_3;
			case 4:
			goto st_case_4;
			case 5:
			goto st_case_5;
			case 6:
			goto st_case_6;
			case 7:
			goto st_case_7;
			case 8:
			goto st_case_8;
			case 9:
			goto st_case_9;
			case 10:
			goto st_case_10;
			case 11:
			goto st_case_11;
			case 12:
			goto st_case_12;
			case 13:
			goto st_case_13;
			case 14:
			goto st_case_14;
			case 15:
			goto st_case_15;
			case 16:
			goto st_case_16;
			case 17:
			goto st_case_17;
			case 18:
			goto st_case_18;
			case 19:
			goto st_case_19;
			case 20:
			goto st_case_20;
			case 21:
			goto st_case_21;
			case 22:
			goto st_case_22;
			case 23:
			goto st_case_23;
			case 24:
			goto st_case_24;
			case 25:
			goto st_case_25;
			case 26:
			goto st_case_26;
			case 27:
			goto st_case_27;
			case 28:
			goto st_case_28;
			case 29:
			goto st_case_29;
			case 30:
			goto st_case_30;
			case 31:
			goto st_case_31;
			case 32:
			goto st_case_32;
			case 33:
			goto st_case_33;
			case 34:
			goto st_case_34;
			case 35:
			goto st_case_35;
			case 36:
			goto st_case_36;
			case 37:
			goto st_case_37;
			case 38:
			goto st_case_38;
			case 39:
			goto st_case_39;
			case 40:
			goto st_case_40;
			case 41:
			goto st_case_41;
			case 42:
			goto st_case_42;
			case 43:
			goto st_case_43;
			case 44:
			goto st_case_44;
			case 45:
			goto st_case_45;
			case 46:
			goto st_case_46;
			case 47:
			goto st_case_47;
			case 48:
			goto st_case_48;
			case 49:
			goto st_case_49;
			case 50:
			goto st_case_50;
			case 51:
			goto st_case_51;
			case 52:
			goto st_case_52;
			case 53:
			goto st_case_53;
			case 54:
			goto st_case_54;
			case 55:
			goto st_case_55;
			case 56:
			goto st_case_56;
			case 57:
			goto st_case_57;
			case 58:
			goto st_case_58;
			case 59:
			goto st_case_59;
			case 60:
			goto st_case_60;
			case 61:
			goto st_case_61;
			case 62:
			goto st_case_62;
			case 63:
			goto st_case_63;
			case 64:
			goto st_case_64;
			case 65:
			goto st_case_65;
			case 66:
			goto st_case_66;
			case 67:
			goto st_case_67;
			case 68:
			goto st_case_68;
			case 69:
			goto st_case_69;
			case 70:
			goto st_case_70;
			case 71:
			goto st_case_71;
			case 72:
			goto st_case_72;
			case 73:
			goto st_case_73;
			case 74:
			goto st_case_74;
			case 75:
			goto st_case_75;
			case 76:
			goto st_case_76;
			case 77:
			goto st_case_77;
			case 78:
			goto st_case_78;
			case 79:
			goto st_case_79;
			case 80:
			goto st_case_80;
			case 81:
			goto st_case_81;
			case 82:
			goto st_case_82;
			case 83:
			goto st_case_83;
			case 84:
			goto st_case_84;
			case 85:
			goto st_case_85;
			case 86:
			goto st_case_86;
			case 87:
			goto st_case_87;
			case 88:
			goto st_case_88;
			case 89:
			goto st_case_89;
			case 90:
			goto st_case_90;
			case 91:
			goto st_case_91;
			case 92:
			goto st_case_92;
			case 93:
			goto st_case_93;
			case 94:
			goto st_case_94;
			case 95:
			goto st_case_95;
			case 96:
			goto st_case_96;
			case 97:
			goto st_case_97;
			case 98:
			goto st_case_98;
			case 99:
			goto st_case_99;
			case 100:
			goto st_case_100;
			case 101:
			goto st_case_101;
			case 102:
			goto st_case_102;
			case 103:
			goto st_case_103;
			case 104:
			goto st_case_104;
			case 105:
			goto st_case_105;
			case 106:
			goto st_case_106;
			case 107:
			goto st_case_107;
			case 108:
			goto st_case_108;
			case 109:
			goto st_case_109;
			case 110:
			goto st_case_110;
			case 111:
			goto st_case_111;
			case 112:
			goto st_case_112;
			case 113:
			goto st_case_113;
			case 114:
			goto st_case_114;
			case 115:
			goto st_case_115;
			case 116:
			goto st_case_116;
			case 117:
			goto st_case_117;
			case 118:
			goto st_case_118;
			case 119:
			goto st_case_119;
			case 120:
			goto st_case_120;
			case 121:
			goto st_case_121;
			case 122:
			goto st_case_122;
			case 123:
			goto st_case_123;
			case 124:
			goto st_case_124;
			
		}
		_ctr12:
		{
			if (parser->pos) {
				const char *entry = parser->store;
				const size_t entry_len = parser->pos;
				parser->store[parser->pos] = 0;
				parser->pos = 0;
				
				package_set(pkg, parser->entry, entry, entry_len);
			}
			
		}
		
		
		goto _st125;
		_st125:
		p+= 1;
		st_case_125:
		if ( p == pe  )
		goto _out125;
		
		switch ( ((*( p  ))
		) ) {
			case 35:
			{
				goto _st1;
				
			}
			case 97:
			{
				goto _st2;
				
			}
			case 98:
			{
				goto _st9;
				
			}
			case 99:
			{
				goto _st23;
				
			}
			case 100:
			{
				goto _st41;
				
			}
			case 103:
			{
				goto _st47;
				
			}
			case 108:
			{
				goto _st52;
				
			}
			case 109:
			{
				goto _st59;
				
			}
			case 111:
			{
				goto _st69;
				
			}
			case 112:
			{
				goto _st78;
				
			}
			case 114:
			{
				goto _st110;
				
			}
			case 115:
			{
				goto _st118;
				
			}
			case 117:
			{
				goto _st122;
				
			}
			
		}
		goto _st0;
		_st0:
		st_case_0:
		goto _out0;
		_st1:
		p+= 1;
		st_case_1:
		if ( p == pe  )
		goto _out1;
		
		if ( ((*( p  ))
		)== 10  )
		{
			goto _st125;
			
		}
		
		goto _st1;
		_st2:
		p+= 1;
		st_case_2:
		if ( p == pe  )
		goto _out2;
		
		if ( ((*( p  ))
		)== 114  )
		{
			goto _st3;
			
		}
		
		goto _st0;
		_st3:
		p+= 1;
		st_case_3:
		if ( p == pe  )
		goto _out3;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st4;
			
		}
		
		goto _st0;
		_st4:
		p+= 1;
		st_case_4:
		if ( p == pe  )
		goto _out4;
		
		if ( ((*( p  ))
		)== 104  )
		{
			goto _st5;
			
		}
		
		goto _st0;
		_st5:
		p+= 1;
		st_case_5:
		if ( p == pe  )
		goto _out5;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr7;
			
		}
		
		goto _st0;
		_ctr7:
		{
			parser->entry = PKG_ARCH; 
		}
		
		
		goto _st6;
		_ctr20:
		{
			parser->entry = PKG_BACKUP; 
		}
		
		
		goto _st6;
		_ctr28:
		{
			parser->entry = PKG_BUILDDATE; 
		}
		
		
		goto _st6;
		_ctr41:
		{
			parser->entry = PKG_CHECKDEPENDS; 
		}
		
		
		goto _st6;
		_ctr48:
		{
			parser->entry = PKG_CONFLICTS; 
		}
		
		
		goto _st6;
		_ctr55:
		{
			parser->entry = PKG_DEPENDS; 
		}
		
		
		goto _st6;
		_ctr61:
		{
			parser->entry = PKG_GROUPS; 
		}
		
		
		goto _st6;
		_ctr69:
		{
			parser->entry = PKG_LICENSE; 
		}
		
		
		goto _st6;
		_ctr80:
		{
			parser->entry = PKG_MAKEDEPENDS; 
		}
		
		
		goto _st6;
		_ctr90:
		{
			parser->entry = PKG_OPTDEPENDS; 
		}
		
		
		goto _st6;
		_ctr101:
		{
			parser->entry = PKG_PACKAGER; 
		}
		
		
		goto _st6;
		_ctr110:
		{
			parser->entry = PKG_PKGBASE; 
		}
		
		
		goto _st6;
		_ctr114:
		{
			parser->entry = PKG_DESCRIPTION; 
		}
		
		
		goto _st6;
		_ctr118:
		{
			parser->entry = PKG_PKGNAME; 
		}
		
		
		goto _st6;
		_ctr121:
		{
			parser->entry = PKG_VERSION; 
		}
		
		
		goto _st6;
		_ctr128:
		{
			parser->entry = PKG_PROVIDES; 
		}
		
		
		goto _st6;
		_ctr137:
		{
			parser->entry = PKG_REPLACES; 
		}
		
		
		goto _st6;
		_ctr142:
		{
			parser->entry = PKG_ISIZE; 
		}
		
		
		goto _st6;
		_ctr146:
		{
			parser->entry = PKG_URL; 
		}
		
		
		goto _st6;
		_st6:
		p+= 1;
		st_case_6:
		if ( p == pe  )
		goto _out6;
		
		if ( ((*( p  ))
		)== 61  )
		{
			goto _st7;
			
		}
		
		goto _st0;
		_st7:
		p+= 1;
		st_case_7:
		if ( p == pe  )
		goto _out7;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _st8;
			
		}
		
		goto _st0;
		_ctr11:
		{
			parser->store[parser->pos++] = (((*( p  ))
			));
			if (parser->pos == LINE_MAX) {
				errx(1, "desc line too long");
			}
			
		}
		
		
		goto _st8;
		_st8:
		p+= 1;
		st_case_8:
		if ( p == pe  )
		goto _out8;
		
		if ( ((*( p  ))
		)== 10  )
		{
			goto _ctr12;
			
		}
		
		goto _ctr11;
		_st9:
		p+= 1;
		st_case_9:
		if ( p == pe  )
		goto _out9;
		
		switch ( ((*( p  ))
		) ) {
			case 97:
			{
				goto _st10;
				
			}
			case 117:
			{
				goto _st15;
				
			}
			
		}
		goto _st0;
		_st10:
		p+= 1;
		st_case_10:
		if ( p == pe  )
		goto _out10;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st11;
			
		}
		
		goto _st0;
		_st11:
		p+= 1;
		st_case_11:
		if ( p == pe  )
		goto _out11;
		
		if ( ((*( p  ))
		)== 107  )
		{
			goto _st12;
			
		}
		
		goto _st0;
		_st12:
		p+= 1;
		st_case_12:
		if ( p == pe  )
		goto _out12;
		
		if ( ((*( p  ))
		)== 117  )
		{
			goto _st13;
			
		}
		
		goto _st0;
		_st13:
		p+= 1;
		st_case_13:
		if ( p == pe  )
		goto _out13;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st14;
			
		}
		
		goto _st0;
		_st14:
		p+= 1;
		st_case_14:
		if ( p == pe  )
		goto _out14;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr20;
			
		}
		
		goto _st0;
		_st15:
		p+= 1;
		st_case_15:
		if ( p == pe  )
		goto _out15;
		
		if ( ((*( p  ))
		)== 105  )
		{
			goto _st16;
			
		}
		
		goto _st0;
		_st16:
		p+= 1;
		st_case_16:
		if ( p == pe  )
		goto _out16;
		
		if ( ((*( p  ))
		)== 108  )
		{
			goto _st17;
			
		}
		
		goto _st0;
		_st17:
		p+= 1;
		st_case_17:
		if ( p == pe  )
		goto _out17;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st18;
			
		}
		
		goto _st0;
		_st18:
		p+= 1;
		st_case_18:
		if ( p == pe  )
		goto _out18;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st19;
			
		}
		
		goto _st0;
		_st19:
		p+= 1;
		st_case_19:
		if ( p == pe  )
		goto _out19;
		
		if ( ((*( p  ))
		)== 97  )
		{
			goto _st20;
			
		}
		
		goto _st0;
		_st20:
		p+= 1;
		st_case_20:
		if ( p == pe  )
		goto _out20;
		
		if ( ((*( p  ))
		)== 116  )
		{
			goto _st21;
			
		}
		
		goto _st0;
		_st21:
		p+= 1;
		st_case_21:
		if ( p == pe  )
		goto _out21;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st22;
			
		}
		
		goto _st0;
		_st22:
		p+= 1;
		st_case_22:
		if ( p == pe  )
		goto _out22;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr28;
			
		}
		
		goto _st0;
		_st23:
		p+= 1;
		st_case_23:
		if ( p == pe  )
		goto _out23;
		
		switch ( ((*( p  ))
		) ) {
			case 104:
			{
				goto _st24;
				
			}
			case 111:
			{
				goto _st34;
				
			}
			
		}
		goto _st0;
		_st24:
		p+= 1;
		st_case_24:
		if ( p == pe  )
		goto _out24;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st25;
			
		}
		
		goto _st0;
		_st25:
		p+= 1;
		st_case_25:
		if ( p == pe  )
		goto _out25;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st26;
			
		}
		
		goto _st0;
		_st26:
		p+= 1;
		st_case_26:
		if ( p == pe  )
		goto _out26;
		
		if ( ((*( p  ))
		)== 107  )
		{
			goto _st27;
			
		}
		
		goto _st0;
		_st27:
		p+= 1;
		st_case_27:
		if ( p == pe  )
		goto _out27;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st28;
			
		}
		
		goto _st0;
		_st28:
		p+= 1;
		st_case_28:
		if ( p == pe  )
		goto _out28;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st29;
			
		}
		
		goto _st0;
		_st29:
		p+= 1;
		st_case_29:
		if ( p == pe  )
		goto _out29;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st30;
			
		}
		
		goto _st0;
		_st30:
		p+= 1;
		st_case_30:
		if ( p == pe  )
		goto _out30;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st31;
			
		}
		
		goto _st0;
		_st31:
		p+= 1;
		st_case_31:
		if ( p == pe  )
		goto _out31;
		
		if ( ((*( p  ))
		)== 110  )
		{
			goto _st32;
			
		}
		
		goto _st0;
		_st32:
		p+= 1;
		st_case_32:
		if ( p == pe  )
		goto _out32;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st33;
			
		}
		
		goto _st0;
		_st33:
		p+= 1;
		st_case_33:
		if ( p == pe  )
		goto _out33;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr41;
			
		}
		
		goto _st0;
		_st34:
		p+= 1;
		st_case_34:
		if ( p == pe  )
		goto _out34;
		
		if ( ((*( p  ))
		)== 110  )
		{
			goto _st35;
			
		}
		
		goto _st0;
		_st35:
		p+= 1;
		st_case_35:
		if ( p == pe  )
		goto _out35;
		
		if ( ((*( p  ))
		)== 102  )
		{
			goto _st36;
			
		}
		
		goto _st0;
		_st36:
		p+= 1;
		st_case_36:
		if ( p == pe  )
		goto _out36;
		
		if ( ((*( p  ))
		)== 108  )
		{
			goto _st37;
			
		}
		
		goto _st0;
		_st37:
		p+= 1;
		st_case_37:
		if ( p == pe  )
		goto _out37;
		
		if ( ((*( p  ))
		)== 105  )
		{
			goto _st38;
			
		}
		
		goto _st0;
		_st38:
		p+= 1;
		st_case_38:
		if ( p == pe  )
		goto _out38;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st39;
			
		}
		
		goto _st0;
		_st39:
		p+= 1;
		st_case_39:
		if ( p == pe  )
		goto _out39;
		
		if ( ((*( p  ))
		)== 116  )
		{
			goto _st40;
			
		}
		
		goto _st0;
		_st40:
		p+= 1;
		st_case_40:
		if ( p == pe  )
		goto _out40;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr48;
			
		}
		
		goto _st0;
		_st41:
		p+= 1;
		st_case_41:
		if ( p == pe  )
		goto _out41;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st42;
			
		}
		
		goto _st0;
		_st42:
		p+= 1;
		st_case_42:
		if ( p == pe  )
		goto _out42;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st43;
			
		}
		
		goto _st0;
		_st43:
		p+= 1;
		st_case_43:
		if ( p == pe  )
		goto _out43;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st44;
			
		}
		
		goto _st0;
		_st44:
		p+= 1;
		st_case_44:
		if ( p == pe  )
		goto _out44;
		
		if ( ((*( p  ))
		)== 110  )
		{
			goto _st45;
			
		}
		
		goto _st0;
		_st45:
		p+= 1;
		st_case_45:
		if ( p == pe  )
		goto _out45;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st46;
			
		}
		
		goto _st0;
		_st46:
		p+= 1;
		st_case_46:
		if ( p == pe  )
		goto _out46;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr55;
			
		}
		
		goto _st0;
		_st47:
		p+= 1;
		st_case_47:
		if ( p == pe  )
		goto _out47;
		
		if ( ((*( p  ))
		)== 114  )
		{
			goto _st48;
			
		}
		
		goto _st0;
		_st48:
		p+= 1;
		st_case_48:
		if ( p == pe  )
		goto _out48;
		
		if ( ((*( p  ))
		)== 111  )
		{
			goto _st49;
			
		}
		
		goto _st0;
		_st49:
		p+= 1;
		st_case_49:
		if ( p == pe  )
		goto _out49;
		
		if ( ((*( p  ))
		)== 117  )
		{
			goto _st50;
			
		}
		
		goto _st0;
		_st50:
		p+= 1;
		st_case_50:
		if ( p == pe  )
		goto _out50;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st51;
			
		}
		
		goto _st0;
		_st51:
		p+= 1;
		st_case_51:
		if ( p == pe  )
		goto _out51;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr61;
			
		}
		
		goto _st0;
		_st52:
		p+= 1;
		st_case_52:
		if ( p == pe  )
		goto _out52;
		
		if ( ((*( p  ))
		)== 105  )
		{
			goto _st53;
			
		}
		
		goto _st0;
		_st53:
		p+= 1;
		st_case_53:
		if ( p == pe  )
		goto _out53;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st54;
			
		}
		
		goto _st0;
		_st54:
		p+= 1;
		st_case_54:
		if ( p == pe  )
		goto _out54;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st55;
			
		}
		
		goto _st0;
		_st55:
		p+= 1;
		st_case_55:
		if ( p == pe  )
		goto _out55;
		
		if ( ((*( p  ))
		)== 110  )
		{
			goto _st56;
			
		}
		
		goto _st0;
		_st56:
		p+= 1;
		st_case_56:
		if ( p == pe  )
		goto _out56;
		
		if ( ((*( p  ))
		)== 115  )
		{
			goto _st57;
			
		}
		
		goto _st0;
		_st57:
		p+= 1;
		st_case_57:
		if ( p == pe  )
		goto _out57;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st58;
			
		}
		
		goto _st0;
		_st58:
		p+= 1;
		st_case_58:
		if ( p == pe  )
		goto _out58;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr69;
			
		}
		
		goto _st0;
		_st59:
		p+= 1;
		st_case_59:
		if ( p == pe  )
		goto _out59;
		
		if ( ((*( p  ))
		)== 97  )
		{
			goto _st60;
			
		}
		
		goto _st0;
		_st60:
		p+= 1;
		st_case_60:
		if ( p == pe  )
		goto _out60;
		
		if ( ((*( p  ))
		)== 107  )
		{
			goto _st61;
			
		}
		
		goto _st0;
		_st61:
		p+= 1;
		st_case_61:
		if ( p == pe  )
		goto _out61;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st62;
			
		}
		
		goto _st0;
		_st62:
		p+= 1;
		st_case_62:
		if ( p == pe  )
		goto _out62;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st63;
			
		}
		
		goto _st0;
		_st63:
		p+= 1;
		st_case_63:
		if ( p == pe  )
		goto _out63;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st64;
			
		}
		
		goto _st0;
		_st64:
		p+= 1;
		st_case_64:
		if ( p == pe  )
		goto _out64;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st65;
			
		}
		
		goto _st0;
		_st65:
		p+= 1;
		st_case_65:
		if ( p == pe  )
		goto _out65;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st66;
			
		}
		
		goto _st0;
		_st66:
		p+= 1;
		st_case_66:
		if ( p == pe  )
		goto _out66;
		
		if ( ((*( p  ))
		)== 110  )
		{
			goto _st67;
			
		}
		
		goto _st0;
		_st67:
		p+= 1;
		st_case_67:
		if ( p == pe  )
		goto _out67;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st68;
			
		}
		
		goto _st0;
		_st68:
		p+= 1;
		st_case_68:
		if ( p == pe  )
		goto _out68;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr80;
			
		}
		
		goto _st0;
		_st69:
		p+= 1;
		st_case_69:
		if ( p == pe  )
		goto _out69;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st70;
			
		}
		
		goto _st0;
		_st70:
		p+= 1;
		st_case_70:
		if ( p == pe  )
		goto _out70;
		
		if ( ((*( p  ))
		)== 116  )
		{
			goto _st71;
			
		}
		
		goto _st0;
		_st71:
		p+= 1;
		st_case_71:
		if ( p == pe  )
		goto _out71;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st72;
			
		}
		
		goto _st0;
		_st72:
		p+= 1;
		st_case_72:
		if ( p == pe  )
		goto _out72;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st73;
			
		}
		
		goto _st0;
		_st73:
		p+= 1;
		st_case_73:
		if ( p == pe  )
		goto _out73;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st74;
			
		}
		
		goto _st0;
		_st74:
		p+= 1;
		st_case_74:
		if ( p == pe  )
		goto _out74;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st75;
			
		}
		
		goto _st0;
		_st75:
		p+= 1;
		st_case_75:
		if ( p == pe  )
		goto _out75;
		
		if ( ((*( p  ))
		)== 110  )
		{
			goto _st76;
			
		}
		
		goto _st0;
		_st76:
		p+= 1;
		st_case_76:
		if ( p == pe  )
		goto _out76;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st77;
			
		}
		
		goto _st0;
		_st77:
		p+= 1;
		st_case_77:
		if ( p == pe  )
		goto _out77;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr90;
			
		}
		
		goto _st0;
		_st78:
		p+= 1;
		st_case_78:
		if ( p == pe  )
		goto _out78;
		
		switch ( ((*( p  ))
		) ) {
			case 97:
			{
				goto _st79;
				
			}
			case 107:
			{
				goto _st86;
				
			}
			case 114:
			{
				goto _st103;
				
			}
			
		}
		goto _st0;
		_st79:
		p+= 1;
		st_case_79:
		if ( p == pe  )
		goto _out79;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st80;
			
		}
		
		goto _st0;
		_st80:
		p+= 1;
		st_case_80:
		if ( p == pe  )
		goto _out80;
		
		if ( ((*( p  ))
		)== 107  )
		{
			goto _st81;
			
		}
		
		goto _st0;
		_st81:
		p+= 1;
		st_case_81:
		if ( p == pe  )
		goto _out81;
		
		if ( ((*( p  ))
		)== 97  )
		{
			goto _st82;
			
		}
		
		goto _st0;
		_st82:
		p+= 1;
		st_case_82:
		if ( p == pe  )
		goto _out82;
		
		if ( ((*( p  ))
		)== 103  )
		{
			goto _st83;
			
		}
		
		goto _st0;
		_st83:
		p+= 1;
		st_case_83:
		if ( p == pe  )
		goto _out83;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st84;
			
		}
		
		goto _st0;
		_st84:
		p+= 1;
		st_case_84:
		if ( p == pe  )
		goto _out84;
		
		if ( ((*( p  ))
		)== 114  )
		{
			goto _st85;
			
		}
		
		goto _st0;
		_st85:
		p+= 1;
		st_case_85:
		if ( p == pe  )
		goto _out85;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr101;
			
		}
		
		goto _st0;
		_st86:
		p+= 1;
		st_case_86:
		if ( p == pe  )
		goto _out86;
		
		if ( ((*( p  ))
		)== 103  )
		{
			goto _st87;
			
		}
		
		goto _st0;
		_st87:
		p+= 1;
		st_case_87:
		if ( p == pe  )
		goto _out87;
		
		switch ( ((*( p  ))
		) ) {
			case 98:
			{
				goto _st88;
				
			}
			case 100:
			{
				goto _st92;
				
			}
			case 110:
			{
				goto _st96;
				
			}
			case 118:
			{
				goto _st100;
				
			}
			
		}
		goto _st0;
		_st88:
		p+= 1;
		st_case_88:
		if ( p == pe  )
		goto _out88;
		
		if ( ((*( p  ))
		)== 97  )
		{
			goto _st89;
			
		}
		
		goto _st0;
		_st89:
		p+= 1;
		st_case_89:
		if ( p == pe  )
		goto _out89;
		
		if ( ((*( p  ))
		)== 115  )
		{
			goto _st90;
			
		}
		
		goto _st0;
		_st90:
		p+= 1;
		st_case_90:
		if ( p == pe  )
		goto _out90;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st91;
			
		}
		
		goto _st0;
		_st91:
		p+= 1;
		st_case_91:
		if ( p == pe  )
		goto _out91;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr110;
			
		}
		
		goto _st0;
		_st92:
		p+= 1;
		st_case_92:
		if ( p == pe  )
		goto _out92;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st93;
			
		}
		
		goto _st0;
		_st93:
		p+= 1;
		st_case_93:
		if ( p == pe  )
		goto _out93;
		
		if ( ((*( p  ))
		)== 115  )
		{
			goto _st94;
			
		}
		
		goto _st0;
		_st94:
		p+= 1;
		st_case_94:
		if ( p == pe  )
		goto _out94;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st95;
			
		}
		
		goto _st0;
		_st95:
		p+= 1;
		st_case_95:
		if ( p == pe  )
		goto _out95;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr114;
			
		}
		
		goto _st0;
		_st96:
		p+= 1;
		st_case_96:
		if ( p == pe  )
		goto _out96;
		
		if ( ((*( p  ))
		)== 97  )
		{
			goto _st97;
			
		}
		
		goto _st0;
		_st97:
		p+= 1;
		st_case_97:
		if ( p == pe  )
		goto _out97;
		
		if ( ((*( p  ))
		)== 109  )
		{
			goto _st98;
			
		}
		
		goto _st0;
		_st98:
		p+= 1;
		st_case_98:
		if ( p == pe  )
		goto _out98;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st99;
			
		}
		
		goto _st0;
		_st99:
		p+= 1;
		st_case_99:
		if ( p == pe  )
		goto _out99;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr118;
			
		}
		
		goto _st0;
		_st100:
		p+= 1;
		st_case_100:
		if ( p == pe  )
		goto _out100;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st101;
			
		}
		
		goto _st0;
		_st101:
		p+= 1;
		st_case_101:
		if ( p == pe  )
		goto _out101;
		
		if ( ((*( p  ))
		)== 114  )
		{
			goto _st102;
			
		}
		
		goto _st0;
		_st102:
		p+= 1;
		st_case_102:
		if ( p == pe  )
		goto _out102;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr121;
			
		}
		
		goto _st0;
		_st103:
		p+= 1;
		st_case_103:
		if ( p == pe  )
		goto _out103;
		
		if ( ((*( p  ))
		)== 111  )
		{
			goto _st104;
			
		}
		
		goto _st0;
		_st104:
		p+= 1;
		st_case_104:
		if ( p == pe  )
		goto _out104;
		
		if ( ((*( p  ))
		)== 118  )
		{
			goto _st105;
			
		}
		
		goto _st0;
		_st105:
		p+= 1;
		st_case_105:
		if ( p == pe  )
		goto _out105;
		
		if ( ((*( p  ))
		)== 105  )
		{
			goto _st106;
			
		}
		
		goto _st0;
		_st106:
		p+= 1;
		st_case_106:
		if ( p == pe  )
		goto _out106;
		
		if ( ((*( p  ))
		)== 100  )
		{
			goto _st107;
			
		}
		
		goto _st0;
		_st107:
		p+= 1;
		st_case_107:
		if ( p == pe  )
		goto _out107;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st108;
			
		}
		
		goto _st0;
		_st108:
		p+= 1;
		st_case_108:
		if ( p == pe  )
		goto _out108;
		
		if ( ((*( p  ))
		)== 115  )
		{
			goto _st109;
			
		}
		
		goto _st0;
		_st109:
		p+= 1;
		st_case_109:
		if ( p == pe  )
		goto _out109;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr128;
			
		}
		
		goto _st0;
		_st110:
		p+= 1;
		st_case_110:
		if ( p == pe  )
		goto _out110;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st111;
			
		}
		
		goto _st0;
		_st111:
		p+= 1;
		st_case_111:
		if ( p == pe  )
		goto _out111;
		
		if ( ((*( p  ))
		)== 112  )
		{
			goto _st112;
			
		}
		
		goto _st0;
		_st112:
		p+= 1;
		st_case_112:
		if ( p == pe  )
		goto _out112;
		
		if ( ((*( p  ))
		)== 108  )
		{
			goto _st113;
			
		}
		
		goto _st0;
		_st113:
		p+= 1;
		st_case_113:
		if ( p == pe  )
		goto _out113;
		
		if ( ((*( p  ))
		)== 97  )
		{
			goto _st114;
			
		}
		
		goto _st0;
		_st114:
		p+= 1;
		st_case_114:
		if ( p == pe  )
		goto _out114;
		
		if ( ((*( p  ))
		)== 99  )
		{
			goto _st115;
			
		}
		
		goto _st0;
		_st115:
		p+= 1;
		st_case_115:
		if ( p == pe  )
		goto _out115;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st116;
			
		}
		
		goto _st0;
		_st116:
		p+= 1;
		st_case_116:
		if ( p == pe  )
		goto _out116;
		
		if ( ((*( p  ))
		)== 115  )
		{
			goto _st117;
			
		}
		
		goto _st0;
		_st117:
		p+= 1;
		st_case_117:
		if ( p == pe  )
		goto _out117;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr137;
			
		}
		
		goto _st0;
		_st118:
		p+= 1;
		st_case_118:
		if ( p == pe  )
		goto _out118;
		
		if ( ((*( p  ))
		)== 105  )
		{
			goto _st119;
			
		}
		
		goto _st0;
		_st119:
		p+= 1;
		st_case_119:
		if ( p == pe  )
		goto _out119;
		
		if ( ((*( p  ))
		)== 122  )
		{
			goto _st120;
			
		}
		
		goto _st0;
		_st120:
		p+= 1;
		st_case_120:
		if ( p == pe  )
		goto _out120;
		
		if ( ((*( p  ))
		)== 101  )
		{
			goto _st121;
			
		}
		
		goto _st0;
		_st121:
		p+= 1;
		st_case_121:
		if ( p == pe  )
		goto _out121;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr142;
			
		}
		
		goto _st0;
		_st122:
		p+= 1;
		st_case_122:
		if ( p == pe  )
		goto _out122;
		
		if ( ((*( p  ))
		)== 114  )
		{
			goto _st123;
			
		}
		
		goto _st0;
		_st123:
		p+= 1;
		st_case_123:
		if ( p == pe  )
		goto _out123;
		
		if ( ((*( p  ))
		)== 108  )
		{
			goto _st124;
			
		}
		
		goto _st0;
		_st124:
		p+= 1;
		st_case_124:
		if ( p == pe  )
		goto _out124;
		
		if ( ((*( p  ))
		)== 32  )
		{
			goto _ctr146;
			
		}
		
		goto _st0;
		_out125: parser->cs = 125;
		goto _out; 
		_out0: parser->cs = 0;
		goto _out; 
		_out1: parser->cs = 1;
		goto _out; 
		_out2: parser->cs = 2;
		goto _out; 
		_out3: parser->cs = 3;
		goto _out; 
		_out4: parser->cs = 4;
		goto _out; 
		_out5: parser->cs = 5;
		goto _out; 
		_out6: parser->cs = 6;
		goto _out; 
		_out7: parser->cs = 7;
		goto _out; 
		_out8: parser->cs = 8;
		goto _out; 
		_out9: parser->cs = 9;
		goto _out; 
		_out10: parser->cs = 10;
		goto _out; 
		_out11: parser->cs = 11;
		goto _out; 
		_out12: parser->cs = 12;
		goto _out; 
		_out13: parser->cs = 13;
		goto _out; 
		_out14: parser->cs = 14;
		goto _out; 
		_out15: parser->cs = 15;
		goto _out; 
		_out16: parser->cs = 16;
		goto _out; 
		_out17: parser->cs = 17;
		goto _out; 
		_out18: parser->cs = 18;
		goto _out; 
		_out19: parser->cs = 19;
		goto _out; 
		_out20: parser->cs = 20;
		goto _out; 
		_out21: parser->cs = 21;
		goto _out; 
		_out22: parser->cs = 22;
		goto _out; 
		_out23: parser->cs = 23;
		goto _out; 
		_out24: parser->cs = 24;
		goto _out; 
		_out25: parser->cs = 25;
		goto _out; 
		_out26: parser->cs = 26;
		goto _out; 
		_out27: parser->cs = 27;
		goto _out; 
		_out28: parser->cs = 28;
		goto _out; 
		_out29: parser->cs = 29;
		goto _out; 
		_out30: parser->cs = 30;
		goto _out; 
		_out31: parser->cs = 31;
		goto _out; 
		_out32: parser->cs = 32;
		goto _out; 
		_out33: parser->cs = 33;
		goto _out; 
		_out34: parser->cs = 34;
		goto _out; 
		_out35: parser->cs = 35;
		goto _out; 
		_out36: parser->cs = 36;
		goto _out; 
		_out37: parser->cs = 37;
		goto _out; 
		_out38: parser->cs = 38;
		goto _out; 
		_out39: parser->cs = 39;
		goto _out; 
		_out40: parser->cs = 40;
		goto _out; 
		_out41: parser->cs = 41;
		goto _out; 
		_out42: parser->cs = 42;
		goto _out; 
		_out43: parser->cs = 43;
		goto _out; 
		_out44: parser->cs = 44;
		goto _out; 
		_out45: parser->cs = 45;
		goto _out; 
		_out46: parser->cs = 46;
		goto _out; 
		_out47: parser->cs = 47;
		goto _out; 
		_out48: parser->cs = 48;
		goto _out; 
		_out49: parser->cs = 49;
		goto _out; 
		_out50: parser->cs = 50;
		goto _out; 
		_out51: parser->cs = 51;
		goto _out; 
		_out52: parser->cs = 52;
		goto _out; 
		_out53: parser->cs = 53;
		goto _out; 
		_out54: parser->cs = 54;
		goto _out; 
		_out55: parser->cs = 55;
		goto _out; 
		_out56: parser->cs = 56;
		goto _out; 
		_out57: parser->cs = 57;
		goto _out; 
		_out58: parser->cs = 58;
		goto _out; 
		_out59: parser->cs = 59;
		goto _out; 
		_out60: parser->cs = 60;
		goto _out; 
		_out61: parser->cs = 61;
		goto _out; 
		_out62: parser->cs = 62;
		goto _out; 
		_out63: parser->cs = 63;
		goto _out; 
		_out64: parser->cs = 64;
		goto _out; 
		_out65: parser->cs = 65;
		goto _out; 
		_out66: parser->cs = 66;
		goto _out; 
		_out67: parser->cs = 67;
		goto _out; 
		_out68: parser->cs = 68;
		goto _out; 
		_out69: parser->cs = 69;
		goto _out; 
		_out70: parser->cs = 70;
		goto _out; 
		_out71: parser->cs = 71;
		goto _out; 
		_out72: parser->cs = 72;
		goto _out; 
		_out73: parser->cs = 73;
		goto _out; 
		_out74: parser->cs = 74;
		goto _out; 
		_out75: parser->cs = 75;
		goto _out; 
		_out76: parser->cs = 76;
		goto _out; 
		_out77: parser->cs = 77;
		goto _out; 
		_out78: parser->cs = 78;
		goto _out; 
		_out79: parser->cs = 79;
		goto _out; 
		_out80: parser->cs = 80;
		goto _out; 
		_out81: parser->cs = 81;
		goto _out; 
		_out82: parser->cs = 82;
		goto _out; 
		_out83: parser->cs = 83;
		goto _out; 
		_out84: parser->cs = 84;
		goto _out; 
		_out85: parser->cs = 85;
		goto _out; 
		_out86: parser->cs = 86;
		goto _out; 
		_out87: parser->cs = 87;
		goto _out; 
		_out88: parser->cs = 88;
		goto _out; 
		_out89: parser->cs = 89;
		goto _out; 
		_out90: parser->cs = 90;
		goto _out; 
		_out91: parser->cs = 91;
		goto _out; 
		_out92: parser->cs = 92;
		goto _out; 
		_out93: parser->cs = 93;
		goto _out; 
		_out94: parser->cs = 94;
		goto _out; 
		_out95: parser->cs = 95;
		goto _out; 
		_out96: parser->cs = 96;
		goto _out; 
		_out97: parser->cs = 97;
		goto _out; 
		_out98: parser->cs = 98;
		goto _out; 
		_out99: parser->cs = 99;
		goto _out; 
		_out100: parser->cs = 100;
		goto _out; 
		_out101: parser->cs = 101;
		goto _out; 
		_out102: parser->cs = 102;
		goto _out; 
		_out103: parser->cs = 103;
		goto _out; 
		_out104: parser->cs = 104;
		goto _out; 
		_out105: parser->cs = 105;
		goto _out; 
		_out106: parser->cs = 106;
		goto _out; 
		_out107: parser->cs = 107;
		goto _out; 
		_out108: parser->cs = 108;
		goto _out; 
		_out109: parser->cs = 109;
		goto _out; 
		_out110: parser->cs = 110;
		goto _out; 
		_out111: parser->cs = 111;
		goto _out; 
		_out112: parser->cs = 112;
		goto _out; 
		_out113: parser->cs = 113;
		goto _out; 
		_out114: parser->cs = 114;
		goto _out; 
		_out115: parser->cs = 115;
		goto _out; 
		_out116: parser->cs = 116;
		goto _out; 
		_out117: parser->cs = 117;
		goto _out; 
		_out118: parser->cs = 118;
		goto _out; 
		_out119: parser->cs = 119;
		goto _out; 
		_out120: parser->cs = 120;
		goto _out; 
		_out121: parser->cs = 121;
		goto _out; 
		_out122: parser->cs = 122;
		goto _out; 
		_out123: parser->cs = 123;
		goto _out; 
		_out124: parser->cs = 124;
		goto _out; 
		_out: {
		
		}
		
	}
	(void)pkginfo_en_main;
	if (parser->cs == pkginfo_error)
	return -1;
	
	return buf_len;
}

ssize_t read_pkginfo(struct archive *archive, struct pkg *pkg)
{
	char *buf;
	ssize_t nbytes_r = 0;
	struct pkginfo_parser parser;
	pkginfo_parser_init(&parser);
	
	for (;;) {
		size_t bufsize;
		archive_read(archive, &buf, &bufsize);
		
		ssize_t result = pkginfo_parser_feed(&parser, pkg, buf, bufsize);
		if (result < 0) {
			return result;
		} else {
			nbytes_r += result;
		}
		
		break;
	}
	
	return nbytes_r;
}
