/* Generated automatically from libmemo.scm.  DO NOT EDIT */
#define LIBGAUCHE_BODY 
#include <gauche.h>
#include <gauche/code.h>
#include "gauche/priv/configP.h"
#include "gauche/priv/memoP.h"
static ScmObj libmemomake_memo_table(ScmObj*, int, void*);
static SCM_DEFINE_SUBRX(libmemomake_memo_table__STUB, 2, 1,0, SCM_FALSE,SCM_SUBR_IMMEDIATE_ARG, libmemomake_memo_table, NULL, NULL);

static ScmObj libmemomemo_table_getv2(ScmObj*, int, void*);
static SCM_DEFINE_SUBRX(libmemomemo_table_getv2__STUB, 2, 0,0, SCM_FALSE,SCM_SUBR_IMMEDIATE_ARG, libmemomemo_table_getv2, NULL, NULL);

static ScmObj libmemomemo_table_get2(ScmObj*, int, void*);
static SCM_DEFINE_SUBRX(libmemomemo_table_get2__STUB, 2, 0,0, SCM_FALSE,SCM_SUBR_IMMEDIATE_ARG, libmemomemo_table_get2, NULL, NULL);

static ScmObj libmemomemo_table_putvX(ScmObj*, int, void*);
static SCM_DEFINE_SUBR(libmemomemo_table_putvX__STUB, 3, 0,SCM_FALSE,libmemomemo_table_putvX, NULL, NULL);

static ScmObj libmemomemo_table_putX(ScmObj*, int, void*);
static SCM_DEFINE_SUBR(libmemomemo_table_putX__STUB, 3, 0,SCM_FALSE,libmemomemo_table_putX, NULL, NULL);

static ScmObj libmemomemo_table_dump(ScmObj*, int, void*);
static SCM_DEFINE_SUBRX(libmemomemo_table_dump__STUB, 1, 2,0, SCM_FALSE,SCM_SUBR_IMMEDIATE_ARG, libmemomemo_table_dump, NULL, NULL);

