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

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

typedef struct {
  D wrapper;
  D mangler_;
  D cg_variables_;
  D registers_;
  D variables_;
} _KLharp_x86_back_endGVharp_x86;

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;


/* 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_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 _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
extern _KLclassGVKd KLharp_x86_back_endGVharp_x86;
extern _KLmm_wrapperGVKi_0 KLharp_x86_back_endGVharp_x86W;
extern _KLclassGVKd KLopGYharp_opVharp;
extern _KLmm_wrapperGVKi_0 KLopGYharp_opVharpW;
extern D pentium_instructionsVharp_x86;
extern D reg__stackVharp_x86;

/* Defined object declarations */

static _KLsimple_closure_methodGVKi_0 K9;
static D K9I (D, D);
static _KLsimple_closure_methodGVKi_0 K6;
static D K6I (D, D);
static _KLsignatureGVKe K7;
static _KLsimple_object_vectorGVKd_2 K8;

/* Indirection variables */


/* Variables */


/* Objects */

static _KLsimple_closure_methodGVKi_0 K9 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_2,
  &K7,
  &K9I,
  (D) 1
};

static _KLsimple_closure_methodGVKi_0 K6 = {
  &KLsimple_closure_methodGVKiW /* wrapper */,
  &xep_2,
  &K7,
  &K6I,
  (D) 1
};

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

static _KLsimple_object_vectorGVKd_2 K8 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &KLharp_x86_back_endGVharp_x86,
  &KLopGYharp_opVharp
};

/* Code */

static D K9I (D a1D_, D a2D_) {
  D T3;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:16
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:16
  T3 = &KPfalseVKi;
  MV_SET_ELT(0, &KPfalseVKi);
  MV_SET_COUNT(1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:16
  return(T3);
}

static D K6I (D a1D_, D a2D_) {
  D T3;
  D T4;
  D T5;
  D T6;
  D T7;
  DWORD T8;
  DWORD T9;
  DWORD T10;
  DWORD T11;
  D T12;
  D T13;
  D T14;
  D T15;
  DWORD T16;
  DWORD T17;
  DWORD T18;
  D T19;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:22
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:24
  T4 = SLOT_VALUE(a1D_, 3);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:24
  T5 = SLOT_VALUE(T4, 25);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:25
  T6 = SLOT_VALUE_INITD(T5, 14);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:25
  T7 = SLOT_VALUE_INITD(T5, 16);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:25
  T8 = primitive_cast_integer_as_raw(T6);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:25
  T9 = primitive_cast_integer_as_raw(T7);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:25
  T10 = primitive_machine_word_logxor(T9,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:25
  T11 = primitive_machine_word_add_signal_overflow(T8,T10);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:26
  T12 = primitive_machine_word_equalQ(T11,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:26
  if (T12 == &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:27
    T13 = pentium_instructionsVharp_x86;
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:27
    T14 = SLOT_VALUE(T13, 2);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:27
    T15 = SLOT_VALUE_INITD(T14, 9);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:28
    T16 = primitive_machine_word_shift_right(T11,2);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:28
    T17 = primitive_machine_word_multiply_signal_overflow(16,T16);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:28
    T18 = primitive_machine_word_logior(T17,1);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:28
    T19 = primitive_cast_raw_as_integer(T18);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:27
    CALL5(T15, a1D_, T14, reg__stackVharp_x86, reg__stackVharp_x86, T19);
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:26
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:22
  T3 = &KPfalseVKi;
  MV_SET_ELT(0, &KPfalseVKi);
  MV_SET_COUNT(1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:22
  return(T3);
}


/* SYSTEM INIT CODE */

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

/* USER INIT CODE */

void _Init_harp_x86__X_allocate_for_user () {
{
  D instruction_set_;
  D T2;
  D T3;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:16
  instruction_set_ = pentium_instructionsVharp_x86;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:16
  T3 = SLOT_VALUE(instruction_set_, 15);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:16
  SLOT_VALUE_SETTER(&K9, T3, 9);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:16
  T2 = &KPfalseVKi;
  goto I0;
}
I0:

{
  D instruction_set_;
  D T2;
  D T3;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:22
  instruction_set_ = pentium_instructionsVharp_x86;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:22
  T3 = SLOT_VALUE(instruction_set_, 14);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:22
  SLOT_VALUE_SETTER(&K6, T3, 9);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/x86/allocate.dylan:22
  T2 = &KPfalseVKi;
  goto I3;
}
I3:

  return;
}


/* eof */
