/* generated by Id 1.0 at 2007-08-31 06:59:45 Z */
/* with the command: -I../stage1/ -I../st80 -c StringIO.st -o ../stage2/StringIO.o.c */

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <setjmp.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <assert.h>
#define GC_DLL 1
#include <gc/gc.h>
#if defined(WIN32)
# include <malloc.h>
# include <windows.h>
  typedef HINSTANCE dlhandle_t;
# define dlopen(path, mode)	LoadLibrary(path)
# define dlsym(handle, name)	((void *)GetProcAddress(handle, name))
# define dlclose(handle)	FreeLibrary(handle)
# include <winbase.h>
  inline int gettimeofday(struct timeval *tp, void *tzp)
  {
     union {
       long long ns100;
       FILETIME ft;
     } _now;
     GetSystemTimeAsFileTime(&_now.ft);
     tp->tv_usec= (long)((_now.ns100 / 10LL) % 1000000LL);
     tp->tv_sec= (long)((_now.ns100 - (116444736000000000LL)) / 10000000LL);
     return 0;
   }
#else
# include <dlfcn.h>
  typedef void *dlhandle_t;
#endif
#ifndef O_BINARY
# define O_BINARY 0
#endif

typedef struct t__object *oop;

typedef oop (*_imp_t)(oop _thunk, oop receiver, ...);

struct __closure
{
  _imp_t method;
  oop	 data;
};

static void              *(*_local_param   )(int index)= 0;
static oop  		  (*_local_intern  )(const char *string)= 0;
static oop  		  (*_local_proto   )(oop base)= 0;
static oop  		  (*_local_import  )(const char *name)= 0;
static oop  		  (*_local_export  )(const char *name, oop value)= 0;
static void 		  (*_local_method  )(oop type, oop selector, _imp_t method)= 0;
static oop  		  (*_local_alloc   )(oop type, size_t size)= 0;
static oop  		 *(*_local_palloc  )(size_t size)= 0;
static void  		 *(*_local_balloc  )(size_t size)= 0;
static struct __closure  *(*_local_bind    )(oop selector, oop receiver)= 0;
static oop                (*_local_nlreturn)(oop nlr, oop result)= 0;
static oop                (*_local_nlresult)(void)= 0;
static oop  		    _local_object= 0;
static oop  		   *_local_tag_vtable= 0;
static oop  		   *_local_nil_vtable= 0;
static void               (*_local_gc_addRoots)(char *lo, char *hi)= 0;
static void	          (*_local_gc_unregisterDisappearingLink)(void *ptr)= 0;
static void		  (*_local_gc_generalRegisterDisappearingLink)(void *link, void *ptr)= 0;
static void		  (*_local_gc_gcollect)(void)= 0;
static void		 *(*_local_enter)(char *name, char *type, char *file)= 0;
static void		  (*_local_line)(int line)= 0;
static void		  (*_local_leave)(void *)= 0;
static char		 *(*_local_backtrace)(void)= 0;

#define _param(INDEX)		_local_param(INDEX)
#define _selector(NAME)		_local_intern(NAME)
#define _proto(BASE)		_local_proto(BASE)
#define _id_import(NAME)	_local_import(NAME)
#define _id_export(NAME, VAL)	_local_export((NAME), (VAL))
#define _method(TYPE, SEL, IMP)	_local_method((TYPE), (SEL), (_imp_t)(IMP))
#define _alloc(RCV, LBS)	_local_alloc((RCV), (LBS))
#define _palloc(LBS)		_local_palloc((LBS))
#define _balloc(LBS)		_local_balloc((LBS))
#define _nlreturn(NLR, ARG)	_local_nlreturn((NLR), (ARG))
#define _nlresult()		_local_nlresult()
#define _backtrace()		_local_backtrace()
#ifdef ID_DEBUG
# define _enter(NM, TYPE, FILE)	void *__id_debug= _local_enter(NM, TYPE, FILE)
# define _line(line)		_local_line(line)
# define _leave()		_local_leave(__id_debug)
#else
# define _enter(NM, TYPE, FILE)
# define _line(line)
# define _leave()
#endif
#define _return			_leave(); return

#define _send(MSG, RCV, ARG...) ({					\
  register oop _r= (RCV);						\
  struct __closure *_c= (struct __closure *)_local_bind((MSG), _r);	\
  (_c->method)((oop)_c, _r, _r, ##ARG);					\
})

#define _super(TYP, MSG, RCV, ARG...) ({				\
  register oop _r= (RCV);						\
  struct __closure *_c= (struct __closure *)_local_bind((MSG), (TYP));	\
  (_c->method)((oop)_c, _r, _r, ##ARG);					\
})