#if defined(__CYGWIN__) || defined(GAUCHE_WINDOWS)
#define SCM_CGEN_CONST /*empty*/
#else
#define SCM_CGEN_CONST const
#endif
static SCM_CGEN_CONST struct scm__scRec {
  ScmString d1966[30];
} scm__sc SCM_UNUSED = {
  {   /* ScmString d1966 */
      SCM_STRING_CONST_INITIALIZER("weak", 4, 4),
      SCM_STRING_CONST_INITIALIZER("fixed", 5, 5),
      SCM_STRING_CONST_INITIALIZER("make-memo-table", 15, 15),
      SCM_STRING_CONST_INITIALIZER("capacity", 8, 8),
      SCM_STRING_CONST_INITIALIZER("num-keys", 8, 8),
      SCM_STRING_CONST_INITIALIZER("key", 3, 3),
      SCM_STRING_CONST_INITIALIZER("source-info", 11, 11),
      SCM_STRING_CONST_INITIALIZER("libmemo.scm", 11, 11),
      SCM_STRING_CONST_INITIALIZER("bind-info", 9, 9),
      SCM_STRING_CONST_INITIALIZER("gauche.internal", 15, 15),
      SCM_STRING_CONST_INITIALIZER("<ulong>", 7, 7),
      SCM_STRING_CONST_INITIALIZER("<int>", 5, 5),
      SCM_STRING_CONST_INITIALIZER("*", 1, 1),
      SCM_STRING_CONST_INITIALIZER("->", 2, 2),
      SCM_STRING_CONST_INITIALIZER("<top>", 5, 5),
      SCM_STRING_CONST_INITIALIZER("memo-table-getv2", 16, 16),
      SCM_STRING_CONST_INITIALIZER("tab", 3, 3),
      SCM_STRING_CONST_INITIALIZER("keys", 4, 4),
      SCM_STRING_CONST_INITIALIZER("<memo-table>", 12, 12),
      SCM_STRING_CONST_INITIALIZER("<vector>", 8, 8),
      SCM_STRING_CONST_INITIALIZER("<boolean>", 9, 9),
      SCM_STRING_CONST_INITIALIZER("memo-table-get2", 15, 15),
      SCM_STRING_CONST_INITIALIZER("<list>", 6, 6),
      SCM_STRING_CONST_INITIALIZER("memo-table-putv!", 16, 16),
      SCM_STRING_CONST_INITIALIZER("value", 5, 5),
      SCM_STRING_CONST_INITIALIZER("memo-table-put!", 15, 15),
      SCM_STRING_CONST_INITIALIZER("memo-table-dump", 15, 15),
      SCM_STRING_CONST_INITIALIZER("optional", 8, 8),
      SCM_STRING_CONST_INITIALIZER("port", 4, 4),
      SCM_STRING_CONST_INITIALIZER("<void>", 6, 6),
  },
};
static struct scm__rcRec {
  ScmPair d1967[62] SCM_ALIGN_PAIR;
  ScmObj d1965[90];
} scm__rc SCM_UNUSED = {
  {   /* ScmPair d1967 */
       { SCM_NIL, SCM_NIL },
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[1])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[2])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[3])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[4])},
       { SCM_MAKE_INT(46U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1966[7]), SCM_OBJ(&scm__rc.d1967[6])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[7])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[9])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[10])},
       { SCM_OBJ(&scm__rc.d1967[11]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1967[8]), SCM_OBJ(&scm__rc.d1967[12])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[14])},
       { SCM_MAKE_INT(63U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1966[7]), SCM_OBJ(&scm__rc.d1967[16])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[17])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[19])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[20])},
       { SCM_OBJ(&scm__rc.d1967[21]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1967[18]), SCM_OBJ(&scm__rc.d1967[22])},
       { SCM_MAKE_INT(72U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1966[7]), SCM_OBJ(&scm__rc.d1967[24])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[25])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[27])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[28])},
       { SCM_OBJ(&scm__rc.d1967[29]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1967[26]), SCM_OBJ(&scm__rc.d1967[30])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[32])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[33])},
       { SCM_MAKE_INT(80U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1966[7]), SCM_OBJ(&scm__rc.d1967[35])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[36])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[38])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[39])},
       { SCM_OBJ(&scm__rc.d1967[40]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1967[37]), SCM_OBJ(&scm__rc.d1967[41])},
       { SCM_MAKE_INT(85U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1966[7]), SCM_OBJ(&scm__rc.d1967[43])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[44])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[46])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[47])},
       { SCM_OBJ(&scm__rc.d1967[48]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1967[45]), SCM_OBJ(&scm__rc.d1967[49])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[51])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[52])},
       { SCM_MAKE_INT(89U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1966[7]), SCM_OBJ(&scm__rc.d1967[54])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[55])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[57])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1967[58])},
       { SCM_OBJ(&scm__rc.d1967[59]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1967[56]), SCM_OBJ(&scm__rc.d1967[60])},
  },
  {   /* ScmObj d1965 */
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_OBJ(SCM_CLASS_STATIC_TAG(Scm_VectorClass)) /* <vector> */,
    SCM_VECTOR_SIZE_SLOT_INITIALIZER(7, FALSE),
    SCM_MAKE_INT(1U),
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_OBJ(SCM_CLASS_STATIC_TAG(Scm_VectorClass)) /* <vector> */,
    SCM_VECTOR_SIZE_SLOT_INITIALIZER(7, FALSE),
    SCM_MAKE_INT(1U),
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_OBJ(SCM_CLASS_STATIC_TAG(Scm_VectorClass)) /* <vector> */,
    SCM_VECTOR_SIZE_SLOT_INITIALIZER(7, FALSE),
    SCM_MAKE_INT(1U),
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_OBJ(SCM_CLASS_STATIC_TAG(Scm_VectorClass)) /* <vector> */,
    SCM_VECTOR_SIZE_SLOT_INITIALIZER(7, FALSE),
    SCM_MAKE_INT(1U),
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_OBJ(SCM_CLASS_STATIC_TAG(Scm_VectorClass)) /* <vector> */,
    SCM_VECTOR_SIZE_SLOT_INITIALIZER(7, FALSE),
    SCM_MAKE_INT(1U),
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_OBJ(SCM_CLASS_STATIC_TAG(Scm_VectorClass)) /* <vector> */,
    SCM_VECTOR_SIZE_SLOT_INITIALIZER(6, FALSE),
    SCM_MAKE_INT(1U),
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
    SCM_UNDEFINED,
  },
};

