#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(3);
define__KLsimple_object_vectorGVKd(1);
define__KLsimple_object_vectorGVKd(2);
define__KLsimple_object_vectorGVKd(256);
define__KLsimple_object_vectorGVKd(8);
define__KLsimple_object_vectorGVKd(0);

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

typedef struct {
  dylan_value wrapper;
  dylan_value condition_format_string_;
  dylan_value condition_format_arguments_;
} _KLarithmetic_errorGVKe;

typedef struct {
  dylan_value wrapper;
  dylan_value handler_type_;
  dylan_value handler_function_;
  dylan_value handler_test_;
  dylan_value handler_init_arguments_;
} _KLhandlerGVKi;

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

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

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

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

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

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 stretchy_representation_;
} _KLstretchy_object_vectorGVKe;

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

typedef struct {
  dylan_value wrapper;
  dylan_value signature_properties_;
  dylan_value signature_required_;
  dylan_value 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 _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
extern _KLsymbolGVKd KJtype_;
extern _KLclassGVKd KLsymbolGVKd;
extern _KLmm_wrapperGVKi_0 KLsymbolGVKdW;
extern _KLclassGVKd KLarithmetic_errorGVKe;
extern _KLmm_wrapperGVKi_0 KLarithmetic_errorGVKeW;
extern _KLsymbolGVKd KJfunction_;
extern _KLsymbolGVKd KJtest_;
extern _KLsymbolGVKd KJinit_arguments_;
extern _KLsimple_object_vectorGVKd_0 KPempty_vectorVKi;
dylan_value KLhandlerGZ32ZconstructorVKiMM0I (dylan_value, dylan_value, dylan_value, dylan_value, dylan_value, dylan_value);
extern _KLclassGVKd KLhandlerGVKi;
extern _KLmm_wrapperGVKi_0 KLhandlerGVKiW;
extern _KLmm_wrapperGVKi_0 KLpairGVKdW;
extern _KLfunction_classGVKi KLsimple_closure_methodGVKi;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLsimple_closure_methodGVKiW;
extern _KLclassGVKd KLsignatureGVKe;
extern _KLmm_wrapperGVKi_0 KLsignatureGVKeW;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLfunction_classGVKi KLkeyword_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLkeyword_methodGVKeW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLclassGVKd KLkeyword_signatureGVKe;
extern _KLmm_wrapperGVKi_0 KLkeyword_signatureGVKeW;
extern _KLsimple_object_vectorGVKd_256 KDsignature_LobjectG_typesVKi;
dylan_value KLstretchy_object_vectorGZ32ZconstructorVKiMM0I (dylan_value, dylan_value);
extern _KLclassGVKd KLstretchy_object_vectorGVKe;
extern _KLmm_wrapperGVKi_0 KLstretchy_object_vectorGVKeW;
dylan_value Kdrain_finalization_queueYfinalizationVdylanI ();
dylan_value KelementVKdMM3I (dylan_value, dylan_value, dylan_value, dylan_value);
extern _KLsealed_generic_functionGVKe Kunsupplied_objectVKi;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
dylan_value Kelement_setterVKdMM11I (dylan_value, dylan_value, dylan_value);
extern _KLclassGVKd KLsignatureAvaluesGVKi;
extern _KLmm_wrapperGVKi_0 KLsignatureAvaluesGVKiW;
extern _KLsimple_object_vectorGVKd_2 KDsignature_Lstretchy_object_vectorG_typesVKi;
extern dylan_value Tcurrent_handlersTVKi;

/* Defined object declarations */

dylan_value Kcollect_garbageVmemory_managerMM0I (dylan_value, dylan_value);
dylan_value KroomVmemory_managerMM0I ();
static _KLsimple_closure_methodGVKi_0 KUhandler_functionUF4;
static dylan_value KUhandler_functionUF4I (dylan_value, dylan_value);
static _KLsignatureGVKe K5;
static _KLsimple_object_vectorGVKd_2 K6;
extern _KLsimple_methodGVKe KroomVmemory_managerMM0;
static _KLsignatureGVKe K8;
extern _KLkeyword_methodGVKe Kcollect_garbageVmemory_managerMM0;
static _KLkeyword_signatureGVKe K10;
static _KLsimple_object_vectorGVKd_2 K11;
static _KLsymbolGVKd KJprint_statsQ_;
static _KLbyte_stringGVKd_12 K13;
static _KLsimple_object_vectorGVKd_1 K14;
extern _KLsimple_methodGVKe Kmark_garbageVmemory_managerMM0;
dylan_value Kmark_garbageVmemory_managerMM0I ();
extern _KLsimple_methodGVKe Kblock_promotionVmemory_managerMM0;
dylan_value Kblock_promotionVmemory_managerMM0I ();
extern _KLsimple_methodGVKe Kgarbage_collection_statsVmemory_managerMM0;
dylan_value Kgarbage_collection_statsVmemory_managerMM0I ();
static _KLsimple_object_vectorGVKd_3 K21;
static _KLsignatureAvaluesGVKi K22;
extern _KLsimple_methodGVKe Kenable_gc_messagesVmemory_managerMM0;
dylan_value Kenable_gc_messagesVmemory_managerMM0I ();
static _KLsignatureGVKe K25;

/* Indirection variables */

static dylan_value IKJprint_statsQ_ = &KJprint_statsQ_;

/* Variables */

dylan_value enable_gc_messagesVmemory_manager = &Kenable_gc_messagesVmemory_managerMM0;
dylan_value garbage_collection_statsVmemory_manager = &Kgarbage_collection_statsVmemory_managerMM0;
dylan_value block_promotionVmemory_manager = &Kblock_promotionVmemory_managerMM0;
dylan_value mark_garbageVmemory_manager = &Kmark_garbageVmemory_managerMM0;
dylan_value collect_garbageVmemory_manager = &Kcollect_garbageVmemory_managerMM0;
dylan_value roomVmemory_manager = &KroomVmemory_managerMM0;
dylan_value stats_bufferVmemory_manager = &K21;

/* Objects */

static _KLsimple_closure_methodGVKi_0 KUhandler_functionUF4 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_2,
  &K5,
  &KUhandler_functionUF4I,
  (dylan_value) 1
};

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

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

