/* Generated automatically from libmemo.scm.  DO NOT EDIT */
#define LIBGAUCHE_BODY 
#include <gauche.h>
#include <gauche/code.h>

#line 36 "libmemo.scm"
#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 d1613[29];
} scm__sc SCM_UNUSED = {
  {   /* ScmString d1613 */
      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("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("->", 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("*", 1, 1),
      SCM_STRING_CONST_INITIALIZER("<void>", 6, 6),
  },
};
static struct scm__rcRec {
  ScmPair d1614[59] SCM_ALIGN_PAIR;
  ScmObj d1612[86];
} scm__rc SCM_UNUSED = {
  {   /* ScmPair d1614 */
       { SCM_NIL, SCM_NIL },
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[1])},
       { SCM_MAKE_INT(45U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1613[6]), SCM_OBJ(&scm__rc.d1614[3])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[4])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[6])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[7])},
       { SCM_OBJ(&scm__rc.d1614[8]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1614[5]), SCM_OBJ(&scm__rc.d1614[9])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[11])},
       { SCM_MAKE_INT(62U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1613[6]), SCM_OBJ(&scm__rc.d1614[13])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[14])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[16])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[17])},
       { SCM_OBJ(&scm__rc.d1614[18]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1614[15]), SCM_OBJ(&scm__rc.d1614[19])},
       { SCM_MAKE_INT(71U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1613[6]), SCM_OBJ(&scm__rc.d1614[21])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[22])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[24])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[25])},
       { SCM_OBJ(&scm__rc.d1614[26]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1614[23]), SCM_OBJ(&scm__rc.d1614[27])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[29])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[30])},
       { SCM_MAKE_INT(79U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1613[6]), SCM_OBJ(&scm__rc.d1614[32])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[33])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[35])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[36])},
       { SCM_OBJ(&scm__rc.d1614[37]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1614[34]), SCM_OBJ(&scm__rc.d1614[38])},
       { SCM_MAKE_INT(84U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1613[6]), SCM_OBJ(&scm__rc.d1614[40])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[41])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[43])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[44])},
       { SCM_OBJ(&scm__rc.d1614[45]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1614[42]), SCM_OBJ(&scm__rc.d1614[46])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[48])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[49])},
       { SCM_MAKE_INT(88U), SCM_NIL},
       { SCM_OBJ(&scm__sc.d1613[6]), SCM_OBJ(&scm__rc.d1614[51])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[52])},
       { SCM_UNDEFINED, SCM_NIL},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[54])},
       { SCM_UNDEFINED, SCM_OBJ(&scm__rc.d1614[55])},
       { SCM_OBJ(&scm__rc.d1614[56]), SCM_NIL},
       { SCM_OBJ(&scm__rc.d1614[53]), SCM_OBJ(&scm__rc.d1614[57])},
  },
  {   /* ScmObj d1612 */
    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(6, FALSE),
    SCM_MAKE_INT(1U),
    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_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_OPTARGS = 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_UINTEGERP(capacity_scm)) Scm_Error("u_long required, but got %S", capacity_scm);
  capacity = Scm_GetIntegerU(capacity_scm);
  num_keys_scm = SCM_SUBRARGS[1];
  if (!SCM_INTEGERP(num_keys_scm)) Scm_Error("int required, but got %S", num_keys_scm);
  num_keys = Scm_GetInteger(num_keys_scm);
  if (Scm_Length(SCM_OPTARGS) % 2)
    Scm_Error("keyword list not even: %S", SCM_OPTARGS);
  while (!SCM_NULLP(SCM_OPTARGS)) {
    if (SCM_EQ(SCM_CAR(SCM_OPTARGS), scm__rc.d1612[0])) {
      weak_scm = SCM_CADR(SCM_OPTARGS);
    } else 
    if (SCM_EQ(SCM_CAR(SCM_OPTARGS), scm__rc.d1612[1])) {
      fixed_scm = SCM_CADR(SCM_OPTARGS);
    }
    else Scm_Warn("unknown keyword %S", SCM_CAR(SCM_OPTARGS));
    SCM_OPTARGS = SCM_CDDR(SCM_OPTARGS);
  }
  if (!(weak_scm)) Scm_Error("scheme object required, but got %S", weak_scm);
  weak = (weak_scm);
  if (!(fixed_scm)) Scm_Error("scheme object required, but got %S", fixed_scm);
  fixed = (fixed_scm);
  {
{
ScmObj SCM_RESULT;

#line 49 "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=(Scm_MakeMemoTable(capacity,num_keys,flags));goto SCM_STUB_RETURN;}}
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RETURN(SCM_OBJ_SAFE(SCM_RESULT));
}
  }
}


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_Error("<memo-table> required, but got %S", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_VECTORP(keys_scm)) Scm_Error("<vector> required, but got %S", keys_scm);
  keys = SCM_VECTOR(keys_scm);
  {
ScmObj SCM_RESULT0;
int SCM_RESULT1;
{

#line 64 "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);goto SCM_STUB_RETURN;}} else {
{SCM_RESULT0=(v),SCM_RESULT1=(TRUE);goto SCM_STUB_RETURN;}}}
}
goto SCM_STUB_RETURN;
SCM_STUB_RETURN:
SCM_RETURN(Scm_Values2(SCM_OBJ_SAFE(SCM_RESULT0),SCM_MAKE_BOOL(SCM_RESULT1)));
  }
}


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_Error("<memo-table> required, but got %S", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_LISTP(keys_scm)) Scm_Error("list required, but got %S", keys_scm);
  keys = (keys_scm);
  {
ScmObj SCM_RESULT0;
int SCM_RESULT1;
{

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


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_Error("<memo-table> required, but got %S", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_VECTORP(keys_scm)) Scm_Error("<vector> required, but got %S", keys_scm);
  keys = SCM_VECTOR(keys_scm);
  value_scm = SCM_SUBRARGS[2];
  if (!(value_scm)) Scm_Error("scheme object required, but got %S", value_scm);
  value = (value_scm);
  {
{
ScmObj SCM_RESULT;

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


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_Error("<memo-table> required, but got %S", tab_scm);
  tab = SCM_MEMO_TABLE(tab_scm);
  keys_scm = SCM_SUBRARGS[1];
  if (!SCM_LISTP(keys_scm)) Scm_Error("list required, but got %S", keys_scm);
  keys = (keys_scm);
  value_scm = SCM_SUBRARGS[2];
  if (!(value_scm)) Scm_Error("scheme object required, but got %S", value_scm);
  value = (value_scm);
  {
{
ScmObj SCM_RESULT;

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


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[3];
  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<3; SCM_i++) {
    SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
  }
  tab_scm = SCM_SUBRARGS[0];
  if (!SCM_MEMO_TABLE_P(tab_scm)) Scm_Error("<memo-table> required, but got %S", 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_Error("<port> required, but got %S", port_scm);
  port = SCM_PORT(port_scm);
  {

#line 91 "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.d1612[0] = Scm_MakeKeyword(SCM_STRING(SCM_OBJ(&scm__sc.d1613[0]))); /* :weak */
  scm__rc.d1612[1] = Scm_MakeKeyword(SCM_STRING(SCM_OBJ(&scm__sc.d1613[1]))); /* :fixed */
  scm__rc.d1612[2] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[2])),TRUE); /* make-memo-table */
  scm__rc.d1612[3] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[3])),TRUE); /* capacity */
  scm__rc.d1612[4] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[4])),TRUE); /* num-keys */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[1]), scm__rc.d1612[4]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[2]), scm__rc.d1612[3]);
  scm__rc.d1612[5] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[5])),TRUE); /* source-info */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[5]), scm__rc.d1612[5]);
  scm__rc.d1612[6] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[7])),TRUE); /* bind-info */
  scm__rc.d1612[7] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[8])),TRUE); /* gauche.internal */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[6]), scm__rc.d1612[2]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[7]), scm__rc.d1612[7]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[8]), scm__rc.d1612[6]);
  scm__rc.d1612[8] = Scm_MakeExtendedPair(scm__rc.d1612[2], SCM_OBJ(&scm__rc.d1614[2]), SCM_OBJ(&scm__rc.d1614[10]));
  scm__rc.d1612[9] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[9])),TRUE); /* <ulong> */
  scm__rc.d1612[10] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[10])),TRUE); /* <int> */
  scm__rc.d1612[11] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[11])),TRUE); /* -> */
  scm__rc.d1612[12] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[12])),TRUE); /* <top> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[13]))[3] = scm__rc.d1612[7];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[13]))[4] = scm__rc.d1612[9];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[13]))[5] = scm__rc.d1612[10];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[13]))[6] = scm__rc.d1612[11];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[13]))[7] = scm__rc.d1612[12];
  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.d1612[8];
  libmemomake_memo_table__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1612[13]);
  scm__rc.d1612[21] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[13])),TRUE); /* memo-table-getv2 */
  scm__rc.d1612[22] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[14])),TRUE); /* tab */
  scm__rc.d1612[23] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[15])),TRUE); /* keys */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[11]), scm__rc.d1612[23]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[12]), scm__rc.d1612[22]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[15]), scm__rc.d1612[5]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[16]), scm__rc.d1612[21]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[17]), scm__rc.d1612[7]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[18]), scm__rc.d1612[6]);
  scm__rc.d1612[24] = Scm_MakeExtendedPair(scm__rc.d1612[21], SCM_OBJ(&scm__rc.d1614[12]), SCM_OBJ(&scm__rc.d1614[20]));
  scm__rc.d1612[25] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[16])),TRUE); /* <memo-table> */
  scm__rc.d1612[26] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[17])),TRUE); /* <vector> */
  scm__rc.d1612[27] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[18])),TRUE); /* <boolean> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[28]))[3] = scm__rc.d1612[7];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[28]))[4] = scm__rc.d1612[25];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[28]))[5] = scm__rc.d1612[26];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[28]))[6] = scm__rc.d1612[11];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[28]))[7] = scm__rc.d1612[12];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[28]))[8] = scm__rc.d1612[27];
  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.d1612[24];
  libmemomemo_table_getv2__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1612[28]);
  scm__rc.d1612[37] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[19])),TRUE); /* memo-table-get2 */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[23]), scm__rc.d1612[5]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[24]), scm__rc.d1612[37]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[25]), scm__rc.d1612[7]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[26]), scm__rc.d1612[6]);
  scm__rc.d1612[38] = Scm_MakeExtendedPair(scm__rc.d1612[37], SCM_OBJ(&scm__rc.d1614[12]), SCM_OBJ(&scm__rc.d1614[28]));
  scm__rc.d1612[39] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[20])),TRUE); /* <list> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[40]))[3] = scm__rc.d1612[7];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[40]))[4] = scm__rc.d1612[25];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[40]))[5] = scm__rc.d1612[39];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[40]))[6] = scm__rc.d1612[11];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[40]))[7] = scm__rc.d1612[12];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[40]))[8] = scm__rc.d1612[27];
  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.d1612[38];
  libmemomemo_table_get2__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1612[40]);
  scm__rc.d1612[49] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[21])),TRUE); /* memo-table-putv! */
  scm__rc.d1612[50] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[22])),TRUE); /* value */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[29]), scm__rc.d1612[50]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[30]), scm__rc.d1612[23]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[31]), scm__rc.d1612[22]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[34]), scm__rc.d1612[5]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[35]), scm__rc.d1612[49]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[36]), scm__rc.d1612[7]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[37]), scm__rc.d1612[6]);
  scm__rc.d1612[51] = Scm_MakeExtendedPair(scm__rc.d1612[49], SCM_OBJ(&scm__rc.d1614[31]), SCM_OBJ(&scm__rc.d1614[39]));
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[52]))[3] = scm__rc.d1612[7];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[52]))[4] = scm__rc.d1612[25];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[52]))[5] = scm__rc.d1612[26];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[52]))[6] = scm__rc.d1612[12];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[52]))[7] = scm__rc.d1612[11];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[52]))[8] = scm__rc.d1612[12];
  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.d1612[51];
  libmemomemo_table_putvX__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1612[52]);
  scm__rc.d1612[61] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[23])),TRUE); /* memo-table-put! */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[42]), scm__rc.d1612[5]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[43]), scm__rc.d1612[61]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[44]), scm__rc.d1612[7]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[45]), scm__rc.d1612[6]);
  scm__rc.d1612[62] = Scm_MakeExtendedPair(scm__rc.d1612[61], SCM_OBJ(&scm__rc.d1614[31]), SCM_OBJ(&scm__rc.d1614[47]));
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[63]))[3] = scm__rc.d1612[7];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[63]))[4] = scm__rc.d1612[25];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[63]))[5] = scm__rc.d1612[39];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[63]))[6] = scm__rc.d1612[12];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[63]))[7] = scm__rc.d1612[11];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[63]))[8] = scm__rc.d1612[12];
  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.d1612[62];
  libmemomemo_table_putX__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1612[63]);
  scm__rc.d1612[72] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[24])),TRUE); /* memo-table-dump */
  scm__rc.d1612[73] = Scm_MakeKeyword(SCM_STRING(SCM_OBJ(&scm__sc.d1613[25]))); /* :optional */
  scm__rc.d1612[74] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[26])),TRUE); /* port */
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[48]), scm__rc.d1612[74]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[49]), scm__rc.d1612[73]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[50]), scm__rc.d1612[22]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[53]), scm__rc.d1612[5]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[54]), scm__rc.d1612[72]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[55]), scm__rc.d1612[7]);
  SCM_SET_CAR(SCM_OBJ(&scm__rc.d1614[56]), scm__rc.d1612[6]);
  scm__rc.d1612[75] = Scm_MakeExtendedPair(scm__rc.d1612[72], SCM_OBJ(&scm__rc.d1614[50]), SCM_OBJ(&scm__rc.d1614[58]));
  scm__rc.d1612[76] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[27])),TRUE); /* * */
  scm__rc.d1612[77] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1613[28])),TRUE); /* <void> */
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[78]))[3] = scm__rc.d1612[7];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[78]))[4] = scm__rc.d1612[25];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[78]))[5] = scm__rc.d1612[76];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[78]))[6] = scm__rc.d1612[11];
  ((ScmObj*)SCM_OBJ(&scm__rc.d1612[78]))[7] = scm__rc.d1612[77];
  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.d1612[75];
  libmemomemo_table_dump__STUB.common.typeHint = SCM_OBJ(&scm__rc.d1612[78]);
  Scm_VMExecuteToplevels(toplevels);
}
