#include "opendylan/run-time.h"

/* Generated by Open Dylan 2014.1 for x86_64-linux */

/* Typedefs for referenced classes */

typedef struct {
  dylan_value wrapper;
  dylan_value instanceQ_iep_;
  dylan_value debug_name_;
  dylan_value class_implementation_class_;
  dylan_value class_subtype_bit_;
  dylan_value class_module_;
} _KLclassGVKd;

#define  define__KLmm_wrapperGVKi(nrepeated) \
  typedef struct { \
    dylan_value wrapper; \
    dylan_value mm_wrapper_implementation_class_; \
    dylan_value mm_wrapper_subtype_mask_; \
    DWORD mm_wrapper_fixed_part_; \
    DWORD mm_wrapper_variable_part_; \
    dylan_value mm_wrapper_number_patterns_; \
    DWORD mm_wrapper_pattern_element_[nrepeated+1]; \
  } _KLmm_wrapperGVKi_##nrepeated;
define__KLmm_wrapperGVKi(1);
define__KLmm_wrapperGVKi(0);

typedef struct {
  dylan_value wrapper;
} _KLobjectGVKd;

typedef struct {
  dylan_value wrapper;
} _KLunboundGVKe;

typedef struct {
  dylan_value wrapper;
} _KLbooleanGVKd;

#define  define__KLsimple_object_vectorGVKd(nrepeated) \
  typedef struct { \
    dylan_value wrapper; \
    dylan_value size_; \
    dylan_value vector_element_[nrepeated+1]; \
  } _KLsimple_object_vectorGVKd_##nrepeated;
define__KLsimple_object_vectorGVKd(2);
define__KLsimple_object_vectorGVKd(3);
define__KLsimple_object_vectorGVKd(16);
define__KLsimple_object_vectorGVKd(0);
define__KLsimple_object_vectorGVKd(1);

typedef struct {
  dylan_value wrapper;
  dylan_value head_;
  dylan_value tail_;
} _KLempty_listGVKd;

#define  define__KLbyte_stringGVKd(nrepeated) \
  typedef struct { \
    dylan_value wrapper; \
    dylan_value size_; \
    char string_element_[nrepeated+1]; \
  } _KLbyte_stringGVKd_##nrepeated;
define__KLbyte_stringGVKd(54);

typedef struct {
  dylan_value wrapper;
  dylan_value xep_;
  dylan_value function_signature_;
  dylan_value mep_;
  dylan_value iep_;
  dylan_value keyword_specifiers_;
} _KLkeyword_methodGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value instanceQ_iep_;
  dylan_value debug_name_;
  dylan_value class_implementation_class_;
  dylan_value class_subtype_bit_;
  dylan_value class_module_;
} _KLfunction_classGVKi;

typedef struct {
  dylan_value wrapper;
  dylan_value signature_properties_;
  dylan_value signature_required_;
  dylan_value signature_keys_;
  dylan_value signature_key_types_;
} _KLkeyword_signatureGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value instanceQ_iep_;
  dylan_value singleton_object_;
} _KLsingletonGVKd;

typedef struct {
  dylan_value wrapper;
  dylan_value xep_;
} _KLmethodGVKd;

typedef struct {
  dylan_value wrapper;
  dylan_value xep_;
  dylan_value function_signature_;
  dylan_value mep_;
} _KLsimple_methodGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value signature_properties_;
  dylan_value signature_required_;
  dylan_value signature_values_;
} _KLsignatureAvaluesGVKi;

typedef struct {
  dylan_value wrapper;
  dylan_value xep_;
  dylan_value function_signature_;
  dylan_value mep_;
} _KLlambdaGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value xep_;
  dylan_value function_signature_;
  dylan_value Pgf_cache_;
  dylan_value debug_name_;
  dylan_value generic_function_methods_;
  dylan_value discriminator_;
} _KLsealed_generic_functionGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value properties_;
  dylan_value engine_node_callback_;
  dylan_value engine_node_entry_point_;
  dylan_value cache_header_engine_node_next_;
  dylan_value cache_header_engine_node_parent_;
} _KLsimple_typechecked_cache_header_engine_nodeGVKg;

typedef struct {
  dylan_value wrapper;
  dylan_value properties_;
  dylan_value engine_node_callback_;
  dylan_value engine_node_entry_point_;
} _KLabsent_engine_nodeGVKg;

typedef struct {
  dylan_value wrapper;
  dylan_value signature_properties_;
  dylan_value signature_required_;
} _KLsignatureGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value xep_;
} _KLfunctionGVKd;