static oop s_new_5f_= 0;
static oop s_baseName= 0;
static oop s_value_5f_= 0;
static oop s__5fimport_= 0;
static oop s_do_= 0;
static oop s_last= 0;
static oop s_ifTrue_= 0;
static oop s_flattened= 0;
static oop s__2c= 0;
static oop s_first= 0;
static oop s__3d_3d= 0;
static oop s_removeLast= 0;
static oop s__5fclone= 0;
static oop s__5fcString= 0;
static oop s_isEmpty= 0;
static oop s_size_5f_value_5f_= 0;
static oop s_ifTrue_ifFalse_= 0;
static oop s_directoryName= 0;
static oop s_absolutePathName= 0;
static oop s_isReadableFile= 0;
static oop s_findFileSearching_withSuffixes_ifError_= 0;
static oop s_function_5f_arity_5f_outer_state_nlr_5f_= 0;
static oop s_findFileSearching_withSuffixes_= 0;
static oop s_delimited_= 0;
static oop s_osErrorString= 0;
static oop s_readFromFileNamed_ifError_= 0;
static oop s_readFromFileNamed_= 0;
static oop s_fileContents= 0;
static oop s_writeToFileNamed_ifError_= 0;
static oop s_writeToFileNamed_= 0;
static oop s_strftimeNow= 0;
static oop s_strftimeZulu= 0;
static oop s_dateStamp= 0;
static oop s_timeStamp= 0;
static oop s_dateAndTimeStamp= 0;
static oop s_error_= 0;
static oop s_value= 0;
static oop s_dateAndTimeZoneStamp= 0;
static oop s_dateAndTimeZuluStamp= 0;
static oop s_tokenized_= 0;
static struct _Selector { const char *name; oop *addr; } _Selectors[]= {
  { "new_:", &s_new_5f_ },
  { "baseName", &s_baseName },
  { "value_:", &s_value_5f_ },
  { "_import:", &s__5fimport_ },
  { "do:", &s_do_ },
  { "last", &s_last },
  { "ifTrue:", &s_ifTrue_ },
  { "flattened", &s_flattened },
  { ",", &s__2c },
  { "first", &s_first },
  { "==", &s__3d_3d },
  { "removeLast", &s_removeLast },
  { "_clone", &s__5fclone },
  { "_cString", &s__5fcString },
  { "isEmpty", &s_isEmpty },
  { "size_:value_:", &s_size_5f_value_5f_ },
  { "ifTrue:ifFalse:", &s_ifTrue_ifFalse_ },
  { "directoryName", &s_directoryName },
  { "absolutePathName", &s_absolutePathName },
  { "isReadableFile", &s_isReadableFile },
  { "findFileSearching:withSuffixes:ifError:", &s_findFileSearching_withSuffixes_ifError_ },
  { "function_:arity_:outer:state:nlr_:", &s_function_5f_arity_5f_outer_state_nlr_5f_ },
  { "findFileSearching:withSuffixes:", &s_findFileSearching_withSuffixes_ },
  { "delimited:", &s_delimited_ },
  { "osErrorString", &s_osErrorString },
  { "readFromFileNamed:ifError:", &s_readFromFileNamed_ifError_ },
  { "readFromFileNamed:", &s_readFromFileNamed_ },
  { "fileContents", &s_fileContents },
  { "writeToFileNamed:ifError:", &s_writeToFileNamed_ifError_ },
  { "writeToFileNamed:", &s_writeToFileNamed_ },
  { "strftimeNow", &s_strftimeNow },
  { "strftimeZulu", &s_strftimeZulu },
  { "dateStamp", &s_dateStamp },
  { "timeStamp", &s_timeStamp },
  { "dateAndTimeStamp", &s_dateAndTimeStamp },
  { "error:", &s_error_ },
  { "value", &s_value },
  { "dateAndTimeZoneStamp", &s_dateAndTimeZoneStamp },
  { "dateAndTimeZuluStamp", &s_dateAndTimeZuluStamp },
  { "tokenized:", &s_tokenized_ },
  { 0, 0 }
};
struct t__object {
  struct _vtable *_vtable[0];
};
struct t__selector {
  struct _vtable *_vtable[0];
  oop v__size;
  oop v__elements;
};
struct t__assoc {
  struct _vtable *_vtable[0];
  oop v_key;
  oop v_value;
};
struct t__closure {
  struct _vtable *_vtable[0];
  oop v__method;
  oop v_data;
};
struct t__vector {
  struct _vtable *_vtable[0];
  oop v__size;
};
struct t__vtable {
  struct _vtable *_vtable[0];
  oop v__tally;
  oop v_bindings;
  oop v_delegate;
};
struct t_Object {
  struct _vtable *_vtable[0];
};
struct t_UndefinedObject {
  struct _vtable *_vtable[0];
};
struct t_StaticBlockClosure {
  struct _vtable *_vtable[0];
  oop v__function;
  oop v__arity;
};
struct t_BlockClosure {
  struct _vtable *_vtable[0];
  oop v__function;
  oop v__arity;
  oop v_outer;
  oop v_state;
  oop v__nlr;
};
struct t_Magnitude {
  struct _vtable *_vtable[0];
};
struct t_Character {
  struct _vtable *_vtable[0];
  oop v_value;
};
struct t_Number {
  struct _vtable *_vtable[0];
};
struct t_Fraction {
  struct _vtable *_vtable[0];
  oop v_numerator;
  oop v_denominator;
};
struct t_Float {
  struct _vtable *_vtable[0];
};
struct t_Integer {
  struct _vtable *_vtable[0];
};
struct t_SmallInteger {
  struct _vtable *_vtable[0];
};
struct t_LargePositiveInteger {
  struct _vtable *_vtable[0];
  oop v_bytes;
};
struct t_LargeNegativeInteger {
  struct _vtable *_vtable[0];
  oop v_bytes;
};
struct t_Collection {
  struct _vtable *_vtable[0];
};
struct t_SequenceableCollection {
  struct _vtable *_vtable[0];
};
struct t_ArrayedCollection {
  struct _vtable *_vtable[0];
  oop v_size;
};
struct t_Array {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__pointers;
};
struct t_ImmutableArray {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__pointers;
};
struct t_WordArray {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__words;
};
struct t_ImmutableWordArray {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__words;
};
struct t_ByteArray {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__bytes;
};
struct t_ImmutableByteArray {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__bytes;
};
struct t_String {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__bytes;
};
struct t_ImmutableString {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__bytes;
};
struct t_Symbol {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__bytes;
};
struct t_nil {
  struct _vtable *_vtable[0];
};
struct t_true {
  struct _vtable *_vtable[0];
};
struct t_false {
  struct _vtable *_vtable[0];
};
struct t_CharacterTable {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__pointers;
};
struct t_Smalltalk {
  struct _vtable *_vtable[0];
  oop v_argumentCount;
  oop v_argumentVector;
};
static oop l_1= 0;
static oop l_2= 0;
static oop l_3= 0;
static oop l_4= 0;
static oop l_5= 0;
static oop l_6= 0;
static oop l_9= 0;
static oop l_11= 0;
static oop l_13= 0;
static oop l_15= 0;
static oop l_16= 0;
static oop l_17= 0;
static oop l_18= 0;
static oop l_19= 0;
static oop l_20= 0;
static oop v__object= 0;
static oop v__vector= 0;
static oop v_Object= 0;
static oop v_UndefinedObject= 0;
static oop v_StaticBlockClosure= 0;
static oop v_BlockClosure= 0;
static oop v_Magnitude= 0;
static oop v_Character= 0;
static oop v_Number= 0;
static oop v_Integer= 0;
static oop v_LargePositiveInteger= 0;
static oop v_Collection= 0;
static oop v_SequenceableCollection= 0;
static oop v_ArrayedCollection= 0;
static oop v_Array= 0;
static oop v_ImmutableArray= 0;
static oop v_WordArray= 0;
static oop v_ByteArray= 0;
static oop v_String= 0;
static oop v_ImmutableString= 0;
static oop v_true= 0;
static oop v_false= 0;
static oop v_Smalltalk= 0;
static oop al_6[1]= {
  
(oop)&l_5
};
static oop String___5fcString(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("_cString", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  _line(26);
 {
# define self ((struct t_String *)v_self)

  int len= (int)self->v_size >> 1;
  char *cString= (char *)_balloc(len + 1);
  memcpy(cString, self->v__bytes, len);
  cString[len]= '\0';
  return (oop)cString;

# undef self
 }
  _1= 0;
  _1= v_self;
  _leave();
  return _1;
  _leave();
 }
static oop String__directoryName(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("directoryName", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop v_dirName= 0;
  oop _1= 0;
  oop _2= 0;
  (void)v_dirName;
  _line(35);
  _1= v_self;
  _2= l_1;
  _line(40);
  _1=_send(s_tokenized_, _1, _2);
  v_dirName= _1;
  _line(40);
  _1=_send(s_removeLast, _1);
  /* ifTrue:ifFalse: */
  _1= v_dirName;
  _line(41);
  _1=_send(s_isEmpty, _1);
  if (!_1) goto _l1;
 {
  _1= l_2;
 }
  goto _l2;
 _l1:;
 {
  _1= v_dirName;
  _2= l_1;
  _line(43);
  _1=_send(s_delimited_, _1, _2);
  _line(43);
  _1=_send(s_flattened, _1);
 }
 _l2:;
  _leave();
  return _1;
  _leave();
 }
static oop String__baseName(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("baseName", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  oop _2= 0;
  _line(46);
  _1= v_self;
  _2= l_3;
  _line(50);
  _1=_send(s_tokenized_, _1, _2);
  _line(50);
  _1=_send(s_last, _1);
  _leave();
  return _1;
  _leave();
 }
static oop String__absolutePathName(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("absolutePathName", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop v_cPath= 0;
  oop _1= 0;
  oop _2= 0;
  (void)v_cPath;
  _line(53);
  _1= v_self;
  _line(60);
  _1=_send(s__5fcString, _1);
  v_cPath= _1;
 {
# define self ((struct t_String *)v_self)
{
      char *path= (char *)v_cPath;
      char buf[PATH_MAX];
#    if defined(WIN32)
      if (!_fullpath(buf, path, PATH_MAX)) return 0;
#    else
      if (!realpath(path, buf)) return 0;
#    endif
      v_cPath= (oop)buf;
    }
# undef self
 }
  _1= 0;
  _1= v_String;
  _2= v_cPath;
  _line(71);
  _1=_send(s_value_5f_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__isReadableFile(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("isReadableFile", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop v_cPath= 0;
  oop _1= 0;
  (void)v_cPath;
  _line(74);
  _1= v_self;
  _line(78);
  _1=_send(s__5fcString, _1);
  v_cPath= _1;
 {
# define self ((struct t_String *)v_self)
{
      char *path= (char *)v_cPath;
      struct stat sb;
      if (-1 == stat(path, &sb)) return 0;
      if (S_IFREG != (sb.st_mode & S_IFMT)) return 0;
      if (-1 == access(path, R_OK)) return 0;
    }
# undef self
 }
  _1= 0;
  _1= v_self;
  _leave();
  return _1;
  _leave();
 }
static oop b_8(oop v__closure, oop v__self, oop v_suffix)
 {
  _enter("[]", "?", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  _line(97);
  /* ifTrue: */
  _1= 0;
  _2= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1];  /* dir */
  _3= l_9;
  _line(98);
  _2=_send(s__2c, _2, _3);
  _3= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_outer)->v_state))[2];  /* self */
  _line(98);
  _2=_send(s__2c, _2, _3);
  _3= v_suffix;
  _line(98);
  _2=_send(s__2c, _2, _3);
  ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_outer)->v_state))[4]= _2;  /* path */
  _line(98);
  _2=_send(s_isReadableFile, _2);
  if (!_2) goto _l3;
 {
  _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_outer)->v_state))[4];  /* path */
  _line(99);
  _1=_send(s_absolutePathName, _1);
  _leave();
  return _nlreturn(((struct t_BlockClosure *)v__self)->v__nlr, _1);
 }
 _l3:;
  _leave();
  return _1;
  _leave();
 }
