#include "run-time.h"

/* Typedefs for referenced classes */

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

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

typedef struct {
  D wrapper;
} _KLobjectGVKd;

typedef struct {
  D wrapper;
} _KLunboundGVKe;

typedef struct {
  D wrapper;
} _KLbooleanGVKd;

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

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

typedef struct {
  D wrapper;
  D signature_properties_;
  D signature_required_;
} _KLobject_signatureGVKe;

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

#define  define__KLbyte_stringGVKd(nrepeated) \
  typedef struct { \
    D wrapper; \
    D size_; \
    char string_element_[nrepeated+1]; \
  } _KLbyte_stringGVKd_##nrepeated;
define__KLbyte_stringGVKd(9);
define__KLbyte_stringGVKd(38);
define__KLbyte_stringGVKd(34);

typedef struct {
  D wrapper;
  D head_;
  D tail_;
} _KLpairGVKd;

typedef struct {
  D wrapper;
  D element_source_location_;
} _KLmaybe_empty_substitutionGVdfmc_macro_expander;

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

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

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

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

typedef struct {
  D wrapper;
  D element_source_location_;
} _KLsubstitutionGVdfmc_macro_expander;

#define  define__KLsimple_closure_methodGVKi(nrepeated) \
  typedef struct { \
    D wrapper; \
    D xep_; \
    D function_signature_; \
    D mep_; \
    D environment_size_; \
    D environment_element_[nrepeated+1]; \
  } _KLsimple_closure_methodGVKi_##nrepeated;
define__KLsimple_closure_methodGVKi(0);

typedef struct {
  D wrapper;
  D fragment_record_;
  D fragment_source_position_;
  D fragment_left_delimiter_;
  D fragment_nested_fragments_;
  D fragment_right_delimiter_;
} _KLbraces_fragmentGVdfmc_reader;

typedef struct {
  D wrapper;
  D fragment_record_;
  D fragment_source_position_;
  D fragment_left_delimiter_;
  D fragment_nested_fragments_;
  D fragment_right_delimiter_;
} _KLbrackets_fragmentGVdfmc_reader;

typedef struct {
  D wrapper;
  D fragment_record_;
  D fragment_source_position_;
  D fragment_left_delimiter_;
  D fragment_nested_fragments_;
  D fragment_right_delimiter_;
} _KLparens_fragmentGVdfmc_reader;

typedef struct {
  D wrapper;
  D fragment_record_;
  D fragment_source_position_;
} _KLfragmentGVdfmc_reader;

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

typedef struct {
  D wrapper;
  D fragment_record_;
  D fragment_source_position_;
} _KLseparator_fragmentGVdfmc_reader;

typedef struct {
  D wrapper;
  D head_;
  D tail_;
} _KLlistGVKd;

typedef struct {
  D wrapper;
  D instanceQ_iep_;
  D union_type1_;
  D union_type2_;
} _KLunionGVKe;

typedef struct {
  D wrapper;
  D xep_;
  D function_signature_;
  D Pgf_cache_;
  D debug_name_;
  D generic_function_methods_;
  D discriminator_;
  D incremental_gf_module_;
  D incremental_gf_domain_info_;
  D incremental_gf_method_libraries_;
  D incremental_gf_properties_;
} _KLincremental_generic_functionGVKe;

typedef struct {
  D wrapper;
  D template_fragments_;
} _KLtemplateGVdfmc_reader;

typedef struct {
  D wrapper;
  D symbol_name_;
} _KLsymbolGVKd;

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