typedef struct {
  dylan_value wrapper;
  dylan_value domain_library_;
  dylan_value domain_next_;
  dylan_value domain_method_;
} _KLmethod_domainGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value namespace_name_;
  dylan_value library_major_version_;
  dylan_value library_minor_version_;
  dylan_value library_build_count_;
  dylan_value used_libraries_;
  dylan_value all_used_libraries_;
  dylan_value runtime_module_;
  dylan_value library_defined_generics_;
  dylan_value library_number_static_dispatches_;
  dylan_value library_number_dynamic_dispatches_;
} _KLlibraryGVKe;


/* Typedefs for defined classes */


/* Referenced object declarations */

extern _KLclassGVKd KLclassGVKd;
extern _KLmm_wrapperGVKi_0 KLclassGVKdW;
extern _KLclassGVKd KLmm_wrapperGVKi;
extern _KLmm_wrapperGVKi_1 KLmm_wrapperGVKiW;
extern _KLclassGVKd KLobjectGVKd;
extern _KLmm_wrapperGVKi_0 KLobjectGVKdW;
extern _KLunboundGVKe KPunboundVKi;
extern _KLclassGVKd KLunboundGVKe;
extern _KLmm_wrapperGVKi_0 KLunboundGVKeW;
extern _KLbooleanGVKd KPtrueVKi;
extern _KLclassGVKd KLbooleanGVKd;
extern _KLmm_wrapperGVKi_0 KLbooleanGVKdW;
extern _KLbooleanGVKd KPfalseVKi;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
dylan_value KerrorVKdMM1I (dylan_value, dylan_value);
extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLfunction_classGVKi KLkeyword_methodGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLkeyword_methodGVKeW;
extern _KLsimple_object_vectorGVKd_0 KPempty_vectorVKi;
extern _KLclassGVKd KLkeyword_signatureGVKe;
extern _KLmm_wrapperGVKi_0 KLkeyword_signatureGVKeW;
extern _KLclassGVKd KLsingletonGVKd;
extern _KLmm_wrapperGVKi_0 KLsingletonGVKdW;
dylan_value Ksingleton_pointer_idQ_instanceQVKiI (dylan_value x_, dylan_value s_);
extern _KLclassGVKd KLmethodGVKd;
extern _KLmm_wrapperGVKi_0 KLmethodGVKdW;
dylan_value Kinitialize_signature_completenessVKiI (dylan_value);
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLclassGVKd KLsignatureAvaluesGVKi;
extern _KLmm_wrapperGVKi_0 KLsignatureAvaluesGVKiW;
extern _KLsimple_object_vectorGVKd_16 KDsignature_LbooleanG_typesVKi;
extern _KLfunction_classGVKi KLlambdaGVKe;
extern _KLmm_wrapperGVKi_0 KLlambdaGVKeW;
extern _KLsealed_generic_functionGVKe Kreduce_incomplete_classesVKi;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLclassGVKd KLsimple_typechecked_cache_header_engine_nodeGVKg;
extern _KLmm_wrapperGVKi_0 KLsimple_typechecked_cache_header_engine_nodeGVKgW;
extern _KLabsent_engine_nodeGVKg RSINGULAR_Labsent_engine_nodeG;
extern _KLclassGVKd KLabsent_engine_nodeGVKg;
extern _KLmm_wrapperGVKi_0 KLabsent_engine_nodeGVKgW;
extern _KLclassGVKd KLsignatureGVKe;
extern _KLmm_wrapperGVKi_0 KLsignatureGVKeW;
extern _KLclassGVKd KLfunctionGVKd;
extern _KLmm_wrapperGVKi_0 KLfunctionGVKdW;
extern _KLclassGVKd KLmethod_domainGVKe;
extern _KLmm_wrapperGVKi_0 KLmethod_domainGVKeW;
extern _KLlibraryGVKe Kdylan_libraryYdylan_userVdylan;
extern _KLclassGVKd KLlibraryGVKe;
extern _KLmm_wrapperGVKi_0 KLlibraryGVKeW;
extern _KLsealed_generic_functionGVKe Kmap_congruency_classesVKi;

/* Defined object declarations */

