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

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

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

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

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 xep_;
} _KLfunctionGVKd;

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

typedef struct {
  D wrapper;
  D op_name_;
  D op_properties_;
  D op_disallow_fn_;
  D op_prefer_fn_;
  D op_clash_fn_;
  D op_destroys_fn_;
  D op_c_preserved_destroys_fn_;
  D op_implicit_uses_;
  D op_spread_;
  D op_code_gen_fn_;
  D op_reverse_op_;
  D op_constant_fold_op_;
  D op_info_;
} _KLopGYharp_opVharp;

typedef struct {
  D wrapper;
} _KLintegerGVKd;

typedef struct {
  D wrapper;
} _KLregisterGYharp_registersVharp;


/* Typedefs for defined classes */


/* Referenced object declarations */

D Kruntime_referenceYnative_main_harpVharp_nativeMM0I (D);
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 _KLfunction_classGVKi KLincremental_generic_functionGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLincremental_generic_functionGVKeW;
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 Knative_main_harp_moduleYdylan_userVharp_native;
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 KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLclassGVKd KLsignatureGVKe;
extern _KLmm_wrapperGVKi_0 KLsignatureGVKeW;
extern _KLclassGVKd KLharp_native_back_endGYnative_back_endVharp_native;
extern _KLmm_wrapperGVKi_0 KLharp_native_back_endGYnative_back_endVharp_nativeW;
extern _KLclassGVKd KLpairGVKd;
extern _KLmm_wrapperGVKi_0 KLpairGVKdW;
extern _KLincremental_generic_functionGVKe KinstructionsYbase_harpVharp;
extern _KLsealed_generic_functionGVKe Kharp_callYnative_instructionsVharp_native;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLsealed_generic_functionGVKe Kop_code_gen_fnYharp_opVharp;
extern _KLclassGVKd KLfunctionGVKd;
extern _KLmm_wrapperGVKi_0 KLfunctionGVKdW;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLincremental_generic_functionGVKe Kharp_warningYbase_harpVharp;
D Kreturn_address_sizeYnative_main_harpVharp_nativeMM0I (D);
extern _KLclassGVKd KLopGYharp_opVharp;
extern _KLmm_wrapperGVKi_0 KLopGYharp_opVharpW;
extern _KLclassGVKd KLintegerGVKd;
extern _KLmm_wrapperGVKi_0 KLintegerGVKdW;
extern _KLsealed_generic_functionGVKe Kharp_load_stack_arg_nYharp_instructionsVharp;
extern _KLsealed_generic_functionGVKe Kharp_subYharp_instructionsVharp;
extern _KLclassGVKd KLregisterGYharp_registersVharp;
extern _KLmm_wrapperGVKi_0 KLregisterGYharp_registersVharpW;
D Kharp_errorYbase_harpVharpMM0I (D);

/* Defined object declarations */

static _KLbyte_stringGVKd_26 K1;
extern _KLincremental_generic_functionGVKe Kcall_remove_optionalsYnative_main_harpVharp_native;
extern _KLsimple_methodGVKe Kcall_remove_optionalsYnative_main_harpVharp_nativeMM0;
D Kcall_remove_optionalsYnative_main_harpVharp_nativeMM0I (D);
static _KLpairGVKd K5;
static _KLsignatureGVKe K6;
static _KLbyte_stringGVKd_21 K7;
static _KLsimple_object_vectorGVKd_1 K8;
extern _KLsimple_methodGVKe Koperate_on_stack_argYnative_main_harpVharp_nativeMM0;
D Koperate_on_stack_argYnative_main_harpVharp_nativeMM0I (D, D, D, D, D);
static _KLbyte_stringGVKd_16 K11;
static _KLsignatureGVKe K12;
static _KLsimple_object_vectorGVKd_5 K13;
extern _KLsimple_methodGVKe Kfind_size_for_stack_pointer_adjustYnative_main_harpVharp_nativeMM0;
D Kfind_size_for_stack_pointer_adjustYnative_main_harpVharp_nativeMM0I (D, D, D);
static _KLsignatureGVKe K16;
static _KLsimple_object_vectorGVKd_3 K17;
extern _KLsimple_methodGVKe Kcheck_for_valid_stack_adjustYnative_main_harpVharp_nativeMM0;
D Kcheck_for_valid_stack_adjustYnative_main_harpVharp_nativeMM0I (D, D);
static _KLbyte_stringGVKd_58 K20;
static _KLsignatureGVKe K21;
static _KLsimple_object_vectorGVKd_2 K22;