_KLsimple_methodGVKe KroomVmemory_managerMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_0,
  &K8,
  &KroomVmemory_managerMM0I
};

static _KLsignatureGVKe K8 = {
  &KLsignatureGVKeW /* wrapper */,
  (dylan_value) 44040193,
  &KPempty_vectorVKi
};

_KLkeyword_methodGVKe Kcollect_garbageVmemory_managerMM0 = {
  &KLkeyword_methodGVKeW /* wrapper */,
  &rest_key_xep_2,
  &K10,
  &key_mep_2,
  &Kcollect_garbageVmemory_managerMM0I,
  &K11
};

static _KLkeyword_signatureGVKe K10 = {
  &KLkeyword_signatureGVKeW /* wrapper */,
  (dylan_value) 44302337,
  &KPempty_vectorVKi,
  &K14,
  &KDsignature_LobjectG_typesVKi
};

static _KLsimple_object_vectorGVKd_2 K11 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (dylan_value) 9,
  &KJprint_statsQ_,
  &KPfalseVKi
};

static _KLsymbolGVKd KJprint_statsQ_ = {
  &KLsymbolGVKdW /* wrapper */,
  &K13
};

static _KLbyte_stringGVKd_12 K13 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (dylan_value) 49,
  "print-stats?"
};

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

_KLsimple_methodGVKe Kmark_garbageVmemory_managerMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_0,
  &K8,
  &Kmark_garbageVmemory_managerMM0I
};

_KLsimple_methodGVKe Kblock_promotionVmemory_managerMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_0,
  &K8,
  &Kblock_promotionVmemory_managerMM0I
};

_KLsimple_methodGVKe Kgarbage_collection_statsVmemory_managerMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_0,
  &K22,
  &Kgarbage_collection_statsVmemory_managerMM0I
};

static _KLsimple_object_vectorGVKd_3 K21 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (dylan_value) 13,
  &KPfalseVKi,
  &KPfalseVKi,
  &KPfalseVKi
};

static _KLsignatureAvaluesGVKi K22 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (dylan_value) 33555457,
  &KPempty_vectorVKi,
  &KDsignature_Lstretchy_object_vectorG_typesVKi
};

_KLsimple_methodGVKe Kenable_gc_messagesVmemory_managerMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_0,
  &K25,
  &Kenable_gc_messagesVmemory_managerMM0I
};

static _KLsignatureGVKe K25 = {
  &KLsignatureGVKeW /* wrapper */,
  (dylan_value) 41943041,
  &KPempty_vectorVKi
};

/* Code */