static oop b_7(oop v__closure, oop v__self, oop v_dir)
 {
  _enter("[]", "?", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _state2= _send(s_new_5f_, v__vector, 2);
  oop _1= 0;
  oop _2= 0;
  ((oop *)_state2)[1]= v_dir;
  _line(96);
  _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1];  /* suffixes */
  /* Scope('suffix'->ArgumentVariableNode) */
  /* Scope('dir'->ArgumentVariableNode) */
  /* Object */
  /* 3 */
  /* 2 */
  _2= _send(s_function_5f_arity_5f_outer_state_nlr_5f_, v_BlockClosure, (oop)b_8, 1, v__self, ((oop *)_state2), ((struct t_BlockClosure *)v__self)->v__nlr);
  _line(97);
  _1=_send(s_do_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__findFileSearching_withSuffixes_ifError_(oop v__closure, oop v_stateful_self, oop v_self, oop v_searchPaths, oop v_suffixes, oop v_errorBlock)
 {
  _enter("findFileSearching:withSuffixes:ifError:", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _state1= _send(s_new_5f_, v__vector, 7);
  oop v_dirs= 0;
  oop _1= 0;
  oop _2= 0;
  jmp_buf __nlr;
  oop _nlr;
  (void)v_dirs;
  ((oop *)_state1)[3]= v_stateful_self;
  ((oop *)_state1)[2]= v_self;
  ((oop *)_state1)[1]= v_suffixes;
  _nlr= (oop)&__nlr;
  if (setjmp(__nlr)) { return _nlresult(); }
  _line(88);
  /* ifTrue:ifFalse: */
  _1= ((oop *)_state1)[2];  /* self */
  _line(95);
  _1=_send(s_first, _1);
  _2= l_4;
  _1= (_1 == _2) ? v_true : v_false;
  if (!_1) goto _l4;
 {
  _1= l_6;
 }
  goto _l5;
 _l4:;
 {
  _1= v_searchPaths;
 }
 _l5:;
  v_dirs= _1;
  _1= v_dirs;
  /* Scope('dir'->ArgumentVariableNode) */
  /* Scope('path'->TemporaryVariableNode 'searchPaths'->ArgumentVariableNode 'dirs'->TemporaryVariableNode 'stateful_self'->ArgumentVariableNode 'size'->SlotVariableNode 'self'->ArgumentVariableNode 'errorBlock'->ArgumentVariableNode 'suffixes'->ArgumentVariableNode '_bytes'->SlotVariableNode) */
  /* nil */
  /* 2 */
  /* 1 */
  _2= _send(s_function_5f_arity_5f_outer_state_nlr_5f_, v_BlockClosure, (oop)b_7, 1, 0, ((oop *)_state1), _nlr);
  _line(96);
  _1=_send(s_do_, _1, _2);
  _1= v_errorBlock;
  _line(100);
  _1=_send(s_value, _1);
  _leave();
  return _1;
  _leave();
 }
static oop b_10(oop v__closure, oop v__self)
 {
  _enter("[]", "?", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  _line(107);
  _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1];  /* self */
  _2= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1];  /* self */
  _3= l_11;
  _line(107);
  _2=_send(s__2c, _2, _3);
  _3= v_Smalltalk;
  _line(107);
  _3=_send(s_osErrorString, _3);
  _line(107);
  _2=_send(s__2c, _2, _3);
  _line(107);
  _1=_send(s_error_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__findFileSearching_withSuffixes_(oop v__closure, oop v_stateful_self, oop v_self, oop v_searchPaths, oop v_suffixes)
 {
  _enter("findFileSearching:withSuffixes:", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _state1= _send(s_new_5f_, v__vector, 5);
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  oop _4= 0;
  ((oop *)_state1)[2]= v_stateful_self;
  ((oop *)_state1)[1]= v_self;
  _line(103);
  _1= ((oop *)_state1)[1];  /* self */
  _2= v_searchPaths;
  _3= v_suffixes;
  /* Scope() */
  /* Scope('_bytes'->SlotVariableNode 'size'->SlotVariableNode 'self'->ArgumentVariableNode 'suffixes'->ArgumentVariableNode 'searchPaths'->ArgumentVariableNode 'stateful_self'->ArgumentVariableNode) */
  /* nil */
  /* 2 */
  /* 1 */
  _4= _send(s_function_5f_arity_5f_outer_state_nlr_5f_, v_BlockClosure, (oop)b_10, 0, 0, ((oop *)_state1), 0);
  _line(105);
  _1=_send(s_findFileSearching_withSuffixes_ifError_, _1, _2, _3, _4);
  _leave();
  return _1;
  _leave();
 }
static oop String__readFromFileNamed_ifError_(oop v__closure, oop v_stateful_self, oop v_self, oop v_path, oop v_errorBlock)
 {
  _enter("readFromFileNamed:ifError:", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop v_cPath= 0;
  oop _1= 0;
  (void)v_cPath;
  _line(111);
  _1= v_self;
  _line(117);
  _1=_send(s__5fclone, _1);
  v_self= _1;
  v_stateful_self= _1;
  _1= v_path;
  _line(118);
  _1=_send(s__5fcString, _1);
  v_cPath= _1;
 {
# define self ((struct t_String *)v_self)
{
      char *path= (char *)v_cPath;
      int fd= open(path, O_RDONLY | O_BINARY);
      if (fd >= 0)
        {
	  int position= 0;
	  int remaining= 0;
          struct stat sb;
          fstat(fd, &sb);
          remaining= sb.st_size;
	  self->v__bytes= _balloc(remaining);
          while (remaining)
            {
	      int count= read(fd, (char *)self->v__bytes + position, remaining);
              if (count < 1)
                break;
              position += count;
              remaining -= count;
	    }
          close(fd);
          if (!remaining)
            {
              self->v_size= (oop)(((long)position << 1) | 1);
              return v_self;
            }
        }
    }
# undef self
 }
  _1= 0;
  _1= v_errorBlock;
  _line(146);
  _1=_send(s_value, _1);
  _leave();
  return _1;
  _leave();
 }
static oop b_12(oop v__closure, oop v__self)
 {
  _enter("[]", "?", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  _line(151);
  _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1];  /* self */
  _2= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[3];  /* path */
  _3= l_13;
  _line(151);
  _2=_send(s__2c, _2, _3);
  _3= v_Smalltalk;
  _line(151);
  _3=_send(s_osErrorString, _3);
  _line(151);
  _2=_send(s__2c, _2, _3);
  _line(151);
  _1=_send(s_error_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__readFromFileNamed_(oop v__closure, oop v_stateful_self, oop v_self, oop v_path)
 {
  _enter("readFromFileNamed:", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _state1= _send(s_new_5f_, v__vector, 6);
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  ((oop *)_state1)[2]= v_stateful_self;
  ((oop *)_state1)[1]= v_self;
  ((oop *)_state1)[3]= v_path;
  _line(149);
  _1= ((oop *)_state1)[1];  /* self */
  _2= ((oop *)_state1)[3];  /* path */
  /* Scope() */
  /* Scope('size'->SlotVariableNode 'self'->ArgumentVariableNode 'path'->ArgumentVariableNode '_bytes'->SlotVariableNode 'stateful_self'->ArgumentVariableNode) */
  /* nil */
  /* 2 */
  /* 1 */
  _3= _send(s_function_5f_arity_5f_outer_state_nlr_5f_, v_BlockClosure, (oop)b_12, 0, 0, ((oop *)_state1), 0);
  _line(151);
  _1=_send(s_readFromFileNamed_ifError_, _1, _2, _3);
  _leave();
  return _1;
  _leave();
 }
static oop String__fileContents(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("fileContents", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  oop _2= 0;
  _line(154);
  _1= v_self;
  _2= v_self;
  _line(157);
  _1=_send(s_readFromFileNamed_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__writeToFileNamed_ifError_(oop v__closure, oop v_stateful_self, oop v_self, oop v_path, oop v_errorBlock)
 {
  _enter("writeToFileNamed:ifError:", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop v_cPath= 0;
  oop _1= 0;
  (void)v_cPath;
  _line(160);
  _1= v_path;
  _line(165);
  _1=_send(s__5fcString, _1);
  v_cPath= _1;
 {
# define self ((struct t_String *)v_self)
{
      char *path= (char *)v_cPath;
      int fd= open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
      if (fd >= 0)
        {
	  int position= 0;
	  int remaining= (int)self->v_size >> 1;
          while (remaining)
            {
	      int count= write(fd, (char *)self->v__bytes + position, remaining);
              if (count < 1)
                break;
              position += count;
              remaining -= count;
	    }
          close(fd);
          if (!remaining)
            return v_self;
        }
    }
# undef self
 }
  _1= 0;
  _1= v_errorBlock;
  _line(186);
  _1=_send(s_value, _1);
  _leave();
  return _1;
  _leave();
 }
static oop b_14(oop v__closure, oop v__self)
 {
  _enter("[]", "?", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  _line(191);
  _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1];  /* self */
  _2= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[3];  /* path */
  _3= l_15;
  _line(191);
  _2=_send(s__2c, _2, _3);
  _3= v_Smalltalk;
  _line(191);
  _3=_send(s_osErrorString, _3);
  _line(191);
  _2=_send(s__2c, _2, _3);
  _line(191);
  _1=_send(s_error_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__writeToFileNamed_(oop v__closure, oop v_stateful_self, oop v_self, oop v_path)
 {
  _enter("writeToFileNamed:", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _state1= _send(s_new_5f_, v__vector, 6);
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  ((oop *)_state1)[2]= v_stateful_self;
  ((oop *)_state1)[1]= v_self;
  ((oop *)_state1)[3]= v_path;
  _line(189);
  _1= ((oop *)_state1)[1];  /* self */
  _2= ((oop *)_state1)[3];  /* path */
  /* Scope() */
  /* Scope('size'->SlotVariableNode 'self'->ArgumentVariableNode 'path'->ArgumentVariableNode '_bytes'->SlotVariableNode 'stateful_self'->ArgumentVariableNode) */
  /* nil */
  /* 2 */
  /* 1 */
  _3= _send(s_function_5f_arity_5f_outer_state_nlr_5f_, v_BlockClosure, (oop)b_14, 0, 0, ((oop *)_state1), 0);
  _line(191);
  _1=_send(s_writeToFileNamed_ifError_, _1, _2, _3);
  _leave();
  return _1;
  _leave();
 }
static oop String__strftimeNow(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("strftimeNow", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop v__format= 0;
  oop v__buf= 0;
  oop _1= 0;
  oop _2= 0;
  (void)v__format;
  (void)v__buf;
  _line(196);
  _1= v_self;
  _line(199);
  _1=_send(s__5fcString, _1);
  v__format= _1;
 {
# define self ((struct t_String *)v_self)

      char buf[32];
      time_t clock= time(0);
      strftime(buf, sizeof(buf), (const char *)v__format, localtime(&clock));
      v__buf= (oop)buf;
    
# undef self
 }
  _1= 0;
  _1= v_String;
  _2= v__buf;
  _line(206);
  _1=_send(s_value_5f_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__strftimeZulu(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("strftimeZulu", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop v__format= 0;
  oop v__buf= 0;
  oop _1= 0;
  oop _2= 0;
  (void)v__format;
  (void)v__buf;
  _line(209);
  _1= v_self;
  _line(212);
  _1=_send(s__5fcString, _1);
  v__format= _1;
 {
# define self ((struct t_String *)v_self)

      char buf[32];
      time_t clock= time(0);
      strftime(buf, sizeof(buf), (const char *)v__format, gmtime(&clock));
      v__buf= (oop)buf;
    
# undef self
 }
  _1= 0;
  _1= v_String;
  _2= v__buf;
  _line(219);
  _1=_send(s_value_5f_, _1, _2);
  _leave();
  return _1;
  _leave();
 }
static oop String__dateStamp(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("dateStamp", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  _line(222);
  _1= l_16;
  _line(222);
  _1=_send(s_strftimeNow, _1);
  _leave();
  return _1;
  _leave();
 }
static oop String__timeStamp(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("timeStamp", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  _line(223);
  _1= l_17;
  _line(223);
  _1=_send(s_strftimeNow, _1);
  _leave();
  return _1;
  _leave();
 }
static oop String__dateAndTimeStamp(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("dateAndTimeStamp", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  _line(224);
  _1= l_18;
  _line(224);
  _1=_send(s_strftimeNow, _1);
  _leave();
  return _1;
  _leave();
 }
static oop String__dateAndTimeZoneStamp(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("dateAndTimeZoneStamp", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  _line(225);
  _1= l_19;
  _line(225);
  _1=_send(s_strftimeNow, _1);
  _leave();
  return _1;
  _leave();
 }
static oop String__dateAndTimeZuluStamp(oop v__closure, oop v_stateful_self, oop v_self)
 {
  _enter("dateAndTimeZuluStamp", "String", "/home/saintiss/source/svn/stIdst_278/object/idc/StringIO.st");
  oop _1= 0;
  _line(226);
  _1= l_20;
  _line(226);
  _1=_send(s_strftimeZulu, _1);
  _leave();
  return _1;
  _leave();
 }

void __id__init__StringIO(void)
{
  if (_local_object) return;
  { 
    dlhandle_t global= dlopen(0, RTLD_LAZY);
    _local_object= *(oop *)dlsym(global, "_libid_object");
    _local_param= dlsym(global, "_libid_param");
    _local_intern= dlsym(global, "_libid_intern");
    _local_proto= dlsym(global, "_libid_proto");
    _local_import= dlsym(global, "_libid_import");
    _local_export= dlsym(global, "_libid_export");
    _local_method= dlsym(global, "_libid_method");
    _local_alloc= dlsym(global, "_libid_alloc");
    _local_palloc= dlsym(global, "_libid_palloc");
    _local_balloc= dlsym(global, "_libid_balloc");
    _local_bind= dlsym(global, "_libid_bind");
    _local_nlreturn= dlsym(global, "_libid_nlreturn");
    _local_nlresult= dlsym(global, "_libid_nlresult");
    _local_enter= dlsym(global, "_libid_enter");
    _local_line= dlsym(global, "_libid_line");
    _local_leave= dlsym(global, "_libid_leave");
    _local_backtrace= dlsym(global, "_libid_backtrace");
    _local_tag_vtable= dlsym(global, "_libid_tag_vtable");
    _local_nil_vtable= dlsym(global, "_libid_nil_vtable");
    _local_gc_addRoots= dlsym(global, "GC_add_roots");
    _local_gc_unregisterDisappearingLink= dlsym(global, "GC_unregister_disappearing_link");
    _local_gc_generalRegisterDisappearingLink= dlsym(global, "GC_general_register_disappearing_link");
    _local_gc_gcollect= dlsym(global, "GC_gcollect");
    dlclose(global);
  }
# define GC_add_roots _local_gc_addRoots
  GC_INIT();
  {
    struct _Selector *s= 0;
    for (s= _Selectors;  s->name;  ++s)
      *s->addr= _selector(s->name);
  }
  _enter("__id__init__", "<initialisation>", "StringIO.st");

  _send(s__5fimport_, _local_object, "String", "__id__init__String");
  _send(s__5fimport_, _local_object, "ByteArray", "__id__init__ByteArray");
  _send(s__5fimport_, _local_object, "ArrayedCollection", "__id__init__ArrayedCollection");
  _send(s__5fimport_, _local_object, "SequenceableCollection", "__id__init__SequenceableCollection");
  _send(s__5fimport_, _local_object, "Collection", "__id__init__Collection");
  _send(s__5fimport_, _local_object, "Object", "__id__init__Object");
  _send(s__5fimport_, _local_object, "_object", "__id__init___5fobject");
  v__object= _id_import("_object");
  v__vector= _id_import("_vector");
  v_Object= _id_import("Object");
  v_UndefinedObject= _id_import("UndefinedObject");
  v_StaticBlockClosure= _id_import("StaticBlockClosure");
  v_BlockClosure= _id_import("BlockClosure");
  v_Magnitude= _id_import("Magnitude");
  v_Character= _id_import("Character");
  v_Number= _id_import("Number");
  v_Integer= _id_import("Integer");
  v_LargePositiveInteger= _id_import("LargePositiveInteger");
  v_Collection= _id_import("Collection");
  v_SequenceableCollection= _id_import("SequenceableCollection");
  v_ArrayedCollection= _id_import("ArrayedCollection");
  v_Array= _id_import("Array");
  v_ImmutableArray= _id_import("ImmutableArray");
  v_WordArray= _id_import("WordArray");
  v_ByteArray= _id_import("ByteArray");
  v_String= _id_import("String");
  v_ImmutableString= _id_import("ImmutableString");
  v_true= _id_import("true");
  v_false= _id_import("false");
  _send(s__5fimport_, _local_object, "BlockClosure", "__id__init__BlockClosure");
  _send(s__5fimport_, _local_object, "SmallInteger", "__id__init__SmallInteger");
  _send(s__5fimport_, _local_object, "Integer", "__id__init__Integer");
  _send(s__5fimport_, _local_object, "Number", "__id__init__Number");
  _send(s__5fimport_, _local_object, "Magnitude", "__id__init__Magnitude");
  _send(s__5fimport_, _local_object, "Array", "__id__init__Array");
  _send(s__5fimport_, _local_object, "Character", "__id__init__Character");
  _send(s__5fimport_, _local_object, "WordArray", "__id__init__WordArray");
  _send(s__5fimport_, _local_object, "Smalltalk", "__id__init__Smalltalk");
  v_Smalltalk= _id_import("Smalltalk");
  _method(v_String, s__5fcString, String___5fcString);
  l_1= _send(s_size_5f_value_5f_, v_ImmutableString, 1, "/");
  l_2= _send(s_size_5f_value_5f_, v_ImmutableString, 1, ".");
  _method(v_String, s_directoryName, String__directoryName);
  l_3= _send(s_size_5f_value_5f_, v_ImmutableString, 1, "/");
  _method(v_String, s_baseName, String__baseName);
  _method(v_String, s_absolutePathName, String__absolutePathName);
  _method(v_String, s_isReadableFile, String__isReadableFile);
  l_4= _send(s_value_5f_, v_Character, 47);
  l_5= _send(s_size_5f_value_5f_, v_ImmutableString, 0, "");
  l_6= _send(s_size_5f_value_5f_, v_ImmutableArray, 1, al_6);
  l_9= _send(s_size_5f_value_5f_, v_ImmutableString, 1, "/");
  _method(v_String, s_findFileSearching_withSuffixes_ifError_, String__findFileSearching_withSuffixes_ifError_);
  l_11= _send(s_size_5f_value_5f_, v_ImmutableString, 2, ": ");
  _method(v_String, s_findFileSearching_withSuffixes_, String__findFileSearching_withSuffixes_);
  _method(v_String, s_readFromFileNamed_ifError_, String__readFromFileNamed_ifError_);
  l_13= _send(s_size_5f_value_5f_, v_ImmutableString, 2, ": ");
  _method(v_String, s_readFromFileNamed_, String__readFromFileNamed_);
  _method(v_String, s_fileContents, String__fileContents);
  _method(v_String, s_writeToFileNamed_ifError_, String__writeToFileNamed_ifError_);
  l_15= _send(s_size_5f_value_5f_, v_ImmutableString, 2, ": ");
  _method(v_String, s_writeToFileNamed_, String__writeToFileNamed_);
  _method(v_String, s_strftimeNow, String__strftimeNow);
  _method(v_String, s_strftimeZulu, String__strftimeZulu);
  l_16= _send(s_size_5f_value_5f_, v_ImmutableString, 8, "%Y-%m-%d");
  _method(v_String, s_dateStamp, String__dateStamp);
  l_17= _send(s_size_5f_value_5f_, v_ImmutableString, 8, "%H:%M:%S");
  _method(v_String, s_timeStamp, String__timeStamp);
  l_18= _send(s_size_5f_value_5f_, v_ImmutableString, 17, "%Y-%m-%d %H:%M:%S");
  _method(v_String, s_dateAndTimeStamp, String__dateAndTimeStamp);
  l_19= _send(s_size_5f_value_5f_, v_ImmutableString, 20, "%Y-%m-%d %H:%M:%S %Z");
  _method(v_String, s_dateAndTimeZoneStamp, String__dateAndTimeZoneStamp);
  l_20= _send(s_size_5f_value_5f_, v_ImmutableString, 19, "%Y-%m-%d %H:%M:%S Z");
  _method(v_String, s_dateAndTimeZuluStamp, String__dateAndTimeZuluStamp);
  _leave();
}
