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

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

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_;
  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(2);
define__KLsimple_object_vectorGVKd(16);


/* Typedefs for defined classes */


/* Referenced object declarations */

dylan_value KCVKdMM0I (dylan_value, dylan_value);
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;
extern _KLincremental_generic_functionGVKe K_VKd;
extern _KLfunction_classGVKi KLincremental_generic_functionGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLincremental_generic_functionGVKeW;
extern _KLclassGVKd KLintegerGVKd;
extern _KLmm_wrapperGVKi_0 KLintegerGVKdW;
extern _KLincremental_generic_functionGVKe KnegativeVKd;
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 KLpairGVKd;
extern _KLmm_wrapperGVKi_0 KLpairGVKdW;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLclassGVKd KLsignatureAvaluesGVKi;
extern _KLmm_wrapperGVKi_0 KLsignatureAvaluesGVKiW;
extern _KLsimple_object_vectorGVKd_16 KDsignature_LintegerG_typesVKi;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;

/* Defined object declarations */

extern _KLsimple_methodGVKe Ktag_as_addressVdood;
dylan_value Ktag_as_addressVdoodI (dylan_value object_, dylan_value address_);
static _KLsignatureAvaluesGVKi K4;
static _KLsimple_object_vectorGVKd_2 K5;

/* Indirection variables */


/* Variables */

dylan_value Ldood_disk_addressGVdood = &KLintegerGVKd;
dylan_value Ldood_disk_pointerGVdood = &KLintegerGVKd;
dylan_value Dmax_dood_integerVdood = &KPunboundVKi;
dylan_value Dmin_dood_integerVdood = &KPunboundVKi;
dylan_value tag_as_addressVdood = &Ktag_as_addressVdood;

/* Objects */

_KLsimple_methodGVKe Ktag_as_addressVdood = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_2,
  &K4,
  &Ktag_as_addressVdoodI
};

static _KLsignatureAvaluesGVKi K4 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (dylan_value) 33555465,
  &K5,
  &KDsignature_LintegerG_typesVKi
};

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

/* Code */

dylan_value Ktag_as_addressVdoodI (dylan_value object_, dylan_value address_) {
  dylan_value T2_0;
  dylan_value T3;
  dylan_value shiftF4;
  DWORD T5;
  DWORD T6;
  DWORD mxF7;
  dylan_value T8;
  DWORD T9;
  dylan_value T10;
  dylan_value T11;
  DWORD T12;
  DWORD T13;
  DWORD T14;
  DWORD T15;
  dylan_value T16;
  DWORD T17;
  DWORD T18;
  DWORD T19;
  DWORD T20;
  dylan_value T21_0;
  DWORD T22;
  dylan_value T23;
  dylan_value shiftF24;
  DWORD T25;
  DWORD T26;
  DWORD mxF27;
  dylan_value T28;
  DWORD T29;
  dylan_value T30;
  dylan_value T31;
  DWORD T32;
  DWORD T33;
  DWORD T34;
  DWORD T35;
  dylan_value T36;
  DWORD T37;
  DWORD T38;
  DWORD T39;
  DWORD T40;
  dylan_value T41_0;
  DWORD T42;
  dylan_value T43;

  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:99
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:101
  T3 = primitive_instanceQ(object_,&KLpairGVKd);
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:101
  if (T3 != &KPfalseVKi) {
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    shiftF4 = (dylan_value) 9;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T5 = primitive_cast_integer_as_raw(address_);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T6 = primitive_machine_word_logxor(T5,1);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    mxF7 = T6;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T8 = shiftF4;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T9 = primitive_cast_integer_as_raw(T8);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T10 = primitive_machine_word_equalQ(T9,257);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    if (T10 != &KPfalseVKi) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
      shiftF4 = (dylan_value) 129;
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
      T11 = shiftF4;
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
      T12 = mxF7;
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
      T13 = primitive_cast_integer_as_raw(T11);
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
      T14 = primitive_machine_word_shift_right(T13,2);
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
      T15 = primitive_machine_word_shift_left_signal_overflow(T12,T14);
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
      mxF7 = T15;
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T16 = shiftF4;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T17 = mxF7;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T18 = primitive_cast_integer_as_raw(T16);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T19 = primitive_machine_word_shift_right(T18,2);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T20 = primitive_machine_word_shift_left_signal_overflow(T17,T19);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T22 = primitive_machine_word_logior(T20,5);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T23 = primitive_cast_raw_as_integer(T22);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:102
    T21_0 = T23;
    T2_0 = T21_0;
  } else {
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    shiftF24 = (dylan_value) 9;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T25 = primitive_cast_integer_as_raw(address_);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T26 = primitive_machine_word_logxor(T25,1);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    mxF27 = T26;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T28 = shiftF24;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T29 = primitive_cast_integer_as_raw(T28);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T30 = primitive_machine_word_equalQ(T29,257);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    if (T30 != &KPfalseVKi) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
      shiftF24 = (dylan_value) 129;
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
      T31 = shiftF24;
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
      T32 = mxF27;
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
      T33 = primitive_cast_integer_as_raw(T31);
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
      T34 = primitive_machine_word_shift_right(T33,2);
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
      T35 = primitive_machine_word_shift_left_signal_overflow(T32,T34);
      // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
      mxF27 = T35;
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T36 = shiftF24;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T37 = mxF27;
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T38 = primitive_cast_integer_as_raw(T36);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T39 = primitive_machine_word_shift_right(T38,2);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T40 = primitive_machine_word_shift_left_signal_overflow(T37,T39);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T42 = primitive_machine_word_logior(T40,1);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T43 = primitive_cast_raw_as_integer(T42);
    // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:104
    T41_0 = T43;
    T2_0 = T41_0;
  }
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:101
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:99
  MV_SET_COUNT(1);
  return(T2_0);
}


/* SYSTEM INIT CODE */

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

/* USER INIT CODE */

void _Init_dood__X_types_for_user () {
{
  dylan_value T0;
  dylan_value Dmax_dood_integer_tmp_;
  dylan_value T2;
  dylan_value T3;

  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:34
  T3 = KCVKdMM0I((dylan_value) 9, (dylan_value) 237);
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:34
  CONGRUENT_CALL_PROLOG(&K_VKd, 2);
  T0 = CONGRUENT_CALL2(T3, (dylan_value) 5);
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:33
  primitive_type_check(T0, &KLintegerGVKd);
  Dmax_dood_integer_tmp_ = T0;
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:33
  Dmax_dood_integerVdood = Dmax_dood_integer_tmp_;
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:33
  T2 = &KPfalseVKi;
  goto I0;
}
I0:

{
  dylan_value T0;
  dylan_value Dmin_dood_integer_tmp_;
  dylan_value T2;
  dylan_value T3;

  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:36
  T3 = KCVKdMM0I((dylan_value) 9, (dylan_value) 237);
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:36
  CONGRUENT_CALL_PROLOG(&KnegativeVKd, 1);
  T0 = CONGRUENT_CALL1(T3);
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:35
  primitive_type_check(T0, &KLintegerGVKd);
  Dmin_dood_integer_tmp_ = T0;
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:35
  Dmin_dood_integerVdood = Dmin_dood_integer_tmp_;
  // /home/bruce/Development/dylan/opendylan/sources/lib/dood/types.dylan:35
  T2 = &KPfalseVKi;
  goto I1;
}
I1:

  return;
}


/* eof */
