/* Generated by Nim Compiler v0.16.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.16.0/lib -o lib/nimcache/stdlib_streams.o lib/nimcache/stdlib_streams.c */
#define NIM_INTBITS 32

#include "nimbase.h"
#include <setjmp.h>
#include <stdio.h>
#undef linux
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* p0, NI op0);
typedef N_NIMCALL_PTR(void*, TY_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p0);
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* s0);
typedef N_NIMCALL_PTR(NIM_BOOL, TY_KjFcmLOhf4VQvVcyLJWXZw) (Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0);
typedef N_NIMCALL_PTR(void, TY_jlOYFw9cHausuCbPoWx2iiA) (Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, NI pos0);
typedef N_NIMCALL_PTR(NI, TY_Xzm85qBLb9cf9cu8VOfAr8PQ) (Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0);
typedef N_NIMCALL_PTR(NI, TY_tjaJtoUzLe1BMUbItlcGhQ) (Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0);
typedef N_NIMCALL_PTR(void, TY_b9bsIuILxTLVZHPvJBW187A) (Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0);
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, ClPrc) (Exception* e0, void* ClEnv);
void* ClEnv;
} 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* s0, NI newlen0);
N_NIMCALL(NIM_CHAR, readchar_MXNOkfw9cIUOi4sewWv9cidw)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0);
N_NIMCALL(NI, readdata_Gnwdizh7H5Q9cYivUoGHrVA)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s0, NIM_CHAR c0);
static N_NIMCALL(void, Marker_TY_Z018yRjOOerOKfp9aM3JSOg)(void* p, NI op);
N_LIB_EXPORT N_CDECL(void*, nimrtl_newObj)(TNimType* typ0, NI size0);
N_NIMCALL(void, fsclose_qQbp4Nsuc4ou9bqUUbaqJ6A)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0);
N_NIMCALL(void, close_BWnr8V7RERYno9bIdPmw8Hw)(FILE* f0);
N_NIMCALL(NIM_BOOL, fsatend_acl02gpfK9cCD8utiP6NxdA)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0);
N_NIMCALL(NIM_BOOL, endoffile_OpxMRqWNQzmofyVQsNQqVA)(FILE* f0);
N_NIMCALL(void, fssetposition_C0SEQJWfadg6oK29b8FuMZg)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, NI pos0);
N_NIMCALL(void, setfilepos_YAngY19cHH2nZ9bqhMgAHz8Q)(FILE* f0, NI64 pos0, Fileseekpos_I9aQjuvWxs8BspGbxwsngWw relativeto0);
N_NIMCALL(NI, fsgetposition_ht6Fg1Bmvqnb8CP4WayC2A)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0);
N_NIMCALL(NI64, getfilepos_XePgC9ccBXCgb9bEHXZpnMqA_2)(FILE* f0);
N_NIMCALL(NI, fsreaddata_7P4Enb2Vt3iOCL5K9cnGqYw)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0);
N_NIMCALL(NI, readbuffer_nZ0pNe9cd9cXtoayexCiaDtA)(FILE* f0, void* buffer0, NI len0);
N_NIMCALL(NI, fspeekdata_7P4Enb2Vt3iOCL5K9cnGqYw_2)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0);
N_LIB_EXPORT N_CDECL(void, nimrtl_pushSafePoint)(TSafePoint* s0);
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* s0, void* buffer0, NI buflen0);
N_NIMCALL(NI, writebuffer_nZ0pNe9cd9cXtoayexCiaDtA_2)(FILE* f0, void* buffer0, NI len0);
N_NIMCALL(Ioerror_9czoZw3pzPyrBmb5zTHY1OQ*, neweio_lOrpXone7dPkEAOURnfgBw)(NimStringDesc* msg0);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_copyStringRC1)(NimStringDesc* src0);
static N_INLINE(void, nimGCunrefNoCycle)(void* p0);
static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr0);
N_LIB_EXPORT N_CDECL(void, nimrtl_rtlAddZCT)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0);
N_LIB_EXPORT N_CDECL(void, nimrtl_raiseException)(Exception* e0, NCSTRING ename0);
N_NIMCALL(void, fsflush_qQbp4Nsuc4ou9bqUUbaqJ6A_2)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0);
N_NIMCALL(void, flushfile_BWnr8V7RERYno9bIdPmw8Hw_2)(FILE* f0);
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(T_Ue7tnBcsL67VCiRfvt8q0A_4, "cannot write to stream", 22);