/* 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 _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLobject_signatureGVKe KDsignature_LobjectG_object_rest_value_2VKi;
extern _KLclassGVKd KLobject_signatureGVKe;
extern _KLmm_wrapperGVKi_0 KLobject_signatureGVKeW;
extern _KLabsent_engine_nodeGVKg RSINGULAR_Labsent_engine_nodeG;
extern _KLclassGVKd KLabsent_engine_nodeGVKg;
extern _KLmm_wrapperGVKi_0 KLabsent_engine_nodeGVKgW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLclassGVKd KLpairGVKd;
extern _KLmm_wrapperGVKi_0 KLpairGVKdW;
extern _KLclassGVKd KLmaybe_empty_substitutionGVdfmc_macro_expander;
extern _KLmm_wrapperGVKi_0 KLmaybe_empty_substitutionGVdfmc_macro_expanderW;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLclassGVKd KLsignatureGVKe;
extern _KLmm_wrapperGVKi_0 KLsignatureGVKeW;
extern _KLsimple_object_vectorGVKd_16 KDsignature_LlistG_typesVKi;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
extern _KLobject_signatureGVKe KDsignature_LobjectG_object_rest_value_1VKi;
extern _KLsealed_generic_functionGVKe Kgenerate_substitution_functionVdfmc_macro_expander;
extern _KLclassGVKd KLsubstitutionGVdfmc_macro_expander;
extern _KLmm_wrapperGVKi_0 KLsubstitutionGVdfmc_macro_expanderW;
D Kcall_list_with_collectingVdfmc_macro_expanderI (D funlist_, D arg_);
D Kmake_braces_fragmentVdfmc_macro_expanderI (D);
extern _KLfunction_classGVKi KLsimple_closure_methodGVKi;
extern _KLmm_wrapperGVKi_0 KLsimple_closure_methodGVKiW;
extern _KLsimple_object_vectorGVKd_16 KDsignature_Lsimple_object_vectorG_typesVKi;
extern _KLclassGVKd KLbraces_fragmentGVdfmc_reader;
extern _KLmm_wrapperGVKi_0 KLbraces_fragmentGVdfmc_readerW;
D Kmake_brackets_fragmentVdfmc_macro_expanderI (D);
extern _KLclassGVKd KLbrackets_fragmentGVdfmc_reader;
extern _KLmm_wrapperGVKi_0 KLbrackets_fragmentGVdfmc_readerW;
D Kmake_parens_fragmentVdfmc_macro_expanderI (D);
extern _KLclassGVKd KLparens_fragmentGVdfmc_reader;
extern _KLmm_wrapperGVKi_0 KLparens_fragmentGVdfmc_readerW;
extern _KLclassGVKd KLfragmentGVdfmc_reader;
extern _KLmm_wrapperGVKi_0 KLfragmentGVdfmc_readerW;
extern _KLsealed_generic_functionGVKe Kgenerate_constructor_functionVdfmc_macro_expander;
extern _KLclassGVKd KLfunctionGVKd;
extern _KLmm_wrapperGVKi_0 KLfunctionGVKdW;
extern _KLsealed_generic_functionGVKe Kmaybe_substitute_separatorVdfmc_macro_expander;
extern _KLclassGVKd KLseparator_fragmentGVdfmc_reader;
extern _KLmm_wrapperGVKi_0 KLseparator_fragmentGVdfmc_readerW;
extern _KLclassGVKd KLlistGVKd;
extern _KLmm_wrapperGVKi_0 KLlistGVKdW;
extern _KLclassGVKd KLunionGVKe;
extern _KLmm_wrapperGVKi_0 KLunionGVKeW;
D Kunion_instanceQVKiI (D, D);
extern _KLincremental_generic_functionGVKe KemptyQVKd;
extern _KLfunction_classGVKi KLincremental_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLincremental_generic_functionGVKeW;
extern _KLsimple_methodGVKe Kempty_template_elementsQVdfmc_macro_expander;
D KLtemplateGZ32ZconstructorVdfmc_readerMM0I (D, D, D);
extern _KLclassGVKd KLtemplateGVdfmc_reader;
extern _KLmm_wrapperGVKi_0 KLtemplateGVdfmc_readerW;
extern _KLclassGVKd KLsymbolGVKd;
extern _KLmm_wrapperGVKi_0 KLsymbolGVKdW;
extern _KLclassGVKd KLsignatureAvaluesGVKi;
extern _KLmm_wrapperGVKi_0 KLsignatureAvaluesGVKiW;
extern _KLsimple_object_vectorGVKd_2 KDsignature_LfunctionG_typesVKi;
extern D Dthe_empty_templateVdfmc_macro_expander;

/* Defined object declarations */