static ScmObj libmemomake_memo_table(ScmObj *SCM_FP SCM_UNUSED, int SCM_ARGCNT SCM_UNUSED, void *data_ SCM_UNUSED)
{
  ScmObj capacity_scm;
  u_long capacity;
  ScmObj num_keys_scm;
  int num_keys;
  ScmObj weak_scm = SCM_FALSE;
  ScmObj weak;
  ScmObj fixed_scm = SCM_FALSE;
  ScmObj fixed;
  ScmObj SCM_SUBRARGS[2];
  ScmObj SCM_KEYARGS = SCM_ARGREF(SCM_ARGCNT-1);
  SCM_ENTER_SUBR("make-memo-table");
  for (int SCM_i=0; SCM_i<2; SCM_i++) {
    SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
  }
  capacity_scm = SCM_SUBRARGS[0];
  if (!SCM_INTEGER_FITS_ULONG_P(capacity_scm)) Scm_TypeError("capacity", "u_long", capacity_scm);
  capacity = Scm_GetIntegerU(capacity_scm);
  num_keys_scm = SCM_SUBRARGS[1];
  if (!SCM_INTEGER_FITS_INT_P(num_keys_scm)) Scm_TypeError("num-keys", "int", num_keys_scm);
  num_keys = Scm_GetInteger(num_keys_scm);
  if (Scm_Length(SCM_KEYARGS) % 2)
    Scm_Error("keyword list not even: %S", SCM_KEYARGS);
  while (!SCM_NULLP(SCM_KEYARGS)) {
    if (SCM_EQ(SCM_CAR(SCM_KEYARGS), scm__rc.d1965[0])) {
      weak_scm = SCM_CADR(SCM_KEYARGS);
    } else 
    if (SCM_EQ(SCM_CAR(SCM_KEYARGS), scm__rc.d1965[1])) {
      fixed_scm = SCM_CADR(SCM_KEYARGS);
    }
    else Scm_Warn("unknown keyword %S", SCM_CAR(SCM_KEYARGS));
    SCM_KEYARGS = SCM_CDDR(SCM_KEYARGS);
  }
  if (!(weak_scm)) Scm_TypeError("weak", "scheme object", weak_scm);
  weak = (weak_scm);
  if (!(fixed_scm)) Scm_TypeError("fixed", "scheme object", fixed_scm);
  fixed = (fixed_scm);
  {
{
ScmObj SCM_RESULT;
ScmObj SCM_RESULT_s;

#line 50 "libmemo.scm"
{u_long flags=0;
if (!(SCM_FALSEP(weak))){{(flags)|=(SCM_MEMO_TABLE_WEAK);}}
if (!(SCM_FALSEP(fixed))){{(flags)|=(SCM_MEMO_TABLE_FIXED);}}
SCM_RESULT = 
#line 53 "libmemo.scm"
Scm_MakeMemoTable(capacity,num_keys,flags);
SCM_RESULT_s = SCM_OBJ_SAFE(SCM_RESULT);
goto SCM_STUB_RETURN_BOXED;}
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RESULT_s = SCM_OBJ_SAFE(SCM_RESULT);
goto SCM_STUB_RETURN_BOXED;
SCM_STUB_RETURN_BOXED:
SCM_RETURN(SCM_RESULT_s);
}
  }
}


