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

#include "nimbase.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_TNode__eTSqWXWVL7LuzmZf0c6unQ tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ;
typedef struct tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg;
typedef struct tyObject_TType__8qAQZfpTDk89aeclTNn4d9cg tyObject_TType__8qAQZfpTDk89aeclTNn4d9cg;
typedef struct tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg;
typedef struct tyObject_TIdent__LG4CHFyohryWo9bzZeyjDjA tyObject_TIdent__LG4CHFyohryWo9bzZeyjDjA;
typedef struct tySequence__9ahcSjIErJohSBBFLwuF56Q tySequence__9ahcSjIErJohSBBFLwuF56Q;
typedef struct tySequence__9ahcSjIErJohSBBFLwuF56Q_Content tySequence__9ahcSjIErJohSBBFLwuF56Q_Content;
typedef NU32 tyArray__PPSU5X9aizf5OJq0lL4Og7A[4];
struct tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg {
	tyArray__PPSU5X9aizf5OJq0lL4Og7A udata;
};
struct tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA {
	NU16 line;
	NI16 col;
	NI32 fileIndex;
};
typedef NU32 tySet_tyEnum_TNodeFlag__3UjGgL9bLM4RXBnoZJs9cviw;
typedef NU8 tyEnum_TNodeKind__eZrq5BxQzEyOryCcwdj4Kw;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct tySequence__9ahcSjIErJohSBBFLwuF56Q {
  NI len; tySequence__9ahcSjIErJohSBBFLwuF56Q_Content* p;
};
struct tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ {
	tyObject_TType__8qAQZfpTDk89aeclTNn4d9cg* typField;
	tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA info;
	tySet_tyEnum_TNodeFlag__3UjGgL9bLM4RXBnoZJs9cviw flags;
	tyEnum_TNodeKind__eZrq5BxQzEyOryCcwdj4Kw kind;
union{
	struct {
	NI64 intVal;
} _kind_1;
	struct {
	NF floatVal;
} _kind_2;
	struct {
	NimStringV2 strVal;
} _kind_3;
	struct {
	tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg* sym;
} _kind_4;
	struct {
	tyObject_TIdent__LG4CHFyohryWo9bzZeyjDjA* ident;
} _kind_5;
	struct {
	tySequence__9ahcSjIErJohSBBFLwuF56Q sons;
} _kind_6;
};
};
struct tySequence__9ahcSjIErJohSBBFLwuF56Q_Content { NI cap; tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* data[SEQ_DECL_SIZE]; };
static N_INLINE(NI, len__ast_u3190)(tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* n_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg, getOrdValue__types_u167)(tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* n_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lteq___int128_u408)(tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg a_p0, tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg b_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___int128_u412)(tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg a_p0, tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg b_p1);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
extern NIM_BOOL nimInErrorMode__system_u4179;
static N_INLINE(NI, len__ast_u3190)(tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* n_p0) {
	NI result;
	NI T1_;
	T1_ = (*n_p0)._kind_6.sons.len;
	result = T1_;
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4179);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, caseObjDefaultBranch__expanddefaults_u4)(tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* obj_p0, tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg branch_p1) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = ((NI)0);
	{
		NI i_1;
		NI colontmp_;
		NI i_2;
		i_1 = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = len__ast_u3190(obj_p0);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		i_2 = ((NI)1);
		{
			while (1) {
				if (!(i_2 < colontmp_)) goto LA3;
				i_1 = i_2;
				{
					NI j_1;
					NI colontmp__2;
					NI T5_;
					NI res_1;
					j_1 = (NI)0;
					colontmp__2 = (NI)0;
					T5_ = (NI)0;
					T5_ = len__ast_u3190((*obj_p0)._kind_6.sons.p->data[i_1]);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					colontmp__2 = (NI)(T5_ - ((NI)2));
					res_1 = ((NI)0);
					{
						while (1) {
							if (!(res_1 <= colontmp__2)) goto LA7;
							j_1 = ((NI) (res_1));
							{
								tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg x_1;
								tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg y_1;
								if (!((*(*(*obj_p0)._kind_6.sons.p->data[i_1])._kind_6.sons.p->data[j_1]).kind == ((tyEnum_TNodeKind__eZrq5BxQzEyOryCcwdj4Kw)44))) goto LA10_;
								x_1 = getOrdValue__types_u167((*(*(*obj_p0)._kind_6.sons.p->data[i_1])._kind_6.sons.p->data[j_1])._kind_6.sons.p->data[((NI)0)]);
								if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
								y_1 = getOrdValue__types_u167((*(*(*obj_p0)._kind_6.sons.p->data[i_1])._kind_6.sons.p->data[j_1])._kind_6.sons.p->data[((NI)1)]);
								if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
								{
									NIM_BOOL T14_;
									T14_ = (NIM_BOOL)0;
									T14_ = lteq___int128_u408(x_1, branch_p1);
									if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
									if (!(T14_)) goto LA15_;
									T14_ = lteq___int128_u408(branch_p1, y_1);
									if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
LA15_: ;
									if (!T14_) goto LA16_;
									result = i_1;
									goto BeforeRet_;
								}
LA16_: ;
							}
							goto LA8_;
LA10_: ;
							{
								tyObject_Int128__Moyhy3H7f18q9axhPc7Yt9bg T19_;
								NIM_BOOL T20_;
								T19_ = getOrdValue__types_u167((*(*obj_p0)._kind_6.sons.p->data[i_1])._kind_6.sons.p->data[j_1]);
								if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
								T20_ = (NIM_BOOL)0;
								T20_ = eqeq___int128_u412(T19_, branch_p1);
								if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
								if (!T20_) goto LA21_;
								result = i_1;
								goto BeforeRet_;
							}
							goto LA8_;
LA21_: ;
LA8_: ;
							res_1 += ((NI)1);
						} LA7: ;
					}
				}
				{
					NI T25_;
					T25_ = (NI)0;
					T25_ = len__ast_u3190((*obj_p0)._kind_6.sons.p->data[i_1]);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					if (!(T25_ == ((NI)1))) goto LA26_;
					result = i_1;
					goto BeforeRet_;
				}
LA26_: ;
				i_2 += ((NI)1);
			} LA3: ;
		}
	}
	result = ((NI)1);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