extern _KLsimple_methodGVKe Kmap_congruency_classesVKiMM5;
dylan_value Kmap_congruency_classesVKiMM5I (dylan_value, dylan_value);
extern _KLmethod_domainGVKe KmakeVKdRD_dylanRD_0;
extern _KLsimple_methodGVKe Kreduce_incomplete_classesVKiMM6;
dylan_value Kreduce_incomplete_classesVKiMM6I (dylan_value, dylan_value, dylan_value);
extern _KLsimple_methodGVKe Ktype_completeQVKeMM3;
dylan_value Ktype_completeQVKeMM3I (dylan_value);
extern _KLsimple_methodGVKe Krecompute_type_completeXVKiMM2;
dylan_value Krecompute_type_completeXVKiMM2I (dylan_value);
extern _KLkeyword_methodGVKe KmakeVKdMM45;
dylan_value KmakeVKdMM45I (dylan_value, dylan_value);
static _KLbyte_stringGVKd_54 K11;
static _KLkeyword_signatureGVKe K12;
static _KLsimple_object_vectorGVKd_1 K13;
static _KLsingletonGVKd K14;
static _KLsignatureAvaluesGVKi K15;
static _KLsimple_object_vectorGVKd_1 K16;
static _KLsimple_typechecked_cache_header_engine_nodeGVKg K17;
static _KLsignatureGVKe K18;
static _KLsimple_object_vectorGVKd_3 K19;
static _KLsimple_typechecked_cache_header_engine_nodeGVKg K20;
static _KLsignatureGVKe K21;
static _KLsimple_object_vectorGVKd_2 K22;
extern _KLsimple_methodGVKe Kfunction_nextQVKe;
dylan_value Kfunction_nextQVKeI (dylan_value f_);

/* Indirection variables */


/* Variables */

dylan_value function_nextQVKe = &Kfunction_nextQVKe;

/* Objects */

_KLsimple_methodGVKe Kmap_congruency_classesVKiMM5 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K21,
  &Kmap_congruency_classesVKiMM5I
};

_KLmethod_domainGVKe KmakeVKdRD_dylanRD_0 = {
  &KLmethod_domainGVKeW /* wrapper */,
  &Kdylan_libraryYdylan_userVdylan,
  &KPfalseVKi,
  &KmakeVKdMM45
};

_KLsimple_methodGVKe Kreduce_incomplete_classesVKiMM6 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_3,
  &K18,
  &Kreduce_incomplete_classesVKiMM6I
};

_KLsimple_methodGVKe Ktype_completeQVKeMM3 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K15,
  &Ktype_completeQVKeMM3I
};

_KLsimple_methodGVKe Krecompute_type_completeXVKiMM2 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K15,
  &Krecompute_type_completeXVKiMM2I
};

_KLkeyword_methodGVKe KmakeVKdMM45 = {
  &KLkeyword_methodGVKeW /* wrapper */,
  &rest_key_xep_2,
  &K12,
  &key_mep_2,
  &KmakeVKdMM45I,
  &KPempty_vectorVKi
};

static _KLbyte_stringGVKd_54 K11 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (dylan_value) 217,
  "Cannot instantiate %=, it is not an instantiable type."
};

static _KLkeyword_signatureGVKe K12 = {
  &KLkeyword_signatureGVKeW /* wrapper */,
  (dylan_value) 43254789,
  &K13,
  &KPempty_vectorVKi,
  &KPempty_vectorVKi
};

static _KLsimple_object_vectorGVKd_1 K13 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (dylan_value) 5,
  &K14
};

static _KLsingletonGVKd K14 = {
  &KLsingletonGVKdW /* wrapper */,
  &Ksingleton_pointer_idQ_instanceQVKiI,
  &KLmethodGVKd
};

static _KLsignatureAvaluesGVKi K15 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (dylan_value) 33555461,
  &K16,
  &KDsignature_LbooleanG_typesVKi
};

static _KLsimple_object_vectorGVKd_1 K16 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (dylan_value) 5,
  &KLlambdaGVKe
};

static _KLsimple_typechecked_cache_header_engine_nodeGVKg K17 = {
  &KLsimple_typechecked_cache_header_engine_nodeGVKgW /* wrapper */,
  (dylan_value) 65593,
  &KPfalseVKi,
  &cache_header_engine_3,
  &RSINGULAR_Labsent_engine_nodeG,
  &Kreduce_incomplete_classesVKi
};

static _KLsignatureGVKe K18 = {
  &KLsignatureGVKeW /* wrapper */,
  (dylan_value) 41944077,
  &K19
};

static _KLsimple_object_vectorGVKd_3 K19 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (dylan_value) 13,
  &KLfunctionGVKd,
  &KLlambdaGVKe,
  &KLobjectGVKd
};

static _KLsimple_typechecked_cache_header_engine_nodeGVKg K20 = {
  &KLsimple_typechecked_cache_header_engine_nodeGVKgW /* wrapper */,
  (dylan_value) 65593,
  &KPfalseVKi,
  &cache_header_engine_2,
  &RSINGULAR_Labsent_engine_nodeG,
  &Kmap_congruency_classesVKi
};

