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

#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(1);
define__KLsimple_object_vectorGVKd(4);
define__KLsimple_object_vectorGVKd(2);
define__KLsimple_object_vectorGVKd(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;
  dylan_value xep_;
  dylan_value function_signature_;
  dylan_value mep_;
} _KLsimple_methodGVKe;

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

typedef struct {
  dylan_value wrapper;
  dylan_value outer_stream_;
  dylan_value private_stream_element_type_value_;
  dylan_value private_stream_direction_value_;
  dylan_value private_stream_lock_value_;
  dylan_value actual_stream_input_buffer_;
  dylan_value actual_stream_output_buffer_;
  dylan_value stream_shared_buffer_;
  dylan_value initial_position_;
  dylan_value current_position_;
  dylan_value final_position_;
  dylan_value stream_locator_;
  dylan_value accessor_;
} _KLfile_streamGYstreams_internalsVio;

#define  define__KLbufferGYstreamsVio(nrepeated) \
  typedef struct { \
    dylan_value wrapper; \
    dylan_value buffer_next_; \
    dylan_value buffer_end_; \
    dylan_value buffer_position_; \
    dylan_value buffer_dirtyQ_; \
    dylan_value buffer_start_; \
    dylan_value buffer_on_page_bits_; \
    dylan_value buffer_off_page_bits_; \
    dylan_value buffer_use_count_; \
    dylan_value buffer_owning_stream_; \
    dylan_value size_; \
    char buffer_element_[nrepeated+1]; \
  } _KLbufferGYstreamsVio_##nrepeated;

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(5);
define__KLbyte_stringGVKd(40);
define__KLbyte_stringGVKd(7);

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_;
} _KLsealed_generic_functionGVKe;


/* 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 _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
dylan_value KgethashVKiI (dylan_value, dylan_value, dylan_value, dylan_value);
dylan_value Kjam_variableVjamMM0I (dylan_value, dylan_value, dylan_value, dylan_value);
extern _KLsimple_object_vectorGVKd_0 KPempty_vectorVKi;
extern _KLincremental_generic_functionGVKe KemptyQVKd;
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 KelementVKd;
extern _KLsimple_methodGVKe Kparse_regular_expressionYjam_internalsVjam;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLsymbolGVKd KJdirection_;
extern _KLclassGVKd KLsymbolGVKd;
extern _KLmm_wrapperGVKi_0 KLsymbolGVKdW;
extern _KLsymbolGVKd KJinput_;
extern _KLincremental_generic_functionGVKe Kopen_file_streamYstreams_protocolVcommon_dylan;
extern _KLclassGVKd KLfile_streamGYstreams_internalsVio;
extern _KLmm_wrapperGVKi_0 KLfile_streamGYstreams_internalsVioW;
extern _KLincremental_generic_functionGVKe Kstream_input_bufferYstreams_internalsVio;
extern _KLclassGVKd KLbufferGYstreamsVio;
extern _KLmm_wrapperGVKi_0 KLbufferGYstreamsVioW;
extern _KLsymbolGVKd KJwaitQ_;
extern _KLincremental_generic_functionGVKe Kdo_next_input_bufferYstreamsVio;
extern _KLincremental_generic_functionGVKe Kdo_get_input_bufferYstreamsVio;
dylan_value KerrorVKdMM1I (dylan_value, dylan_value);
extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
extern _KLincremental_generic_functionGVKe Kdo_release_input_bufferYstreamsVio;
extern _KLincremental_generic_functionGVKe Kstream_openQYstreams_protocolVcommon_dylan;
extern _KLincremental_generic_functionGVKe KcloseYcommon_extensionsVcommon_dylan;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLsealed_generic_functionGVKe Kbuffer_endYstreamsVio;
extern _KLclassGVKd KLsealed_generic_functionGVKe;
extern _KLmm_wrapperGVKi_0 KLsealed_generic_functionGVKeW;
extern _KLsealed_generic_functionGVKe Kbuffer_next_setterYstreamsVio;

/* Defined object declarations */

dylan_value Ktarget_header_scanYjam_internalsVjamMM0I (dylan_value, dylan_value);
static _KLbyte_stringGVKd_7 K1;
static _KLbyte_stringGVKd_7 K2;
static _KLsymbolGVKd KJbytes_;
static dylan_value KloopF6I (dylan_value, dylan_value);
static _KLbyte_stringGVKd_40 K5;
static _KLbyte_stringGVKd_5 K7;

/* Indirection variables */

static dylan_value IKJbytes_ = &KJbytes_;

/* Variables */


/* Objects */

static _KLbyte_stringGVKd_7 K1 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (dylan_value) 29,
  "HDRSCAN"
};

static _KLbyte_stringGVKd_7 K2 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (dylan_value) 29,
  "HDRRULE"
};

static _KLsymbolGVKd KJbytes_ = {
  &KLsymbolGVKdW /* wrapper */,
  &K7
};

static _KLbyte_stringGVKd_40 K5 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (dylan_value) 161,
  "Stream %= does not have the input buffer"
};

static _KLbyte_stringGVKd_5 K7 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (dylan_value) 21,
  "bytes"
};