/* Indirection variables */


/* Variables */

D check_for_valid_stack_adjustYnative_main_harpVharp_native = &Kcheck_for_valid_stack_adjustYnative_main_harpVharp_nativeMM0;
D find_size_for_stack_pointer_adjustYnative_main_harpVharp_native = &Kfind_size_for_stack_pointer_adjustYnative_main_harpVharp_nativeMM0;
D operate_on_stack_argYnative_main_harpVharp_native = &Koperate_on_stack_argYnative_main_harpVharp_nativeMM0;
D remove_optionals_runtimeYnative_main_harpVharp_native = &KPunboundVKi;
D call_remove_optionalsYnative_main_harpVharp_native = &Kcall_remove_optionalsYnative_main_harpVharp_native;

/* Objects */

static _KLbyte_stringGVKd_26 K1 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 105,
  "primitive_remove_optionals"
};

_KLincremental_generic_functionGVKe Kcall_remove_optionalsYnative_main_harpVharp_native = {
  &KLincremental_generic_functionGVKeW /* wrapper */,
  &gf_xep_1,
  &K6,
  &KPfalseVKi,
  &K7,
  &K5,
  &RSINGULAR_Labsent_engine_nodeG,
  &Knative_main_harp_moduleYdylan_userVharp_native,
  &KPfalseVKi,
  &KPempty_vectorVKi,
  (D) 25
};

_KLsimple_methodGVKe Kcall_remove_optionalsYnative_main_harpVharp_nativeMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K6,
  &Kcall_remove_optionalsYnative_main_harpVharp_nativeMM0I
};

static _KLpairGVKd K5 = {
  &KLpairGVKdW /* wrapper */,
  &Kcall_remove_optionalsYnative_main_harpVharp_nativeMM0,
  &KPempty_listVKi
};

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

static _KLbyte_stringGVKd_21 K7 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 85,
  "call-remove-optionals"
};

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

_KLsimple_methodGVKe Koperate_on_stack_argYnative_main_harpVharp_nativeMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_5,
  &K12,
  &Koperate_on_stack_argYnative_main_harpVharp_nativeMM0I
};

static _KLbyte_stringGVKd_16 K11 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 65,
  "with-stack wrong"
};

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

static _KLsimple_object_vectorGVKd_5 K13 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 21,
  &KLharp_native_back_endGYnative_back_endVharp_native,
  &KLopGYharp_opVharp,
  &KLobjectGVKd,
  &KLintegerGVKd,
  &KLobjectGVKd
};

_KLsimple_methodGVKe Kfind_size_for_stack_pointer_adjustYnative_main_harpVharp_nativeMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_3,
  &K16,
  &Kfind_size_for_stack_pointer_adjustYnative_main_harpVharp_nativeMM0I
};

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

static _KLsimple_object_vectorGVKd_3 K17 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 13,
  &KLharp_native_back_endGYnative_back_endVharp_native,
  &KLregisterGYharp_registersVharp,
  &KLintegerGVKd
};

_KLsimple_methodGVKe Kcheck_for_valid_stack_adjustYnative_main_harpVharp_nativeMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K21,
  &Kcheck_for_valid_stack_adjustYnative_main_harpVharp_nativeMM0I
};

static _KLbyte_stringGVKd_58 K20 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 233,
  "Invalid attempt to adjust stack by %= when stack state ~s."
};

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

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

/* Code */

