#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 namespace_name_;
  D home_library_;
} _KLmoduleGVKe;

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

typedef struct {
  D wrapper;
  D namespace_name_;
  D library_major_version_;
  D library_minor_version_;
  D library_build_count_;
  D used_libraries_;
  D all_used_libraries_;
  D runtime_module_;
  D library_defined_generics_;
  D library_number_static_dispatches_;
  D library_number_dynamic_dispatches_;
} _KLlibraryGVKe;

#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(3);
define__KLsimple_object_vectorGVKd(8);
define__KLsimple_object_vectorGVKd(0);

typedef struct {
  D wrapper;
  D library_major_version_;
  D library_minor_version_;
  D library_build_count_;
  D used_library_;
  D used_library_binding_;
} _KLused_libraryGVKe;

typedef struct {
  D wrapper;
  D symbol_name_;
} _KLsymbolGVKd;

typedef struct {
  D wrapper;
  D actual_section_;
  D import_fixups_;
  D id_import_fixups_;
} _KLsection_with_fixupsGVbinary_builder;

typedef struct {
  D wrapper;
  D binary_file_;
  D current_section_;
  D debug_section_;
  D code_section_;
  D init_code_section_;
  D elf_init_code_section_;
  D elf_fini_code_section_;
  D directives_section_;
  D optional_data_section_;
  D optional_vars_section_;
  D optional_objs_section_;
  D optional_untraced_objs_section_;
  D optional_untraced_data_section_;
  D destination_;
  D def_file_;
  D source_file_;
  D current_fixups_;
  D id_current_fixups_;
  D dynamic_linkingQ_;
} _KLbinary_builderGVbinary_builder;

typedef struct {
  D wrapper;
  D dynamic_offsets_;
  D dynamic_positions_;
} _KLdynamic_fixupsGVbinary_builder;


/* Typedefs for defined classes */


/* Referenced object declarations */

D Kinitialize_class_dispatch_keys_vectoredVKgI (D);
D KPlibrary_version_checkVKeI (D, 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 _KLclassGVKd KLmoduleGVKe;
extern _KLmm_wrapperGVKi_0 KLmoduleGVKeW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLclassGVKd KLlibraryGVKe;
extern _KLmm_wrapperGVKi_0 KLlibraryGVKeW;
extern _KLsimple_object_vectorGVKd_0 KPempty_vectorVKi;
extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
extern _KLclassGVKd KLused_libraryGVKe;
extern _KLmm_wrapperGVKi_0 KLused_libraryGVKeW;
extern _KLlibraryGVKe Kdylan_libraryYdylan_userVdylan;
extern _KLclassGVKd KLsymbolGVKd;
extern _KLmm_wrapperGVKi_0 KLsymbolGVKdW;
extern _KLlibraryGVKe Kcommon_dylan_libraryYdylan_userVcommon_dylan;
extern _KLlibraryGVKe Kgeneric_arithmetic_libraryYdylan_userVgeneric_arithmetic;
extern _KLlibraryGVKe Kbig_integers_libraryYdylan_userVbig_integers;
extern _KLlibraryGVKe Kcollections_libraryYdylan_userVcollections;
extern _KLlibraryGVKe Kio_libraryYdylan_userVio;
extern _KLlibraryGVKe Ksystem_libraryYdylan_userVsystem;
extern _KLlibraryGVKe Kbinary_manager_libraryYdylan_userVbinary_manager;
extern _KLclassGVKd KLsection_with_fixupsGVbinary_builder;
extern _KLclassGVKd KLbinary_builderGVbinary_builder;
extern _KLclassGVKd KLdynamic_fixupsGVbinary_builder;

/* Defined object declarations */

extern _KLlibraryGVKe Kbinary_builder_libraryYdylan_userVbinary_builder;
extern _KLmoduleGVKe Kbinary_builder_moduleYdylan_userVbinary_builder;
static _KLbyte_stringGVKd_14 K5;
static _KLsimple_object_vectorGVKd_8 K6;
static _KLused_libraryGVKe K7;
static _KLused_libraryGVKe K8;
static _KLused_libraryGVKe K9;
static _KLused_libraryGVKe K10;
static _KLused_libraryGVKe K11;
static _KLused_libraryGVKe K12;
static _KLused_libraryGVKe K13;
static _KLused_libraryGVKe K14;
static _KLsymbolGVKd KJtight_;
static _KLbyte_stringGVKd_5 K16;
static _KLsimple_object_vectorGVKd_3 K17;

/* Indirection variables */

static D IKJtight_ = &KJtight_;

/* Variables */

D binary_builder_moduleYdylan_userVbinary_builder = &Kbinary_builder_moduleYdylan_userVbinary_builder;
D binary_builder_libraryYdylan_userVbinary_builder = &Kbinary_builder_libraryYdylan_userVbinary_builder;

/* Objects */

_KLlibraryGVKe Kbinary_builder_libraryYdylan_userVbinary_builder = {
  &KLlibraryGVKeW /* wrapper */,
  &K5,
  (D) 1,
  (D) 1,
  (D) 129552373,
  &K6,
  &KPempty_vectorVKi,
  &KPfalseVKi,
  &KPempty_vectorVKi,
  (D) 209,
  (D) 557
};

_KLmoduleGVKe Kbinary_builder_moduleYdylan_userVbinary_builder = {
  &KLmoduleGVKeW /* wrapper */,
  &K5,
  &Kbinary_builder_libraryYdylan_userVbinary_builder
};

static _KLbyte_stringGVKd_14 K5 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 57,
  "binary-builder"
};