extern _KLsimple_methodGVKe Kgenerate_template_functionVdfmc_macro_expanderMM0;
D Kgenerate_template_functionVdfmc_macro_expanderMM0I (D);
static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_template_functionF60;
static D Kanonymous_of_generate_template_functionF60I (D);
D Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0I (D);
extern _KLsealed_generic_functionGVKe Kgenerate_template_element_functionVdfmc_macro_expander;
extern _KLsimple_methodGVKe Kgenerate_template_element_functionVdfmc_macro_expanderMM0;
D Kgenerate_template_element_functionVdfmc_macro_expanderMM0I (D, D);
extern _KLsimple_methodGVKe Kgenerate_template_element_functionVdfmc_macro_expanderMM1;
D Kgenerate_template_element_functionVdfmc_macro_expanderMM1I (D, D);
static _KLpairGVKd K10;
static _KLpairGVKd K11;
static _KLbyte_stringGVKd_34 K12;
static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_template_element_functionF54;
static D Kanonymous_of_generate_template_element_functionF54I (D);
D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM0I (D);
extern _KLsealed_generic_functionGVKe Kgenerate_one_template_element_functionVdfmc_macro_expander;
extern _KLsimple_methodGVKe Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0;
static _KLsignatureGVKe K18;
extern _KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM0;
extern _KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM1;
D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM1I (D);
extern _KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM2;
D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM2I (D);
extern _KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM3;
D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM3I (D);
extern _KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM4;
D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM4I (D);
static _KLpairGVKd K28;
static _KLpairGVKd K29;
static _KLpairGVKd K30;
static _KLpairGVKd K31;
static _KLpairGVKd K32;
static _KLbyte_stringGVKd_38 K33;
static _KLsignatureGVKe K34;
static _KLsimple_object_vectorGVKd_1 K35;
static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_one_template_element_functionF38;
static D Kanonymous_of_generate_one_template_element_functionF38I (D);
static _KLsignatureGVKe K39;
static _KLsignatureGVKe K40;
static _KLsimple_object_vectorGVKd_1 K41;
static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_one_template_element_functionF44;
static D Kanonymous_of_generate_one_template_element_functionF44I (D);
static _KLsignatureGVKe K45;
static _KLsimple_object_vectorGVKd_1 K46;
static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_one_template_element_functionF49;
static D Kanonymous_of_generate_one_template_element_functionF49I (D);
static _KLsignatureGVKe K50;
static _KLsimple_object_vectorGVKd_1 K51;
static _KLsignatureGVKe K52;
static _KLsimple_object_vectorGVKd_1 K53;
static _KLsignatureGVKe K55;
static _KLsimple_object_vectorGVKd_2 K56;
static _KLsignatureGVKe K57;
static _KLsimple_object_vectorGVKd_2 K58;
static _KLunionGVKe K59;
static _KLsymbolGVKd KJfragments_;
static _KLbyte_stringGVKd_9 K62;
static _KLsignatureAvaluesGVKi K63;

/* Indirection variables */

static D IKJfragments_ = &KJfragments_;

/* Variables */

D generate_template_functionVdfmc_macro_expander = &Kgenerate_template_functionVdfmc_macro_expanderMM0;

/* Objects */

_KLsimple_methodGVKe Kgenerate_template_functionVdfmc_macro_expanderMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K63,
  &Kgenerate_template_functionVdfmc_macro_expanderMM0I
};

static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_template_functionF60 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_1,
  &K39,
  &Kanonymous_of_generate_template_functionF60I,
  (D) 1
};

_KLsealed_generic_functionGVKe Kgenerate_template_element_functionVdfmc_macro_expander = {
  &KLsealed_generic_functionGVKeW /* wrapper */,
  &gf_xep_2,
  &KDsignature_LobjectG_object_rest_value_2VKi,
  (D) 9,
  &K12,
  &K10,
  &RSINGULAR_Labsent_engine_nodeG
};

