#include "run-time.h"

/* Typedefs for referenced classes */

#define  define__KLsimple_integer_vectorGVKe(nrepeated) \
  typedef struct { \
    D wrapper; \
    D size_; \
    D integer_vector_element_[nrepeated+1]; \
  } _KLsimple_integer_vectorGVKe_##nrepeated;

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;
  D head_;
  D tail_;
} _KLempty_listGVKd;

typedef struct {
  D wrapper;
} _KLobjectGVKd;

typedef struct {
  D wrapper;
} _KLunboundGVKe;

typedef struct {
  D wrapper;
} _KLbooleanGVKd;

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

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

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

typedef struct {
  D wrapper;
  D xep_;
  D function_signature_;
  D Pgf_cache_;
  D debug_name_;
  D generic_function_methods_;
  D discriminator_;
} _KLsealed_generic_functionGVKe;

typedef struct {
  D wrapper;
  D signature_properties_;
  D signature_required_;
} _KLobject_signatureGVKe;

typedef struct {
  D wrapper;
  D properties_;
  D engine_node_callback_;
  D engine_node_entry_point_;
} _KLabsent_engine_nodeGVKg;

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

typedef struct {
  D wrapper;
  D head_;
  D tail_;
} _KLpairGVKd;

typedef struct {
  D wrapper;
} _KLintegerGVKd;


/* Typedefs for defined classes */


/* Referenced object declarations */

D KasVKdMM41I (D, D);
extern _KLclassGVKd KLsimple_integer_vectorGVKe;
extern _KLclassGVKd KLclassGVKd;
extern _KLmm_wrapperGVKi_0 KLclassGVKdW;
extern _KLclassGVKd KLmm_wrapperGVKi;
extern _KLmm_wrapperGVKi_1 KLmm_wrapperGVKiW;
extern _KLmm_wrapperGVKi_0 KLsimple_integer_vectorGVKeW;
extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
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 KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
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_LintegerG_typesVKi;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLsimple_methodGVKe Kcount_bits_in_byteYharp_utilsVharpMM1;
extern _KLobject_signatureGVKe KDsignature_LobjectG_object_rest_value_1VKi;
extern _KLclassGVKd KLobject_signatureGVKe;
extern _KLmm_wrapperGVKi_0 KLobject_signatureGVKeW;
extern _KLabsent_engine_nodeGVKg RSINGULAR_Labsent_engine_nodeG;
extern _KLclassGVKd KLabsent_engine_nodeGVKg;
extern _KLmm_wrapperGVKi_0 KLabsent_engine_nodeGVKgW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLclassGVKd KLpairGVKd;
extern _KLmm_wrapperGVKi_0 KLpairGVKdW;
extern _KLsimple_methodGVKe KlogcountYharp_utilsVharpMM2;
extern _KLsimple_methodGVKe KlogcountYharp_utilsVharpMM3;
extern _KLclassGVKd KLintegerGVKd;
extern _KLmm_wrapperGVKi_0 KLintegerGVKdW;
extern _KLsimple_object_vectorGVKd_16 KDsignature_Lsimple_object_vectorG_typesVKi;

/* Defined object declarations */

static _KLsimple_object_vectorGVKd_256 K1;
extern _KLsealed_generic_functionGVKe Kcount_bits_in_byteYharp_utilsVharp;
extern _KLsimple_methodGVKe Kcount_bits_in_byteYharp_utilsVharpMM0;
D Kcount_bits_in_byteYharp_utilsVharpMM0I (D x_);
static _KLsignatureAvaluesGVKi K5;
static _KLpairGVKd K6;
static _KLpairGVKd K7;
static _KLbyte_stringGVKd_18 K8;
extern _KLsealed_generic_functionGVKe KlogcountYharp_utilsVharp;
extern _KLsimple_methodGVKe KlogcountYharp_utilsVharpMM0;
D KlogcountYharp_utilsVharpMM0I (D x_);
extern _KLsimple_methodGVKe KlogcountYharp_utilsVharpMM1;
D KlogcountYharp_utilsVharpMM1I (D);
static _KLpairGVKd K14;
static _KLpairGVKd K15;
static _KLpairGVKd K16;
static _KLpairGVKd K17;
static _KLbyte_stringGVKd_8 K18;
static _KLsignatureAvaluesGVKi K19;

/* Indirection variables */


/* Variables */

