// SDB-CGEN V2.6.2
#include <ctype.h>
#include <stdio.h>
#include <string.h>

struct kv { const char *name; const char *value; };
static const struct kv kvs[] = {
// gcc -DMAIN=1 hppa.c ; ./a.out > hppa.h
	{"add", "add two registers or register and immediate"},
	{"addb", "add and branch"},
	{"addi", "add immediate"},
	{"addil", "add to left"},
	{"addl", "add logical"},
	{"and", "bitwise and"},
	{"andcm", "bitwise and complement"},
	{"b", "branch"},
	{"be", "branch if equal"},
	{"bl", "branch and link"},
	{"bne", "branch if not equal"},
	{"break", "software breakpoint"},
	{"bv", "branch vector"},
	{"call", "call subroutine"},
	{"cldw", "conditional load word"},
	{"cmp", "compare"},
	{"cmpb", "compare and branch"},
	{"cmpib", "compare immediate and branch"},
	{"cmpiclr", "compare immediate and clear"},
	{"copr", "coprocessor operation"},
	{"cstd", "conditional store double"},
	{"dep", "deposit bits"},
	{"depd", "deposit double"},
	{"depdi", "deposit double immediate"},
	{"depwi", "deposit word immediate"},
	{"diag", "diagnostics"},
	{"extr", "extract bits"},
	{"extrd", "extract double"},
	{"extrw", "extract word"},
	{"fldw", "load floating point word"},
	{"fstw", "store floating point word"},
	{"hshladd", "halfword shift left and add"},
	{"iitlbp", "insert instruction TLB purge"},
	{"jmp", "jump"},
	{"ld", "load"},
	{"ldb", "load byte"},
	{"ldd", "load double"},
	{"ldh", "load halfword"},
	{"ldi", "load immediate"},
	{"ldil", "load immediate left"},
	{"ldo", "load offset"},
	{"ldw", "load word"},
	{"ldwm", "load word and modify"},
	{"mov", "move"},
	{"movib", "move immediate and branch"},
	{"nop", "no operation"},
	{"or", "bitwise or"},
	{"ret", "return from subroutine"},
	{"shl", "shift left"},
	{"shlp", "shift left pair"},
	{"shr", "shift right"},
	{"shrp", "shift right pair"},
	{"spop2", "special operation 2"},
	{"spop3", "special operation 3"},
	{"st", "store"},
	{"stb", "store byte"},
	{"stby", "store byte indexed"},
	{"std", "store double"},
	{"sth", "store halfword"},
	{"stw", "store word"},
	{"stwm", "store word and modify"},
	{"sub", "subtract"},
	{"subi", "subtract immediate"},
	{"syscall", "system call"},
	{"uaddcm", "unsigned add with carry"},
	{"xor", "bitwise exclusive or"},
  {NULL, NULL}
};
typedef int (*GperfForeachCallback)(void *user, const char *k, const char *v);
int gperf_hppa_foreach(GperfForeachCallback cb, void *user) {
  int i = 0; while (kvs[i].name) {
  cb (user, kvs[i].name, kvs[i].value);
  i++;}
  return 0;
}
const char *gperf_hppa_get(const char *s) {
  int i = 0; while (kvs[i].name) {
  if (!strcmp (s, kvs[i].name)) return kvs[i].value;
  i++;}
  return NULL;
}
#define sdb_hash_c_hppa(x,y) gperf_hppa_hash(x)
const unsigned int gperf_hppa_hash(const char *s) {
  int sum = strlen (s);
  while (*s) { sum += *s; s++; }
  return sum;
}
struct {const char *name;void *get;void *hash;void *foreach;} gperf_hppa = {
  .name = "hppa",
  .get = &gperf_hppa_get,
  .hash = &gperf_hppa_hash,
  .foreach = &gperf_hppa_foreach
};

#if MAIN
int main () {
	const char *s = ((char*(*)(char*))gperf_hppa.get)("foo");
	printf ("%s\n", s);
}
#endif
