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

#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(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 {
  D wrapper;
  D symbol_name_;
} _KLsymbolGVKd;

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

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

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

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

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

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

typedef struct {
  D wrapper;
  D signature_properties_;
  D signature_required_;
  D signature_keys_;
  D signature_key_types_;
} _KLkeyword_signatureGVKe;

typedef struct {
  D wrapper;
  D stretchy_representation_;
} _KLstretchy_object_vectorGVKe;

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

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 _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;
D KLhandlerGZ32ZconstructorVKiMM0I (D, D, D, D, D, D);
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;
D KLstretchy_object_vectorGZ32ZconstructorVKiMM0I (D, D);
extern _KLclassGVKd KLstretchy_object_vectorGVKe;
extern _KLmm_wrapperGVKi_0 KLstretchy_object_vectorGVKeW;
D Kdrain_finalization_queueYfinalizationVdylanI ();
D KelementVKdMM11I (D, D, D, D);
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;
D Kelement_setterVKdMM19I (D, D, D);
extern _KLclassGVKd KLsignatureAvaluesGVKi;
extern _KLmm_wrapperGVKi_0 KLsignatureAvaluesGVKiW;
extern _KLsimple_object_vectorGVKd_2 KDsignature_Lstretchy_object_vectorG_typesVKi;
extern D Tcurrent_handlersTVKi;

/* Defined object declarations */

D Kcollect_garbageVmemory_managerMM0I (D, D);
D KroomVmemory_managerMM0I ();
static _KLsimple_closure_methodGVKi_0 KUhandler_functionUF4;
static D KUhandler_functionUF4I (D, D);
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;
D Kmark_garbageVmemory_managerMM0I ();
extern _KLsimple_methodGVKe Kblock_promotionVmemory_managerMM0;
D Kblock_promotionVmemory_managerMM0I ();
extern _KLsimple_methodGVKe Kgarbage_collection_statsVmemory_managerMM0;
D Kgarbage_collection_statsVmemory_managerMM0I ();
static _KLsimple_object_vectorGVKd_3 K21;
static _KLsignatureAvaluesGVKi K22;
extern _KLsimple_methodGVKe Kenable_gc_messagesVmemory_managerMM0;
D Kenable_gc_messagesVmemory_managerMM0I ();
static _KLsignatureGVKe K25;

/* Indirection variables */

static D IKJprint_statsQ_ = &KJprint_statsQ_;

/* Variables */

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

/* Objects */

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

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

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

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

static _KLsignatureGVKe K8 = {
  &KLsignatureGVKeW /* wrapper */,
  (D) 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 */,
  (D) 44302337,
  &KPempty_vectorVKi,
  &K14,
  &KDsignature_LobjectG_typesVKi
};

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

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

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

static _KLsimple_object_vectorGVKd_1 K14 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 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 */,
  (D) 13,
  &KPfalseVKi,
  &KPfalseVKi,
  &KPfalseVKi
};

static _KLsignatureAvaluesGVKi K22 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (D) 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 */,
  (D) 41943041,
  &KPempty_vectorVKi
};

/* Code */

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

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

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

  // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:7
  // /Users/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 {
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    Uoriginal_handlersU_ = primitive_read_thread_variable(Tcurrent_handlersTVKi);
    // /Users/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_);
    // /Users/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;
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T10_0 = KLhandlerGZ32ZconstructorVKiMM0I(&KLhandlerGVKi, &T9, &KLarithmetic_errorGVKe, T4, &KPfalseVKi, &KPempty_vectorVKi);
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T11 = T10_0;
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    T5 = primitive_read_thread_variable(Tcurrent_handlersTVKi);
    // /Users/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);
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    SLOT_VALUE_SETTER(T11, T12, 0);
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    SLOT_VALUE_SETTER(T5, T12, 1);
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    primitive_write_thread_variable(Tcurrent_handlersTVKi, T12);
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    ENTER_UNWIND_FRAME(T6);
    if (!nlx_setjmp(FRAME_DEST(T6))) {
      // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T7 = primitive_mps_committed();
      // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T13 = primitive_machine_word_shift_left_signal_overflow(T7,2);
      // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T14 = primitive_machine_word_logior(T13,1);
      // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T15 = primitive_cast_raw_as_integer(T14);
      // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:9
      T16 = T15;
      MV_SET_ELT(0, T15);
      MV_SET_ELT(1, (D) 1);
      MV_SET_COUNT(2);
      // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
      FALL_THROUGH_UNWIND(T16);
    }
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    primitive_write_thread_variable(Tcurrent_handlersTVKi, Uoriginal_handlersU_);
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
    CONTINUE_UNWIND();
    // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  T8 = T16;
    /* invalidate Uunwind_exceptionUPexit_0_ */
  }
  // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:8
  // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:7
  return(T8);
}

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

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

D Kmark_garbageVmemory_managerMM0I () {
  D T1;

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

D Kblock_promotionVmemory_managerMM0I () {
  D T1_0;

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

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

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

D Kenable_gc_messagesVmemory_managerMM0I () {
  D T1;

  // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:76
  // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:77
  primitive_mps_enable_gc_messages();
  // /Users/bruce/Development/dylan/opendylan/sources/lib/memory-manager/native-memory-manager.dylan:77
  T1 = &KPfalseVKi;
  // /Users/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 D KPresolve_symbolVKiI(D);
  {
    D 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 */
