/* Generated by Nim Compiler v1.3.5 */
/*   (c) 2020 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 64

/* section: NIM_merge_HEADERS */

#include "nimbase.h"
#include <stdio.h>
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix

/* section: NIM_merge_FRAME_DEFINES */
#define nimfr_(x, y)
#define nimln_(x, y)

/* section: NIM_merge_FORWARD_TYPES */
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ;
typedef struct RootObj RootObj;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
typedef struct tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ;
typedef struct tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw;
typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
typedef struct Exception Exception;
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
typedef struct tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw;
typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;

/* section: NIM_merge_TYPES */
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
NI align;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct RootObj {
TNimType* m_type;
};
typedef N_NIMCALL_PTR(void, tyProc__JQrsH08b4uPTH9cyFPlVOZg) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__9bmhFrLahRsL2hltfRDVtlQ) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(void, tyProc__3svSoGIUJIsHkaBL7q4DAQ) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NI pos);
typedef N_NIMCALL_PTR(NI, tyProc__xflqkf2D1uVClg70czEDHA) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef N_NIMCALL_PTR(NI, tyProc__c9c0f59ak4YGQ6neEym8LPKw) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice);
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__7jFfqMk9ajToCz6Hv9atCA4A) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** line);
typedef N_NIMCALL_PTR(NI, tyProc__2VVzVL9bOnKhj1eZKkf9cEuA) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
typedef N_NIMCALL_PTR(void, tyProc__ki6p1QyfOkJLQJ9aw5NI0AQ) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
struct tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ {
  RootObj Sup;
tyProc__JQrsH08b4uPTH9cyFPlVOZg closeImpl;
tyProc__9bmhFrLahRsL2hltfRDVtlQ atEndImpl;
tyProc__3svSoGIUJIsHkaBL7q4DAQ setPositionImpl;
tyProc__xflqkf2D1uVClg70czEDHA getPositionImpl;
tyProc__c9c0f59ak4YGQ6neEym8LPKw readDataStrImpl;
tyProc__7jFfqMk9ajToCz6Hv9atCA4A readLineImpl;
tyProc__2VVzVL9bOnKhj1eZKkf9cEuA readDataImpl;
tyProc__2VVzVL9bOnKhj1eZKkf9cEuA peekDataImpl;
tyProc__ki6p1QyfOkJLQJ9aw5NI0AQ writeDataImpl;
tyProc__JQrsH08b4uPTH9cyFPlVOZg flushImpl;
};
struct tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ {
  tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ Sup;
FILE* f;
};
typedef NU8 tyEnum_FileSeekPos__I9aQjuvWxs8BspGbxwsngWw;
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
NI a;
NI b;
};
struct Exception {
  RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
Exception* up;
};
struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
  Exception Sup;
};
struct tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw {
  tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
};
struct tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw {
  tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ Sup;
NimStringDesc* data;
NI pos;
};
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};

/* section: NIM_merge_SEQ_TYPES */
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
  TGenericSeq Sup;
  tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
};