_KLsimple_methodGVKe Kgenerate_template_element_functionVdfmc_macro_expanderMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K57,
  &Kgenerate_template_element_functionVdfmc_macro_expanderMM0I
};

_KLsimple_methodGVKe Kgenerate_template_element_functionVdfmc_macro_expanderMM1 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K55,
  &Kgenerate_template_element_functionVdfmc_macro_expanderMM1I
};

static _KLpairGVKd K10 = {
  &KLpairGVKdW /* wrapper */,
  &Kgenerate_template_element_functionVdfmc_macro_expanderMM0,
  &K11
};

static _KLpairGVKd K11 = {
  &KLpairGVKdW /* wrapper */,
  &Kgenerate_template_element_functionVdfmc_macro_expanderMM1,
  &KPempty_listVKi
};

static _KLbyte_stringGVKd_34 K12 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 137,
  "generate-template-element-function"
};

static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_template_element_functionF54 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_1,
  &K39,
  &Kanonymous_of_generate_template_element_functionF54I,
  (D) 1
};

_KLsealed_generic_functionGVKe Kgenerate_one_template_element_functionVdfmc_macro_expander = {
  &KLsealed_generic_functionGVKeW /* wrapper */,
  &gf_xep_1,
  &KDsignature_LobjectG_object_rest_value_1VKi,
  (D) 1,
  &K33,
  &K28,
  &RSINGULAR_Labsent_engine_nodeG
};

_KLsimple_methodGVKe Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K18,
  &Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0I
};

static _KLsignatureGVKe K18 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 44040197,
  &KDsignature_LlistG_typesVKi
};

_KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K52,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM0I
};

_KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM1 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K50,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM1I
};

_KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM2 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K45,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM2I
};

_KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM3 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K40,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM3I
};

_KLsimple_methodGVKe Kgenerate_one_template_element_functionVdfmc_macro_expanderMM4 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K34,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM4I
};

static _KLpairGVKd K28 = {
  &KLpairGVKdW /* wrapper */,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM0,
  &K29
};

static _KLpairGVKd K29 = {
  &KLpairGVKdW /* wrapper */,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM1,
  &K30
};

static _KLpairGVKd K30 = {
  &KLpairGVKdW /* wrapper */,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM2,
  &K31
};

static _KLpairGVKd K31 = {
  &KLpairGVKdW /* wrapper */,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM3,
  &K32
};

static _KLpairGVKd K32 = {
  &KLpairGVKdW /* wrapper */,
  &Kgenerate_one_template_element_functionVdfmc_macro_expanderMM4,
  &KPempty_listVKi
};

static _KLbyte_stringGVKd_38 K33 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 153,
  "generate-one-template-element-function"
};

static _KLsignatureGVKe K34 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 44040197,
  &K35
};

static _KLsimple_object_vectorGVKd_1 K35 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  &KLsubstitutionGVdfmc_macro_expander
};

static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_one_template_element_functionF38 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_1,
  &K39,
  &Kanonymous_of_generate_one_template_element_functionF38I,
  (D) 1
};

static _KLsignatureGVKe K39 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 41944069,
  &KDsignature_Lsimple_object_vectorG_typesVKi
};

static _KLsignatureGVKe K40 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 44040197,
  &K41
};

static _KLsimple_object_vectorGVKd_1 K41 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  &KLbraces_fragmentGVdfmc_reader
};

static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_one_template_element_functionF44 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_1,
  &K39,
  &Kanonymous_of_generate_one_template_element_functionF44I,
  (D) 1
};

static _KLsignatureGVKe K45 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 44040197,
  &K46
};

static _KLsimple_object_vectorGVKd_1 K46 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  &KLbrackets_fragmentGVdfmc_reader
};

static _KLsimple_closure_methodGVKi_0 Kanonymous_of_generate_one_template_element_functionF49 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_1,
  &K39,
  &Kanonymous_of_generate_one_template_element_functionF49I,
  (D) 1
};

