#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 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 xep_;
  D function_signature_;
  D Pgf_cache_;
  D debug_name_;
  D generic_function_methods_;
  D discriminator_;
} _KLsealed_generic_functionGVKe;

typedef struct {
  D wrapper;
  D emitted_name_;
  D private_model_definition_;
  D private_model_creator_;
  D users_;
  D private_Cfunction_signature_;
  D Pmep_;
  D private_debug_name_;
  D function_properties_;
  D private_signature_spec_;
  D parameters_dynamic_extent_;
  D private_lambda_heap_;
  D private_lambda_body_;
  D binding_name_;
  D c_modifiers_;
  D c_signature_;
  D alternate_name_;
  D dll_exportQ_;
} _KLBc_callable_functionGVdfmc_modeling;

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;

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

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

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

typedef struct {
  D wrapper;
  D namespace_name_;
  D home_library_;
} _KLmoduleGVKe;

#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(0);

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

typedef struct {
  D wrapper;
  D mangler_;
  D cg_variables_;
  D registers_;
  D variables_;
} _KLharp_back_endGYbase_harpVharp;


/* 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 _KLsimple_methodGVKe Kins__tagYharp_instructionsVharpMM0;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
D Kins__remYharp_instructionsVharpMM0I (D, D);
extern _KLsealed_generic_functionGVKe KfunctionVdfmc_modeling;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLclassGVKd KLBc_callable_functionGVdfmc_modeling;
extern _KLmm_wrapperGVKi_0 KLBc_callable_functionGVdfmc_modelingW;
extern _KLsealed_generic_functionGVKe Kc_modifiersVdfmc_modeling;
extern _KLincremental_generic_functionGVKe KEVKd;
extern _KLfunction_classGVKi KLincremental_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLincremental_generic_functionGVKeW;
extern _KLsimple_methodGVKe Kins__rts_and_dropYnative_instructionsVharp_nativeMM0;
D Ktrace_harpQVdfmc_harp_cgI (D, D);
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
extern _KLabsent_engine_nodeGVKg RSINGULAR_Labsent_engine_nodeG;
extern _KLclassGVKd KLabsent_engine_nodeGVKg;
extern _KLmm_wrapperGVKi_0 KLabsent_engine_nodeGVKgW;
extern _KLmoduleGVKe Kdfmc_harp_cg_moduleYdylan_userVdfmc_harp_cg;
extern _KLclassGVKd KLmoduleGVKe;
extern _KLmm_wrapperGVKi_0 KLmoduleGVKeW;
extern _KLsimple_object_vectorGVKd_0 KPempty_vectorVKi;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
extern _KLclassGVKd KLsignatureGVKe;
extern _KLmm_wrapperGVKi_0 KLsignatureGVKeW;
extern _KLclassGVKd KLharp_back_endGYbase_harpVharp;
extern _KLmm_wrapperGVKi_0 KLharp_back_endGYbase_harpVharpW;
extern D Ttrace_harpQTVdfmc_harp_cg;

/* Defined object declarations */

D Kemit_epilogVdfmc_harp_cgMM0I (D, D);
static _KLbyte_stringGVKd_15 K1;
static _KLbyte_stringGVKd_9 K2;
extern _KLincremental_generic_functionGVKe Krts_dropping_argsVdfmc_harp_cg;
static _KLbyte_stringGVKd_4 K4;
static _KLsignatureGVKe K5;
static _KLbyte_stringGVKd_17 K6;
static _KLsimple_object_vectorGVKd_1 K7;

/* Indirection variables */


/* Variables */

D rts_dropping_argsVdfmc_harp_cg = &Krts_dropping_argsVdfmc_harp_cg;

/* Objects */

static _KLbyte_stringGVKd_15 K1 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 61,
  "function epilog"
};

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

_KLincremental_generic_functionGVKe Krts_dropping_argsVdfmc_harp_cg = {
  &KLincremental_generic_functionGVKeW /* wrapper */,
  &gf_xep_1,
  &K5,
  (D) 1,
  &K6,
  &KPempty_listVKi,
  &RSINGULAR_Labsent_engine_nodeG,
  &Kdfmc_harp_cg_moduleYdylan_userVdfmc_harp_cg,
  &KPfalseVKi,
  &KPempty_vectorVKi,
  (D) 25
};

static _KLbyte_stringGVKd_4 K4 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 17,
  "EXIT"
};

static _KLsignatureGVKe K5 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 41943045,
  &K7
};

static _KLbyte_stringGVKd_17 K6 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 69,
  "rts-dropping-args"
};

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

/* Code */

D Kemit_epilogVdfmc_harp_cgMM0I (D back_end_, D lambda_) {
  D T3;
  D T4;
  D T5;
  D T6;
  D T7;
  D T8;
  D T9;
  D T10;
  D T11;
  D T12;
  D T13;
  D T14;
  D T15;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:11
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:13
  T11 = SLOT_VALUE(back_end_, 1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:13
  T12 = SLOT_VALUE(T11, 9);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:13
  CALL2(&Kins__tagYharp_instructionsVharpMM0, back_end_, T12);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:14
  Kins__remYharp_instructionsVharpMM0I(back_end_, &K1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:16
  CONGRUENT_CALL_PROLOG(&KfunctionVdfmc_modeling, 1);
  T3 = CONGRUENT_CALL1(lambda_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:16
  T13 = primitive_instanceQ(T3,&KLBc_callable_functionGVdfmc_modeling);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:16
  if (T13 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:17
    CONGRUENT_CALL_PROLOG(&KfunctionVdfmc_modeling, 1);
    T4 = CONGRUENT_CALL1(lambda_);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:17
    CONGRUENT_CALL_PROLOG(&Kc_modifiersVdfmc_modeling, 1);
    T5 = CONGRUENT_CALL1(T4);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:17
    CONGRUENT_CALL_PROLOG(&KEVKd, 2);
    T14 = CONGRUENT_CALL2(T5, &K2);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:17
    T15 = primitive_not(T14);
    T6 = T15;
  } else {
    T6 = &KPfalseVKi;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:16
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:16
  if (T6 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:18
    CALL2(&Kins__rts_and_dropYnative_instructionsVharp_nativeMM0, back_end_, (D) 1);
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:20
    CONGRUENT_CALL_PROLOG(&Krts_dropping_argsVdfmc_harp_cg, 1);
    CONGRUENT_CALL1(back_end_);
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:16
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:22
  T7 = Ttrace_harpQTVdfmc_harp_cg;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:22
  if (T7 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:22
    T8 = Ktrace_harpQVdfmc_harp_cgI(back_end_, &K4);
    T10 = T8;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:22
    T9 = &KPfalseVKi;
    T10 = T9;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:22
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/harp-cg/harp-epilog.dylan:11
  MV_SET_COUNT(0);
  return(T10);
}


/* SYSTEM INIT CODE */

void _Init_dfmc_harp_cg__X_harp_epilog_for_system () {
  extern D KPresolve_symbolVKiI(D);
  return;
}

/* USER INIT CODE */

void _Init_dfmc_harp_cg__X_harp_epilog_for_user () {
  return;
}


/* eof */
