#include "run-time.h"

/* Typedefs for referenced classes */

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

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;
  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 instanceQ_iep_;
  D debug_name_;
  D class_implementation_class_;
  D class_subtype_bit_;
  D class_module_;
} _KLfunction_classGVKi;

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

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

#define  define__KLbyte_stringGVKd(nrepeated) \
  typedef struct { \
    D wrapper; \
    D size_; \
    char string_element_[nrepeated+1]; \
  } _KLbyte_stringGVKd_##nrepeated;
define__KLbyte_stringGVKd(10);
define__KLbyte_stringGVKd(7);
define__KLbyte_stringGVKd(2);

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

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);

typedef struct {
  D wrapper;
} _KLintegerGVKd;

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

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

typedef struct {
  D wrapper;
  D users_;
  D emitted_name_;
  D function_;
  D Cengine_node_ep_properties_;
  D Cengine_node_;
} _KLBengine_node_epGVdfmc_modeling;

typedef struct {
  D wrapper;
} _KLstreamGYcommon_extensionsVcommon_dylan;

typedef struct {
  D wrapper;
  D users_;
  D emitted_name_;
  D function_;
  D code_;
} _KLBiepGVdfmc_modeling;


/* Typedefs for defined classes */


/* Referenced object declarations */

extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLclassGVKd KLclassGVKd;
extern _KLmm_wrapperGVKi_0 KLclassGVKdW;
extern _KLclassGVKd KLmm_wrapperGVKi;
extern _KLmm_wrapperGVKi_1 KLmm_wrapperGVKiW;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
D KPadd_methodVKnI (D, D, D);
extern _KLincremental_generic_functionGVKe Kprint_objectYprintVio;
extern _KLfunction_classGVKi KLincremental_generic_functionGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLincremental_generic_functionGVKeW;
extern _KLlibraryGVKe Kdfmc_debug_back_end_libraryYdylan_userVdfmc_debug_back_end;
extern _KLclassGVKd KLlibraryGVKe;
extern _KLmm_wrapperGVKi_0 KLlibraryGVKeW;
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 _KLsealed_generic_functionGVKe KformatYformatVio;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLclassGVKd KLsignatureGVKe;
extern _KLmm_wrapperGVKi_0 KLsignatureGVKeW;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
extern _KLclassGVKd KLintegerGVKd;
extern _KLmm_wrapperGVKi_0 KLintegerGVKdW;
D Kobject_classVKdI (D);
extern _KLincremental_generic_functionGVKe Kdebug_nameVKe;
extern _KLsealed_generic_functionGVKe KCentry_point_nameVdfmc_modeling;
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 KLBengine_node_epGVdfmc_modeling;
extern _KLmm_wrapperGVKi_0 KLBengine_node_epGVdfmc_modelingW;
extern _KLclassGVKd KLstreamGYcommon_extensionsVcommon_dylan;
extern _KLmm_wrapperGVKi_0 KLstreamGYcommon_extensionsVcommon_dylanW;
extern _KLsealed_generic_functionGVKe KfunctionVdfmc_modeling;
extern _KLclassGVKd KLBiepGVdfmc_modeling;
extern _KLmm_wrapperGVKi_0 KLBiepGVdfmc_modelingW;

/* Defined object declarations */

extern _KLsimple_methodGVKe Kprint_objectYprintVioMdfmc_debug_back_endM0;
D Kprint_objectYprintVioMdfmc_debug_back_endM0I (D, D);
extern _KLsimple_methodGVKe Kprint_objectYprintVioMdfmc_debug_back_endM1;
D Kprint_objectYprintVioMdfmc_debug_back_endM1I (D, D);
extern _KLsimple_methodGVKe KindentVdfmc_debug_back_endMM0;
D KindentVdfmc_debug_back_endMM0I (D, D);
static _KLbyte_stringGVKd_2 K10;
static _KLsignatureGVKe K11;
static _KLsimple_object_vectorGVKd_2 K12;
static _KLsimple_typechecked_cache_header_engine_nodeGVKg K13;
static _KLbyte_stringGVKd_7 K14;
static _KLsignatureGVKe K15;
static _KLsimple_object_vectorGVKd_2 K16;
static _KLsimple_typechecked_cache_header_engine_nodeGVKg K17;
static _KLbyte_stringGVKd_10 K18;
static _KLsignatureGVKe K19;
static _KLsimple_object_vectorGVKd_2 K20;

/* Indirection variables */


/* Variables */

D indentVdfmc_debug_back_end = &KindentVdfmc_debug_back_endMM0;
D ToffsetTVdfmc_debug_back_end = &KPunboundVKi;
D Tlambdas_in_progressTVdfmc_debug_back_end = &KPunboundVKi;

/* Objects */

_KLsimple_methodGVKe Kprint_objectYprintVioMdfmc_debug_back_endM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K19,
  &Kprint_objectYprintVioMdfmc_debug_back_endM0I
};

_KLsimple_methodGVKe Kprint_objectYprintVioMdfmc_debug_back_endM1 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K15,
  &Kprint_objectYprintVioMdfmc_debug_back_endM1I
};

_KLsimple_methodGVKe KindentVdfmc_debug_back_endMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K11,
  &KindentVdfmc_debug_back_endMM0I
};

static _KLbyte_stringGVKd_2 K10 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 9,
  "  "
};

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

static _KLsimple_object_vectorGVKd_2 K12 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &KLobjectGVKd,
  &KLintegerGVKd
};