dylan_value Kcollect_garbageVmemory_managerMM0I (dylan_value Urest_, dylan_value print_statsQ_) {
  DBOOL T3;
  dylan_value T4;
  dylan_value T5;
  dylan_value T6;

  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:16
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:18
  T3 = primitive_boolean_as_raw(print_statsQ_);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:18
  primitive_mps_collect(T3);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:19
  T4 = KroomVmemory_managerMM0I();
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:17
  T5 = MV_SPILL(T4);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:21
  primitive_mps_release();
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:17
  T6 = MV_UNSPILL(T5);
  T6 = T4;
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:16
  return(T6);
}

dylan_value KroomVmemory_managerMM0I () {
  volatile dylan_value Uunwind_exceptionUPexit_0_;
  volatile dylan_value T2;
  volatile dylan_value Uoriginal_handlersU_;
  volatile dylan_value T4;
  volatile dylan_value T5;
  volatile dylan_value T6;
  volatile DSINT T7;
  volatile dylan_value T8;
  volatile _KLsimple_object_vectorGVKd_8 T9 = {&KLsimple_object_vectorGVKdW, (dylan_value) 33};
  volatile dylan_value T10_0;
  volatile dylan_value T11;
  volatile dylan_value T12;
  volatile DWORD T13;
  volatile DWORD T14;
  volatile dylan_value T15;
  volatile dylan_value T16;

  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:7
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  ENTER_EXIT_FRAME(Uunwind_exceptionUPexit_0_);
  if (nlx_setjmp(FRAME_DEST(Uunwind_exceptionUPexit_0_))) {
    T8 = FRAME_RETVAL(Uunwind_exceptionUPexit_0_);
  } else {
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    Uoriginal_handlersU_ = primitive_read_thread_variable(Tcurrent_handlersTVKi);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T4 = MAKE_CLOSURE_INITD(&KUhandler_functionUF4, 2, Uoriginal_handlersU_, Uunwind_exceptionUPexit_0_);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T9.vector_element_[0] = &KJtype_;
    T9.vector_element_[1] = &KLarithmetic_errorGVKe;
    T9.vector_element_[2] = &KJfunction_;
    T9.vector_element_[3] = T4;
    T9.vector_element_[4] = &KJtest_;
    T9.vector_element_[5] = &KPfalseVKi;
    T9.vector_element_[6] = &KJinit_arguments_;
    T9.vector_element_[7] = &KPempty_vectorVKi;
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T10_0 = KLhandlerGZ32ZconstructorVKiMM0I(&KLhandlerGVKi, &T9, &KLarithmetic_errorGVKe, T4, &KPfalseVKi, &KPempty_vectorVKi);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T11 = T10_0;
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T5 = primitive_read_thread_variable(Tcurrent_handlersTVKi);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T12 = primitive_object_allocate_filled(3,&KLpairGVKdW,2,&KPunboundVKi,0,0,&KPunboundVKi);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    SLOT_VALUE_SETTER(T11, T12, 0);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    SLOT_VALUE_SETTER(T5, T12, 1);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    primitive_write_thread_variable(Tcurrent_handlersTVKi, T12);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    ENTER_UNWIND_FRAME(T6);
    if (!nlx_setjmp(FRAME_DEST(T6))) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T7 = primitive_mps_committed();
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T13 = primitive_machine_word_shift_left_signal_overflow(T7,2);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T14 = primitive_machine_word_logior(T13,1);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T15 = primitive_cast_raw_as_integer(T14);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T16 = T15;
      MV_SET_ELT(0, T15);
      MV_SET_ELT(1, (dylan_value) 1);
      MV_SET_COUNT(2);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
      FALL_THROUGH_UNWIND(T16);
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    primitive_write_thread_variable(Tcurrent_handlersTVKi, Uoriginal_handlersU_);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    CONTINUE_UNWIND();
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  T8 = T16;
    /* invalidate Uunwind_exceptionUPexit_0_ */
  }
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:7
  return(T8);
}

static dylan_value KUhandler_functionUF4I (dylan_value e_, dylan_value Unext_handlerU_) {
  dylan_value all_values_;
  dylan_value T4;
  dylan_value T5;
  dylan_value T6;
  CAPTURE_ENVIRONMENT

  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  primitive_write_thread_variable(Tcurrent_handlersTVKi, CREF(0));
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:12
  T4 = (dylan_value) 0x7FFFFFFFFFFFFFFDL;
  MV_SET_ELT(0, (dylan_value) 0x7FFFFFFFFFFFFFFDL);
  MV_SET_ELT(1, (dylan_value) 1);
  MV_SET_COUNT(2);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  all_values_ = MV_GET_REST_AT(T4, 0);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  T5 = MV_SET_REST_AT(all_values_, 0);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  T6 = NLX(CREF(1), T5);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  return(T6);
}

