#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 head_;
  dylan_value tail_;
} _KLempty_listGVKd;

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;
  dylan_value xep_;
  dylan_value function_signature_;
  dylan_value Pgf_cache_;
  dylan_value debug_name_;
  dylan_value generic_function_methods_;
  dylan_value discriminator_;
  dylan_value incremental_gf_module_;
  dylan_value incremental_gf_domain_info_;
  dylan_value incremental_gf_method_libraries_;
  dylan_value incremental_gf_properties_;
} _KLincremental_generic_functionGVKe;

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

typedef struct {
  dylan_value wrapper;
} _KLobjectGVKd;

typedef struct {
  dylan_value wrapper;
} _KLunboundGVKe;

typedef struct {
  dylan_value wrapper;
} _KLbooleanGVKd;

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;

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

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_;
} _KLsignatureGVKe;

#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(1);
define__KLsimple_object_vectorGVKd(2);

typedef struct {
  dylan_value wrapper;
} _KLintegerGVKd;

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 users_;
  dylan_value emitted_name_;
  dylan_value function_;
  dylan_value Cengine_node_ep_properties_;
  dylan_value Cengine_node_;
} _KLBengine_node_epGVdfmc_modeling;

typedef struct {
  dylan_value wrapper;
} _KLstreamGYcommon_extensionsVcommon_dylan;

typedef struct {
  dylan_value wrapper;
  dylan_value users_;
  dylan_value emitted_name_;
  dylan_value function_;
  dylan_value 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;
dylan_value KPadd_methodVKnI (dylan_value, dylan_value, dylan_value);
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;
dylan_value Kobject_classVKdI (dylan_value);
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;
dylan_value Kprint_objectYprintVioMdfmc_debug_back_endM0I (dylan_value, dylan_value);
extern _KLsimple_methodGVKe Kprint_objectYprintVioMdfmc_debug_back_endM1;
dylan_value Kprint_objectYprintVioMdfmc_debug_back_endM1I (dylan_value, dylan_value);
extern _KLsimple_methodGVKe KindentVdfmc_debug_back_endMM0;
dylan_value KindentVdfmc_debug_back_endMM0I (dylan_value, dylan_value);
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 */

dylan_value indentVdfmc_debug_back_end = &KindentVdfmc_debug_back_endMM0;
dylan_value ToffsetTVdfmc_debug_back_end = &KPunboundVKi;
dylan_value 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 */,
  (dylan_value) 9,
  "  "
};

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

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

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

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

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

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

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

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

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

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

/* Code */

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

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

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

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

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

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

/* USER INIT CODE */

void _Init_dfmc_debug_back_end__X_debug_for_user () {
{
  dylan_value T0;

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

{
  dylan_value T0;

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

{
  dylan_value T0;

  // /home/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:

{
  dylan_value T0;

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

  return;
}


/* eof */