static ScmObj libmemomemo_table_getv2(ScmObj *SCM_FP SCM_UNUSED, int SCM_ARGCNT SCM_UNUSED, void *data_ SCM_UNUSED)
{
  ScmObj tab_scm;
  ScmMemoTable* tab;
  ScmObj keys_scm;
  ScmVector* keys;
  ScmObj SCM_SUBRARGS[2];
  SCM_ENTER_SUBR("memo-table-getv2");
  for (int SCM_i=0; SCM_i<2; SCM_i++) {
    SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
  }
  tab_scm = SCM_SUBRARGS[0];
  if (!SCM_MEMO_TABLE_P(tab_scm)) Scm_TypeError("tab", "<memo-table>", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_VECTORP(keys_scm)) Scm_TypeError("keys", "<vector>", keys_scm);
  keys = SCM_VECTOR(keys_scm);
  {
ScmObj SCM_RESULT0;
int SCM_RESULT1;
ScmObj SCM_RESULT_s;
{

#line 65 "libmemo.scm"
{ScmObj v=Scm_MemoTableGetv(tab,SCM_VECTOR_ELEMENTS(keys),
SCM_VECTOR_SIZE(keys));
if (SCM_UNBOUNDP(v)){
SCM_RESULT0 = SCM_UNDEFINED;
SCM_RESULT1 = FALSE;
SCM_RESULT_s = Scm_Values2(SCM_OBJ_SAFE(SCM_RESULT0), SCM_MAKE_BOOL(SCM_RESULT1));
goto SCM_STUB_RETURN_BOXED;} else {
SCM_RESULT0 = v;
SCM_RESULT1 = TRUE;
SCM_RESULT_s = Scm_Values2(SCM_OBJ_SAFE(SCM_RESULT0), SCM_MAKE_BOOL(SCM_RESULT1));
goto SCM_STUB_RETURN_BOXED;}}
}
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RESULT_s = Scm_Values2(SCM_OBJ_SAFE(SCM_RESULT0), SCM_MAKE_BOOL(SCM_RESULT1));
goto SCM_STUB_RETURN_BOXED;
SCM_STUB_RETURN_BOXED:
SCM_RETURN(SCM_RESULT_s);
  }
}


static ScmObj libmemomemo_table_get2(ScmObj *SCM_FP SCM_UNUSED, int SCM_ARGCNT SCM_UNUSED, void *data_ SCM_UNUSED)
{
  ScmObj tab_scm;
  ScmMemoTable* tab;
  ScmObj keys_scm;
  ScmObj keys;
  ScmObj SCM_SUBRARGS[2];
  SCM_ENTER_SUBR("memo-table-get2");
  for (int SCM_i=0; SCM_i<2; SCM_i++) {
    SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
  }
  tab_scm = SCM_SUBRARGS[0];
  if (!SCM_MEMO_TABLE_P(tab_scm)) Scm_TypeError("tab", "<memo-table>", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_LISTP(keys_scm)) Scm_TypeError("keys", "list", keys_scm);
  keys = (keys_scm);
  {
ScmObj SCM_RESULT0;
int SCM_RESULT1;
ScmObj SCM_RESULT_s;
{

#line 74 "libmemo.scm"
{ScmObj v=Scm_MemoTableGet(tab,keys);
if (SCM_UNBOUNDP(v)){
SCM_RESULT0 = SCM_UNDEFINED;
SCM_RESULT1 = FALSE;
SCM_RESULT_s = Scm_Values2(SCM_OBJ_SAFE(SCM_RESULT0), SCM_MAKE_BOOL(SCM_RESULT1));
goto SCM_STUB_RETURN_BOXED;} else {
SCM_RESULT0 = v;
SCM_RESULT1 = TRUE;
SCM_RESULT_s = Scm_Values2(SCM_OBJ_SAFE(SCM_RESULT0), SCM_MAKE_BOOL(SCM_RESULT1));
goto SCM_STUB_RETURN_BOXED;}}
}
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RESULT_s = Scm_Values2(SCM_OBJ_SAFE(SCM_RESULT0), SCM_MAKE_BOOL(SCM_RESULT1));
goto SCM_STUB_RETURN_BOXED;
SCM_STUB_RETURN_BOXED:
SCM_RETURN(SCM_RESULT_s);
  }
}


