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

#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_HeapQueue__9aOHerBv0an5tP1z30X2SCw tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw;
typedef struct tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ;
typedef struct tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ_Content tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ_Content;
typedef struct tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg;
typedef struct tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A;
typedef struct tyObject_ItemId__N3z7uIvKCrk0S9cej5ew0nA tyObject_ItemId__N3z7uIvKCrk0S9cej5ew0nA;
typedef struct tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ;
typedef struct tyObject_TType__8qAQZfpTDk89aeclTNn4d9cg tyObject_TType__8qAQZfpTDk89aeclTNn4d9cg;
typedef struct tyObject_TIdent__LG4CHFyohryWo9bzZeyjDjA tyObject_TIdent__LG4CHFyohryWo9bzZeyjDjA;
typedef struct tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA;
typedef struct tyObject_TLoc__KvQVlvKb6mbV567NQ0hMOw tyObject_TLoc__KvQVlvKb6mbV567NQ0hMOw;
typedef struct tyObject_TLib__sVuuRvQkiYNOUiPRZhmZig tyObject_TLib__sVuuRvQkiYNOUiPRZhmZig;
struct tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ {
  NI len; tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ_Content* p;
};
struct tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw {
	tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ data;
};
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q {
	NI dist;
	NI depth;
	NimStringV2 msg;
	tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg* sym;
};
struct tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A {
	NI rc;
	NI rootIdx;
};
struct tyObject_ItemId__N3z7uIvKCrk0S9cej5ew0nA {
	NI32 module;
	NI32 item;
};
typedef NU8 tyEnum_TSymKind__9a75lHd9cV25XwN4jXXBmM0Q;
typedef NU16 tyEnum_TMagic__I3BbtzbLAKAfOym58MkGAg;
struct tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA {
	NU16 line;
	NI16 col;
	NI32 fileIndex;
};
typedef NU64 tySet_tyEnum_TSymFlag__Ii9cPbwXR8ePKVRFOdTKpDg;
typedef NU32 tySet_tyEnum_TOption__LEwWf0yAgZkZx5Got2wGSQ;
typedef NU8 tyEnum_TLocKind__4f5UmCRM8alrCgj32FqIRQ;
typedef NU8 tyEnum_TStorageLoc__f19b6ZkRyh7BNPxlyjRbEGg;
typedef NU16 tySet_tyEnum_TLocFlag__Df76pxukl21zlyRFq9aa0Bg;
struct tyObject_TLoc__KvQVlvKb6mbV567NQ0hMOw {
	tyEnum_TLocKind__4f5UmCRM8alrCgj32FqIRQ k;
	tyEnum_TStorageLoc__f19b6ZkRyh7BNPxlyjRbEGg storage;
	tySet_tyEnum_TLocFlag__Df76pxukl21zlyRFq9aa0Bg flags;
	tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* lode;
	NimStringV2 snippet;
};
struct tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg {
	tyObject_ItemId__N3z7uIvKCrk0S9cej5ew0nA itemId;
	tyEnum_TSymKind__9a75lHd9cV25XwN4jXXBmM0Q kind;
union{
	struct {
	tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg* gcUnsafetyReason;
	tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* transformedBody;
} _kind_1;
	struct {
	tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg* guard;
	NI bitsize;
	NI alignment;
} _kind_2;
};
	tyEnum_TMagic__I3BbtzbLAKAfOym58MkGAg magic;
	tyObject_TType__8qAQZfpTDk89aeclTNn4d9cg* typ;
	tyObject_TIdent__LG4CHFyohryWo9bzZeyjDjA* name;
	tyObject_TLineInfo__cGj50BJ9bj3Zx09a9bMvKs8HA info;
	tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg* ownerField;
	tySet_tyEnum_TSymFlag__Ii9cPbwXR8ePKVRFOdTKpDg flags;
	tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* ast;
	tySet_tyEnum_TOption__LEwWf0yAgZkZx5Got2wGSQ options;
	NI position;
	NI32 offset;
	NI32 disamb;
	tyObject_TLoc__KvQVlvKb6mbV567NQ0hMOw loc;
	tyObject_TLib__sVuuRvQkiYNOUiPRZhmZig* annex;
	tyObject_TNode__eTSqWXWVL7LuzmZf0c6unQ* constraint;
	tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg* instantiatedFrom;
};
struct tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ_Content { NI cap; tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q data[SEQ_DECL_SIZE]; };
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__lookups_u4111)(tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ* x_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* y_p1);
N_LIB_PRIVATE N_NIMCALL(void, siftup__lookups_u4197)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, NI startpos_p1, NI p_p2);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___lookups_u4010)(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* dest_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* src_p1);
static N_INLINE(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*, X5BX5D___lookups_u4257)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, NI i_p1);
static N_INLINE(NIM_BOOL, heapCmp__lookups_u4346)(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* x_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* y_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lt___lookups_u3871)(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* a_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* b_p1);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___lookups_u4016)(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* dest_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___lookups_u4004)(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___lookups_u4007)(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* dest_p0);
static N_INLINE(NI, len__lookups_u4190)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw heap_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___lookups_u3940)(tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u805)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, unregisterCycle__system_u3127)(tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___ast_u3469)(tyObject_TSym__lYFc3T7YHHNBnaZR9at0NSg* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimRawDispose)(void* p_p0, NI alignment_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2691)(NimStringV2 dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
static N_INLINE(void, pop__lookups_u4579)(tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ* s_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* Result);
N_LIB_PRIVATE N_NIMCALL(void, shrink__lookups_u3970)(tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ* x_p0, NI newLen_p1);
N_LIB_PRIVATE N_NIMCALL(void, siftdownToBottom__lookups_u4719)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, NI p_p1);
extern NIM_BOOL nimInErrorMode__system_u4143;
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(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw, initHeapQueue__lookups_u3910)(void) {
	tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw result;
	nimZeroMem((void*)(&result), sizeof(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw));
	return result;
}
static N_INLINE(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*, X5BX5D___lookups_u4257)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, NI i_p1) {
	tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* result;
	result = (&(*heap_p0).data.p->data[i_p1]);
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4143);
	return result;
}
static N_INLINE(NIM_BOOL, heapCmp__lookups_u4346)(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* x_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* y_p1) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	result = lt___lookups_u3871(x_p0, y_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, siftup__lookups_u4197)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, NI startpos_p1, NI p_p2) {
	tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q newitem_1;
	NI pos_1;
	tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* T2_;
NIM_BOOL oldNimErrFin5_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&newitem_1), sizeof(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q));
	pos_1 = p_p2;
	T2_ = (tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*)0;
	T2_ = X5BX5D___lookups_u4257((&(*heap_p0)), (pos_1));
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	eqcopy___lookups_u4010((&newitem_1), (&(*T2_)));
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		while (1) {
			tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q parent_1;
			NI parentpos_1;
			tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* T6_;
			if (!(startpos_p1 < pos_1)) goto LA4;
			nimZeroMem((void*)(&parent_1), sizeof(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q));
			parentpos_1 = (NI)((NI64)((NI)(pos_1 - ((NI)1))) >> (NU64)(((NI)1) & (64 - 1)));
			T6_ = (tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*)0;
			T6_ = X5BX5D___lookups_u4257((&(*heap_p0)), (parentpos_1));
			if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
			eqcopy___lookups_u4010((&parent_1), (&(*T6_)));
			if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
			{
				NIM_BOOL T9_;
				T9_ = (NIM_BOOL)0;
				T9_ = heapCmp__lookups_u4346((&newitem_1), (&parent_1));
				if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
				if (!T9_) goto LA10_;
				eqsink___lookups_u4016((&(*heap_p0).data.p->data[pos_1]), (&parent_1));
				if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
				eqwasMoved___lookups_u4004((&parent_1));
				if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
				pos_1 = parentpos_1;
			}
			goto LA7_;
LA10_: ;
			{
				eqdestroy___lookups_u4007((&parent_1));
				if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				goto LA3;
			}
LA7_: ;
			{
				LA5_:;
			}
			{
				oldNimErrFin5_ = *nimErr_; *nimErr_ = NIM_FALSE;
				eqdestroy___lookups_u4007((&parent_1));
				if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				*nimErr_ = oldNimErrFin5_;
			}
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		} LA4: ;
	} LA3: ;
	eqsink___lookups_u4016((&(*heap_p0).data.p->data[pos_1]), (&newitem_1));
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		LA1_:;
	}
	{
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
static N_INLINE(NI, len__lookups_u4190)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw heap_p0) {
	NI result;
	NI T1_;
	T1_ = heap_p0.data.len;
	result = T1_;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, push__lookups_u4107)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* item_p1) {
	tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q blitTmp_1;
	NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&blitTmp_1), sizeof(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q));
	blitTmp_1.dist = (*item_p1).dist;
	blitTmp_1.depth = (*item_p1).depth;
	blitTmp_1.msg = (*item_p1).msg;
	blitTmp_1.sym = (*item_p1).sym;
	add__lookups_u4111((&(*heap_p0).data), (&blitTmp_1));
	T1_ = (NI)0;
	T1_ = len__lookups_u4190((*heap_p0));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	siftup__lookups_u4197(heap_p0, ((NI)0), (NI)(T1_ - ((NI)1)));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
