/* Generated by Nim Compiler v0.17.0 */
/*   (c) 2017 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, arm, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing -fPIC  -I/build/nim/src/Nim-0.17.0/lib -o lib/nimcache/stdlib_streams.o lib/nimcache/stdlib_streams.c */
#define NIM_NEW_MANGLING_RULES
#define NIM_INTBITS 32

#include "nimbase.h"
#include <setjmp.h>
#include <stdio.h>
#undef linux
#undef near
typedef struct StreamObj_RShkcoDOPnoCVhtpN1hDPQ StreamObj_RShkcoDOPnoCVhtpN1hDPQ;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw;
typedef struct Exception Exception;
typedef struct TSafePoint TSafePoint;
typedef struct IOError_9czoZw3pzPyrBmb5zTHY1OQ IOError_9czoZw3pzPyrBmb5zTHY1OQ;
typedef struct SystemError_Fjf9b9b2IlzRO2tspHxG3tgg SystemError_Fjf9b9b2IlzRO2tspHxG3tgg;
typedef struct Cell_1zcF9cV8XIAtbN8h5HRUB8g Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef NU8 TNimKind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ_Set;
typedef N_NIMCALL_PTR(void, TY_ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct  TNimType  {
NI size;
TNimKind_jIBKr1ejBgsfM33Kxw4j7A kind;
TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ_Set flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY_ojoeKfW4VYIm36I9cpDTQIg marker;
TY_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
typedef N_NIMCALL_PTR(void, TY_cnkJEp9bna8U6yi9aVW9cAJ0Q) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
typedef N_NIMCALL_PTR(NIM_BOOL, TY_KjFcmLOhf4VQvVcyLJWXZw) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
typedef N_NIMCALL_PTR(void, TY_jlOYFw9cHausuCbPoWx2iiA) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, NI pos);
typedef N_NIMCALL_PTR(NI, TY_Xzm85qBLb9cf9cu8VOfAr8PQ) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
typedef N_NIMCALL_PTR(NI, TY_tjaJtoUzLe1BMUbItlcGhQ) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
typedef N_NIMCALL_PTR(void, TY_b9bsIuILxTLVZHPvJBW187A) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
struct  StreamObj_RShkcoDOPnoCVhtpN1hDPQ  {
  TNimObject Sup;
TY_cnkJEp9bna8U6yi9aVW9cAJ0Q closeImpl;
TY_KjFcmLOhf4VQvVcyLJWXZw atEndImpl;
TY_jlOYFw9cHausuCbPoWx2iiA setPositionImpl;
TY_Xzm85qBLb9cf9cu8VOfAr8PQ getPositionImpl;
TY_tjaJtoUzLe1BMUbItlcGhQ readDataImpl;
TY_tjaJtoUzLe1BMUbItlcGhQ peekDataImpl;
TY_b9bsIuILxTLVZHPvJBW187A writeDataImpl;
TY_cnkJEp9bna8U6yi9aVW9cAJ0Q flushImpl;
};
typedef NU8 TNimNodeKind_unfNsxrcATrufDZmpBq4HQ;
struct  TNimNode  {
TNimNodeKind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw  {
  StreamObj_RShkcoDOPnoCVhtpN1hDPQ Sup;
FILE* f;
};
typedef NU8 FileSeekPos_I9aQjuvWxs8BspGbxwsngWw;
struct  Exception  {
  TNimObject Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClP_0) (Exception* e, void* ClE_0);
void* ClE_0;
} TY_KeeAOYBd84Ofsw6Y7LizaQ;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY_KeeAOYBd84Ofsw6Y7LizaQ raiseAction;
};
struct  SystemError_Fjf9b9b2IlzRO2tspHxG3tgg  {
  Exception Sup;
};
struct  IOError_9czoZw3pzPyrBmb5zTHY1OQ  {
  SystemError_Fjf9b9b2IlzRO2tspHxG3tgg Sup;
};
struct  Cell_1zcF9cV8XIAtbN8h5HRUB8g  {
NI refcount;
TNimType* typ;
};
static N_NIMCALL(void, Marker_TY_r3Wc5tOoxP8rz1DvGVTUvw)(void* p, NI op);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_setLengthStr)(NimStringDesc* s, NI newLen);
N_NIMCALL(NIM_CHAR, readChar_MXNOkfw9cIUOi4sewWv9cidw)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
N_NIMCALL(NI, readData_Gnwdizh7H5Q9cYivUoGHrVA)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
static N_NIMCALL(void, Marker_TY_Z018yRjOOerOKfp9aM3JSOg)(void* p, NI op);
N_LIB_EXPORT N_CDECL(void*, nimrtl_newObj)(TNimType* typ, NI size);
N_NIMCALL(void, fsClose_qQbp4Nsuc4ou9bqUUbaqJ6A)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
N_NIMCALL(void, close_BWnr8V7RERYno9bIdPmw8Hw_2)(FILE* f);
N_NIMCALL(NIM_BOOL, fsAtEnd_acl02gpfK9cCD8utiP6NxdA)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
N_NIMCALL(NIM_BOOL, endOfFile_OpxMRqWNQzmofyVQsNQqVA)(FILE* f);
N_NIMCALL(void, fsSetPosition_C0SEQJWfadg6oK29b8FuMZg)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, NI pos);
N_NIMCALL(void, setFilePos_YAngY19cHH2nZ9bqhMgAHz8Q)(FILE* f, NI64 pos, FileSeekPos_I9aQjuvWxs8BspGbxwsngWw relativeTo);
N_NIMCALL(NI, fsGetPosition_ht6Fg1Bmvqnb8CP4WayC2A)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
N_NIMCALL(NI64, getFilePos_XePgC9ccBXCgb9bEHXZpnMqA_2)(FILE* f);
N_NIMCALL(NI, fsReadData_7P4Enb2Vt3iOCL5K9cnGqYw)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
N_NIMCALL(NI, readBuffer_nZ0pNe9cd9cXtoayexCiaDtA)(FILE* f, void* buffer, NI len);
N_NIMCALL(NI, fsPeekData_7P4Enb2Vt3iOCL5K9cnGqYw_2)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
N_LIB_EXPORT N_CDECL(void, nimrtl_pushSafePoint)(TSafePoint* s);
N_LIB_EXPORT N_CDECL(void, nimrtl_popSafePoint)(void);
N_LIB_EXPORT N_CDECL(void, nimrtl_reraiseException)(void);
N_NIMCALL(void, fsWriteData_mrtMhMXvYVpi5Svw9bWueBw)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
N_NIMCALL(NI, writeBuffer_nZ0pNe9cd9cXtoayexCiaDtA_2)(FILE* f, void* buffer, NI len);
N_NIMCALL(IOError_9czoZw3pzPyrBmb5zTHY1OQ*, newEIO_lOrpXone7dPkEAOURnfgBw)(NimStringDesc* msg);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr);
N_LIB_EXPORT N_CDECL(void, nimrtl_rtlAddZCT)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_EXPORT N_CDECL(void, nimrtl_raiseException)(Exception* e, NCSTRING ename);
N_NIMCALL(void, fsFlush_qQbp4Nsuc4ou9bqUUbaqJ6A_2)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
N_NIMCALL(void, flushFile_BWnr8V7RERYno9bIdPmw8Hw_3)(FILE* f);
extern TNimType NTI_13RNkKqUOX1TtorOUlKtqA_;
TNimType NTI_RShkcoDOPnoCVhtpN1hDPQ_;
TNimType NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q_;
TNimType NTI_KjFcmLOhf4VQvVcyLJWXZw_;
TNimType NTI_jlOYFw9cHausuCbPoWx2iiA_;
TNimType NTI_Xzm85qBLb9cf9cu8VOfAr8PQ_;
TNimType NTI_tjaJtoUzLe1BMUbItlcGhQ_;
TNimType NTI_b9bsIuILxTLVZHPvJBW187A_;
TNimType NTI_r3Wc5tOoxP8rz1DvGVTUvw_;
TNimType NTI_qoDM8xYRV40zbhS9acPNT9bw_;
extern TNimType NTI_7BHnQsEj49a9c6QtudqWTo1w_;
TNimType NTI_Z018yRjOOerOKfp9aM3JSOg_;
extern TNimType NTI_HX2M9cQhE3jaovp9aYJDdslA_;
extern TNimType NTI_9czoZw3pzPyrBmb5zTHY1OQ_;
STRING_LITERAL(TM_Ue7tnBcsL67VCiRfvt8q0A_4, "cannot write to stream", 22);

