/* Generated by Nim Compiler v2.2.10 */
#define NIM_INTBITS 32
#define NIM_EmulateOverflowChecks

#include "nimbase.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
typedef struct tyObject_RodFile__k9byU8W8yLbzhHX06zPe4zg tyObject_RodFile__k9byU8W8yLbzhHX06zPe4zg;
typedef struct tyObject_LineInfoManager__TTy646Kfh1cVyXU9aSMasUQ tyObject_LineInfoManager__TTy646Kfh1cVyXU9aSMasUQ;
typedef struct tySequence__orxtl6CusdjXleqrxi67gw tySequence__orxtl6CusdjXleqrxi67gw;
typedef struct tySequence__orxtl6CusdjXleqrxi67gw_Content tySequence__orxtl6CusdjXleqrxi67gw_Content;
typedef struct tyTuple__MaWaKZwaGUqCXKsSK12rVg tyTuple__MaWaKZwaGUqCXKsSK12rVg;
struct tySequence__orxtl6CusdjXleqrxi67gw {
  NI len; tySequence__orxtl6CusdjXleqrxi67gw_Content* p;
};
struct tyObject_LineInfoManager__TTy646Kfh1cVyXU9aSMasUQ {
	tySequence__orxtl6CusdjXleqrxi67gw aside;
};
struct tyTuple__MaWaKZwaGUqCXKsSK12rVg {
	NU32 Field0;
	NI32 Field1;
	NI32 Field2;
};
struct tySequence__orxtl6CusdjXleqrxi67gw_Content { NI cap; tyTuple__MaWaKZwaGUqCXKsSK12rVg data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, loadSeq__icZiclineinfos_u258)(tyObject_RodFile__k9byU8W8yLbzhHX06zPe4zg* f_p0, tySequence__orxtl6CusdjXleqrxi67gw* s_p1);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__system_u2172)(void* a_p0, int v_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(void, add__icZiclineinfos_u58)(tySequence__orxtl6CusdjXleqrxi67gw* x_p0, tyTuple__MaWaKZwaGUqCXKsSK12rVg y_p1);
N_LIB_PRIVATE N_NIMCALL(void, storeSeq__icZiclineinfos_u186)(tyObject_RodFile__k9byU8W8yLbzhHX06zPe4zg* f_p0, tySequence__orxtl6CusdjXleqrxi67gw s_p1);
extern NIM_BOOL nimInErrorMode__system_u4144;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4144);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, load__icZiclineinfos_u255)(tyObject_RodFile__k9byU8W8yLbzhHX06zPe4zg* r_p0, tyObject_LineInfoManager__TTy646Kfh1cVyXU9aSMasUQ* m_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	loadSeq__icZiclineinfos_u258(r_p0, (&(*m_p1).aside));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
static N_INLINE(void, nimSetMem__system_u2172)(void* a_p0, int v_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
	nimSetMem__system_u2172(p_p0, ((int)0), size_p1);
}
N_LIB_PRIVATE N_NIMCALL(tyTuple__MaWaKZwaGUqCXKsSK12rVg, unpack__icZiclineinfos_u158)(tyObject_LineInfoManager__TTy646Kfh1cVyXU9aSMasUQ m_p0, NU32 i_p1) {
	tyTuple__MaWaKZwaGUqCXKsSK12rVg result;
	NU32 i_2;
	nimZeroMem((void*)(&result), sizeof(tyTuple__MaWaKZwaGUqCXKsSK12rVg));
	i_2 = i_p1;
	{
		NU32 colontmp_;
		NI32 colontmp__2;
		NI32 colontmp__3;
		if (!((NU32)(i_2 & ((NU32)1)) == ((NU32)0))) goto LA3_;
		colontmp_ = (NU32)((NU32)((NU32)(i_2) >> (NU32)(((NU32)1) & (32 - 1))) & ((NU32)1023));
		colontmp__2 = ((NI32) ((NU32)((NU32)((NU32)(i_2) >> (NU32)(((NU32)11) & (32 - 1))) & ((NU32)16383))));
		colontmp__3 = ((NI32) ((NU32)((NU32)((NU32)(i_2) >> (NU32)(((NU32)25) & (32 - 1))) & ((NU32)127))));
		result.Field0 = colontmp_;
		result.Field1 = colontmp__2;
		result.Field2 = colontmp__3;
	}
	goto LA1_;
LA3_: ;
	{
		result = m_p0.aside.p->data[((NI) ((NU32)((NU32)(i_2) >> (NU32)(((NU32)1) & (32 - 1)))))];
	}
LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NU32, pack__icZiclineinfos_u30)(tyObject_LineInfoManager__TTy646Kfh1cVyXU9aSMasUQ* m_p0, NU32 file_p1, NI32 line_p2, NI32 col_p3) {
	NU32 result;
	result = (NU32)0;
	{
		NIM_BOOL T3_;
		NIM_BOOL T4_;
		NU32 colontmpD_;
		NU32 colontmpD__2;
		NU32 colontmpD__3;
		NU32 colontmpD__4;
		NU32 col_2;
		NU32 line_2;
		T3_ = (NIM_BOOL)0;
		T4_ = (NIM_BOOL)0;
		T4_ = ((NU32)(file_p1) <= (NU32)(((NU32)1023)));
		if (!(T4_)) goto LA5_;
		T4_ = (line_p2 <= ((NI32)16383));
LA5_: ;
		T3_ = T4_;
		if (!(T3_)) goto LA6_;
		T3_ = (col_p3 <= ((NI32)127));
LA6_: ;
		if (!T3_) goto LA7_;
		colontmpD_ = (NU32)0;
		colontmpD__2 = (NU32)0;
		colontmpD__3 = (NU32)0;
		colontmpD__4 = (NU32)0;
		{
			if (!(col_p3 < ((NI32)0))) goto LA11_;
			colontmpD_ = ((NU32)0);
			col_2 = colontmpD_;
		}
		goto LA9_;
LA11_: ;
		{
			colontmpD__2 = ((NU32) (col_p3));
			col_2 = colontmpD__2;
		}
LA9_: ;
		{
			if (!(line_p2 < ((NI32)0))) goto LA16_;
			colontmpD__3 = ((NU32)0);
			line_2 = colontmpD__3;
		}
		goto LA14_;
LA16_: ;
		{
			colontmpD__4 = ((NU32) (line_p2));
			line_2 = colontmpD__4;
		}
LA14_: ;
		result = (NU32)((NU32)((NU32)((NU32)(file_p1) << (NU32)(((NU32)1) & (32 - 1))) | (NU32)((NU32)(line_2) << (NU32)(((NU32)11) & (32 - 1)))) | (NU32)((NU32)(col_2) << (NU32)(((NU32)25) & (32 - 1))));
	}
	goto LA1_;
LA7_: ;
	{
		NI T20_;
		tyTuple__MaWaKZwaGUqCXKsSK12rVg T21_;
		T20_ = (*m_p0).aside.len;
		result = ((NU32) ((NI)((NI)((NU32)(T20_) << (NU32)(((NI)1) & (32 - 1))) | ((NI)1))));
		T21_.Field0 = file_p1;
		T21_.Field1 = line_p2;
		T21_.Field2 = col_p3;
		add__icZiclineinfos_u58((&(*m_p0).aside), T21_);
	}
LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, store__icZiclineinfos_u183)(tyObject_RodFile__k9byU8W8yLbzhHX06zPe4zg* r_p0, tyObject_LineInfoManager__TTy646Kfh1cVyXU9aSMasUQ m_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	storeSeq__icZiclineinfos_u186(r_p0, m_p1.aside);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