D Kcall_remove_optionalsYnative_main_harpVharp_nativeMM0I (D be_) {
  D DinstructionsD_;
  D DopD_;
  D T4;
  D T5;
  D T6;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:181
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:183
  CONGRUENT_CALL_PROLOG(&KinstructionsYbase_harpVharp, 1);
  DinstructionsD_ = CONGRUENT_CALL1(be_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:183
  DopD_ = CALL1(&Kharp_callYnative_instructionsVharp_native, DinstructionsD_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:183
  T4 = CALL1(&Kop_code_gen_fnYharp_opVharp, DopD_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:183
  primitive_type_check(T4, &KLfunctionGVKd);
  T5 = T4;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:183
  T6 = CALL4(T5, be_, DopD_, remove_optionals_runtimeYnative_main_harpVharp_native, (D) 1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:181
  MV_SET_COUNT(0);
  return(T6);
}

D Koperate_on_stack_argYnative_main_harpVharp_nativeMM0I (D be_, D op_, D dest_, D n_, D stackQ_) {
  D T6;
  D T7;
  D T8;
  D T9;
  D T10;
  D T11;
  D T12;
  D T13;
  D T14;
  D T15;
  _KLsimple_object_vectorGVKd_1 T16 = {&KLsimple_object_vectorGVKdW, (D) 5};
  D T17;
  D T18;
  D T19;
  DWORD T20;
  DWORD T21;
  DWORD T22;
  DWORD T23;
  DWORD T24;
  DWORD T25;
  D T26;
  D T27;
  D T28;
  D T29;
  DWORD T30;
  DWORD T31;
  DWORD T32;
  DWORD T33;
  DWORD T34;
  DWORD T35;
  DWORD T36;
  D T37;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:114
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:116
  T11 = SLOT_VALUE(be_, 3);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:116
  T12 = SLOT_VALUE_INITD(T11, 17);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:117
  T13 = primitive_idQ(stackQ_,T12);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:117
  if (T13 != &KPfalseVKi) {
    T6 = T13;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:117
    T14 = SLOT_VALUE(be_, 3);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:117
    T15 = SLOT_VALUE_INITD(T14, 27);
    T6 = T15;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:117
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:117
  if (T6 == &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:118
    T16.vector_element_[0] = &K11;
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:118
    CONGRUENT_CALL_PROLOG(&Kharp_warningYbase_harpVharp, 2);
    CONGRUENT_CALL2(be_, &T16);
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:117
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:120
  if (T12 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T17 = SLOT_VALUE_INITD(op_, 9);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T18 = SLOT_VALUE(be_, 2);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T19 = SLOT_VALUE_INITD(T18, 0);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T20 = primitive_cast_integer_as_raw(n_);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T21 = primitive_machine_word_logxor(T20,1);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T22 = primitive_machine_word_add_signal_overflow(9,T21);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T23 = primitive_machine_word_shift_right(T22,2);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T24 = primitive_machine_word_multiply_signal_overflow(16,T23);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T25 = primitive_machine_word_logior(T24,1);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T26 = primitive_cast_raw_as_integer(T25);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:121
    T7 = CALL5(T17, be_, op_, dest_, T19, T26);
    T10 = T7;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T27 = SLOT_VALUE_INITD(op_, 9);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T28 = SLOT_VALUE(be_, 2);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T29 = SLOT_VALUE_INITD(T28, 1);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T8 = Kreturn_address_sizeYnative_main_harpVharp_nativeMM0I(be_);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T30 = primitive_cast_integer_as_raw(T8);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T31 = primitive_cast_integer_as_raw(n_);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T32 = primitive_machine_word_logxor(T31,1);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T33 = primitive_machine_word_add_signal_overflow(T30,T32);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T34 = primitive_machine_word_shift_right(T33,2);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T35 = primitive_machine_word_multiply_signal_overflow(16,T34);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T36 = primitive_machine_word_logior(T35,1);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T37 = primitive_cast_raw_as_integer(T36);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:123
    T9 = CALL5(T27, be_, op_, dest_, T29, T37);
    T10 = T9;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:120
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:114
  MV_SET_COUNT(0);
  return(T10);
}

D Kfind_size_for_stack_pointer_adjustYnative_main_harpVharp_nativeMM0I (D be_, D dest_, D count_offset_) {
  D DinstructionsDF4;
  D DopDF5;
  D T6;
  D T7;
  D DinstructionsDF8;
  D DopDF9;
  D T10;
  D T11;
  D T12;
  D T13;
  D T14;
  DWORD T15;
  DWORD T16;
  DWORD T17;
  DWORD T18;
  D T19;
  D T20;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:189
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:192
  T15 = primitive_cast_integer_as_raw(count_offset_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:192
  T16 = primitive_machine_word_logxor(T15,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:192
  T17 = primitive_machine_word_multiply_signal_overflow(T16,4);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:192
  T18 = primitive_machine_word_logior(T17,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:192
  T19 = primitive_cast_raw_as_integer(T18);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:194
  CONGRUENT_CALL_PROLOG(&KinstructionsYbase_harpVharp, 1);
  DinstructionsDF4 = CONGRUENT_CALL1(be_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:194
  DopDF5 = CALL1(&Kharp_load_stack_arg_nYharp_instructionsVharp, DinstructionsDF4);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:194
  T6 = CALL1(&Kop_code_gen_fnYharp_opVharp, DopDF5);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:194
  primitive_type_check(T6, &KLfunctionGVKd);
  T7 = T6;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:194
  CALL5(T7, be_, DopDF5, &KPfalseVKi, dest_, count_offset_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:196
  T20 = primitive_idQ(T19,(D) 1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:196
  if (T20 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:196
    T13 = &KPfalseVKi;
    MV_SET_ELT(0, &KPfalseVKi);
    MV_SET_COUNT(1);
    T14 = T13;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:197
    CONGRUENT_CALL_PROLOG(&KinstructionsYbase_harpVharp, 1);
    DinstructionsDF8 = CONGRUENT_CALL1(be_);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:197
    DopDF9 = CALL1(&Kharp_subYharp_instructionsVharp, DinstructionsDF8);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:197
    T10 = CALL1(&Kop_code_gen_fnYharp_opVharp, DopDF9);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:197
    primitive_type_check(T10, &KLfunctionGVKd);
    T11 = T10;
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:197
    T12 = CALL5(T11, be_, DopDF9, dest_, dest_, T19);
    T14 = T12;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:196
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:189
  return(T14);
}

D Kcheck_for_valid_stack_adjustYnative_main_harpVharp_nativeMM0I (D be_, D offset_) {
  D T3;
  D T4;
  D T5;
  D T6;
  D T7;
  D T8;
  DWORD T9;
  D T10;
  D T11;
  D T12;
  D T13;
  D T14;
  _KLsimple_object_vectorGVKd_3 T15 = {&KLsimple_object_vectorGVKdW, (D) 13};

  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:349
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
  T8 = primitive_idQ(offset_,(D) 1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
  if (T8 != &KPfalseVKi) {
    T4 = &KPfalseVKi;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
    T9 = primitive_cast_integer_as_raw(offset_);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
    T10 = primitive_machine_word_less_thanQ(T9,1);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
    if (T10 != &KPfalseVKi) {
      T3 = T10;
    } else {
      // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
      T11 = SLOT_VALUE(be_, 3);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
      T12 = SLOT_VALUE_INITD(T11, 17);
      T3 = T12;
    }
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
    T4 = T3;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
  if (T4 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:353
    T13 = SLOT_VALUE(be_, 3);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:353
    T14 = SLOT_VALUE_INITD(T13, 17);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:352
    T15.vector_element_[0] = &K20;
    T15.vector_element_[1] = offset_;
    T15.vector_element_[2] = T14;
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:352
    T5 = Kharp_errorYbase_harpVharpMM0I(&T15);
    T7 = T5;
  } else {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
    T6 = &KPfalseVKi;
    MV_SET_ELT(0, &KPfalseVKi);
    MV_SET_COUNT(1);
    T7 = T6;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:351
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:349
  return(T7);
}


/* SYSTEM INIT CODE */

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

/* USER INIT CODE */

void _Init_harp_native__X_save_res_for_user () {
{
  D T0;
  D T1;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:136
  T0 = Kruntime_referenceYnative_main_harpVharp_nativeMM0I(&K1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:135
  remove_optionals_runtimeYnative_main_harpVharp_native = T0;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/native/save-res.dylan:135
  T1 = &KPfalseVKi;
  goto I0;
}
I0:

  return;
}


/* eof */