static _KLsignatureGVKe K50 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 44040197,
  &K51
};

static _KLsimple_object_vectorGVKd_1 K51 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  &KLparens_fragmentGVdfmc_reader
};

static _KLsignatureGVKe K52 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 44040197,
  &K53
};

static _KLsimple_object_vectorGVKd_1 K53 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  &KLfragmentGVdfmc_reader
};

static _KLsignatureGVKe K55 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 48234505,
  &K56
};

static _KLsimple_object_vectorGVKd_2 K56 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &KLseparator_fragmentGVdfmc_reader,
  &KLlistGVKd
};

static _KLsignatureGVKe K57 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 44040201,
  &K58
};

static _KLsimple_object_vectorGVKd_2 K58 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &K59,
  &KLlistGVKd
};

static _KLunionGVKe K59 = {
  &KLunionGVKeW /* wrapper */,
  &Kunion_instanceQVKiI,
  &KLfragmentGVdfmc_reader,
  &KLsubstitutionGVdfmc_macro_expander
};

static _KLsymbolGVKd KJfragments_ = {
  &KLsymbolGVKdW /* wrapper */,
  &K62
};

static _KLbyte_stringGVKd_9 K62 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 37,
  "fragments"
};

static _KLsignatureAvaluesGVKi K63 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (D) 33555461,
  &KDsignature_LlistG_typesVKi,
  &KDsignature_LfunctionG_typesVKi
};

/* Code */