static _KLsimple_typechecked_cache_header_engine_nodeGVKg K13 = {
  &KLsimple_typechecked_cache_header_engine_nodeGVKgW /* wrapper */,
  (D) 131129,
  &KPfalseVKi,
  &cache_header_engine_3,
  &RSINGULAR_Labsent_engine_nodeG,
  &KformatYformatVio
};

static _KLbyte_stringGVKd_7 K14 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 29,
  "{%= %=}"
};

static _KLsignatureGVKe K15 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 41943049,
  &K16
};

static _KLsimple_object_vectorGVKd_2 K16 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &KLBengine_node_epGVdfmc_modeling,
  &KLstreamGYcommon_extensionsVcommon_dylan
};

static _KLsimple_typechecked_cache_header_engine_nodeGVKg K17 = {
  &KLsimple_typechecked_cache_header_engine_nodeGVKgW /* wrapper */,
  (D) 131129,
  &KPfalseVKi,
  &cache_header_engine_3,
  &RSINGULAR_Labsent_engine_nodeG,
  &KformatYformatVio
};

static _KLbyte_stringGVKd_10 K18 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 41,
  "(iep of)%="
};

static _KLsignatureGVKe K19 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 41943049,
  &K20
};

static _KLsimple_object_vectorGVKd_2 K20 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &KLBiepGVdfmc_modeling,
  &KLstreamGYcommon_extensionsVcommon_dylan
};

/* Code */

D Kprint_objectYprintVioMdfmc_debug_back_endM0I (D o_, D stream_) {
  D T3;
  _KLsimple_object_vectorGVKd_1 T4 = {&KLsimple_object_vectorGVKdW, (D) 5};
  D T5;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:23
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:24
  CONGRUENT_CALL_PROLOG(&KfunctionVdfmc_modeling, 1);
  T3 = CONGRUENT_CALL1(o_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:24
  T4.vector_element_[0] = T3;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:24
  ENGINE_NODE_CALL_PROLOG(&KformatYformatVio, &K17, 3);
  T5 = ENGINE_NODE_CALL3(&K17, stream_, &K18, &T4);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:23
  MV_SET_COUNT(0);
  return(T5);
}

D Kprint_objectYprintVioMdfmc_debug_back_endM1I (D o_, D stream_) {
  D T3;
  D T4;
  D T5;
  _KLsimple_object_vectorGVKd_2 T6 = {&KLsimple_object_vectorGVKdW, (D) 9};
  D T7;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:77
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:78
  T3 = Kobject_classVKdI(o_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:78
  CONGRUENT_CALL_PROLOG(&Kdebug_nameVKe, 1);
  T4 = CONGRUENT_CALL1(T3);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:78
  CONGRUENT_CALL_PROLOG(&KCentry_point_nameVdfmc_modeling, 1);
  T5 = CONGRUENT_CALL1(o_);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:78
  T6.vector_element_[0] = T4;
  T6.vector_element_[1] = T5;
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:78
  ENGINE_NODE_CALL_PROLOG(&KformatYformatVio, &K13, 3);
  T7 = ENGINE_NODE_CALL3(&K13, stream_, &K14, &T6);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:77
  MV_SET_COUNT(0);
  return(T7);
}

D KindentVdfmc_debug_back_endMM0I (D stream_, D offset_) {
  DWORD i_T, i_;
  D T4;
  DWORD T5;
  D T6;
  DWORD T7;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:12
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
  i_T = 1;
L0: ;
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
    i_ = i_T;
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
    T5 = primitive_cast_integer_as_raw(offset_);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
    T6 = primitive_machine_word_less_thanQ(i_,T5);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
    if (T6 != &KPfalseVKi) {
      // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:14
      CALL2(&KformatYformatVio, stream_, &K10);
      // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
      T7 = primitive_machine_word_add_signal_overflow(i_,4);
      // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
      i_T = T7;
      goto L0;
    }
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
    T4 = &KPfalseVKi;
    MV_SET_ELT(0, &KPfalseVKi);
    MV_SET_COUNT(1);
    // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:13
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:12
  return(T4);
}


/* SYSTEM INIT CODE */

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

/* USER INIT CODE */

void _Init_dfmc_debug_back_end__X_debug_for_user () {
{
  D T0;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:10
  ToffsetTVdfmc_debug_back_end = primitive_allocate_thread_variable((D) 1);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:10
  T0 = &KPfalseVKi;
  goto I0;
}
I0:

{
  D T0;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:21
  Tlambdas_in_progressTVdfmc_debug_back_end = primitive_allocate_thread_variable(&KPempty_listVKi);
  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:21
  T0 = &KPfalseVKi;
  goto I1;
}
I1:

{
  D T0;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:23
  T0 = KPadd_methodVKnI(&Kprint_objectYprintVio, &Kprint_objectYprintVioMdfmc_debug_back_endM0, &Kdfmc_debug_back_end_libraryYdylan_userVdfmc_debug_back_end);
  goto I4;
}
I4:

{
  D T0;

  // /Users/bruce/Development/dylan/opendylan/sources/dfmc/debug-back-end/debug.dylan:77
  T0 = KPadd_methodVKnI(&Kprint_objectYprintVio, &Kprint_objectYprintVioMdfmc_debug_back_endM1, &Kdfmc_debug_back_end_libraryYdylan_userVdfmc_debug_back_end);
  goto I7;
}
I7:

  return;
}


/* eof */