static N_INLINE(NI, minuspercent___system_u805)(NI x_p0, NI y_p1) {
	NI result;
	result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
	return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastDyn)(void* p_p0) {
	NIM_BOOL result;
	result = NIM_FALSE;
	{
		tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A* cell_1;
		NI T5_;
		if (!!((p_p0 == NIM_NIL))) goto LA3_;
		T5_ = (NI)0;
		T5_ = minuspercent___system_u805(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
		cell_1 = ((tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A*) (T5_));
		{
			if (!((NI)((*cell_1).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
			result = NIM_TRUE;
		}
		goto LA6_;
LA8_: ;
		{
			(*cell_1).rc = minuspercent___system_u805((*cell_1).rc, ((NI)16));
		}
LA6_: ;
		{
			if (!result) goto LA13_;
			{
				if (!(((NI)0) < (*cell_1).rootIdx)) goto LA17_;
				unregisterCycle__system_u3127(cell_1);
			}
LA17_: ;
		}
LA13_: ;
	}
LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___lookups_u3940)(tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ dest_p0) {
	NI colontmp_;
	colontmp_ = ((NI)0);
	{
		while (1) {
			NI T3_;
			T3_ = dest_p0.len;
			if (!(colontmp_ < T3_)) goto LA2;
			{
				NIM_BOOL T6_;
				T6_ = (NIM_BOOL)0;
				T6_ = nimDecRefIsLastDyn(dest_p0.p->data[colontmp_].sym);
				if (!T6_) goto LA7_;
				eqdestroy___ast_u3469((&(*dest_p0.p->data[colontmp_].sym)));
				nimRawDispose(dest_p0.p->data[colontmp_].sym, ((NI)8));
			}
LA7_: ;
			eqdestroy___system_u2691(dest_p0.p->data[colontmp_].msg);
			colontmp_ += ((NI)1);
		} LA2: ;
	}
	if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
 alignedDealloc(dest_p0.p, NIM_ALIGNOF(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___lookups_u3922)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw dest_p0) {
	eqdestroy___lookups_u3940(dest_p0.data);
}
static N_INLINE(void, pop__lookups_u4579)(tySequence__m2cY0Y5fsG9a9cgxBvApyTZQ* s_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* Result) {
	NI L_1;
	NI T1_;
	T1_ = (*s_p0).len;
	L_1 = (NI)(T1_ - ((NI)1));
	(*Result).dist = (*s_p0).p->data[L_1].dist;
	(*Result).depth = (*s_p0).p->data[L_1].depth;
	(*Result).msg = (*s_p0).p->data[L_1].msg;
	(*Result).sym = (*s_p0).p->data[L_1].sym;
	eqwasMoved___lookups_u4004((&(*s_p0).p->data[L_1]));
	shrink__lookups_u3970(s_p0, (L_1));
}
N_LIB_PRIVATE N_NIMCALL(void, siftdownToBottom__lookups_u4719)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, NI p_p1) {
	tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q newitem_1;
	NI endpos_1;
	NI pos_1;
	NI startpos_1;
	tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* T1_;
	NI childpos_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&newitem_1), sizeof(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q));
	endpos_1 = len__lookups_u4190((*heap_p0));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	pos_1 = p_p1;
	startpos_1 = pos_1;
	T1_ = (tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*)0;
	T1_ = X5BX5D___lookups_u4257((&(*heap_p0)), (pos_1));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	eqcopy___lookups_u4010((&newitem_1), (&(*T1_)));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	childpos_1 = (NI)((NI)(((NI)2) * pos_1) + ((NI)1));
	{
		while (1) {
			NI rightpos_1;
			tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* T13_;
			if (!(childpos_1 < endpos_1)) goto LA3;
			rightpos_1 = (NI)(childpos_1 + ((NI)1));
			{
				NIM_BOOL T6_;
				tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* T8_;
				tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* T9_;
				NIM_BOOL T10_;
				T6_ = (NIM_BOOL)0;
				T6_ = (rightpos_1 < endpos_1);
				if (!(T6_)) goto LA7_;
				T8_ = (tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*)0;
				T8_ = X5BX5D___lookups_u4257((&(*heap_p0)), (childpos_1));
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				T9_ = (tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*)0;
				T9_ = X5BX5D___lookups_u4257((&(*heap_p0)), (rightpos_1));
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				T10_ = (NIM_BOOL)0;
				T10_ = heapCmp__lookups_u4346((&(*T8_)), (&(*T9_)));
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				T6_ = !(T10_);
LA7_: ;
				if (!T6_) goto LA11_;
				childpos_1 = rightpos_1;
			}
LA11_: ;
			T13_ = (tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*)0;
			T13_ = X5BX5D___lookups_u4257((&(*heap_p0)), (childpos_1));
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			eqcopy___lookups_u4010((&(*heap_p0).data.p->data[pos_1]), (&(*T13_)));
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			pos_1 = childpos_1;
			childpos_1 = (NI)((NI)(((NI)2) * pos_1) + ((NI)1));
		} LA3: ;
	}
	eqsink___lookups_u4016((&(*heap_p0).data.p->data[pos_1]), (&newitem_1));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	siftup__lookups_u4197(heap_p0, startpos_1, pos_1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, pop__lookups_u4575)(tyObject_HeapQueue__9aOHerBv0an5tP1z30X2SCw* heap_p0, tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* Result) {
	tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q lastelt_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)Result, sizeof(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q));
	nimZeroMem((void*)(&lastelt_1), sizeof(tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q));
	pop__lookups_u4579((&(*heap_p0).data), (&lastelt_1));
	{
		NI T3_;
		tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q* T6_;
		T3_ = (NI)0;
		T3_ = len__lookups_u4190((*heap_p0));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!(((NI)0) < T3_)) goto LA4_;
		T6_ = (tyObject_SpellCandidate__ITFLWGoi3Tc29brFQatc9a8Q*)0;
		T6_ = X5BX5D___lookups_u4257((&(*heap_p0)), ((NI)0));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		eqcopy___lookups_u4010(Result, (&(*T6_)));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		eqsink___lookups_u4016((&(*heap_p0).data.p->data[((NI)0)]), (&lastelt_1));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		siftdownToBottom__lookups_u4719(heap_p0, ((NI)0));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
LA4_: ;
	{
		(*Result).dist = lastelt_1.dist;
		(*Result).depth = lastelt_1.depth;
		(*Result).msg = lastelt_1.msg;
		(*Result).sym = lastelt_1.sym;
	}
LA1_: ;
	}BeforeRet_: ;
}
