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

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

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_;
  dylan_value signature_values_;
} _KLsignatureAvaluesGVKi;

#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(16);


/* 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 _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLclassGVKd KLsignatureAvaluesGVKi;
extern _KLmm_wrapperGVKi_0 KLsignatureAvaluesGVKiW;
extern _KLsimple_object_vectorGVKd_16 KDsignature_Lmachine_wordG_typesVKi;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
extern _KLsimple_object_vectorGVKd_16 KDsignature_LintegerG_typesVKi;

/* Defined object declarations */

extern _KLsimple_methodGVKe Kcoerce_machine_word_to_integerVKm;
dylan_value Kcoerce_machine_word_to_integerVKmI (dylan_value x_);
static _KLsignatureAvaluesGVKi K2;

/* Indirection variables */


/* Variables */

dylan_value coerce_machine_word_to_integerVKm = &Kcoerce_machine_word_to_integerVKm;

/* Objects */

_KLsimple_methodGVKe Kcoerce_machine_word_to_integerVKm = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K2,
  &Kcoerce_machine_word_to_integerVKmI
};

static _KLsignatureAvaluesGVKi K2 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (dylan_value) 33555461,
  &KDsignature_Lmachine_wordG_typesVKi,
  &KDsignature_LintegerG_typesVKi
};

/* Code */

dylan_value Kcoerce_machine_word_to_integerVKmI (dylan_value x_) {
  DWORD raw_x_;
  DWORD T3;
  DWORD T4;
  dylan_value T5;
  dylan_value T6_0;

  // /home/bruce/Development/dylan/opendylan/sources/dylan/conversion-tagged-integer.dylan:53
  // /home/bruce/Development/dylan/opendylan/sources/dylan/conversion-tagged-integer.dylan:57
  raw_x_ = primitive_unwrap_machine_word(x_);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/conversion-tagged-integer.dylan:60
  T3 = primitive_machine_word_shift_left_signal_overflow(raw_x_,2);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/conversion-tagged-integer.dylan:62
  T4 = primitive_machine_word_logior(T3,1);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/conversion-tagged-integer.dylan:62
  T5 = primitive_cast_raw_as_integer(T4);
  // /home/bruce/Development/dylan/opendylan/sources/dylan/conversion-tagged-integer.dylan:62
  T6_0 = T5;
  // /home/bruce/Development/dylan/opendylan/sources/dylan/conversion-tagged-integer.dylan:53
  MV_SET_COUNT(1);
  return(T6_0);
}


/* SYSTEM INIT CODE */

void _Init_dylan__X_conversion_tagged_integer_for_system () {
  extern dylan_value KPresolve_symbolVKiI(dylan_value);
  return;
}

/* USER INIT CODE */

void _Init_dylan__X_conversion_tagged_integer_for_user () {
  return;
}


/* eof */