N_NIMCALL(NI, readData_Gnwdizh7H5Q9cYivUoGHrVA)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen) {
	NI result;
	result = (NI)0;
	result = (*s).readDataImpl(s, buffer, bufLen);
	return result;
}

N_NIMCALL(void, close_4ed7IXme7lqtClFI7s2sTQ)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s) {
	{
		if (!!(((*s).closeImpl == 0))) goto LA3_;
		(*s).closeImpl(s);
	}
	LA3_: ;
}
static N_NIMCALL(void, Marker_TY_r3Wc5tOoxP8rz1DvGVTUvw)(void* p, NI op) {
	StreamObj_RShkcoDOPnoCVhtpN1hDPQ* a;
	a = (StreamObj_RShkcoDOPnoCVhtpN1hDPQ*)p;
}

N_NIMCALL(NIM_CHAR, readChar_MXNOkfw9cIUOi4sewWv9cidw)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s) {
	NIM_CHAR result;
	result = (NIM_CHAR)0;
	{
		NI T3_;
		T3_ = (NI)0;
		T3_ = readData_Gnwdizh7H5Q9cYivUoGHrVA(s, ((void*) ((&result))), ((NI) 1));
		if (!!((T3_ == ((NI) 1)))) goto LA4_;
		result = 0;
	}
	LA4_: ;
	return result;
}