dylan_value Kmark_garbageVmemory_managerMM0I () {
  dylan_value T1;

  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:25
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:26
  T1 = Kcollect_garbageVmemory_managerMM0I(&KPempty_vectorVKi, &KPfalseVKi);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:25
  return(T1);
}

dylan_value Kblock_promotionVmemory_managerMM0I () {
  dylan_value T1_0;

  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:29
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:29
  T1_0 = &KPfalseVKi;
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:29
  MV_SET_COUNT(1);
  return(T1_0);
}

dylan_value Kgarbage_collection_statsVmemory_managerMM0I () {
  D T1;
  DBOOL T2;
  dylan_value T3;
  dylan_value T4_0;
  dylan_value i_;
  dylan_value T6;
  dylan_value T7;
  dylan_value T8;
  dylan_value T9;
  dylan_value T10;
  dylan_value T11_0;
  dylan_value T12;
  dylan_value T13;
  DWORD T14;
  DWORD T15;
  dylan_value T16;
  dylan_value T17;
  DWORD T18;
  DWORD T19;
  dylan_value T20;
  DWORD T21;
  DWORD T22;
  dylan_value T23;

  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:56
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:59
  T11_0 = KLstretchy_object_vectorGZ32ZconstructorVKiMM0I(&KLstretchy_object_vectorGVKe, &KPempty_vectorVKi);
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:59
  T10 = T11_0;
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:60
  i_ = (dylan_value) 1;
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:61
L0: ;
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:62
    Kdrain_finalization_queueYfinalizationVdylanI();
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:65
    T1 = primitive_vector_as_raw(stats_bufferVmemory_manager);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:64
    T2 = primitive_mps_collection_stats(T1);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:63
    T3 = primitive_raw_as_boolean(T2);
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:61
    if (T3 != &KPfalseVKi) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:68
      T12 = KelementVKdMM3I(stats_bufferVmemory_manager, (dylan_value) 1, &KPempty_vectorVKi, &Kunsupplied_objectVKi);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:68
      T9 = i_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:68
      Kelement_setterVKdMM11I(T12, T10, T9);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:69
      T13 = KelementVKdMM3I(stats_bufferVmemory_manager, (dylan_value) 5, &KPempty_vectorVKi, &Kunsupplied_objectVKi);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:69
      T8 = i_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:69
      T14 = primitive_cast_integer_as_raw(T8);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:69
      T15 = primitive_machine_word_add_signal_overflow(T14,4);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:69
      T16 = primitive_cast_raw_as_integer(T15);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:69
      Kelement_setterVKdMM11I(T13, T10, T16);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:70
      T17 = KelementVKdMM3I(stats_bufferVmemory_manager, (dylan_value) 9, &KPempty_vectorVKi, &Kunsupplied_objectVKi);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:70
      T7 = i_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:70
      T18 = primitive_cast_integer_as_raw(T7);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:70
      T19 = primitive_machine_word_add_signal_overflow(T18,8);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:70
      T20 = primitive_cast_raw_as_integer(T19);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:70
      Kelement_setterVKdMM11I(T17, T10, T20);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:71
      T6 = i_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:71
      T21 = primitive_cast_integer_as_raw(T6);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:71
      T22 = primitive_machine_word_add_signal_overflow(T21,12);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:71
      T23 = primitive_cast_raw_as_integer(T22);
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:71
      i_ = T23;
      // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:61
      goto L0;
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:61
    // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:61
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:73
  T4_0 = T10;
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:56
  MV_SET_COUNT(1);
  return(T4_0);
}

dylan_value Kenable_gc_messagesVmemory_managerMM0I () {
  dylan_value T1;

  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:76
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:77
  primitive_mps_enable_gc_messages();
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:77
  T1 = &KPfalseVKi;
  // /home/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:76
  MV_SET_COUNT(0);
  return(T1);
}


/* SYSTEM INIT CODE */

void _Init_memory_manager__X_native_memory_manager_for_system () {
  extern dylan_value KPresolve_symbolVKiI(dylan_value);
  {
    dylan_value T0;

    T0 = KPresolve_symbolVKiI(&KJprint_statsQ_);
    if (T0 != &KJprint_statsQ_) {
      primitive_repeated_slot_value_setter(T0, &K14, 1, 0);
      primitive_repeated_slot_value_setter(T0, &K11, 1, 0);
    }
  }
  return;
}

/* USER INIT CODE */

void _Init_memory_manager__X_native_memory_manager_for_user () {
  return;
}


/* eof */