D logcountYharp_utilsVharp = &KlogcountYharp_utilsVharp;
D count_bits_in_byteYharp_utilsVharp = &Kcount_bits_in_byteYharp_utilsVharp;
D bit_count_for_logcountYharp_utilsVharp = &KPunboundVKi;

/* Objects */

static _KLsimple_object_vectorGVKd_256 K1 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 1025,
  (D) 1,
  (D) 5,
  (D) 5,
  (D) 9,
  (D) 5,
  (D) 9,
  (D) 9,
  (D) 13,
  (D) 5,
  (D) 9,
  (D) 9,
  (D) 13,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 5,
  (D) 9,
  (D) 9,
  (D) 13,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 5,
  (D) 9,
  (D) 9,
  (D) 13,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 5,
  (D) 9,
  (D) 9,
  (D) 13,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 21,
  (D) 25,
  (D) 25,
  (D) 29,
  (D) 5,
  (D) 9,
  (D) 9,
  (D) 13,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 21,
  (D) 25,
  (D) 25,
  (D) 29,
  (D) 9,
  (D) 13,
  (D) 13,
  (D) 17,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 21,
  (D) 25,
  (D) 25,
  (D) 29,
  (D) 13,
  (D) 17,
  (D) 17,
  (D) 21,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 21,
  (D) 25,
  (D) 25,
  (D) 29,
  (D) 17,
  (D) 21,
  (D) 21,
  (D) 25,
  (D) 21,
  (D) 25,
  (D) 25,
  (D) 29,
  (D) 21,
  (D) 25,
  (D) 25,
  (D) 29,
  (D) 25,
  (D) 29,
  (D) 29,
  (D) 33
};

_KLsealed_generic_functionGVKe Kcount_bits_in_byteYharp_utilsVharp = {
  &KLsealed_generic_functionGVKeW /* wrapper */,
  &gf_xep_1,
  &KDsignature_LobjectG_object_rest_value_1VKi,
  &KPfalseVKi,
  &K8,
  &K6,
  &RSINGULAR_Labsent_engine_nodeG
};

_KLsimple_methodGVKe Kcount_bits_in_byteYharp_utilsVharpMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K5,
  &Kcount_bits_in_byteYharp_utilsVharpMM0I
};

static _KLsignatureAvaluesGVKi K5 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (D) 33555461,
  &KDsignature_LintegerG_typesVKi,
  &KDsignature_LintegerG_typesVKi
};

static _KLpairGVKd K6 = {
  &KLpairGVKdW /* wrapper */,
  &Kcount_bits_in_byteYharp_utilsVharpMM0,
  &K7
};

static _KLpairGVKd K7 = {
  &KLpairGVKdW /* wrapper */,
  &Kcount_bits_in_byteYharp_utilsVharpMM1,
  &KPempty_listVKi
};

static _KLbyte_stringGVKd_18 K8 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 73,
  "count-bits-in-byte"
};

_KLsealed_generic_functionGVKe KlogcountYharp_utilsVharp = {
  &KLsealed_generic_functionGVKeW /* wrapper */,
  &gf_xep_1,
  &KDsignature_LobjectG_object_rest_value_1VKi,
  &KPfalseVKi,
  &K18,
  &K14,
  &RSINGULAR_Labsent_engine_nodeG
};

_KLsimple_methodGVKe KlogcountYharp_utilsVharpMM0 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K5,
  &KlogcountYharp_utilsVharpMM0I
};

_KLsimple_methodGVKe KlogcountYharp_utilsVharpMM1 = {
  &KLsimple_methodGVKeW /* wrapper */,
  &xep_1,
  &K19,
  &KlogcountYharp_utilsVharpMM1I
};

static _KLpairGVKd K14 = {
  &KLpairGVKdW /* wrapper */,
  &KlogcountYharp_utilsVharpMM0,
  &K15
};

static _KLpairGVKd K15 = {
  &KLpairGVKdW /* wrapper */,
  &KlogcountYharp_utilsVharpMM1,
  &K16
};

static _KLpairGVKd K16 = {
  &KLpairGVKdW /* wrapper */,
  &KlogcountYharp_utilsVharpMM2,
  &K17
};

static _KLpairGVKd K17 = {
  &KLpairGVKdW /* wrapper */,
  &KlogcountYharp_utilsVharpMM3,
  &KPempty_listVKi
};

static _KLbyte_stringGVKd_8 K18 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 33,
  "logcount"
};