N_NIMCALL(NI, readdata_Gnwdizh7H5Q9cYivUoGHrVA)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0) {
	NI result0;
	result0 = (NI)0;
	result0 = (*s0).readdataimpl(s0, buffer0, buflen0);
	return result0;
}

N_NIMCALL(void, close_4ed7IXme7lqtClFI7s2sTQ)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0) {
	{
		if (!!(((*s0).closeimpl == 0))) goto LA3;
		(*s0).closeimpl(s0);
	}
	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* s0) {
	NIM_CHAR result0;
	result0 = (NIM_CHAR)0;
	{
		NI LOC3;
		LOC3 = (NI)0;
		LOC3 = readdata_Gnwdizh7H5Q9cYivUoGHrVA(s0, ((void*) ((&result0))), ((NI) 1));
		if (!!((LOC3 == ((NI) 1)))) goto LA4;
		result0 = 0;
	}
	LA4: ;
	return result0;
}

N_NIMCALL(NIM_BOOL, readline_y89bfL07uXzOjT5XgI50WmQ)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, NimStringDesc** line0) {
	NIM_BOOL result0;
{	result0 = (NIM_BOOL)0;
	(*line0) = nimrtl_setLengthStr((*line0), ((NI) 0));
	{
		while (1) {
			NIM_CHAR c0;
			c0 = readchar_MXNOkfw9cIUOi4sewWv9cidw(s0);
			{
				if (!((NU8)(c0) == (NU8)(13))) goto LA5;
				c0 = readchar_MXNOkfw9cIUOi4sewWv9cidw(s0);
				goto LA1;
			}
			goto LA3;
			LA5: ;
			{
				if (!((NU8)(c0) == (NU8)(10))) goto LA8;
				goto LA1;
			}
			goto LA3;
			LA8: ;
			{
				if (!((NU8)(c0) == (NU8)(0))) goto LA11;
				{
					if (!(((NI) 0) < ((*line0) ? (*line0)->Sup.len : 0))) goto LA15;
					goto LA1;
				}
				goto LA13;
				LA15: ;
				{
					result0 = NIM_FALSE;
					goto BeforeRet;
				}
				LA13: ;
			}
			goto LA3;
			LA11: ;
			LA3: ;
			(*line0) = addChar((*line0), c0);
		}
	} LA1: ;
	result0 = NIM_TRUE;
	}BeforeRet: ;
	return result0;
}
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* s0) {
	{
		if (!!(((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f == NIM_NIL))) goto LA3;
		close_BWnr8V7RERYno9bIdPmw8Hw((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f);
		(*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f = NIM_NIL;
	}
	LA3: ;
}

N_NIMCALL(NIM_BOOL, fsatend_acl02gpfK9cCD8utiP6NxdA)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0) {
	NIM_BOOL result0;
{	result0 = (NIM_BOOL)0;
	result0 = endoffile_OpxMRqWNQzmofyVQsNQqVA((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f);
	goto BeforeRet;
	}BeforeRet: ;
	return result0;
}

N_NIMCALL(void, fssetposition_C0SEQJWfadg6oK29b8FuMZg)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, NI pos0) {
	setfilepos_YAngY19cHH2nZ9bqhMgAHz8Q((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f, ((NI64) (pos0)), ((Fileseekpos_I9aQjuvWxs8BspGbxwsngWw) 0));
}

N_NIMCALL(NI, fsgetposition_ht6Fg1Bmvqnb8CP4WayC2A)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0) {
	NI result0;
	NI64 LOC1;
{	result0 = (NI)0;
	LOC1 = (NI64)0;
	LOC1 = getfilepos_XePgC9ccBXCgb9bEHXZpnMqA_2((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f);
	result0 = ((NI) (LOC1));
	goto BeforeRet;
	}BeforeRet: ;
	return result0;
}

N_NIMCALL(NI, fsreaddata_7P4Enb2Vt3iOCL5K9cnGqYw)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0) {
	NI result0;
	result0 = (NI)0;
	result0 = readbuffer_nZ0pNe9cd9cXtoayexCiaDtA((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f, buffer0, ((NI) (buflen0)));
	return result0;
}

N_NIMCALL(NI, fspeekdata_7P4Enb2Vt3iOCL5K9cnGqYw_2)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0) {
	NI volatile result0;
	NI pos0;
	TSafePoint T_Ue7tnBcsL67VCiRfvt8q0A_3;
	result0 = (NI)0;
	pos0 = fsgetposition_ht6Fg1Bmvqnb8CP4WayC2A(s0);
	nimrtl_pushSafePoint(&T_Ue7tnBcsL67VCiRfvt8q0A_3);
	T_Ue7tnBcsL67VCiRfvt8q0A_3.status = setjmp(T_Ue7tnBcsL67VCiRfvt8q0A_3.context);
	if (T_Ue7tnBcsL67VCiRfvt8q0A_3.status == 0) {
		result0 = readbuffer_nZ0pNe9cd9cXtoayexCiaDtA((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f, buffer0, ((NI) (buflen0)));
		nimrtl_popSafePoint();
	}
	else {
		nimrtl_popSafePoint();
	}
	{
		fssetposition_C0SEQJWfadg6oK29b8FuMZg(s0, pos0);
	}
	if (T_Ue7tnBcsL67VCiRfvt8q0A_3.status != 0) nimrtl_reraiseException();
	return result0;
}

static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr0) {
	Cell_1zcF9cV8XIAtbN8h5HRUB8g* result0;
	result0 = (Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result0 = ((Cell_1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU32)(((NI) (usr0))) - (NU32)(((NI)sizeof(Cell_1zcF9cV8XIAtbN8h5HRUB8g))))));
	return result0;
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p0) {
	Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0;
	c0 = usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem(p0);
	{
		(*c0).refcount -= ((NI) 8);
		if (!((NU32)((*c0).refcount) < (NU32)(((NI) 8)))) goto LA3;
		nimrtl_rtlAddZCT(c0);
	}
	LA3: ;
}

N_NIMCALL(Ioerror_9czoZw3pzPyrBmb5zTHY1OQ*, neweio_lOrpXone7dPkEAOURnfgBw)(NimStringDesc* msg0) {
	Ioerror_9czoZw3pzPyrBmb5zTHY1OQ* result0;
	NimStringDesc* LOC1;
	result0 = (Ioerror_9czoZw3pzPyrBmb5zTHY1OQ*)0;
	result0 = (Ioerror_9czoZw3pzPyrBmb5zTHY1OQ*) nimrtl_newObj((&NTI_HX2M9cQhE3jaovp9aYJDdslA), sizeof(Ioerror_9czoZw3pzPyrBmb5zTHY1OQ));
	(*result0).Sup.Sup.Sup.m_type = (&NTI_9czoZw3pzPyrBmb5zTHY1OQ);
	LOC1 = (NimStringDesc*)0;
	LOC1 = (*result0).Sup.Sup.message; (*result0).Sup.Sup.message = nimrtl_copyStringRC1(msg0);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	return result0;
}

N_NIMCALL(void, fswritedata_mrtMhMXvYVpi5Svw9bWueBw)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0) {
	{
		NI LOC3;
		Ioerror_9czoZw3pzPyrBmb5zTHY1OQ* LOC6;
		LOC3 = (NI)0;
		LOC3 = writebuffer_nZ0pNe9cd9cXtoayexCiaDtA_2((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f, buffer0, ((NI) (buflen0)));
		if (!!((LOC3 == buflen0))) goto LA4;
		LOC6 = (Ioerror_9czoZw3pzPyrBmb5zTHY1OQ*)0;
		LOC6 = neweio_lOrpXone7dPkEAOURnfgBw(((NimStringDesc*) &T_Ue7tnBcsL67VCiRfvt8q0A_4));
		nimrtl_raiseException((Exception*)LOC6, "IOError");
	}
	LA4: ;
}

N_NIMCALL(void, fsflush_qQbp4Nsuc4ou9bqUUbaqJ6A_2)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0) {
	flushfile_BWnr8V7RERYno9bIdPmw8Hw_2((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f);
}

N_NIMCALL(Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*, newfilestream_j9aOzR9a9bXMSUnTXiGmXXGqQ)(FILE* f0) {
	Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw* result0;
	result0 = (Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*)0;
	result0 = (Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) nimrtl_newObj((&NTI_Z018yRjOOerOKfp9aM3JSOg), sizeof(Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw));
	(*result0).Sup.Sup.m_type = (&NTI_qoDM8xYRV40zbhS9acPNT9bw);
	(*result0).f = f0;
	(*result0).Sup.closeimpl = fsclose_qQbp4Nsuc4ou9bqUUbaqJ6A;
	(*result0).Sup.atendimpl = fsatend_acl02gpfK9cCD8utiP6NxdA;
	(*result0).Sup.setpositionimpl = fssetposition_C0SEQJWfadg6oK29b8FuMZg;
	(*result0).Sup.getpositionimpl = fsgetposition_ht6Fg1Bmvqnb8CP4WayC2A;
	(*result0).Sup.readdataimpl = fsreaddata_7P4Enb2Vt3iOCL5K9cnGqYw;
	(*result0).Sup.peekdataimpl = fspeekdata_7P4Enb2Vt3iOCL5K9cnGqYw_2;
	(*result0).Sup.writedataimpl = fswritedata_mrtMhMXvYVpi5Svw9bWueBw;
	(*result0).Sup.flushimpl = fsflush_qQbp4Nsuc4ou9bqUUbaqJ6A_2;
	return result0;
}
NIM_EXTERNC N_NOINLINE(void, stdlib_streamsInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, stdlib_streamsDatInit000)(void) {
static TNimNode* T_Ue7tnBcsL67VCiRfvt8q0A_2[8];
static TNimNode T_Ue7tnBcsL67VCiRfvt8q0A_0[10];
NTI_RShkcoDOPnoCVhtpN1hDPQ.size = sizeof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ);
NTI_RShkcoDOPnoCVhtpN1hDPQ.kind = 17;
NTI_RShkcoDOPnoCVhtpN1hDPQ.base = (&NTI_13RNkKqUOX1TtorOUlKtqA);
NTI_RShkcoDOPnoCVhtpN1hDPQ.flags = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_2[0] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[1];
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q.size = sizeof(TY_cnkJEp9bna8U6yi9aVW9cAJ0Q);
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q.kind = 25;
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q.base = 0;
NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q.flags = 3;
T_Ue7tnBcsL67VCiRfvt8q0A_0[1].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[1].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, closeimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[1].typ = (&NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q);
T_Ue7tnBcsL67VCiRfvt8q0A_0[1].name = "closeImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_2[1] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[2];
NTI_KjFcmLOhf4VQvVcyLJWXZw.size = sizeof(TY_KjFcmLOhf4VQvVcyLJWXZw);
NTI_KjFcmLOhf4VQvVcyLJWXZw.kind = 25;
NTI_KjFcmLOhf4VQvVcyLJWXZw.base = 0;
NTI_KjFcmLOhf4VQvVcyLJWXZw.flags = 3;
T_Ue7tnBcsL67VCiRfvt8q0A_0[2].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[2].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, atendimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[2].typ = (&NTI_KjFcmLOhf4VQvVcyLJWXZw);
T_Ue7tnBcsL67VCiRfvt8q0A_0[2].name = "atEndImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_2[2] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[3];
NTI_jlOYFw9cHausuCbPoWx2iiA.size = sizeof(TY_jlOYFw9cHausuCbPoWx2iiA);
NTI_jlOYFw9cHausuCbPoWx2iiA.kind = 25;
NTI_jlOYFw9cHausuCbPoWx2iiA.base = 0;
NTI_jlOYFw9cHausuCbPoWx2iiA.flags = 3;
T_Ue7tnBcsL67VCiRfvt8q0A_0[3].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[3].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, setpositionimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[3].typ = (&NTI_jlOYFw9cHausuCbPoWx2iiA);
T_Ue7tnBcsL67VCiRfvt8q0A_0[3].name = "setPositionImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_2[3] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[4];
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ.size = sizeof(TY_Xzm85qBLb9cf9cu8VOfAr8PQ);
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ.kind = 25;
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ.base = 0;
NTI_Xzm85qBLb9cf9cu8VOfAr8PQ.flags = 3;
T_Ue7tnBcsL67VCiRfvt8q0A_0[4].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[4].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, getpositionimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[4].typ = (&NTI_Xzm85qBLb9cf9cu8VOfAr8PQ);
T_Ue7tnBcsL67VCiRfvt8q0A_0[4].name = "getPositionImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_2[4] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[5];
NTI_tjaJtoUzLe1BMUbItlcGhQ.size = sizeof(TY_tjaJtoUzLe1BMUbItlcGhQ);
NTI_tjaJtoUzLe1BMUbItlcGhQ.kind = 25;
NTI_tjaJtoUzLe1BMUbItlcGhQ.base = 0;
NTI_tjaJtoUzLe1BMUbItlcGhQ.flags = 3;
T_Ue7tnBcsL67VCiRfvt8q0A_0[5].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[5].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, readdataimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[5].typ = (&NTI_tjaJtoUzLe1BMUbItlcGhQ);
T_Ue7tnBcsL67VCiRfvt8q0A_0[5].name = "readDataImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_2[5] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[6];
T_Ue7tnBcsL67VCiRfvt8q0A_0[6].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[6].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, peekdataimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[6].typ = (&NTI_tjaJtoUzLe1BMUbItlcGhQ);
T_Ue7tnBcsL67VCiRfvt8q0A_0[6].name = "peekDataImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_2[6] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[7];
NTI_b9bsIuILxTLVZHPvJBW187A.size = sizeof(TY_b9bsIuILxTLVZHPvJBW187A);
NTI_b9bsIuILxTLVZHPvJBW187A.kind = 25;
NTI_b9bsIuILxTLVZHPvJBW187A.base = 0;
NTI_b9bsIuILxTLVZHPvJBW187A.flags = 3;
T_Ue7tnBcsL67VCiRfvt8q0A_0[7].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[7].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, writedataimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[7].typ = (&NTI_b9bsIuILxTLVZHPvJBW187A);
T_Ue7tnBcsL67VCiRfvt8q0A_0[7].name = "writeDataImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_2[7] = &T_Ue7tnBcsL67VCiRfvt8q0A_0[8];
T_Ue7tnBcsL67VCiRfvt8q0A_0[8].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[8].offset = offsetof(Streamobj_RShkcoDOPnoCVhtpN1hDPQ, flushimpl);
T_Ue7tnBcsL67VCiRfvt8q0A_0[8].typ = (&NTI_cnkJEp9bna8U6yi9aVW9cAJ0Q);
T_Ue7tnBcsL67VCiRfvt8q0A_0[8].name = "flushImpl";
T_Ue7tnBcsL67VCiRfvt8q0A_0[0].len = 8; T_Ue7tnBcsL67VCiRfvt8q0A_0[0].kind = 2; T_Ue7tnBcsL67VCiRfvt8q0A_0[0].sons = &T_Ue7tnBcsL67VCiRfvt8q0A_2[0];
NTI_RShkcoDOPnoCVhtpN1hDPQ.node = &T_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;
T_Ue7tnBcsL67VCiRfvt8q0A_0[9].kind = 1;
T_Ue7tnBcsL67VCiRfvt8q0A_0[9].offset = offsetof(Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw, f);
T_Ue7tnBcsL67VCiRfvt8q0A_0[9].typ = (&NTI_7BHnQsEj49a9c6QtudqWTo1w);
T_Ue7tnBcsL67VCiRfvt8q0A_0[9].name = "f";
NTI_qoDM8xYRV40zbhS9acPNT9bw.node = &T_Ue7tnBcsL67VCiRfvt8q0A_0[9];
NTI_Z018yRjOOerOKfp9aM3JSOg.size = sizeof(Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*);
NTI_Z018yRjOOerOKfp9aM3JSOg.kind = 22;
NTI_Z018yRjOOerOKfp9aM3JSOg.base = (&NTI_qoDM8xYRV40zbhS9acPNT9bw);
NTI_Z018yRjOOerOKfp9aM3JSOg.marker = Marker_TY_Z018yRjOOerOKfp9aM3JSOg;
}