static _KLsimple_object_vectorGVKd_8 K6 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 33,
  &K7,
  &K8,
  &K9,
  &K10,
  &K11,
  &K12,
  &K13,
  &K14
};

static _KLused_libraryGVKe K7 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 1,
  (D) 1,
  (D) 129535349,
  &Kbinary_manager_libraryYdylan_userVbinary_manager,
  &KJtight_
};

static _KLused_libraryGVKe K8 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 9,
  (D) 5,
  (D) 128323797,
  &Ksystem_libraryYdylan_userVsystem,
  &KJtight_
};

static _KLused_libraryGVKe K9 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 9,
  (D) 5,
  (D) 128021525,
  &Kio_libraryYdylan_userVio,
  &KJtight_
};

static _KLused_libraryGVKe K10 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 9,
  (D) 5,
  (D) 128429365,
  &Kcollections_libraryYdylan_userVcollections,
  &KJtight_
};

static _KLused_libraryGVKe K11 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 9,
  (D) 5,
  (D) 128648757,
  &Kbig_integers_libraryYdylan_userVbig_integers,
  &KJtight_
};

static _KLused_libraryGVKe K12 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 9,
  (D) 5,
  (D) 128706421,
  &Kgeneric_arithmetic_libraryYdylan_userVgeneric_arithmetic,
  &KJtight_
};

static _KLused_libraryGVKe K13 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 1,
  (D) 1,
  (D) 128002773,
  &Kcommon_dylan_libraryYdylan_userVcommon_dylan,
  &KJtight_
};

static _KLused_libraryGVKe K14 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 9,
  (D) 5,
  (D) 128132821,
  &Kdylan_libraryYdylan_userVdylan,
  &KJtight_
};

static _KLsymbolGVKd KJtight_ = {
  &KLsymbolGVKdW /* wrapper */,
  &K16
};

static _KLbyte_stringGVKd_5 K16 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 21,
  "tight"
};

static _KLsimple_object_vectorGVKd_3 K17 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 13,
  &KLsection_with_fixupsGVbinary_builder,
  &KLbinary_builderGVbinary_builder,
  &KLdynamic_fixupsGVbinary_builder
};

/* Code */


/* SYSTEM INIT CODE */

void _Init_binary_builder__X_library_for_system () {
  extern D KPresolve_symbolVKiI(D);
  {
    D T0;

    T0 = KPresolve_symbolVKiI(&KJtight_);
    if (T0 != &KJtight_) {
      primitive_slot_value_setter(T0, &K7, 4);
      primitive_slot_value_setter(T0, &K8, 4);
      primitive_slot_value_setter(T0, &K9, 4);
      primitive_slot_value_setter(T0, &K10, 4);
      primitive_slot_value_setter(T0, &K11, 4);
      primitive_slot_value_setter(T0, &K12, 4);
      primitive_slot_value_setter(T0, &K13, 4);
      primitive_slot_value_setter(T0, &K14, 4);
    }
  }
  return;
}

/* USER INIT CODE */

void _Init_binary_builder__X_library_for_user () {
{
  D T0;

  T0 = Kinitialize_class_dispatch_keys_vectoredVKgI(&K17);
  goto I0;
}
I0:

{
  D T0;

  T0 = &KPfalseVKi;
  goto I1;
}
I1:

{
  D T0;
  D T1;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/binary-builder/library.dylan:10
  T0 = primitive_runtime_module_handle();
  // /Users/bruce/Development/dylan/opendylan/sources/harp/binary-builder/library.dylan:10
  T1 = KPlibrary_version_checkVKeI(&Kbinary_builder_libraryYdylan_userVbinary_builder, T0);
  goto I2;
}
I2:

  return;
}


/* eof */