static _KLsignatureAvaluesGVKi K19 = {
  &KLsignatureAvaluesGVKiW /* wrapper */,
  (D) 33555461,
  &KDsignature_Lsimple_object_vectorG_typesVKi,
  &KDsignature_LintegerG_typesVKi
};

/* Code */

D Kcount_bits_in_byteYharp_utilsVharpMM0I (D x_) {
  DWORD T2;
  DWORD T3;
  D T4;
  D T5_0;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:40
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:41
  T2 = primitive_cast_integer_as_raw(x_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:41
  T3 = primitive_machine_word_logand(T2,1021);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:43
  T4 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T3);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:43
  T5_0 = T4;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:40
  MV_SET_COUNT(1);
  return(T5_0);
}

D KlogcountYharp_utilsVharpMM0I (D x_) {
  DWORD T2;
  DWORD T3;
  D T4;
  DWORD T5;
  DWORD T6;
  DWORD T7;
  DWORD T8;
  D T9;
  DWORD T10;
  DWORD T11;
  DWORD T12;
  DWORD T13;
  D T14;
  DWORD T15;
  DWORD T16;
  DWORD T17;
  DWORD T18;
  DWORD T19;
  DWORD T20;
  DWORD T21;
  DWORD T22;
  D T23;
  DWORD T24;
  DWORD T25;
  DWORD T26;
  DWORD T27;
  DWORD T28;
  DWORD T29;
  DWORD T30;
  D T31;
  DWORD T32;
  DWORD T33;
  DWORD T34;
  D T35;
  D T36_0;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:47
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:49
  T3 = primitive_cast_integer_as_raw(x_);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:49
  T4 = primitive_machine_word_less_thanQ(T3,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:49
  if (T4 != &KPfalseVKi) {
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:49
    T5 = primitive_machine_word_lognot(T3);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:49
    T6 = primitive_machine_word_logand(T5,-4);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:49
    T7 = primitive_machine_word_logior(T6,1);
    T2 = T7;
  } else {
    T2 = T3;
  }
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:49
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T8 = primitive_machine_word_logand(T2,1021);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T9 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T8);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:52
  T10 = primitive_machine_word_shift_right(T2,8);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:52
  T11 = primitive_machine_word_logand(T10,-4);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:52
  T12 = primitive_machine_word_logior(T11,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:52
  T13 = primitive_machine_word_logand(T12,1021);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:52
  T14 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T13);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T15 = primitive_cast_integer_as_raw(T9);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T16 = primitive_cast_integer_as_raw(T14);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T17 = primitive_machine_word_logxor(T16,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T18 = primitive_machine_word_add_signal_overflow(T15,T17);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:53
  T19 = primitive_machine_word_shift_right(T2,16);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:53
  T20 = primitive_machine_word_logand(T19,-4);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:53
  T21 = primitive_machine_word_logior(T20,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:53
  T22 = primitive_machine_word_logand(T21,1021);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:53
  T23 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T22);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T24 = primitive_cast_integer_as_raw(T23);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T25 = primitive_machine_word_logxor(T24,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T26 = primitive_machine_word_add_signal_overflow(T18,T25);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:54
  T27 = primitive_machine_word_shift_right(T2,24);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:54
  T28 = primitive_machine_word_logand(T27,-4);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:54
  T29 = primitive_machine_word_logior(T28,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:54
  T30 = primitive_machine_word_logand(T29,1021);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:54
  T31 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T30);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T32 = primitive_cast_integer_as_raw(T31);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T33 = primitive_machine_word_logxor(T32,1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T34 = primitive_machine_word_add_signal_overflow(T26,T33);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T35 = primitive_cast_raw_as_integer(T34);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:51
  T36_0 = T35;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:47
  MV_SET_COUNT(1);
  return(T36_0);
}

D KlogcountYharp_utilsVharpMM1I (D vec_) {
  DWORD T2T, T2;
  D i_;
  D T4_0;
  D res_;
  D T6;
  D T7;
  D T8;
  DWORD T9;
  D T10;
  D T11;
  DWORD T12;
  DWORD T13;
  D T14;
  DWORD T15;
  DWORD T16;
  DWORD T17;
  DWORD T18;
  D T19;
  DWORD T20;
  DWORD T21;
  DWORD T22;
  DWORD T23;
  D T24;
  DWORD T25;
  DWORD T26;
  DWORD T27;
  DWORD T28;
  DWORD T29;
  DWORD T30;
  DWORD T31;
  DWORD T32;
  D T33;
  DWORD T34;
  DWORD T35;
  DWORD T36;
  DWORD T37;
  DWORD T38;
  DWORD T39;
  DWORD T40;
  D T41;
  DWORD T42;
  DWORD T43;
  DWORD T44;
  DWORD T45;
  DWORD T46;
  DWORD T47;
  D T48;
  DWORD T49;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:57
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:58
  res_ = (D) 1;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
  T8 = SLOT_VALUE_INITD(vec_, 0);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
  T9 = primitive_cast_integer_as_raw(T8);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
  T2T = 1;
L0: ;
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
    T2 = T2T;
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
    T10 = primitive_machine_word_equalQ(T2,T9);
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
    if (T10 == &KPfalseVKi) {
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
      T11 = REPEATED_D_SLOT_VALUE_TAGGED(vec_, 1, T2);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
      primitive_type_check(T11, &KLintegerGVKd);
      i_ = T11;
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T13 = primitive_cast_integer_as_raw(i_);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T14 = primitive_machine_word_less_thanQ(T13,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      if (T14 != &KPfalseVKi) {
        // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
        T15 = primitive_machine_word_lognot(T13);
        // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
        T16 = primitive_machine_word_logand(T15,-4);
        // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
        T17 = primitive_machine_word_logior(T16,1);
        T12 = T17;
      } else {
        T12 = T13;
      }
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T18 = primitive_machine_word_logand(T12,1021);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T19 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T18);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T20 = primitive_machine_word_shift_right(T12,8);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T21 = primitive_machine_word_logand(T20,-4);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T22 = primitive_machine_word_logior(T21,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T23 = primitive_machine_word_logand(T22,1021);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T24 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T23);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T25 = primitive_cast_integer_as_raw(T19);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T26 = primitive_cast_integer_as_raw(T24);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T27 = primitive_machine_word_logxor(T26,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T28 = primitive_machine_word_add_signal_overflow(T25,T27);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T29 = primitive_machine_word_shift_right(T12,16);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T30 = primitive_machine_word_logand(T29,-4);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T31 = primitive_machine_word_logior(T30,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T32 = primitive_machine_word_logand(T31,1021);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T33 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T32);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T34 = primitive_cast_integer_as_raw(T33);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T35 = primitive_machine_word_logxor(T34,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T36 = primitive_machine_word_add_signal_overflow(T28,T35);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T37 = primitive_machine_word_shift_right(T12,24);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T38 = primitive_machine_word_logand(T37,-4);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T39 = primitive_machine_word_logior(T38,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T40 = primitive_machine_word_logand(T39,1021);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T41 = REPEATED_D_SLOT_VALUE_TAGGED(bit_count_for_logcountYharp_utilsVharp, 1, T40);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T42 = primitive_cast_integer_as_raw(T41);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T43 = primitive_machine_word_logxor(T42,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T44 = primitive_machine_word_add_signal_overflow(T36,T43);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T7 = res_;
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T45 = primitive_cast_integer_as_raw(T7);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T46 = primitive_machine_word_logxor(T44,1);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T47 = primitive_machine_word_add_signal_overflow(T45,T46);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      T48 = primitive_cast_raw_as_integer(T47);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:60
      res_ = T48;
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
      T49 = primitive_machine_word_add_signal_overflow(T2,4);
      // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
      T2T = T49;
      goto L0;
    }
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
    // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:59
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:62
  T6 = res_;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:62
  T4_0 = T6;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:57
  MV_SET_COUNT(1);
  return(T4_0);
}


/* SYSTEM INIT CODE */

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

/* USER INIT CODE */

void _Init_harp__X_logcount_for_user () {
{
  D bit_count_for_logcount_tmp_;
  D T1;
  D T2;

  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:21
  T2 = KasVKdMM41I(&KLsimple_integer_vectorGVKe, &K1);
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:17
  primitive_type_check(T2, &KLsimple_integer_vectorGVKe);
  bit_count_for_logcount_tmp_ = T2;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:17
  bit_count_for_logcountYharp_utilsVharp = bit_count_for_logcount_tmp_;
  // /Users/bruce/Development/dylan/opendylan/sources/harp/core-harp/logcount.dylan:17
  T1 = &KPfalseVKi;
  goto I0;
}
I0:

  return;
}


/* eof */