static ScmObj libmemomemo_table_putvX(ScmObj *SCM_FP SCM_UNUSED, int SCM_ARGCNT SCM_UNUSED, void *data_ SCM_UNUSED)
{
  ScmObj tab_scm;
  ScmMemoTable* tab;
  ScmObj keys_scm;
  ScmVector* keys;
  ScmObj value_scm;
  ScmObj value;
  ScmObj SCM_SUBRARGS[3];
  SCM_ENTER_SUBR("memo-table-putv!");
  for (int SCM_i=0; SCM_i<3; SCM_i++) {
    SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
  }
  tab_scm = SCM_SUBRARGS[0];
  if (!SCM_MEMO_TABLE_P(tab_scm)) Scm_TypeError("tab", "<memo-table>", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_VECTORP(keys_scm)) Scm_TypeError("keys", "<vector>", keys_scm);
  keys = SCM_VECTOR(keys_scm);
  value_scm = SCM_SUBRARGS[2];
  if (!(value_scm)) Scm_TypeError("value", "scheme object", value_scm);
  value = (value_scm);
  {
{
ScmObj SCM_RESULT;
ScmObj SCM_RESULT_s;

#line 81 "libmemo.scm"
SCM_RESULT = 
#line 81 "libmemo.scm"
Scm_MemoTablePutv(tab,SCM_VECTOR_ELEMENTS(keys),
SCM_VECTOR_SIZE(keys),value);
SCM_RESULT_s = SCM_OBJ_SAFE(SCM_RESULT);
goto SCM_STUB_RETURN_BOXED;
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RESULT_s = SCM_OBJ_SAFE(SCM_RESULT);
goto SCM_STUB_RETURN_BOXED;
SCM_STUB_RETURN_BOXED:
SCM_RETURN(SCM_RESULT_s);
}
  }
}


static ScmObj libmemomemo_table_putX(ScmObj *SCM_FP SCM_UNUSED, int SCM_ARGCNT SCM_UNUSED, void *data_ SCM_UNUSED)
{
  ScmObj tab_scm;
  ScmMemoTable* tab;
  ScmObj keys_scm;
  ScmObj keys;
  ScmObj value_scm;
  ScmObj value;
  ScmObj SCM_SUBRARGS[3];
  SCM_ENTER_SUBR("memo-table-put!");
  for (int SCM_i=0; SCM_i<3; SCM_i++) {
    SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
  }
  tab_scm = SCM_SUBRARGS[0];
  if (!SCM_MEMO_TABLE_P(tab_scm)) Scm_TypeError("tab", "<memo-table>", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_LISTP(keys_scm)) Scm_TypeError("keys", "list", keys_scm);
  keys = (keys_scm);
  value_scm = SCM_SUBRARGS[2];
  if (!(value_scm)) Scm_TypeError("value", "scheme object", value_scm);
  value = (value_scm);
  {
{
ScmObj SCM_RESULT;
ScmObj SCM_RESULT_s;

#line 86 "libmemo.scm"
SCM_RESULT = 
#line 86 "libmemo.scm"
Scm_MemoTablePut(tab,keys,value);
SCM_RESULT_s = SCM_OBJ_SAFE(SCM_RESULT);
goto SCM_STUB_RETURN_BOXED;
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RESULT_s = SCM_OBJ_SAFE(SCM_RESULT);
goto SCM_STUB_RETURN_BOXED;
SCM_STUB_RETURN_BOXED:
SCM_RETURN(SCM_RESULT_s);
}
  }
}