static _KLsignatureGVKe K21 = {
  &KLsignatureGVKeW /* wrapper */,
  (dylan_value) 41943049,
  &K22
};

static _KLsimple_object_vectorGVKd_2 K22 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (dylan_value) 9,
  &KLfunctionGVKd,
  &KLlambdaGVKe
};

_KLsimple_methodGVKe Kfunction_nextQVKe = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K15,
  &Kfunction_nextQVKeI
};

/* Code */

dylan_value Kmap_congruency_classesVKiMM5I (dylan_value f_, dylan_value l_) {
  dylan_value T3;
  dylan_value T4;

  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:42
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:43
  T3 = SLOT_VALUE_INITD(l_, 1);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:43
  ENGINE_NODE_CALL_PROLOG(&Kmap_congruency_classesVKi, &K20, 2);
  T4 = ENGINE_NODE_CALL2(&K20, f_, T3);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:42
  MV_SET_COUNT(0);
  return(T4);
}

dylan_value Kreduce_incomplete_classesVKiMM6I (dylan_value f_, dylan_value l_, dylan_value ans_) {
  dylan_value T4;
  dylan_value T5_0;

  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:47
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:49
  T4 = SLOT_VALUE_INITD(l_, 1);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:49
  ENGINE_NODE_CALL_PROLOG(&Kreduce_incomplete_classesVKi, &K17, 3);
  T5_0 = ENGINE_NODE_CALL3(&K17, f_, T4, ans_);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:47
  MV_SET_COUNT(1);
  return(T5_0);
}

dylan_value Ktype_completeQVKeMM3I (dylan_value l_) {
  dylan_value T2;
  dylan_value T3;
  DWORD T4;
  dylan_value T5;
  dylan_value T6_0;

  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:32
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:33
  T2 = SLOT_VALUE_INITD(l_, 1);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:33
  T3 = SLOT_VALUE_INITD(T2, 0);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:33
  T4 = primitive_cast_integer_as_raw(T3);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:33
  T5 = primitive_machine_word_logbitQ(25,T4);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:33
  T6_0 = T5;
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:32
  MV_SET_COUNT(1);
  return(T6_0);
}

dylan_value Krecompute_type_completeXVKiMM2I (dylan_value l_) {
  dylan_value T2;
  dylan_value T3_0;
  dylan_value T4_0;
  dylan_value T5_0;
  dylan_value T6;
  DWORD T7;
  dylan_value T8;

  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:37
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
  T2 = SLOT_VALUE_INITD(l_, 1);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
  T6 = SLOT_VALUE_INITD(T2, 0);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
  T7 = primitive_cast_integer_as_raw(T6);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
  T8 = primitive_machine_word_logbitQ(25,T7);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
  if (T8 != &KPfalseVKi) {
    // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
    T3_0 = T8;
    T5_0 = T3_0;
  } else {
    // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
    T4_0 = Kinitialize_signature_completenessVKiI(T2);
    T5_0 = T4_0;
  }
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:38
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:37
  MV_SET_COUNT(1);
  return(T5_0);
}

dylan_value KmakeVKdMM45I (dylan_value class_, dylan_value all_keys_) {
  _KLsimple_object_vectorGVKd_1 T3 = {&KLsimple_object_vectorGVKdW, (dylan_value) 5};
  dylan_value T4_0;

  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:14
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:15
  T3.vector_element_[0] = class_;
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:15
  T4_0 = KerrorVKdMM1I(&K11, &T3);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:14
  MV_SET_COUNT(1);
  return(T4_0);
}

dylan_value Kfunction_nextQVKeI (dylan_value f_) {
  dylan_value T1;
  dylan_value T2;
  DWORD T3;
  dylan_value T4;
  dylan_value T5_0;

  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:22
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:23
  T1 = SLOT_VALUE_INITD(f_, 1);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:23
  T2 = SLOT_VALUE_INITD(T1, 0);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:23
  T3 = primitive_cast_integer_as_raw(T2);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:23
  T4 = primitive_machine_word_logbitQ(22,T3);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:23
  T5_0 = T4;
  // /home/bruce/Development/dylan/opendylan/sources/dylan/method.dylan:22
  MV_SET_COUNT(1);
  return(T5_0);
}


/* SYSTEM INIT CODE */

void _Init_dylan__X_method_for_system () {
  extern dylan_value KPresolve_symbolVKiI(dylan_value);
  return;
}

/* USER INIT CODE */

void _Init_dylan__X_method_for_user () {
  return;
}


/* eof */
