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

#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(256);
define__KLsimple_object_vectorGVKd(1);
define__KLsimple_object_vectorGVKd(2);

typedef struct {
  dylan_value wrapper;
  dylan_value head_;
  dylan_value tail_;
} _KLempty_listGVKd;

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


/* 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 _KLincremental_generic_functionGVKe Kdebug_nameVKe;
extern _KLfunction_classGVKi KLincremental_generic_functionGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLincremental_generic_functionGVKeW;
extern _KLincremental_generic_functionGVKe Kcopy_sequenceVKd;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLclassGVKd KLsignatureGVKe;
extern _KLmm_wrapperGVKi_0 KLsignatureGVKeW;
extern _KLsimple_object_vectorGVKd_2 KDsignature_LclassG_typesVKi;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
dylan_value KerrorVKdMM1I (dylan_value, dylan_value);
extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLsimple_object_vectorGVKd_256 KDsignature_LobjectG_typesVKi;

/* Defined object declarations */

extern _KLsimple_methodGVKe Klocate_variableVvariable_searchMM0;
dylan_value Klocate_variableVvariable_searchMM0I (dylan_value);
extern _KLsimple_methodGVKe Klocate_variableVvariable_searchMM1;
dylan_value Klocate_variableVvariable_searchMM1I (dylan_value);
static _KLsignatureGVKe K4;
static _KLbyte_stringGVKd_42 K5;
static _KLsignatureGVKe K6;

/* Indirection variables */


/* Variables */


/* Objects */

_KLsimple_methodGVKe Klocate_variableVvariable_searchMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K6,
  &Klocate_variableVvariable_searchMM0I
};

_KLsimple_methodGVKe Klocate_variableVvariable_searchMM1 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K4,
  &Klocate_variableVvariable_searchMM1I
};

static _KLsignatureGVKe K4 = {
  &KLsignatureGVKeW /* wrapper */,
  (dylan_value) 41946117,
  &KDsignature_LclassG_typesVKi
};

static _KLbyte_stringGVKd_42 K5 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (dylan_value) 169,
  "Failed to locate a variable binding for %="
};

static _KLsignatureGVKe K6 = {
  &KLsignatureGVKeW /* wrapper */,
  (dylan_value) 41946117,
  &KDsignature_LobjectG_typesVKi
};

/* Code */

dylan_value Klocate_variableVvariable_searchMM0I (dylan_value o_) {
  _KLsimple_object_vectorGVKd_1 T2 = {&KLsimple_object_vectorGVKdW, (dylan_value) 5};
  dylan_value T3_0;
  dylan_value T3_1;
  dylan_value T3_2;

  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:7
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:9
  T2.vector_element_[0] = o_;
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:9
  T3_0 = KerrorVKdMM1I(&K5, &T2);
  T3_1 = MV_GET_ELT(1);
  T3_2 = MV_GET_ELT(2);
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:7
  MV_SET_ELT(1, T3_1);
  MV_SET_ELT(2, T3_2);
  MV_SET_COUNT(3);
  return(T3_0);
}

dylan_value Klocate_variableVvariable_searchMM1I (dylan_value o_) {
  dylan_value T2;
  dylan_value variable_name_;
  dylan_value T4;
  dylan_value T5;
  dylan_value T6;
  dylan_value T7;
  dylan_value T8_0;
  dylan_value T8_1;
  dylan_value T8_2;

  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:12
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:14
  CONGRUENT_CALL_PROLOG(&Kdebug_nameVKe, 1);
  T2 = CONGRUENT_CALL1(o_);
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:14
  variable_name_ = CALL1(&Kcopy_sequenceVKd, T2);
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:15
  T4 = SLOT_VALUE_INITD(o_, 4);
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:16
  T5 = SLOT_VALUE_INITD(T4, 0);
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:17
  T6 = SLOT_VALUE_INITD(T4, 1);
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:18
  T7 = SLOT_VALUE_INITD(T6, 0);
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:19
  T8_0 = variable_name_;
  T8_1 = T5;
  T8_2 = T7;
  // /home/bruce/Development/dylan/opendylan/sources/lib/variable-search/locate-variable.dylan:12
  MV_SET_ELT(1, T8_1);
  MV_SET_ELT(2, T8_2);
  MV_SET_COUNT(3);
  return(T8_0);
}


/* SYSTEM INIT CODE */

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

/* USER INIT CODE */

void _Init_variable_search__X_locate_variable_for_user () {
  return;
}


/* eof */
