// 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 cc_x86_32.c ; ./a.out > cc_x86_32.h
	{"borland", "cc"},
	{"cc.borland.arg0", "eax"},
	{"cc.borland.arg1", "edx"},
	{"cc.borland.arg2", "ecx"},
	{"cc.borland.argn", "stack_rev"},
	{"cc.borland.pop", "callee"},
	{"cc.borland.ret0", "eax"},
	{"cc.cdecl-fastcall-ms.arg0", "ecx"},
	{"cc.cdecl-fastcall-ms.argn", "stack"},
	{"cc.cdecl-fastcall-ms.pop", "callee"},
	{"cc.cdecl-fastcall-ms.ret0", "eax"},
	{"cc.cdecl.argn", "stack"},
	{"cc.cdecl.clobber", "eax,ecx,edx"},
	{"cc.cdecl.pop", "caller"},
	{"cc.cdecl.preserve", "ebx,esi,edi,ebp,esp"},
	{"cc.cdecl.ret0", "eax"},
	{"cc.dlang.arg0", "edi"},
	{"cc.dlang.arg1", "esi"},
	{"cc.dlang.arg2", "edx"},
	{"cc.dlang.arg3", "ecx"},
	{"cc.dlang.arg4", "r8d"},
	{"cc.dlang.arg5", "r9d"},
	{"cc.dlang.argn", "stack_rev"},
	{"cc.dlang.pop", "callee"},
	{"cc.dlang.ret0", "eax"},
	{"cc.dlang.ret1", "edx"},
	{"cc.dlang.retn", "2"},
	{"cc.dlang.revarg", "1"},
	{"cc.fastcall.arg0", "ecx"},
	{"cc.fastcall.arg1", "edx"},
	{"cc.fastcall.argn", "stack"},
	{"cc.fastcall.clobber", "eax,ecx,edx"},
	{"cc.fastcall.pop", "callee"},
	{"cc.fastcall.preserve", "ebx,esi,edi,ebp,esp"},
	{"cc.fastcall.ret0", "eax"},
	{"cc.golang.argn", "stack"},
	{"cc.golang.pop", "caller"},
	{"cc.golang.ret0", "stack"},
	{"cc.golang.stackalloc", "lower"},
	{"cc.optlink.arg0", "eax"},
	{"cc.optlink.arg1", "edx"},
	{"cc.optlink.arg2", "ecx"},
	{"cc.optlink.argn", "stack"},
	{"cc.optlink.pop", "callee"},
	{"cc.optlink.ret0", "eax"},
	{"cc.pascal.argn", "stack_rev"},
	{"cc.pascal.pop", "callee"},
	{"cc.pascal.ret0", "eax"},
	{"cc.stdcall.argn", "stack"},
	{"cc.stdcall.clobber", "eax,ecx,edx"},
	{"cc.stdcall.pop", "callee"},
	{"cc.stdcall.preserve", "ebx,esi,edi,ebp,esp"},
	{"cc.stdcall.ret0", "eax"},
	{"cc.watcom.arg0", "eax"},
	{"cc.watcom.arg1", "edx"},
	{"cc.watcom.arg2", "ebx"},
	{"cc.watcom.arg3", "ecx"},
	{"cc.watcom.argn", "stack"},
	{"cc.watcom.pop", "callee"},
	{"cc.watcom.ret0", "eax"},
	{"cc.x86syscall.arg0", "ebx"},
	{"cc.x86syscall.arg1", "ecx"},
	{"cc.x86syscall.arg2", "edx"},
	{"cc.x86syscall.arg3", "esi"},
	{"cc.x86syscall.arg4", "edi"},
	{"cc.x86syscall.arg5", "ebp"},
	{"cc.x86syscall.clobber", "eax"},
	{"cc.x86syscall.ret0", "eax"},
	{"cdecl", "cc"},
	{"cdecl-fastcall-ms", "cc"},
	{"default.cc", "cdecl"},
	{"dlang", "cc"},
	{"fastcall", "cc"},
	{"golang", "cc"},
	{"optlink", "cc"},
	{"pascal", "cc"},
	{"stdcall", "cc"},
	{"watcom", "cc"},
	{"x86syscall", "cc"},
  {NULL, NULL}
};
typedef int (*GperfForeachCallback)(void *user, const char *k, const char *v);
int gperf_cc_x86_32_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_cc_x86_32_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_cc_x86_32(x,y) gperf_cc_x86_32_hash(x)
const unsigned int gperf_cc_x86_32_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_cc_x86_32 = {
  .name = "cc-x86-32",
  .get = &gperf_cc_x86_32_get,
  .hash = &gperf_cc_x86_32_hash,
  .foreach = &gperf_cc_x86_32_foreach
};

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