static ScmObj libmemomemo_table_dump(ScmObj *SCM_FP SCM_UNUSED, int SCM_ARGCNT SCM_UNUSED, void *data_ SCM_UNUSED)
{
  ScmObj tab_scm;
  ScmMemoTable* tab;
  ScmObj port_scm;
  ScmPort* port;
  ScmObj SCM_SUBRARGS[2];
  SCM_ENTER_SUBR("memo-table-dump");
  if (SCM_ARGCNT >= 3
      && !SCM_NULLP(SCM_ARGREF(SCM_ARGCNT-1)))
    Scm_Error("too many arguments: up to 2 is expected, %d given.", SCM_ARGCNT + Scm_Length(SCM_ARGREF(SCM_ARGCNT-1)) - 1);
  for (int SCM_i=0; SCM_i<2; SCM_i++) {
    SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
  }
  tab_scm = SCM_SUBRARGS[0];
  if (!SCM_MEMO_TABLE_P(tab_scm)) Scm_TypeError("tab", "<memo-table>", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  if (SCM_ARGCNT > 1+1) {
    port_scm = SCM_SUBRARGS[1];
  } else {
    port_scm = SCM_OBJ(SCM_CUROUT);
  }
  if (!SCM_PORTP(port_scm)) Scm_TypeError("port", "<port>", port_scm);
  port = SCM_PORT(port_scm);
  {

#line 92 "libmemo.scm"
Scm__MemoTableDump(tab,port);
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RETURN(SCM_UNDEFINED);
  }
}

static ScmCompiledCode *toplevels[] = {
 NULL /*termination*/
};
void Scm_Init_libmemo() {
   Scm_SelectModule(SCM_MODULE(SCM_OBJ(Scm_GaucheModule())));
   Scm_SelectModule(SCM_MODULE(SCM_OBJ(Scm_GaucheInternalModule())));
  scm__rc.d1965[0] = Scm_MakeKeyword(SCM_STRING(SCM_OBJ(&scm__sc.d1966[0]))); /* :weak */
  scm__rc.d1965[1] = Scm_MakeKeyword(SCM_STRING(SCM_OBJ(&scm__sc.d1966[1]))); /* :fixed */
  scm__rc.d1965[2] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[2])),TRUE); /* make-memo-table */
  scm__rc.d1965[3] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[3])),TRUE); /* capacity */
  scm__rc.d1965[4] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[4])),TRUE); /* num-keys */
  scm__rc.d1965[5] = Scm_MakeKeyword(SCM_STRING(SCM_OBJ(&scm__sc.d1966[5]))); /* :key */
  scm__rc.d1965[6] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[0])),TRUE); /* weak */
  scm__rc.d1965[7] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[1])),TRUE); /* fixed */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[1]), scm__rc.d1965[7]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[2]), scm__rc.d1965[6]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[3]), scm__rc.d1965[5]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[4]), scm__rc.d1965[4]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[5]), scm__rc.d1965[3]);
  scm__rc.d1965[8] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[6])),TRUE); /* source-info */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[8]), scm__rc.d1965[8]);
  scm__rc.d1965[9] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[8])),TRUE); /* bind-info */
  scm__rc.d1965[10] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[9])),TRUE); /* gauche.internal */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[9]), scm__rc.d1965[2]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[10]), scm__rc.d1965[10]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[11]), scm__rc.d1965[9]);
  scm__rc.d1965[11] = Scm_MakeExtendedPair(scm__rc.d1965[2], SCM_OBJ(&scm__rc.d1967[5]), SCM_OBJ(&scm__rc.d1967[13]));
  scm__rc.d1965[12] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[10])),TRUE); /* <ulong> */
  scm__rc.d1965[13] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[11])),TRUE); /* <int> */
  scm__rc.d1965[14] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[12])),TRUE); /* * */
  scm__rc.d1965[15] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[13])),TRUE); /* -> */
  scm__rc.d1965[16] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[14])),TRUE); /* <top> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[17]))[3] = scm__rc.d1965[10];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[17]))[4] = scm__rc.d1965[12];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[17]))[5] = scm__rc.d1965[13];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[17]))[6] = scm__rc.d1965[14];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[17]))[7] = scm__rc.d1965[15];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[17]))[8] = scm__rc.d1965[16];
  Scm_MakeBinding(SCM_MODULE(SCM_OBJ(Scm_GaucheInternalModule())), SCM_SYMBOL(SCM_INTERN("make-memo-table")), SCM_OBJ(&libmemomake_memo_table__STUB), 0);
  libmemomake_memo_table__STUB.common.info = scm__rc.d1965[11];
  libmemomake_memo_table__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1965[17]);
  scm__rc.d1965[26] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[15])),TRUE); /* memo-table-getv2 */
  scm__rc.d1965[27] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[16])),TRUE); /* tab */
  scm__rc.d1965[28] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[17])),TRUE); /* keys */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[14]), scm__rc.d1965[28]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[15]), scm__rc.d1965[27]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[18]), scm__rc.d1965[8]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[19]), scm__rc.d1965[26]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[20]), scm__rc.d1965[10]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[21]), scm__rc.d1965[9]);
  scm__rc.d1965[29] = Scm_MakeExtendedPair(scm__rc.d1965[26], SCM_OBJ(&scm__rc.d1967[15]), SCM_OBJ(&scm__rc.d1967[23]));
  scm__rc.d1965[30] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[18])),TRUE); /* <memo-table> */
  scm__rc.d1965[31] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[19])),TRUE); /* <vector> */
  scm__rc.d1965[32] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[20])),TRUE); /* <boolean> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[33]))[3] = scm__rc.d1965[10];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[33]))[4] = scm__rc.d1965[30];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[33]))[5] = scm__rc.d1965[31];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[33]))[6] = scm__rc.d1965[15];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[33]))[7] = scm__rc.d1965[16];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[33]))[8] = scm__rc.d1965[32];
  Scm_MakeBinding(SCM_MODULE(SCM_OBJ(Scm_GaucheInternalModule())), SCM_SYMBOL(SCM_INTERN("memo-table-getv2")), SCM_OBJ(&libmemomemo_table_getv2__STUB), 0);
  libmemomemo_table_getv2__STUB.common.info = scm__rc.d1965[29];
  libmemomemo_table_getv2__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1965[33]);
  scm__rc.d1965[42] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[21])),TRUE); /* memo-table-get2 */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[26]), scm__rc.d1965[8]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[27]), scm__rc.d1965[42]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[28]), scm__rc.d1965[10]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[29]), scm__rc.d1965[9]);
  scm__rc.d1965[43] = Scm_MakeExtendedPair(scm__rc.d1965[42], SCM_OBJ(&scm__rc.d1967[15]), SCM_OBJ(&scm__rc.d1967[31]));
  scm__rc.d1965[44] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[22])),TRUE); /* <list> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[45]))[3] = scm__rc.d1965[10];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[45]))[4] = scm__rc.d1965[30];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[45]))[5] = scm__rc.d1965[44];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[45]))[6] = scm__rc.d1965[15];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[45]))[7] = scm__rc.d1965[16];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[45]))[8] = scm__rc.d1965[32];
  Scm_MakeBinding(SCM_MODULE(SCM_OBJ(Scm_GaucheInternalModule())), SCM_SYMBOL(SCM_INTERN("memo-table-get2")), SCM_OBJ(&libmemomemo_table_get2__STUB), 0);
  libmemomemo_table_get2__STUB.common.info = scm__rc.d1965[43];
  libmemomemo_table_get2__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1965[45]);
  scm__rc.d1965[54] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[23])),TRUE); /* memo-table-putv! */
  scm__rc.d1965[55] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[24])),TRUE); /* value */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[32]), scm__rc.d1965[55]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[33]), scm__rc.d1965[28]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[34]), scm__rc.d1965[27]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[37]), scm__rc.d1965[8]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[38]), scm__rc.d1965[54]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[39]), scm__rc.d1965[10]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[40]), scm__rc.d1965[9]);
  scm__rc.d1965[56] = Scm_MakeExtendedPair(scm__rc.d1965[54], SCM_OBJ(&scm__rc.d1967[34]), SCM_OBJ(&scm__rc.d1967[42]));
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[57]))[3] = scm__rc.d1965[10];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[57]))[4] = scm__rc.d1965[30];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[57]))[5] = scm__rc.d1965[31];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[57]))[6] = scm__rc.d1965[16];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[57]))[7] = scm__rc.d1965[15];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[57]))[8] = scm__rc.d1965[16];
  Scm_MakeBinding(SCM_MODULE(SCM_OBJ(Scm_GaucheInternalModule())), SCM_SYMBOL(SCM_INTERN("memo-table-putv!")), SCM_OBJ(&libmemomemo_table_putvX__STUB), 0);
  libmemomemo_table_putvX__STUB.common.info = scm__rc.d1965[56];
  libmemomemo_table_putvX__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1965[57]);
  scm__rc.d1965[66] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[25])),TRUE); /* memo-table-put! */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[45]), scm__rc.d1965[8]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[46]), scm__rc.d1965[66]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[47]), scm__rc.d1965[10]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[48]), scm__rc.d1965[9]);
  scm__rc.d1965[67] = Scm_MakeExtendedPair(scm__rc.d1965[66], SCM_OBJ(&scm__rc.d1967[34]), SCM_OBJ(&scm__rc.d1967[50]));
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[68]))[3] = scm__rc.d1965[10];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[68]))[4] = scm__rc.d1965[30];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[68]))[5] = scm__rc.d1965[44];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[68]))[6] = scm__rc.d1965[16];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[68]))[7] = scm__rc.d1965[15];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[68]))[8] = scm__rc.d1965[16];
  Scm_MakeBinding(SCM_MODULE(SCM_OBJ(Scm_GaucheInternalModule())), SCM_SYMBOL(SCM_INTERN("memo-table-put!")), SCM_OBJ(&libmemomemo_table_putX__STUB), 0);
  libmemomemo_table_putX__STUB.common.info = scm__rc.d1965[67];
  libmemomemo_table_putX__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1965[68]);
  scm__rc.d1965[77] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[26])),TRUE); /* memo-table-dump */
  scm__rc.d1965[78] = Scm_MakeKeyword(SCM_STRING(SCM_OBJ(&scm__sc.d1966[27]))); /* :optional */
  scm__rc.d1965[79] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[28])),TRUE); /* port */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[51]), scm__rc.d1965[79]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[52]), scm__rc.d1965[78]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[53]), scm__rc.d1965[27]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[56]), scm__rc.d1965[8]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[57]), scm__rc.d1965[77]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[58]), scm__rc.d1965[10]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1967[59]), scm__rc.d1965[9]);
  scm__rc.d1965[80] = Scm_MakeExtendedPair(scm__rc.d1965[77], SCM_OBJ(&scm__rc.d1967[53]), SCM_OBJ(&scm__rc.d1967[61]));
  scm__rc.d1965[81] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1966[29])),TRUE); /* <void> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[82]))[3] = scm__rc.d1965[10];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[82]))[4] = scm__rc.d1965[30];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[82]))[5] = scm__rc.d1965[14];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[82]))[6] = scm__rc.d1965[15];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1965[82]))[7] = scm__rc.d1965[81];
  Scm_MakeBinding(SCM_MODULE(SCM_OBJ(Scm_GaucheInternalModule())), SCM_SYMBOL(SCM_INTERN("memo-table-dump")), SCM_OBJ(&libmemomemo_table_dump__STUB), 0);
  libmemomemo_table_dump__STUB.common.info = scm__rc.d1965[80];
  libmemomemo_table_dump__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1965[82]);
  Scm_VMExecuteToplevels(toplevels);
}