D Kgenerate_template_functionVdfmc_macro_expanderMM0I (D elements_) {
  D functions_;
  D T3;
  D T4_0;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:19
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:21
  functions_ = Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0I(elements_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:22
  T3 = MAKE_CLOSURE_INITD(&Kanonymous_of_generate_template_functionF60, 1, functions_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:22
  T4_0 = T3;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:19
  MV_SET_COUNT(1);
  return(T4_0);
}

static D Kanonymous_of_generate_template_functionF60I (D env_) {
  D fragments_;
  D Utmp_;
  D T4;
  D T5;
  D T6_0;
  D T7_0;
  D T8_0;
  _KLsimple_object_vectorGVKd_2 T9 = {&KLsimple_object_vectorGVKdW, (D) 9};
  CAPTURE_ENVIRONMENT

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:22
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:24
  fragments_ = Kcall_list_with_collectingVdfmc_macro_expanderI(CREF(0), env_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:25
  CONGRUENT_CALL_PROLOG(&KemptyQVKd, 1);
  Utmp_ = CONGRUENT_CALL1(fragments_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:25
  if (Utmp_ != &KPfalseVKi) {
    T5 = Utmp_;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:25
    T4 = CALL1(&Kempty_template_elementsQVdfmc_macro_expander, fragments_);
    T5 = T4;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:25
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:25
  if (T5 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:26
    T6_0 = Dthe_empty_templateVdfmc_macro_expander;
    T7_0 = T6_0;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:28
    T9.vector_element_[0] = IKJfragments_;
    T9.vector_element_[1] = fragments_;
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:28
    T8_0 = KLtemplateGZ32ZconstructorVdfmc_readerMM0I(&KLtemplateGVdfmc_reader, &T9, fragments_);
    T7_0 = T8_0;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:25
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:22
  MV_SET_COUNT(1);
  return(T7_0);
}

D Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0I (D elements_) {
  D T2;
  D T3;
  D T4;
  D T5;
  D T6;
  D T7;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:43
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:44
  T5 = primitive_idQ(elements_,&KPempty_listVKi);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:44
  if (T5 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:45
    T2 = &KPempty_listVKi;
    MV_SET_ELT(0, &KPempty_listVKi);
    MV_SET_COUNT(1);
    T4 = T2;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:47
    T6 = SLOT_VALUE_INITD(elements_, 0);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:47
    T7 = SLOT_VALUE_INITD(elements_, 1);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:47
    CONGRUENT_CALL_PROLOG(&Kgenerate_template_element_functionVdfmc_macro_expander, 2);
    T3 = CONGRUENT_CALL2(T6, T7);
    T4 = T3;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:44
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:43
  return(T4);
}

D Kgenerate_template_element_functionVdfmc_macro_expanderMM0I (D element_, D rest_) {
  D this_;
  D restF4;
  D T5;
  D T6_0;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:51
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:53
  CONGRUENT_CALL_PROLOG(&Kgenerate_one_template_element_functionVdfmc_macro_expander, 1);
  this_ = CONGRUENT_CALL1(element_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:54
  restF4 = Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0I(rest_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:55
  T5 = primitive_object_allocate_filled(3,&KLpairGVKdW,2,&KPunboundVKi,0,0,&KPunboundVKi);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:55
  SLOT_VALUE_SETTER(this_, T5, 0);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:55
  SLOT_VALUE_SETTER(restF4, T5, 1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:55
  T6_0 = T5;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:51
  MV_SET_COUNT(1);
  return(T6_0);
}

D Kgenerate_template_element_functionVdfmc_macro_expanderMM1I (D element_, D rest_) {
  D T3;
  D subst_;
  D restF5;
  D T6;
  D T7;
  D T8;
  D T9;
  D T10;
  D T11;
  D T12;
  D sep_;
  D T14;
  D T15;
  D T16;
  D T17_0;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:58
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
  T8 = primitive_idQ(rest_,&KPempty_listVKi);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
  if (T8 != &KPfalseVKi) {
    T3 = T8;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
    T9 = SLOT_VALUE_INITD(rest_, 0);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
    T10 = primitive_instanceQ(T9,&KLmaybe_empty_substitutionGVdfmc_macro_expander);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
    T11 = primitive_not(T10);
    T3 = T11;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
  if (T3 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:61
    T12 = Kgenerate_template_element_functionVdfmc_macro_expanderMM0I(element_, rest_);
    T7 = T12;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:63
    sep_ = Kgenerate_one_template_element_functionVdfmc_macro_expanderMM0I(element_);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:64
    T14 = SLOT_VALUE_INITD(rest_, 0);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:64
    CONGRUENT_CALL_PROLOG(&Kgenerate_one_template_element_functionVdfmc_macro_expander, 1);
    subst_ = CONGRUENT_CALL1(T14);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:65
    T15 = SLOT_VALUE_INITD(rest_, 1);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:65
    restF5 = CALL1(&Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0, T15);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
    T6 = MAKE_CLOSURE_INITD(&Kanonymous_of_generate_template_element_functionF54, 2, sep_, subst_);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
    T16 = primitive_object_allocate_filled(3,&KLpairGVKdW,2,&KPunboundVKi,0,0,&KPunboundVKi);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
    SLOT_VALUE_SETTER(T6, T16, 0);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
    SLOT_VALUE_SETTER(restF5, T16, 1);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
    T17_0 = T16;
    T7 = T17_0;
    MV_SET_COUNT(1);
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:60
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:58
  return(T7);
}

static D Kanonymous_of_generate_template_element_functionF54I (D env_) {
  D T1;
  D T2;
  D T3;
  D T4;
  D T5_0;
  D T6_0;
  CAPTURE_ENVIRONMENT

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:67
  primitive_type_check(CREF(0), &KLfunctionGVKd);
  T1 = CREF(0);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:67
  T2 = CALL1(T1, env_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:67
  primitive_type_check(CREF(1), &KLfunctionGVKd);
  T3 = CREF(1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:67
  T4 = CALL1(T3, env_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:67
  CONGRUENT_CALL_PROLOG(&Kmaybe_substitute_separatorVdfmc_macro_expander, 2);
  T5_0 = CONGRUENT_CALL2(T2, T4);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
  T6_0 = T5_0;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:66
  MV_SET_COUNT(1);
  return(T6_0);
}

D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM0I (D element_) {
  D T2;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:72
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:73
  CONGRUENT_CALL_PROLOG(&Kgenerate_constructor_functionVdfmc_macro_expander, 1);
  T2 = CONGRUENT_CALL1(element_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:72
  return(T2);
}

D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM1I (D element_) {
  D nested_;
  D T3;
  D T4;
  D T5;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:76
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:79
  T5 = SLOT_VALUE_INITD(element_, 3);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:78
  nested_ = CALL1(&Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0, T5);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:80
  T3 = MAKE_CLOSURE_INITD(&Kanonymous_of_generate_one_template_element_functionF49, 1, nested_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:80
  T4 = T3;
  MV_SET_ELT(0, T3);
  MV_SET_COUNT(1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:76
  return(T4);
}

D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM2I (D element_) {
  D nested_;
  D T3;
  D T4;
  D T5;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:85
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:88
  T5 = SLOT_VALUE_INITD(element_, 3);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:87
  nested_ = CALL1(&Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0, T5);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:89
  T3 = MAKE_CLOSURE_INITD(&Kanonymous_of_generate_one_template_element_functionF44, 1, nested_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:89
  T4 = T3;
  MV_SET_ELT(0, T3);
  MV_SET_COUNT(1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:85
  return(T4);
}

D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM3I (D element_) {
  D nested_;
  D T3;
  D T4;
  D T5;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:94
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:97
  T5 = SLOT_VALUE_INITD(element_, 3);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:96
  nested_ = CALL1(&Kgenerate_template_elements_functionsVdfmc_macro_expanderMM0, T5);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:98
  T3 = MAKE_CLOSURE_INITD(&Kanonymous_of_generate_one_template_element_functionF38, 1, nested_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:98
  T4 = T3;
  MV_SET_ELT(0, T3);
  MV_SET_COUNT(1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:94
  return(T4);
}

D Kgenerate_one_template_element_functionVdfmc_macro_expanderMM4I (D element_) {
  D T2;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:103
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:104
  CONGRUENT_CALL_PROLOG(&Kgenerate_substitution_functionVdfmc_macro_expander, 1);
  T2 = CONGRUENT_CALL1(element_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:103
  return(T2);
}

static D Kanonymous_of_generate_one_template_element_functionF38I (D env_) {
  D T1;
  D T2_0;
  D T3_0;
  CAPTURE_ENVIRONMENT

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:98
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:99
  T1 = Kcall_list_with_collectingVdfmc_macro_expanderI(CREF(0), env_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:99
  T2_0 = Kmake_braces_fragmentVdfmc_macro_expanderI(T1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:98
  T3_0 = T2_0;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:98
  MV_SET_COUNT(1);
  return(T3_0);
}

static D Kanonymous_of_generate_one_template_element_functionF44I (D env_) {
  D T1;
  D T2_0;
  D T3_0;
  CAPTURE_ENVIRONMENT

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:89
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:90
  T1 = Kcall_list_with_collectingVdfmc_macro_expanderI(CREF(0), env_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:90
  T2_0 = Kmake_brackets_fragmentVdfmc_macro_expanderI(T1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:89
  T3_0 = T2_0;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:89
  MV_SET_COUNT(1);
  return(T3_0);
}

static D Kanonymous_of_generate_one_template_element_functionF49I (D env_) {
  D T1;
  D T2_0;
  D T3_0;
  CAPTURE_ENVIRONMENT

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:80
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:81
  T1 = Kcall_list_with_collectingVdfmc_macro_expanderI(CREF(0), env_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:81
  T2_0 = Kmake_parens_fragmentVdfmc_macro_expanderI(T1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:80
  T3_0 = T2_0;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/macro-expander/template-function.dylan:80
  MV_SET_COUNT(1);
  return(T3_0);
}


/* SYSTEM INIT CODE */

void _Init_dfmc_macro_expander__X_template_function_for_system () {
  extern D KPresolve_symbolVKiI(D);
  {
    D T0;

    T0 = KPresolve_symbolVKiI(&KJfragments_);
    if (T0 != &KJfragments_) {
      IKJfragments_ = T0;
    }
  }
  return;
}

/* USER INIT CODE */

void _Init_dfmc_macro_expander__X_template_function_for_user () {
  return;
}


/* eof */