/* Code */

dylan_value Ktarget_header_scanYjam_internalsVjamMM0I (dylan_value jam_, dylan_value target_) {
  dylan_value T3;
  dylan_value hdrscan_;
  dylan_value T5;
  dylan_value hdrrule_;
  dylan_value T7;
  dylan_value T8;
  dylan_value T9;
  dylan_value T10;
  dylan_value T11;
  dylan_value T12;
  dylan_value streamF13;
  dylan_value T14;
  dylan_value T15;
  dylan_value T16;
  dylan_value T17;
  dylan_value Ustream_;
  dylan_value T19;
  dylan_value T20;
  dylan_value T21;
  dylan_value T22;
  dylan_value T23;
  dylan_value T24_0;
  dylan_value UtmpF25;
  dylan_value T26_0;
  dylan_value UtmpF27;
  dylan_value T28;
  dylan_value T29;
  _KLsimple_object_vectorGVKd_2 T30 = {&KLsimple_object_vectorGVKdW, (dylan_value) 9};
  dylan_value sb_;
  dylan_value T32;
  dylan_value T33;
  dylan_value T34;
  DWORD T35;
  DWORD T36;
  dylan_value T37;
  _KLsimple_object_vectorGVKd_4 T38 = {&KLsimple_object_vectorGVKdW, (dylan_value) 17};
  dylan_value T39_0;
  _KLsimple_object_vectorGVKd_4 T40 = {&KLsimple_object_vectorGVKdW, (dylan_value) 17};
  dylan_value T41_0;
  dylan_value T42;
  dylan_value T43;
  dylan_value T44;
  dylan_value T45;
  dylan_value T46;
  _KLsimple_object_vectorGVKd_1 T47 = {&KLsimple_object_vectorGVKdW, (dylan_value) 5};
  dylan_value T48;

  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:8
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:12
  T23 = SLOT_VALUE_INITD(target_, 7);
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:12
  T24_0 = KgethashVKiI(T23, &K1, &KPfalseVKi, &KPtrueVKi);
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:12
  UtmpF25 = T24_0;
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:12
  if (UtmpF25 != &KPfalseVKi) {
    hdrscan_ = UtmpF25;
  } else {
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:13
    T3 = Kjam_variableVjamMM0I(jam_, &K1, &KPempty_vectorVKi, &KPempty_vectorVKi);
    hdrscan_ = T3;
  }
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:12
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:15
  T26_0 = KgethashVKiI(T23, &K2, &KPfalseVKi, &KPtrueVKi);
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:15
  UtmpF27 = T26_0;
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:15
  if (UtmpF27 != &KPfalseVKi) {
    hdrrule_ = UtmpF27;
  } else {
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:16
    T5 = Kjam_variableVjamMM0I(jam_, &K2, &KPempty_vectorVKi, &KPempty_vectorVKi);
    hdrrule_ = T5;
  }
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:15
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
  CONGRUENT_CALL_PROLOG(&KemptyQVKd, 1);
  T7 = CONGRUENT_CALL1(hdrscan_);
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
  if (T7 != &KPfalseVKi) {
    T9 = &KPfalseVKi;
  } else {
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
    CONGRUENT_CALL_PROLOG(&KemptyQVKd, 1);
    T8 = CONGRUENT_CALL1(hdrrule_);
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
    T28 = primitive_not(T8);
    T9 = T28;
  }
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
  if (T9 != &KPfalseVKi) {
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:19
    T10 = CALL2(&KelementVKd, hdrscan_, (dylan_value) 1);
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:19
    CALL1(&Kparse_regular_expressionYjam_internalsVjam, T10);
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    Ustream_ = &KPfalseVKi;
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    ENTER_UNWIND_FRAME(T11);
    if (!nlx_setjmp(FRAME_DEST(T11))) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      T29 = SLOT_VALUE_INITD(target_, 1);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      T30.vector_element_[0] = &KJdirection_;
      T30.vector_element_[1] = &KJinput_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      CONGRUENT_CALL_PROLOG(&Kopen_file_streamYstreams_protocolVcommon_dylan, 2);
      T12 = CONGRUENT_CALL2(T29, &T30);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      Ustream_ = T12;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      T22 = Ustream_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      primitive_type_check(T22, &KLfile_streamGYstreams_internalsVio);
      streamF13 = T22;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
      CONGRUENT_CALL_PROLOG(&Kstream_input_bufferYstreams_internalsVio, 1);
      sb_ = CONGRUENT_CALL1(streamF13);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
      if (sb_ != &KPfalseVKi) {
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T32 = sb_;
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T33 = SLOT_VALUE_INITD(T32, 0);
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T34 = SLOT_VALUE_INITD(T32, 1);
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T35 = primitive_cast_integer_as_raw(T33);
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T36 = primitive_cast_integer_as_raw(T34);
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T37 = primitive_machine_word_less_thanQ(T35,T36);
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        if (T37 != &KPfalseVKi) {
          T43 = T32;
        } else {
          // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
          T38.vector_element_[0] = &KJwaitQ_;
          T38.vector_element_[1] = &KPtrueVKi;
          T38.vector_element_[2] = IKJbytes_;
          T38.vector_element_[3] = (dylan_value) 5;
          // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
          CONGRUENT_CALL_PROLOG(&Kdo_next_input_bufferYstreamsVio, 2);
          T39_0 = CONGRUENT_CALL2(streamF13, &T38);
          // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
          T42 = T39_0;
          T43 = T42;
        }
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T45 = T43;
      } else {
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T40.vector_element_[0] = &KJwaitQ_;
        T40.vector_element_[1] = &KPtrueVKi;
        T40.vector_element_[2] = IKJbytes_;
        T40.vector_element_[3] = (dylan_value) 5;
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        CONGRUENT_CALL_PROLOG(&Kdo_get_input_bufferYstreamsVio, 2);
        T41_0 = CONGRUENT_CALL2(streamF13, &T40);
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
        T44 = T41_0;
        T45 = T44;
      }
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
      KloopF6I(streamF13, T45);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:29
      CONGRUENT_CALL_PROLOG(&Kstream_input_bufferYstreams_internalsVio, 1);
      T46 = CONGRUENT_CALL1(streamF13);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:29
      if (T46 == &KPfalseVKi) {
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:29
        T47.vector_element_[0] = streamF13;
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:29
        KerrorVKdMM1I(&K5, &T47);
      }
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:29
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:29
      CONGRUENT_CALL_PROLOG(&Kdo_release_input_bufferYstreamsVio, 1);
      T48 = CONGRUENT_CALL1(streamF13);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      FALL_THROUGH_UNWIND(T48);
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    T20 = Ustream_;
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    if (T20 != &KPfalseVKi) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      T21 = Ustream_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      T14 = CALL1(&Kstream_openQYstreams_protocolVcommon_dylan, T21);
      T15 = T14;
    } else {
      T15 = &KPfalseVKi;
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    if (T15 != &KPfalseVKi) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      T19 = Ustream_;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
      CALL1(&KcloseYcommon_extensionsVcommon_dylan, T19);
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:21
    CONTINUE_UNWIND();
    T17 = T48;
  } else {
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
    T16 = &KPfalseVKi;
    T17 = T16;
  }
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:18
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:8
  MV_SET_COUNT(0);
  return(T17);
}