N_NIMCALL(NIM_BOOL, readLine_y89bfL07uXzOjT5XgI50WmQ)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, NimStringDesc** line) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	(*line) = nimrtl_setLengthStr((*line), ((NI) 0));
	{
		while (1) {
			NIM_CHAR c;
			c = readChar_MXNOkfw9cIUOi4sewWv9cidw(s);
			{
				if (!((NU8)(c) == (NU8)(13))) goto LA5_;
				c = readChar_MXNOkfw9cIUOi4sewWv9cidw(s);
				goto LA1;
			}
			goto LA3_;
			LA5_: ;
			{
				if (!((NU8)(c) == (NU8)(10))) goto LA8_;
				goto LA1;
			}
			goto LA3_;
			LA8_: ;
			{
				if (!((NU8)(c) == (NU8)(0))) goto LA11_;
				{
					if (!(((NI) 0) < ((*line) ? (*line)->Sup.len : 0))) goto LA15_;
					goto LA1;
				}
				goto LA13_;
				LA15_: ;
				{
					result = NIM_FALSE;
					goto BeforeRet_;
				}
				LA13_: ;
			}
			goto LA3_;
			LA11_: ;
			LA3_: ;
			(*line) = addChar((*line), c);
		}
	} LA1: ;
	result = NIM_TRUE;
	}BeforeRet_: ;
	return result;
}
static N_NIMCALL(void, Marker_TY_Z018yRjOOerOKfp9aM3JSOg)(void* p, NI op) {
	FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw* a;
	a = (FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*)p;
}