/* section: NIM_merge_PROC_HEADERS */
static N_NIMCALL(void, Marker_tyRef__1G0jiQbe7KwD5ADza5AZaw)(void* p, NI op);
static N_NIMCALL(void, Marker_tyRef__y4kGpp4Cn6oTOCWBJMIxAg)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NIMCALL(void, fsClose__y1KA3B0U09bKtU09am9a9avRYQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(void, close__fU6ZlJAtQ9bre04EDZLdGsA)(FILE* f);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, fsAtEnd__i3a7v4VsGcqjjJxfg0YUUg)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, endOfFile__FK5lmHTzEdX6epYBp9bfgMg)(FILE* f);
N_LIB_PRIVATE N_NIMCALL(void, fsSetPosition__cci01mizUCs1g9a9bQPBwweQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NI pos);
N_LIB_PRIVATE N_NIMCALL(void, setFilePos__FA7rp0y5drPpfGuceb3IJg)(FILE* f, NI64 pos, tyEnum_FileSeekPos__I9aQjuvWxs8BspGbxwsngWw relativeTo);
N_LIB_PRIVATE N_NIMCALL(NI, fsGetPosition__9aSaecE8PQfXbgmZSvJsfYw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NI64, getFilePos__ihE3HyH1VBDfrPO1nZT7RQ)(FILE* f);
N_LIB_PRIVATE N_NIMCALL(NI, fsReadDataStr__78VQwN48e7jIIL2Q9bINIFw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice);
N_LIB_PRIVATE N_NIMCALL(NI, readBuffer__Y9atVWUcVyKHG9aBP4D0P9czA_2)(FILE* f, void* buffer, NI len);
N_LIB_PRIVATE N_NIMCALL(NI, fsReadData__xdahQHwcesKp9bR6BAtJSqA)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, fsReadLine__9ab9cEjuwJspa9a1pTeb1Z1BQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** line);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, readLine__FbqDHP9bu7nqCh9c04dnSOxw)(FILE* f, NimStringDesc** line);
N_LIB_PRIVATE N_NIMCALL(NI, fsPeekData__xdahQHwcesKp9bR6BAtJSqA_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
N_LIB_PRIVATE N_NIMCALL(void, fsWriteData__4hIni0uSy3RpPUiO9aB3JUQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
N_LIB_PRIVATE N_NIMCALL(NI, writeBuffer__Y9atVWUcVyKHG9aBP4D0P9czA)(FILE* f, void* buffer, NI len);
N_LIB_PRIVATE N_NIMCALL(tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*, newEIO__Ygv4g5RSSeYVT2oEYcgHSw)(NimStringDesc* msg);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
N_LIB_PRIVATE N_NIMCALL(void, fsFlush__y1KA3B0U09bKtU09am9a9avRYQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(void, flushFile__fU6ZlJAtQ9bre04EDZLdGsA_3)(FILE* f);
N_LIB_PRIVATE N_NIMCALL(void, writeData__4hIni0uSy3RpPUiO9aB3JUQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, readChar__0QXrv9cjavWimTiE9cMCngDw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NI, readData__xdahQHwcesKp9bR6BAtJSqA_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tyRef__Z9cj1NxLXx79cYy9c4gbj6CAA)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void, ssClose__y1KA3B0U09bKtU09am9a9avRYQ_4)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, ssAtEnd__i3a7v4VsGcqjjJxfg0YUUg_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(void, ssSetPosition__cci01mizUCs1g9a9bQPBwweQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NI pos);
N_LIB_PRIVATE N_NIMCALL(NI, clamp__hyQgGui0RxAott4YXwjJHQ)(NI x, NI a, NI b);
N_LIB_PRIVATE N_NIMCALL(NI, ssGetPosition__9aSaecE8PQfXbgmZSvJsfYw_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NI, ssReadDataStr__78VQwN48e7jIIL2Q9bINIFw_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice);
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_LIB_PRIVATE N_NIMCALL(NI, ssReadData__xdahQHwcesKp9bR6BAtJSqA_4)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
N_LIB_PRIVATE N_NIMCALL(NI, ssPeekData__xdahQHwcesKp9bR6BAtJSqA_5)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
N_LIB_PRIVATE N_NIMCALL(void, ssWriteData__4hIni0uSy3RpPUiO9aB3JUQ_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);

/* section: NIM_merge_DATA */
extern TNimType NTI__ytyiCJqK439aF9cIibuRVpAg_;
N_LIB_PRIVATE TNimType NTI__THYguAi9bSgidczZ3ywEIMQ_;
N_LIB_PRIVATE TNimType NTI__JQrsH08b4uPTH9cyFPlVOZg_;
N_LIB_PRIVATE TNimType NTI__9bmhFrLahRsL2hltfRDVtlQ_;
N_LIB_PRIVATE TNimType NTI__3svSoGIUJIsHkaBL7q4DAQ_;
N_LIB_PRIVATE TNimType NTI__xflqkf2D1uVClg70czEDHA_;
N_LIB_PRIVATE TNimType NTI__c9c0f59ak4YGQ6neEym8LPKw_;
N_LIB_PRIVATE TNimType NTI__7jFfqMk9ajToCz6Hv9atCA4A_;
N_LIB_PRIVATE TNimType NTI__2VVzVL9bOnKhj1eZKkf9cEuA_;
N_LIB_PRIVATE TNimType NTI__ki6p1QyfOkJLQJ9aw5NI0AQ_;
N_LIB_PRIVATE TNimType NTI__1G0jiQbe7KwD5ADza5AZaw_;
N_LIB_PRIVATE TNimType NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_;
extern TNimType NTI__XBeRj4rw9bUuE7CB3DS1rgg_;
N_LIB_PRIVATE TNimType NTI__y4kGpp4Cn6oTOCWBJMIxAg_;
extern TNimType NTI__HMIVdYjdZYWskTmTQVo5BQ_;
extern TNimType NTI__iLZrPn9anoh9ad1MmO0RczFw_;
STRING_LITERAL(TM__Ue7tnBcsL67VCiRfvt8q0A_3, "cannot write to stream", 22);
N_LIB_PRIVATE TNimType NTI__Olau5FPRehZBBEB77FHnfw_;
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
extern TNimType NTI__rR5Bzr1D5krxoo1NcNyeMA_;
N_LIB_PRIVATE TNimType NTI__Z9cj1NxLXx79cYy9c4gbj6CAA_;

/* section: NIM_merge_VARS */
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;

/* section: NIM_merge_PROCS */
static N_NIMCALL(void, Marker_tyRef__1G0jiQbe7KwD5ADza5AZaw)(void* p, NI op) {
	tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* a;
	a = (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*)p;
}
static N_NIMCALL(void, Marker_tyRef__y4kGpp4Cn6oTOCWBJMIxAg)(void* p, NI op) {
	tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ* a;
	a = (tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*)p;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (NIM_BOOL*)0;
	result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, fsClose__y1KA3B0U09bKtU09am9a9avRYQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		if (!!(((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f == NIM_NIL))) goto LA3_;
		close__fU6ZlJAtQ9bre04EDZLdGsA((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		(*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f = NIM_NIL;
	}
	LA3_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, fsAtEnd__i3a7v4VsGcqjjJxfg0YUUg)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	result = endOfFile__FK5lmHTzEdX6epYBp9bfgMg((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, fsSetPosition__cci01mizUCs1g9a9bQPBwweQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NI pos) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	setFilePos__FA7rp0y5drPpfGuceb3IJg((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f, ((NI64) (pos)), ((tyEnum_FileSeekPos__I9aQjuvWxs8BspGbxwsngWw) 0));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NI, fsGetPosition__9aSaecE8PQfXbgmZSvJsfYw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
	NI result;
	NI64 T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	T1_ = (NI64)0;
	T1_ = getFilePos__ihE3HyH1VBDfrPO1nZT7RQ((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = ((NI) (T1_));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, fsReadDataStr__78VQwN48e7jIIL2Q9bINIFw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice) {
	NI result;
	void* T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	T1_ = (void*)0;
	T1_ = ((void*) ((&(*buffer)->data[slice.a])));
	result = readBuffer__Y9atVWUcVyKHG9aBP4D0P9czA_2((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f, T1_, ((NI) ((NI)((NI)(slice.b + ((NI) 1)) - slice.a))));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, fsReadData__xdahQHwcesKp9bR6BAtJSqA)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	result = readBuffer__Y9atVWUcVyKHG9aBP4D0P9czA_2((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f, buffer, ((NI) (bufLen)));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, fsReadLine__9ab9cEjuwJspa9a1pTeb1Z1BQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** line) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	result = readLine__FbqDHP9bu7nqCh9c04dnSOxw((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f, line);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, fsPeekData__xdahQHwcesKp9bR6BAtJSqA_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
	NI result;
	NI pos;
NIM_BOOL oldNimErrFin1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	pos = fsGetPosition__9aSaecE8PQfXbgmZSvJsfYw(s);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = readBuffer__Y9atVWUcVyKHG9aBP4D0P9czA_2((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f, buffer, ((NI) (bufLen)));
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		LA1_:;
	}
	{
		oldNimErrFin1_ = *nimErr_; *nimErr_ = NIM_FALSE;
		fsSetPosition__cci01mizUCs1g9a9bQPBwweQ(s, pos);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		*nimErr_ = oldNimErrFin1_;
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*, newEIO__Ygv4g5RSSeYVT2oEYcgHSw)(NimStringDesc* msg) {
	tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw* result;
	result = (tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*)0;
	result = (tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*) newObj((&NTI__HMIVdYjdZYWskTmTQVo5BQ_), sizeof(tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw));
	(*result).Sup.Sup.Sup.m_type = (&NTI__iLZrPn9anoh9ad1MmO0RczFw_);
	(*result).Sup.Sup.name = "IOError";
	(*result).Sup.Sup.message = copyString(msg);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, fsWriteData__4hIni0uSy3RpPUiO9aB3JUQ)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NI T3_;
		tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw* T6_;
		T3_ = (NI)0;
		T3_ = writeBuffer__Y9atVWUcVyKHG9aBP4D0P9czA((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f, buffer, ((NI) (bufLen)));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!((T3_ == bufLen))) goto LA4_;
		T6_ = (tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*)0;
		T6_ = newEIO__Ygv4g5RSSeYVT2oEYcgHSw(((NimStringDesc*) &TM__Ue7tnBcsL67VCiRfvt8q0A_3));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseExceptionEx((Exception*)T6_, "IOError", "fsWriteData", "streams.nim", 1334);
		goto BeforeRet_;
	}
	LA4_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, fsFlush__y1KA3B0U09bKtU09am9a9avRYQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	flushFile__fU6ZlJAtQ9bre04EDZLdGsA_3((*((tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) (s))).f);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*, newFileStream__L2sCmH55dBWs0l9aUTvGiSw)(FILE* f) {
	tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ* result;
	result = (tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*)0;
	result = (tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*) newObj((&NTI__y4kGpp4Cn6oTOCWBJMIxAg_), sizeof(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ));
	(*result).Sup.Sup.m_type = (&NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_);
	(*result).f = f;
	(*result).Sup.closeImpl = fsClose__y1KA3B0U09bKtU09am9a9avRYQ;
	(*result).Sup.atEndImpl = fsAtEnd__i3a7v4VsGcqjjJxfg0YUUg;
	(*result).Sup.setPositionImpl = fsSetPosition__cci01mizUCs1g9a9bQPBwweQ;
	(*result).Sup.getPositionImpl = fsGetPosition__9aSaecE8PQfXbgmZSvJsfYw;
	(*result).Sup.readDataStrImpl = fsReadDataStr__78VQwN48e7jIIL2Q9bINIFw;
	(*result).Sup.readDataImpl = fsReadData__xdahQHwcesKp9bR6BAtJSqA;
	(*result).Sup.readLineImpl = fsReadLine__9ab9cEjuwJspa9a1pTeb1Z1BQ;
	(*result).Sup.peekDataImpl = fsPeekData__xdahQHwcesKp9bR6BAtJSqA_2;
	(*result).Sup.writeDataImpl = fsWriteData__4hIni0uSy3RpPUiO9aB3JUQ;
	(*result).Sup.flushImpl = fsFlush__y1KA3B0U09bKtU09am9a9avRYQ_2;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, writeData__4hIni0uSy3RpPUiO9aB3JUQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	(*s).writeDataImpl(s, buffer, bufLen);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s) {
	NCSTRING result;
	result = (NCSTRING)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (s == NIM_NIL);
		if (T3_) goto LA4_;
		T3_ = ((*s).Sup.len == ((NI) 0));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = "";
	}
	goto LA1_;
	LA5_: ;
	{
		result = ((NCSTRING) ((*s).data));
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, write__egjcKjt8WddLFyjTFl5BAw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc* x) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		void* T5_;
		if (!(((NI) 0) < (x ? x->Sup.len : 0))) goto LA3_;
		T5_ = (void*)0;
		T5_ = ((void*) (nimToCStringConv(x)));
		writeData__4hIni0uSy3RpPUiO9aB3JUQ_2(s, T5_, (x ? x->Sup.len : 0));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA3_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, close__y1KA3B0U09bKtU09am9a9avRYQ_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		if (!!(((*s).closeImpl == 0))) goto LA3_;
		(*s).closeImpl(s);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA3_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NI, readData__xdahQHwcesKp9bR6BAtJSqA_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	result = (*s).readDataImpl(s, buffer, bufLen);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, readChar__0QXrv9cjavWimTiE9cMCngDw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
	NIM_CHAR result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_CHAR)0;
	{
		{
			NI T4_;
			T4_ = (NI)0;
			T4_ = readData__xdahQHwcesKp9bR6BAtJSqA_3(s, ((void*) ((&result))), ((NI) 1));
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			if (!!((T4_ == ((NI) 1)))) goto LA5_;
			result = 0;
		}
		LA5_: ;
	}
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, readLine__9ab9cEjuwJspa9a1pTeb1Z1BQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** line) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	{
		if (!!(((*s).readLineImpl == NIM_NIL))) goto LA3_;
		result = (*s).readLineImpl(s, line);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		(*line) = setLengthStr((*line), ((NI) 0));
		{
			while (1) {
				NIM_CHAR c;
				c = readChar__0QXrv9cjavWimTiE9cMCngDw(s);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				{
					if (!((NU8)(c) == (NU8)(13))) goto LA10_;
					c = readChar__0QXrv9cjavWimTiE9cMCngDw(s);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					goto LA6;
				}
				goto LA8_;
				LA10_: ;
				{
					if (!((NU8)(c) == (NU8)(10))) goto LA13_;
					goto LA6;
				}
				goto LA8_;
				LA13_: ;
				{
					if (!((NU8)(c) == (NU8)(0))) goto LA16_;
					{
						if (!(((NI) 0) < ((*line) ? (*line)->Sup.len : 0))) goto LA20_;
						goto LA6;
					}
					goto LA18_;
					LA20_: ;
					{
						result = NIM_FALSE;
						goto BeforeRet_;
					}
					LA18_: ;
				}
				goto LA8_;
				LA16_: ;
				LA8_: ;
				(*line) = addChar((*line), c);
			}
		} LA6: ;
		result = NIM_TRUE;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, readDataStr__78VQwN48e7jIIL2Q9bINIFw_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	{
		if (!!(((*s).readDataStrImpl == NIM_NIL))) goto LA3_;
		result = (*s).readDataStrImpl(s, buffer, slice);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		void* T6_;
		T6_ = (void*)0;
		T6_ = ((void*) ((&(*buffer)->data[((NI) 0)])));
		result = readData__xdahQHwcesKp9bR6BAtJSqA_3(s, T6_, ((*buffer) ? (*buffer)->Sup.len : 0));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_NIMCALL(void, Marker_tyRef__Z9cj1NxLXx79cYy9c4gbj6CAA)(void* p, NI op) {
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* a;
	a = (tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*)p;
	nimGCvisit((void*)(*a).data, op);
}
N_LIB_PRIVATE N_NIMCALL(void, ssClose__y1KA3B0U09bKtU09am9a9avRYQ_4)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	(*s_2).data = ((NimStringDesc*) NIM_NIL);
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, ssAtEnd__i3a7v4VsGcqjjJxfg0YUUg_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
	NIM_BOOL result;
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
{	result = (NIM_BOOL)0;
	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	result = (((*s_2).data ? (*s_2).data->Sup.len : 0) <= (*s_2).pos);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, ssSetPosition__cci01mizUCs1g9a9bQPBwweQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NI pos) {
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	(*s_2).pos = clamp__hyQgGui0RxAott4YXwjJHQ(pos, ((NI) 0), ((*s_2).data ? (*s_2).data->Sup.len : 0));
}
N_LIB_PRIVATE N_NIMCALL(NI, ssGetPosition__9aSaecE8PQfXbgmZSvJsfYw_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s) {
	NI result;
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
{	result = (NI)0;
	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	result = (*s_2).pos;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest, source, ((size_t) (size)));
}
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {
	nimCopyMem(dest, source, size);
}
N_LIB_PRIVATE N_NIMCALL(NI, ssReadDataStr__78VQwN48e7jIIL2Q9bINIFw_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice) {
	NI result;
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
	result = (NI)0;
	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	result = (((NI)((NI)(slice.b + ((NI) 1)) - slice.a) <= (NI)(((*s_2).data ? (*s_2).data->Sup.len : 0) - (*s_2).pos)) ? (NI)((NI)(slice.b + ((NI) 1)) - slice.a) : (NI)(((*s_2).data ? (*s_2).data->Sup.len : 0) - (*s_2).pos));
	{
		if (!(((NI) 0) < result)) goto LA3_;
		{
			copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*buffer)->data[slice.a]))), ((void*) ((&(*s_2).data->data[(*s_2).pos]))), ((NI) (result)));
		}
		(*s_2).pos += result;
	}
	goto LA1_;
	LA3_: ;
	{
		result = ((NI) 0);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, ssReadData__xdahQHwcesKp9bR6BAtJSqA_4)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
	NI result;
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
	result = (NI)0;
	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	result = ((bufLen <= (NI)(((*s_2).data ? (*s_2).data->Sup.len : 0) - (*s_2).pos)) ? bufLen : (NI)(((*s_2).data ? (*s_2).data->Sup.len : 0) - (*s_2).pos));
	{
		if (!(((NI) 0) < result)) goto LA3_;
		copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(buffer, ((void*) ((&(*s_2).data->data[(*s_2).pos]))), ((NI) (result)));
		(*s_2).pos += result;
	}
	goto LA1_;
	LA3_: ;
	{
		result = ((NI) 0);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, ssPeekData__xdahQHwcesKp9bR6BAtJSqA_5)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
	NI result;
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
	result = (NI)0;
	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	result = ((bufLen <= (NI)(((*s_2).data ? (*s_2).data->Sup.len : 0) - (*s_2).pos)) ? bufLen : (NI)(((*s_2).data ? (*s_2).data->Sup.len : 0) - (*s_2).pos));
	{
		if (!(((NI) 0) < result)) goto LA3_;
		copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(buffer, ((void*) ((&(*s_2).data->data[(*s_2).pos]))), ((NI) (result)));
	}
	goto LA1_;
	LA3_: ;
	{
		result = ((NI) 0);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, ssWriteData__4hIni0uSy3RpPUiO9aB3JUQ_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen) {
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* s_2;
{	s_2 = ((tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) (s));
	{
		if (!(bufLen <= ((NI) 0))) goto LA3_;
		goto BeforeRet_;
	}
	LA3_: ;
	{
		if (!(((*s_2).data ? (*s_2).data->Sup.len : 0) < (NI)((*s_2).pos + bufLen))) goto LA7_;
		(*s_2).data = setLengthStr((*s_2).data, ((NI) ((NI)((*s_2).pos + bufLen))));
	}
	LA7_: ;
	copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*s_2).data->data[(*s_2).pos]))), buffer, ((NI) (bufLen)));
	(*s_2).pos += bufLen;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*, newStringStream__9aLRtgEYeRMrZKrObtoOslQ)(NimStringDesc* s) {
	tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw* result;
	result = (tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*)0;
	result = (tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*) newObj((&NTI__Z9cj1NxLXx79cYy9c4gbj6CAA_), sizeof(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw));
	(*result).Sup.Sup.m_type = (&NTI__Olau5FPRehZBBEB77FHnfw_);
	(*result).data = copyString(s);
	(*result).pos = ((NI) 0);
	(*result).Sup.closeImpl = ssClose__y1KA3B0U09bKtU09am9a9avRYQ_4;
	(*result).Sup.atEndImpl = ssAtEnd__i3a7v4VsGcqjjJxfg0YUUg_2;
	(*result).Sup.setPositionImpl = ssSetPosition__cci01mizUCs1g9a9bQPBwweQ_2;
	(*result).Sup.getPositionImpl = ssGetPosition__9aSaecE8PQfXbgmZSvJsfYw_2;
	(*result).Sup.readDataStrImpl = ssReadDataStr__78VQwN48e7jIIL2Q9bINIFw_3;
	(*result).Sup.readDataImpl = ssReadData__xdahQHwcesKp9bR6BAtJSqA_4;
	(*result).Sup.peekDataImpl = ssPeekData__xdahQHwcesKp9bR6BAtJSqA_5;
	(*result).Sup.writeDataImpl = ssWriteData__4hIni0uSy3RpPUiO9aB3JUQ_3;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_streamsDatInit000)(void) {

/* section: NIM_merge_TYPE_INIT1 */
static TNimNode* TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[10];
static TNimNode* TM__Ue7tnBcsL67VCiRfvt8q0A_4_2[2];
static TNimNode TM__Ue7tnBcsL67VCiRfvt8q0A_0[15];

/* section: NIM_merge_TYPE_INIT3 */
NTI__THYguAi9bSgidczZ3ywEIMQ_.size = sizeof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ);
NTI__THYguAi9bSgidczZ3ywEIMQ_.align = NIM_ALIGNOF(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ);
NTI__THYguAi9bSgidczZ3ywEIMQ_.kind = 17;
NTI__THYguAi9bSgidczZ3ywEIMQ_.base = (&NTI__ytyiCJqK439aF9cIibuRVpAg_);
NTI__THYguAi9bSgidczZ3ywEIMQ_.flags = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[0] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[1];
NTI__JQrsH08b4uPTH9cyFPlVOZg_.size = sizeof(tyProc__JQrsH08b4uPTH9cyFPlVOZg);
NTI__JQrsH08b4uPTH9cyFPlVOZg_.align = NIM_ALIGNOF(tyProc__JQrsH08b4uPTH9cyFPlVOZg);
NTI__JQrsH08b4uPTH9cyFPlVOZg_.kind = 25;
NTI__JQrsH08b4uPTH9cyFPlVOZg_.base = 0;
NTI__JQrsH08b4uPTH9cyFPlVOZg_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[1].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[1].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, closeImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[1].typ = (&NTI__JQrsH08b4uPTH9cyFPlVOZg_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[1].name = "closeImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[1] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[2];
NTI__9bmhFrLahRsL2hltfRDVtlQ_.size = sizeof(tyProc__9bmhFrLahRsL2hltfRDVtlQ);
NTI__9bmhFrLahRsL2hltfRDVtlQ_.align = NIM_ALIGNOF(tyProc__9bmhFrLahRsL2hltfRDVtlQ);
NTI__9bmhFrLahRsL2hltfRDVtlQ_.kind = 25;
NTI__9bmhFrLahRsL2hltfRDVtlQ_.base = 0;
NTI__9bmhFrLahRsL2hltfRDVtlQ_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[2].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[2].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, atEndImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[2].typ = (&NTI__9bmhFrLahRsL2hltfRDVtlQ_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[2].name = "atEndImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[2] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[3];
NTI__3svSoGIUJIsHkaBL7q4DAQ_.size = sizeof(tyProc__3svSoGIUJIsHkaBL7q4DAQ);
NTI__3svSoGIUJIsHkaBL7q4DAQ_.align = NIM_ALIGNOF(tyProc__3svSoGIUJIsHkaBL7q4DAQ);
NTI__3svSoGIUJIsHkaBL7q4DAQ_.kind = 25;
NTI__3svSoGIUJIsHkaBL7q4DAQ_.base = 0;
NTI__3svSoGIUJIsHkaBL7q4DAQ_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[3].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[3].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, setPositionImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[3].typ = (&NTI__3svSoGIUJIsHkaBL7q4DAQ_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[3].name = "setPositionImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[3] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[4];
NTI__xflqkf2D1uVClg70czEDHA_.size = sizeof(tyProc__xflqkf2D1uVClg70czEDHA);
NTI__xflqkf2D1uVClg70czEDHA_.align = NIM_ALIGNOF(tyProc__xflqkf2D1uVClg70czEDHA);
NTI__xflqkf2D1uVClg70czEDHA_.kind = 25;
NTI__xflqkf2D1uVClg70czEDHA_.base = 0;
NTI__xflqkf2D1uVClg70czEDHA_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[4].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[4].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, getPositionImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[4].typ = (&NTI__xflqkf2D1uVClg70czEDHA_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[4].name = "getPositionImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[4] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[5];
NTI__c9c0f59ak4YGQ6neEym8LPKw_.size = sizeof(tyProc__c9c0f59ak4YGQ6neEym8LPKw);
NTI__c9c0f59ak4YGQ6neEym8LPKw_.align = NIM_ALIGNOF(tyProc__c9c0f59ak4YGQ6neEym8LPKw);
NTI__c9c0f59ak4YGQ6neEym8LPKw_.kind = 25;
NTI__c9c0f59ak4YGQ6neEym8LPKw_.base = 0;
NTI__c9c0f59ak4YGQ6neEym8LPKw_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[5].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[5].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, readDataStrImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[5].typ = (&NTI__c9c0f59ak4YGQ6neEym8LPKw_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[5].name = "readDataStrImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[5] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[6];
NTI__7jFfqMk9ajToCz6Hv9atCA4A_.size = sizeof(tyProc__7jFfqMk9ajToCz6Hv9atCA4A);
NTI__7jFfqMk9ajToCz6Hv9atCA4A_.align = NIM_ALIGNOF(tyProc__7jFfqMk9ajToCz6Hv9atCA4A);
NTI__7jFfqMk9ajToCz6Hv9atCA4A_.kind = 25;
NTI__7jFfqMk9ajToCz6Hv9atCA4A_.base = 0;
NTI__7jFfqMk9ajToCz6Hv9atCA4A_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[6].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[6].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, readLineImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[6].typ = (&NTI__7jFfqMk9ajToCz6Hv9atCA4A_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[6].name = "readLineImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[6] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[7];
NTI__2VVzVL9bOnKhj1eZKkf9cEuA_.size = sizeof(tyProc__2VVzVL9bOnKhj1eZKkf9cEuA);
NTI__2VVzVL9bOnKhj1eZKkf9cEuA_.align = NIM_ALIGNOF(tyProc__2VVzVL9bOnKhj1eZKkf9cEuA);
NTI__2VVzVL9bOnKhj1eZKkf9cEuA_.kind = 25;
NTI__2VVzVL9bOnKhj1eZKkf9cEuA_.base = 0;
NTI__2VVzVL9bOnKhj1eZKkf9cEuA_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[7].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[7].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, readDataImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[7].typ = (&NTI__2VVzVL9bOnKhj1eZKkf9cEuA_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[7].name = "readDataImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[7] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[8];
TM__Ue7tnBcsL67VCiRfvt8q0A_0[8].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[8].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, peekDataImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[8].typ = (&NTI__2VVzVL9bOnKhj1eZKkf9cEuA_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[8].name = "peekDataImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[8] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[9];
NTI__ki6p1QyfOkJLQJ9aw5NI0AQ_.size = sizeof(tyProc__ki6p1QyfOkJLQJ9aw5NI0AQ);
NTI__ki6p1QyfOkJLQJ9aw5NI0AQ_.align = NIM_ALIGNOF(tyProc__ki6p1QyfOkJLQJ9aw5NI0AQ);
NTI__ki6p1QyfOkJLQJ9aw5NI0AQ_.kind = 25;
NTI__ki6p1QyfOkJLQJ9aw5NI0AQ_.base = 0;
NTI__ki6p1QyfOkJLQJ9aw5NI0AQ_.flags = 3;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[9].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[9].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, writeDataImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[9].typ = (&NTI__ki6p1QyfOkJLQJ9aw5NI0AQ_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[9].name = "writeDataImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[9] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[10];
TM__Ue7tnBcsL67VCiRfvt8q0A_0[10].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[10].offset = offsetof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ, flushImpl);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[10].typ = (&NTI__JQrsH08b4uPTH9cyFPlVOZg_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[10].name = "flushImpl";
TM__Ue7tnBcsL67VCiRfvt8q0A_0[0].len = 10; TM__Ue7tnBcsL67VCiRfvt8q0A_0[0].kind = 2; TM__Ue7tnBcsL67VCiRfvt8q0A_0[0].sons = &TM__Ue7tnBcsL67VCiRfvt8q0A_2_10[0];
NTI__THYguAi9bSgidczZ3ywEIMQ_.node = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[0];
NTI__1G0jiQbe7KwD5ADza5AZaw_.size = sizeof(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*);
NTI__1G0jiQbe7KwD5ADza5AZaw_.align = NIM_ALIGNOF(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*);
NTI__1G0jiQbe7KwD5ADza5AZaw_.kind = 22;
NTI__1G0jiQbe7KwD5ADza5AZaw_.base = (&NTI__THYguAi9bSgidczZ3ywEIMQ_);
NTI__1G0jiQbe7KwD5ADza5AZaw_.marker = Marker_tyRef__1G0jiQbe7KwD5ADza5AZaw;
NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_.size = sizeof(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ);
NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_.align = NIM_ALIGNOF(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ);
NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_.kind = 17;
NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_.base = (&NTI__THYguAi9bSgidczZ3ywEIMQ_);
NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_.flags = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[11].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[11].offset = offsetof(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ, f);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[11].typ = (&NTI__XBeRj4rw9bUuE7CB3DS1rgg_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[11].name = "f";
NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_.node = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[11];
NTI__y4kGpp4Cn6oTOCWBJMIxAg_.size = sizeof(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*);
NTI__y4kGpp4Cn6oTOCWBJMIxAg_.align = NIM_ALIGNOF(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*);
NTI__y4kGpp4Cn6oTOCWBJMIxAg_.kind = 22;
NTI__y4kGpp4Cn6oTOCWBJMIxAg_.base = (&NTI__9bEVSsOIpkY9cf5lCtaS39bPQ_);
NTI__y4kGpp4Cn6oTOCWBJMIxAg_.marker = Marker_tyRef__y4kGpp4Cn6oTOCWBJMIxAg;
NTI__Olau5FPRehZBBEB77FHnfw_.size = sizeof(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw);
NTI__Olau5FPRehZBBEB77FHnfw_.align = NIM_ALIGNOF(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw);
NTI__Olau5FPRehZBBEB77FHnfw_.kind = 17;
NTI__Olau5FPRehZBBEB77FHnfw_.base = (&NTI__THYguAi9bSgidczZ3ywEIMQ_);
TM__Ue7tnBcsL67VCiRfvt8q0A_4_2[0] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[13];
TM__Ue7tnBcsL67VCiRfvt8q0A_0[13].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[13].offset = offsetof(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw, data);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[13].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[13].name = "data";
TM__Ue7tnBcsL67VCiRfvt8q0A_4_2[1] = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[14];
TM__Ue7tnBcsL67VCiRfvt8q0A_0[14].kind = 1;
TM__Ue7tnBcsL67VCiRfvt8q0A_0[14].offset = offsetof(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw, pos);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[14].typ = (&NTI__rR5Bzr1D5krxoo1NcNyeMA_);
TM__Ue7tnBcsL67VCiRfvt8q0A_0[14].name = "pos";
TM__Ue7tnBcsL67VCiRfvt8q0A_0[12].len = 2; TM__Ue7tnBcsL67VCiRfvt8q0A_0[12].kind = 2; TM__Ue7tnBcsL67VCiRfvt8q0A_0[12].sons = &TM__Ue7tnBcsL67VCiRfvt8q0A_4_2[0];
NTI__Olau5FPRehZBBEB77FHnfw_.node = &TM__Ue7tnBcsL67VCiRfvt8q0A_0[12];
NTI__Z9cj1NxLXx79cYy9c4gbj6CAA_.size = sizeof(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*);
NTI__Z9cj1NxLXx79cYy9c4gbj6CAA_.align = NIM_ALIGNOF(tyObject_StringStreamObj__Olau5FPRehZBBEB77FHnfw*);
NTI__Z9cj1NxLXx79cYy9c4gbj6CAA_.kind = 22;
NTI__Z9cj1NxLXx79cYy9c4gbj6CAA_.base = (&NTI__Olau5FPRehZBBEB77FHnfw_);
NTI__Z9cj1NxLXx79cYy9c4gbj6CAA_.marker = Marker_tyRef__Z9cj1NxLXx79cYy9c4gbj6CAA;
}