static dylan_value KloopF6I (dylan_value stream_, dylan_value buf_) {
  dylan_value bufF2;
  dylan_value T3;
  dylan_value T4;
  dylan_value T5;
  dylan_value T6;
  _KLsimple_object_vectorGVKd_1 T7 = {&KLsimple_object_vectorGVKdW, (dylan_value) 5};
  _KLsimple_object_vectorGVKd_4 T8 = {&KLsimple_object_vectorGVKdW, (dylan_value) 17};
  dylan_value T9_0;
  dylan_value T10;
  dylan_value T11;
  dylan_value bufF12T, bufF12;
  dylan_value T13;

  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
  bufF12T = buf_;
L0: ;
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
    bufF12 = bufF12T;
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
    primitive_type_check(bufF12, &KLobjectGVKd);
    T13 = bufF12;
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
    bufF2 = T13;
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:23
    if (bufF2 != &KPfalseVKi) {
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:25
      T3 = CALL1(&Kbuffer_endYstreamsVio, bufF2);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:25
      CALL2(&Kbuffer_next_setterYstreamsVio, T3, bufF2);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
      CONGRUENT_CALL_PROLOG(&Kstream_input_bufferYstreams_internalsVio, 1);
      T6 = CONGRUENT_CALL1(stream_);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
      if (T6 == &KPfalseVKi) {
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
        T7.vector_element_[0] = stream_;
        // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
        KerrorVKdMM1I(&K5, &T7);
      }
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
      T8.vector_element_[0] = &KJwaitQ_;
      T8.vector_element_[1] = &KPtrueVKi;
      T8.vector_element_[2] = IKJbytes_;
      T8.vector_element_[3] = (dylan_value) 5;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
      CONGRUENT_CALL_PROLOG(&Kdo_next_input_bufferYstreamsVio, 2);
      T9_0 = CONGRUENT_CALL2(stream_, &T8);
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
      T10 = T9_0;
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
      bufF12T = T10;
      goto L0;
      T5 = T11;
    } else {
      // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:23
      T4 = &KPfalseVKi;
      MV_SET_ELT(0, &KPfalseVKi);
      MV_SET_COUNT(1);
      T5 = T4;
    }
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:23
    // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:26
  // /home/bruce/Development/dylan/opendylan/sources/lib/jam/jam-header-scan.dylan:22
  return(T5);
}


/* SYSTEM INIT CODE */

void _Init_jam__X_jam_header_scan_for_system () {
  extern dylan_value KPresolve_symbolVKiI(dylan_value);
  {
    dylan_value T0;

    T0 = KPresolve_symbolVKiI(&KJbytes_);
    if (T0 != &KJbytes_) {
      IKJbytes_ = T0;
    }
  }
  return;
}

/* USER INIT CODE */

void _Init_jam__X_jam_header_scan_for_user () {
  return;
}


/* eof */