N_NIMCALL(void, fsClose_qQbp4Nsuc4ou9bqUUbaqJ6A)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s) {
	{
		if (!!(((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f == NIM_NIL))) goto LA3_;
		close_BWnr8V7RERYno9bIdPmw8Hw_2((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f);
		(*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f = NIM_NIL;
	}
	LA3_: ;
}

N_NIMCALL(NIM_BOOL, fsAtEnd_acl02gpfK9cCD8utiP6NxdA)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = endOfFile_OpxMRqWNQzmofyVQsNQqVA((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_NIMCALL(void, fsSetPosition_C0SEQJWfadg6oK29b8FuMZg)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, NI pos) {
	setFilePos_YAngY19cHH2nZ9bqhMgAHz8Q((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f, ((NI64) (pos)), ((FileSeekPos_I9aQjuvWxs8BspGbxwsngWw) 0));
}

N_NIMCALL(NI, fsGetPosition_ht6Fg1Bmvqnb8CP4WayC2A)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s) {
	NI result;
	NI64 T1_;
{	result = (NI)0;
	T1_ = (NI64)0;
	T1_ = getFilePos_XePgC9ccBXCgb9bEHXZpnMqA_2((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f);
	result = ((NI) (T1_));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_NIMCALL(NI, fsReadData_7P4Enb2Vt3iOCL5K9cnGqYw)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen) {
	NI result;
	result = (NI)0;
	result = readBuffer_nZ0pNe9cd9cXtoayexCiaDtA((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f, buffer, ((NI) (bufLen)));
	return result;
}

N_NIMCALL(NI, fsPeekData_7P4Enb2Vt3iOCL5K9cnGqYw_2)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen) {
	NI volatile result;
	NI pos;
	TSafePoint TM_Ue7tnBcsL67VCiRfvt8q0A_3;
	result = (NI)0;
	pos = fsGetPosition_ht6Fg1Bmvqnb8CP4WayC2A(s);
	nimrtl_pushSafePoint(&TM_Ue7tnBcsL67VCiRfvt8q0A_3);
	TM_Ue7tnBcsL67VCiRfvt8q0A_3.status = setjmp(TM_Ue7tnBcsL67VCiRfvt8q0A_3.context);
	if (TM_Ue7tnBcsL67VCiRfvt8q0A_3.status == 0) {
		result = readBuffer_nZ0pNe9cd9cXtoayexCiaDtA((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f, buffer, ((NI) (bufLen)));
		nimrtl_popSafePoint();
	}
	else {
		nimrtl_popSafePoint();
	}
	{
		fsSetPosition_C0SEQJWfadg6oK29b8FuMZg(s, pos);
	}
	if (TM_Ue7tnBcsL67VCiRfvt8q0A_3.status != 0) nimrtl_reraiseException();
	return result;
}

static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr) {
	Cell_1zcF9cV8XIAtbN8h5HRUB8g* result;
	result = (Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result = ((Cell_1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU32)(((NI) (usr))) - (NU32)(((NI)sizeof(Cell_1zcF9cV8XIAtbN8h5HRUB8g))))));
	return result;
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	Cell_1zcF9cV8XIAtbN8h5HRUB8g* c;
	c = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3_;
		nimrtl_rtlAddZCT(c);
	}
	LA3_: ;
}

N_NIMCALL(IOError_9czoZw3pzPyrBmb5zTHY1OQ*, newEIO_lOrpXone7dPkEAOURnfgBw)(NimStringDesc* msg) {
	IOError_9czoZw3pzPyrBmb5zTHY1OQ* result;
	NimStringDesc* T1_;
	result = (IOError_9czoZw3pzPyrBmb5zTHY1OQ*)0;
	result = (IOError_9czoZw3pzPyrBmb5zTHY1OQ*) nimrtl_newObj((&NTI_HX2M9cQhE3jaovp9aYJDdslA_), sizeof(IOError_9czoZw3pzPyrBmb5zTHY1OQ));
	(*result).Sup.Sup.Sup.m_type = (&NTI_9czoZw3pzPyrBmb5zTHY1OQ_);
	T1_ = (NimStringDesc*)0;
	T1_ = (*result).Sup.Sup.message; (*result).Sup.Sup.message = nimrtl_copyStringRC1(msg);
	if (T1_) nimGCunrefNoCycle(T1_);
	return result;
}

N_NIMCALL(void, fsWriteData_mrtMhMXvYVpi5Svw9bWueBw)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen) {
	{
		NI T3_;
		IOError_9czoZw3pzPyrBmb5zTHY1OQ* T6_;
		T3_ = (NI)0;
		T3_ = writeBuffer_nZ0pNe9cd9cXtoayexCiaDtA_2((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f, buffer, ((NI) (bufLen)));
		if (!!((T3_ == bufLen))) goto LA4_;
		T6_ = (IOError_9czoZw3pzPyrBmb5zTHY1OQ*)0;
		T6_ = newEIO_lOrpXone7dPkEAOURnfgBw(((NimStringDesc*) &TM_Ue7tnBcsL67VCiRfvt8q0A_4));
		nimrtl_raiseException((Exception*)T6_, "IOError");
	}
	LA4_: ;
}

N_NIMCALL(void, fsFlush_qQbp4Nsuc4ou9bqUUbaqJ6A_2)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s) {
	flushFile_BWnr8V7RERYno9bIdPmw8Hw_3((*((FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) (s))).f);
}

N_NIMCALL(FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*, newFileStream_j9aOzR9a9bXMSUnTXiGmXXGqQ)(FILE* f) {
	FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw* result;
	result = (FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*)0;
	result = (FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*) nimrtl_newObj((&NTI_Z018yRjOOerOKfp9aM3JSOg_), sizeof(FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw));
	(*result).Sup.Sup.m_type = (&NTI_qoDM8xYRV40zbhS9acPNT9bw_);
	(*result).f = f;
	(*result).Sup.closeImpl = fsClose_qQbp4Nsuc4ou9bqUUbaqJ6A;
	(*result).Sup.atEndImpl = fsAtEnd_acl02gpfK9cCD8utiP6NxdA;
	(*result).Sup.setPositionImpl = fsSetPosition_C0SEQJWfadg6oK29b8FuMZg;
	(*result).Sup.getPositionImpl = fsGetPosition_ht6Fg1Bmvqnb8CP4WayC2A;
	(*result).Sup.readDataImpl = fsReadData_7P4Enb2Vt3iOCL5K9cnGqYw;
	(*result).Sup.peekDataImpl = fsPeekData_7P4Enb2Vt3iOCL5K9cnGqYw_2;
	(*result).Sup.writeDataImpl = fsWriteData_mrtMhMXvYVpi5Svw9bWueBw;
	(*result).Sup.flushImpl = fsFlush_qQbp4Nsuc4ou9bqUUbaqJ6A_2;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, stdlib_streamsInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, stdlib_streamsDatInit000)(void) {
static TNimNode* TM_Ue7tnBcsL67VCiRfvt8q0A_2[8];
static TNimNode TM_Ue7tnBcsL67VCiRfvt8q0A_0[10];
NTI_RShkcoDOPnoCVhtpN1hDPQ_.size = sizeof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ);
NTI_RShkcoDOPnoCVhtpN1hDPQ_.kind = 17;
NTI_RShkcoDOPnoCVhtpN1hDPQ_.base = (&NTI_13RNkKqUOX1TtorOUlKtqA_);
NTI_RShkcoDOPnoCVhtpN1hDPQ_.flags = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_2[0] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[1];
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q_.size = sizeof(TY_cnkJEp9bna8U6yi9aVW9cAJ0Q);
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q_.kind = 25;
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q_.base = 0;
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q_.flags = 3;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[1].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[1].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, closeImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[1].typ = (&NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[1].name = "closeImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_2[1] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[2];
NTI_KjFcmLOhf4VQvVcyLJWXZw_.size = sizeof(TY_KjFcmLOhf4VQvVcyLJWXZw);
NTI_KjFcmLOhf4VQvVcyLJWXZw_.kind = 25;
NTI_KjFcmLOhf4VQvVcyLJWXZw_.base = 0;
NTI_KjFcmLOhf4VQvVcyLJWXZw_.flags = 3;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[2].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[2].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, atEndImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[2].typ = (&NTI_KjFcmLOhf4VQvVcyLJWXZw_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[2].name = "atEndImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_2[2] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[3];
NTI_jlOYFw9cHausuCbPoWx2iiA_.size = sizeof(TY_jlOYFw9cHausuCbPoWx2iiA);
NTI_jlOYFw9cHausuCbPoWx2iiA_.kind = 25;
NTI_jlOYFw9cHausuCbPoWx2iiA_.base = 0;
NTI_jlOYFw9cHausuCbPoWx2iiA_.flags = 3;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[3].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[3].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, setPositionImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[3].typ = (&NTI_jlOYFw9cHausuCbPoWx2iiA_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[3].name = "setPositionImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_2[3] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[4];
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ_.size = sizeof(TY_Xzm85qBLb9cf9cu8VOfAr8PQ);
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ_.kind = 25;
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ_.base = 0;
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ_.flags = 3;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[4].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[4].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, getPositionImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[4].typ = (&NTI_Xzm85qBLb9cf9cu8VOfAr8PQ_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[4].name = "getPositionImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_2[4] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[5];
NTI_tjaJtoUzLe1BMUbItlcGhQ_.size = sizeof(TY_tjaJtoUzLe1BMUbItlcGhQ);
NTI_tjaJtoUzLe1BMUbItlcGhQ_.kind = 25;
NTI_tjaJtoUzLe1BMUbItlcGhQ_.base = 0;
NTI_tjaJtoUzLe1BMUbItlcGhQ_.flags = 3;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[5].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[5].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, readDataImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[5].typ = (&NTI_tjaJtoUzLe1BMUbItlcGhQ_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[5].name = "readDataImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_2[5] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[6];
TM_Ue7tnBcsL67VCiRfvt8q0A_0[6].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[6].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, peekDataImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[6].typ = (&NTI_tjaJtoUzLe1BMUbItlcGhQ_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[6].name = "peekDataImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_2[6] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[7];
NTI_b9bsIuILxTLVZHPvJBW187A_.size = sizeof(TY_b9bsIuILxTLVZHPvJBW187A);
NTI_b9bsIuILxTLVZHPvJBW187A_.kind = 25;
NTI_b9bsIuILxTLVZHPvJBW187A_.base = 0;
NTI_b9bsIuILxTLVZHPvJBW187A_.flags = 3;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[7].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[7].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, writeDataImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[7].typ = (&NTI_b9bsIuILxTLVZHPvJBW187A_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[7].name = "writeDataImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_2[7] = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[8];
TM_Ue7tnBcsL67VCiRfvt8q0A_0[8].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[8].offset = offsetof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ, flushImpl);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[8].typ = (&NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[8].name = "flushImpl";
TM_Ue7tnBcsL67VCiRfvt8q0A_0[0].len = 8; TM_Ue7tnBcsL67VCiRfvt8q0A_0[0].kind = 2; TM_Ue7tnBcsL67VCiRfvt8q0A_0[0].sons = &TM_Ue7tnBcsL67VCiRfvt8q0A_2[0];
NTI_RShkcoDOPnoCVhtpN1hDPQ_.node = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[0];
NTI_r3Wc5tOoxP8rz1DvGVTUvw_.size = sizeof(StreamObj_RShkcoDOPnoCVhtpN1hDPQ*);
NTI_r3Wc5tOoxP8rz1DvGVTUvw_.kind = 22;
NTI_r3Wc5tOoxP8rz1DvGVTUvw_.base = (&NTI_RShkcoDOPnoCVhtpN1hDPQ_);
NTI_r3Wc5tOoxP8rz1DvGVTUvw_.marker = Marker_TY_r3Wc5tOoxP8rz1DvGVTUvw;
NTI_qoDM8xYRV40zbhS9acPNT9bw_.size = sizeof(FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw);
NTI_qoDM8xYRV40zbhS9acPNT9bw_.kind = 17;
NTI_qoDM8xYRV40zbhS9acPNT9bw_.base = (&NTI_RShkcoDOPnoCVhtpN1hDPQ_);
NTI_qoDM8xYRV40zbhS9acPNT9bw_.flags = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[9].kind = 1;
TM_Ue7tnBcsL67VCiRfvt8q0A_0[9].offset = offsetof(FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw, f);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[9].typ = (&NTI_7BHnQsEj49a9c6QtudqWTo1w_);
TM_Ue7tnBcsL67VCiRfvt8q0A_0[9].name = "f";
NTI_qoDM8xYRV40zbhS9acPNT9bw_.node = &TM_Ue7tnBcsL67VCiRfvt8q0A_0[9];
NTI_Z018yRjOOerOKfp9aM3JSOg_.size = sizeof(FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*);
NTI_Z018yRjOOerOKfp9aM3JSOg_.kind = 22;
NTI_Z018yRjOOerOKfp9aM3JSOg_.base = (&NTI_qoDM8xYRV40zbhS9acPNT9bw_);
NTI_Z018yRjOOerOKfp9aM3JSOg_.marker = Marker_TY_Z018yRjOOerOKfp9aM3JSOg;
}

