/* Generated by Nim Compiler v2.2.10 */
#define NIM_INTBITS 64
#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 TNimTypeV2 TNimTypeV2;
typedef struct tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct RootObj RootObj;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content;
typedef struct tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA;
typedef struct tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A;
typedef struct tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg;
typedef struct tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig;
struct TNimTypeV2 {
	void* destructor;
	NI size;
	NI16 align;
	NI16 depth;
	NU32* display;
	void* traceImpl;
	void* typeInfoV1;
	NI flags;
	void* vTable[SEQ_DECL_SIZE];
};
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct RootObj {
	TNimTypeV2* m_type;
};
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  NI len; tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content* p;
};
typedef NU16 tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw;
typedef NU8 tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg;
struct tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg {
	RootObj Sup;
	NI pos;
	NIM_BOOL inShortState;
	tySet_tyChar__nmiMWKVIe46vacnhAFrQvw shortNoVal;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ longNoVal;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ cmds;
	NI idx;
	tySet_tyChar__nmiMWKVIe46vacnhAFrQvw separators;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw rules;
	tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg kind;
	NimStringV2 key;
	NimStringV2 val;
};
typedef NU8 tyEnum_CliMode__DMGoV7jtOGTQXibmV4Wwcw;
typedef NU8 tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw;
struct tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA {
	RootObj Sup;
	NI i0;
};
struct tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A {
	NI rc;
	NI rootIdx;
};
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (NimStringV2* cmds_p0, NI cmds_p0Len_0, NI idx_p1, void* ClE_0);
void* ClE_0;
} tyProc__uxPpwEu9apdQMAlJaIm3TyA;
typedef N_CLOSURE_PTR(void, TM__GYgvYKeHVTEls0AcywABHQ_7) (NimStringV2* cmds_p0, NI cmds_p0Len_0, NI idx_p1);
struct tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg {
	RootObj Sup;
	NI i0;
	NimStringV2 cmd1;
};
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
typedef N_CLOSURE_PTR(void, TM__GYgvYKeHVTEls0AcywABHQ_9) (void);
typedef N_CLOSURE_PTR(void, TM__GYgvYKeHVTEls0AcywABHQ_10) (void);
typedef N_CLOSURE_PTR(void, TM__GYgvYKeHVTEls0AcywABHQ_12) (NimStringV2* cmds_p0, NI cmds_p0Len_0, NI idx_p1);
typedef N_CLOSURE_PTR(void, TM__GYgvYKeHVTEls0AcywABHQ_13) (NimStringV2* cmds_p0, NI cmds_p0Len_0, NI idx_p1);
typedef N_CLOSURE_PTR(void, TM__GYgvYKeHVTEls0AcywABHQ_14) (NimStringV2* cmds_p0, NI cmds_p0Len_0, NI idx_p1);
struct tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig {
	NI a;
	NI b;
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZparseopt_u585)(void* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u215)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2691)(NimStringV2 dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u5530)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ dest_p0);
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, initOptParser__pureZparseopt_u121)(NimStringV2* cmdline_p0, NI cmdline_p0Len_0, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw shortNoVal_p1, tySequence__sM4lkSb7zS6F7OVMvW9cffQ longNoVal_p2, tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw rules_p3, tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* Result);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, at___pureZparseopt_u127)(NimStringV2* a_p0, NI a_p0Len_0);
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, eqdup___system_u5536)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ src_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u5539)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* dest_p0, tySequence__sM4lkSb7zS6F7OVMvW9cffQ src_p1);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, newSeq__stdZsyncio_u579)(NI len_p0);
N_LIB_PRIVATE N_NIMCALL(NI, paramCount__stdZcmdline_u62)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2700)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, paramStr__stdZcmdline_u56)(NI i_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, nosparseCmdLine)(NimStringV2 c_p0);
N_LIB_PRIVATE N_NIMCALL(tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw, toRules__pureZparseopt_u49)(tyEnum_CliMode__DMGoV7jtOGTQXibmV4Wwcw m_p0);
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size_p0, NI alignment_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u661)(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicStatic)(void* p_p0, TNimTypeV2* desc_p1);
static N_INLINE(NI, minuspercent___system_u805)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3492)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u636)(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimRawDispose)(void* p_p0, NI alignment_p1);
N_LIB_PRIVATE N_CLOSURE(void, consumeDelims__pureZparseopt_u394)(NimStringV2* cmds_p0, NI cmds_p0Len_0, NI idx_p1, void* ClE_0);
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s_p0, NI newLen_p1);
N_LIB_PRIVATE N_NIMCALL(void, handleShortOption__pureZparseopt_u301)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0, NimStringV2 cmd_p1);
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZparseopt_u768)(void* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u706)(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2694)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
static N_INLINE(NI, cardSet)(NU8* s_p0, NI len_p1);
static N_INLINE(NI, cardSetImpl__system_u5721)(NU8* s_p0, NI len_p1);
static N_INLINE(NI, countBits32)(NU32 n_p0);
static N_INLINE(NI, countSetBitsImpl__systemZcountbits95impl_u26)(NU32 x_p0);
N_CDECL(int, __builtin_popcount)(unsigned int x_p0);
N_LIB_PRIVATE N_CLOSURE(void, consumeDelims__pureZparseopt_u323)(void* ClE_0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8688)(NimStringV2 s_p0, NI first_p1);
N_LIB_PRIVATE N_NIMCALL(void, advance__pureZparseopt_u333)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u733)(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, advance__pureZparseopt_u406)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(NI, parseWord__pureZparseopt_u91)(NimStringV2 s_p0, NI i_p1, NimStringV2* w_p2, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw delim_p3);
static N_INLINE(NIM_BOOL, contains__stdZenumutils_u51)(NimStringV2* a_p0, NI a_p0Len_0, NimStringV2 item_p1);
static N_INLINE(NI, find__stdZenumutils_u56)(NimStringV2* a_p0, NI a_p0Len_0, NimStringV2 item_p1);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1);
static N_INLINE(NIM_BOOL, equalMem__system_u1750)(void* a_p0, void* b_p1, NI size_p2);
static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, quoteShellCommand__pureZos_u60)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, X5BX5D___pureZparseopt_u489)(NimStringV2* s_p0, NI s_p0Len_0, tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig x_p1);
static N_INLINE(tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig, dotdot___stdZenumutils_u106)(NI a_p0, NI b_p1);
N_LIB_PRIVATE TNimTypeV2 NTIv2__pqMTtVZW7HhFSYkGtStiLg_;
static const struct {
  NI cap; NIM_CHAR data[0+1];
} TM__GYgvYKeHVTEls0AcywABHQ_3 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__GYgvYKeHVTEls0AcywABHQ_4 = {0, (NimStrPayload*)&TM__GYgvYKeHVTEls0AcywABHQ_3};
static const NimStringV2 TM__GYgvYKeHVTEls0AcywABHQ_5 = {0, (NimStrPayload*)&TM__GYgvYKeHVTEls0AcywABHQ_3};
N_LIB_PRIVATE TNimTypeV2 NTIv2__1dc9bVA27M6Aug9b3w8mCoIA_;
N_LIB_PRIVATE TNimTypeV2 NTIv2__yWAIaaaSCbCAUgD46Jj4cg_;
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__GYgvYKeHVTEls0AcywABHQ_11 = {
0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
static NIM_CONST NU32 TM__GYgvYKeHVTEls0AcywABHQ_2[2] = {3701606400, 2735977728};
N_LIB_PRIVATE TNimTypeV2 NTIv2__pqMTtVZW7HhFSYkGtStiLg_ = {.destructor = (void*)rttiDestroy__pureZparseopt_u585, .size = sizeof(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg), .align = (NI16) NIM_ALIGNOF(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg), .depth = 1, .display = TM__GYgvYKeHVTEls0AcywABHQ_2, .traceImpl = (void*)NIM_NIL, .flags = 0};
extern NIM_BOOL nimInErrorMode__system_u4138;
static NIM_CONST NU32 TM__GYgvYKeHVTEls0AcywABHQ_6[2] = {3701606400, 3611186176};
N_LIB_PRIVATE TNimTypeV2 NTIv2__1dc9bVA27M6Aug9b3w8mCoIA_ = {.destructor = (void*)NIM_NIL, .size = sizeof(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA), .align = (NI16) NIM_ALIGNOF(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA), .depth = 1, .display = TM__GYgvYKeHVTEls0AcywABHQ_6, .traceImpl = (void*)NIM_NIL, .flags = 0};
static NIM_CONST NU32 TM__GYgvYKeHVTEls0AcywABHQ_8[2] = {3701606400, 1611163904};
N_LIB_PRIVATE TNimTypeV2 NTIv2__yWAIaaaSCbCAUgD46Jj4cg_ = {.destructor = (void*)rttiDestroy__pureZparseopt_u768, .size = sizeof(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg), .align = (NI16) NIM_ALIGNOF(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg), .depth = 1, .display = TM__GYgvYKeHVTEls0AcywABHQ_8, .traceImpl = (void*)NIM_NIL, .flags = 0};
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u215)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* dest_p0) {
	eqdestroy___system_u2691((*dest_p0).val);
	eqdestroy___system_u2691((*dest_p0).key);
	eqdestroy___system_u5530((*dest_p0).cmds);
	eqdestroy___system_u5530((*dest_p0).longNoVal);
}
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZparseopt_u585)(void* dest_p0) {
	eqdestroy___pureZparseopt_u215((&(*((tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg*) (dest_p0)))));
}
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);
}
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4138);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, initOptParser__pureZparseopt_u121)(NimStringV2* cmdline_p0, NI cmdline_p0Len_0, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw shortNoVal_p1, tySequence__sM4lkSb7zS6F7OVMvW9cffQ longNoVal_p2, tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw rules_p3, tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* Result) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ colontmpD_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	(*Result).Sup.m_type = (&NTIv2__pqMTtVZW7HhFSYkGtStiLg_);
	(*Result).pos = ((NI)0);
	(*Result).idx = ((NI)0);
	(*Result).cmds = at___pureZparseopt_u127(cmdline_p0, cmdline_p0Len_0);
	(*Result).inShortState = NIM_FALSE;
	nimCopyMem((void*)(*Result).shortNoVal, (NIM_CONST void*)shortNoVal_p1, 32);
	colontmpD_ = eqdup___system_u5536(longNoVal_p2);
	(*Result).longNoVal = colontmpD_;
	nimZeroMem((*Result).separators, sizeof(tySet_tyChar__nmiMWKVIe46vacnhAFrQvw));
	(*Result).rules = rules_p3;
	(*Result).kind = ((tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg)0);
	(*Result).key = TM__GYgvYKeHVTEls0AcywABHQ_4;
	(*Result).val = TM__GYgvYKeHVTEls0AcywABHQ_5;
	{
		if (!((rules_p3 &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)10)))&15U)))!=0)) goto LA3_;
		(*Result).separators[(NU)((((NU8)(61))))>>3] |=(1U<<((((NU8)(61)))&7U));
	}
LA3_: ;
	{
		if (!((rules_p3 &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)9)))&15U)))!=0)) goto LA7_;
		(*Result).separators[(NU)((((NU8)(58))))>>3] |=(1U<<((((NU8)(58)))&7U));
	}
LA7_: ;
	{
		NI T13_;
		tySequence__sM4lkSb7zS6F7OVMvW9cffQ T14_;
		if (!(cmdline_p0Len_0 == ((NI)0))) goto LA11_;
		T13_ = (NI)0;
		T13_ = paramCount__stdZcmdline_u62();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T14_.len = 0; T14_.p = NIM_NIL;
		T14_ = newSeq__stdZsyncio_u579((T13_));
		eqsink___system_u5539((&(*Result).cmds), T14_);
		{
			NI i_1;
			NI colontmp_;
			NI res_1;
			i_1 = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = paramCount__stdZcmdline_u62();
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			res_1 = ((NI)1);
			{
				while (1) {
					NimStringV2 T18_;
					if (!(res_1 <= colontmp_)) goto LA17;
					i_1 = ((NI) (res_1));
					T18_.len = 0; T18_.p = NIM_NIL;
					T18_ = paramStr__stdZcmdline_u56(i_1);
					if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2691(T18_); goto BeforeRet_;}
					eqsink___system_u2700((&(*Result).cmds.p->data[(NI)(i_1 - ((NI)1))]), T18_);
					res_1 += ((NI)1);
				} LA17: ;
			}
		}
	}
LA11_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw, toRules__pureZparseopt_u49)(tyEnum_CliMode__DMGoV7jtOGTQXibmV4Wwcw m_p0) {
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw result;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw colontmpD_;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw colontmpD__2;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw colontmpD__3;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw Common_1;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw Lax_1;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw ShortPosix_1;
	nimZeroMem((void*)(&colontmpD_), sizeof(tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw));
	nimZeroMem((void*)(&colontmpD__2), sizeof(tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw));
	nimZeroMem((void*)(&colontmpD__3), sizeof(tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw));
	Common_1 = 1432;
	Lax_1 = 519;
	ShortPosix_1 = 96;
	switch (m_p0) {
	case ((tyEnum_CliMode__DMGoV7jtOGTQXibmV4Wwcw)0):
	{
		colontmpD_ = ((Common_1 | Lax_1) | ShortPosix_1);
		result = colontmpD_;
	}
	break;
	case ((tyEnum_CliMode__DMGoV7jtOGTQXibmV4Wwcw)1):
	{
		colontmpD__2 = (Common_1 | Lax_1);
		result = colontmpD__2;
	}
	break;
	case ((tyEnum_CliMode__DMGoV7jtOGTQXibmV4Wwcw)2):
	{
		colontmpD__3 = (Common_1 | ShortPosix_1);
		result = colontmpD__3;
	}
	break;
	default: __builtin_unreachable();
	}
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, initOptParser__pureZparseopt_u276)(NimStringV2 cmdline_p0, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw shortNoVal_p1, tySequence__sM4lkSb7zS6F7OVMvW9cffQ longNoVal_p2, tyEnum_CliMode__DMGoV7jtOGTQXibmV4Wwcw mode_p3, tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* Result) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ colontmpD_;
	tySet_tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)Result, sizeof(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg));
	(*Result).Sup.m_type = (&NTIv2__pqMTtVZW7HhFSYkGtStiLg_);
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	colontmpD_ = nosparseCmdLine(cmdline_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T1_ = toRules__pureZparseopt_u49(mode_p3);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	initOptParser__pureZparseopt_u121(((colontmpD_).p) ? (colontmpD_.p->data) : NIM_NIL, colontmpD_.len, shortNoVal_p1, longNoVal_p2, T1_, Result);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	eqdestroy___system_u5530(colontmpD_);
	}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, nimDecRefIsLastCyclicStatic)(void* p_p0, TNimTypeV2* desc_p1) {
	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_: ;
		rememberCycle__system_u3492(result, cell_1, desc_p1);
	}
LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u636)(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA* dest_p0) {
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u661)(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA* dest_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLastCyclicStatic(dest_p0, ((TNimTypeV2*) ((&NTIv2__1dc9bVA27M6Aug9b3w8mCoIA_))));
		if (!T3_) goto LA4_;
		eqdestroy___pureZparseopt_u636((&(*dest_p0)));
		nimRawDispose(dest_p0, ((NI)8));
	}
LA4_: ;
}
N_LIB_PRIVATE N_CLOSURE(void, consumeDelims__pureZparseopt_u394)(NimStringV2* cmds_p0, NI cmds_p0Len_0, NI idx_p1, void* ClE_0) {
	tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA* colonenvP__1;
	colonenvP__1 = (tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA*) ClE_0;
	{
		while (1) {
			NIM_BOOL T3_;
			T3_ = (NIM_BOOL)0;
			T3_ = ((*colonenvP__1).i0 < cmds_p0[idx_p1].len);
			if (!(T3_)) goto LA4_;
			T3_ = (((NU8)(cmds_p0[idx_p1].p->data[(*colonenvP__1).i0])) == ((NU8)(9)) || ((NU8)(cmds_p0[idx_p1].p->data[(*colonenvP__1).i0])) == ((NU8)(32)));
LA4_: ;
			if (!T3_) goto LA2;
			(*colonenvP__1).i0 += ((NI)1);
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u706)(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg* dest_p0) {
	eqdestroy___system_u2691((*dest_p0).cmd1);
}
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZparseopt_u768)(void* dest_p0) {
	eqdestroy___pureZparseopt_u706((&(*((tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg*) (dest_p0)))));
}
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1) {
	prepareAdd(s_p0, ((NI)1));
	(*(*s_p0).p).data[(*s_p0).len] = c_p1;
	(*s_p0).len += ((NI)1);
	(*(*s_p0).p).data[(*s_p0).len] = 0;
}
static N_INLINE(NI, countSetBitsImpl__systemZcountbits95impl_u26)(NU32 x_p0) {
	NI result;
	NU32 x_2;
	int T1_;
	result = (NI)0;
	x_2 = x_p0;
	T1_ = (int)0;
	T1_ = __builtin_popcount(((unsigned int) (x_2)));
	result = ((NI) (T1_));
	return result;
}
static N_INLINE(NI, countBits32)(NU32 n_p0) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	result = countSetBitsImpl__systemZcountbits95impl_u26(n_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, cardSetImpl__system_u5721)(NU8* s_p0, NI len_p1) {
	NI result;
	NI i_1;
	NU64 num_1;
	i_1 = ((NI)0);
	result = ((NI)0);
	num_1 = 0ULL;
	{
		while (1) {
			NI T3_;
			if (!(i_1 < len_p1)) goto LA2;
			T3_ = (NI)0;
			T3_ = countBits32(((NU32) (s_p0[i_1])));
			result += T3_;
			i_1 += ((NI)1);
		} LA2: ;
	}
	return result;
}
static N_INLINE(NI, cardSet)(NU8* s_p0, NI len_p1) {
	NI result;
	result = cardSetImpl__system_u5721(s_p0, len_p1);
	return result;
}
N_LIB_PRIVATE N_CLOSURE(void, consumeDelims__pureZparseopt_u323)(void* ClE_0) {
	tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg* colonenvP__1;
	colonenvP__1 = (tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg*) ClE_0;
	{
		while (1) {
			NIM_BOOL T3_;
			T3_ = (NIM_BOOL)0;
			T3_ = ((*colonenvP__1).i0 < (*colonenvP__1).cmd1.len);
			if (!(T3_)) goto LA4_;
			T3_ = (((NU8)((*colonenvP__1).cmd1.p->data[(*colonenvP__1).i0])) == ((NU8)(9)) || ((NU8)((*colonenvP__1).cmd1.p->data[(*colonenvP__1).i0])) == ((NU8)(32)));
LA4_: ;
			if (!T3_) goto LA2;
			(*colonenvP__1).i0 += ((NI)1);
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, advance__pureZparseopt_u333)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0, NI n_p1) {
	(*p_p0).inShortState = NIM_FALSE;
	(*p_p0).pos = ((NI)0);
	(*p_p0).idx += n_p1;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZparseopt_u733)(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg* dest_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLastCyclicStatic(dest_p0, ((TNimTypeV2*) ((&NTIv2__yWAIaaaSCbCAUgD46Jj4cg_))));
		if (!T3_) goto LA4_;
		eqdestroy___pureZparseopt_u706((&(*dest_p0)));
		nimRawDispose(dest_p0, ((NI)8));
	}
LA4_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, handleShortOption__pureZparseopt_u301)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0, NimStringV2 cmd_p1) {
	tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg* colonenv__1;
	tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg* T2_;
	NIM_BOOL canTakeVal_1;
	NIM_BOOL T15_;
	NIM_BOOL T16_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	colonenv__1 = NIM_NIL;
	T2_ = NIM_NIL;
	T2_ = (tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg*) nimNewObj(sizeof(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg), NIM_ALIGNOF(tyObject_Env_parseoptdotnim_handleShortOption___yWAIaaaSCbCAUgD46Jj4cg));
	(*T2_).Sup.m_type = (&NTIv2__yWAIaaaSCbCAUgD46Jj4cg_);
	colonenv__1 = T2_;
	eqcopy___system_u2694((&(*colonenv__1).cmd1), cmd_p1);
	(*colonenv__1).i0 = (*p_p0).pos;
	(*p_p0).kind = ((tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg)3);
	{
		if (!((*colonenv__1).i0 < (*colonenv__1).cmd1.len)) goto LA5_;
		nimAddCharV1((&(*p_p0).key), (*colonenv__1).cmd1.p->data[(*colonenv__1).i0]);
		(*colonenv__1).i0 += ((NI)1);
	}
LA5_: ;
	(*p_p0).inShortState = NIM_TRUE;
	{
		if (!(((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)0)))&15U)))!=0)) goto LA9_;
		{
			while (1) {
				NIM_BOOL T13_;
				T13_ = (NIM_BOOL)0;
				T13_ = ((*colonenv__1).i0 < (*colonenv__1).cmd1.len);
				if (!(T13_)) goto LA14_;
				T13_ = (((NU8)((*colonenv__1).cmd1.p->data[(*colonenv__1).i0])) == ((NU8)(9)) || ((NU8)((*colonenv__1).cmd1.p->data[(*colonenv__1).i0])) == ((NU8)(32)));
LA14_: ;
				if (!T13_) goto LA12;
				(*colonenv__1).i0 += ((NI)1);
				(*p_p0).inShortState = NIM_FALSE;
			} LA12: ;
		}
	}
LA9_: ;
	T15_ = (NIM_BOOL)0;
	T16_ = (NIM_BOOL)0;
	T16_ = (((NI)0) < cardSet((*p_p0).shortNoVal, 32));
	if (!(T16_)) goto LA17_;
	T16_ = (((NI)0) < (*p_p0).key.len);
LA17_: ;
	T15_ = T16_;
	if (!(T15_)) goto LA18_;
	T15_ = !((((*p_p0).shortNoVal[(NU)((((NU8)((*p_p0).key.p->data[((NI)0)]))))>>3] &(1U<<((NU)((((NU8)((*p_p0).key.p->data[((NI)0)]))))&7U)))!=0));
LA18_: ;
	canTakeVal_1 = T15_;
	{
		NIM_BOOL T21_;
		NimStringV2 T34_;
		T21_ = (NIM_BOOL)0;
		T21_ = ((*colonenv__1).i0 < (*colonenv__1).cmd1.len);
		if (!(T21_)) goto LA22_;
		T21_ = (((*p_p0).separators[(NU)((((NU8)((*colonenv__1).cmd1.p->data[(*colonenv__1).i0]))))>>3] &(1U<<((NU)((((NU8)((*colonenv__1).cmd1.p->data[(*colonenv__1).i0]))))&7U)))!=0);
LA22_: ;
		if (!T21_) goto LA23_;
		{
			if (!(((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)2)))&15U)))!=0)) goto LA27_;
			(*colonenv__1).i0 += ((NI)1);
			{
				tyProc__HzVCwACFYM9cx9aV62PdjtuA T33_;
				if (!(((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)1)))&15U)))!=0)) goto LA31_;
				nimZeroMem((void*)(&T33_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
				T33_.ClP_0 = consumeDelims__pureZparseopt_u323; T33_.ClE_0 = colonenv__1;
				T33_.ClE_0? T33_.ClP_0(T33_.ClE_0):((TM__GYgvYKeHVTEls0AcywABHQ_9)(T33_.ClP_0))();
				if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
			}
LA31_: ;
		}
LA27_: ;
		T34_.len = 0; T34_.p = NIM_NIL;
		T34_ = substr__system_u8688((*colonenv__1).cmd1, (*colonenv__1).i0);
		eqsink___system_u2700((&(*p_p0).val), T34_);
		advance__pureZparseopt_u333(p_p0, ((NI)1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		eqdestroy___pureZparseopt_u733(colonenv__1);
		goto BeforeRet_;
	}
	goto LA19_;
LA23_: ;
	{
		NIM_BOOL T36_;
		NIM_BOOL T37_;
		NimStringV2 T47_;
		T36_ = (NIM_BOOL)0;
		T37_ = (NIM_BOOL)0;
		T37_ = canTakeVal_1;
		if (!(T37_)) goto LA38_;
		T37_ = (((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)4)))&15U)))!=0);
LA38_: ;
		T36_ = T37_;
		if (!(T36_)) goto LA39_;
		T36_ = ((*colonenv__1).i0 < (*colonenv__1).cmd1.len);
LA39_: ;
		if (!T36_) goto LA40_;
		{
			tyProc__HzVCwACFYM9cx9aV62PdjtuA T46_;
			if (!(((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)0)))&15U)))!=0)) goto LA44_;
			nimZeroMem((void*)(&T46_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
			T46_.ClP_0 = consumeDelims__pureZparseopt_u323; T46_.ClE_0 = colonenv__1;
			T46_.ClE_0? T46_.ClP_0(T46_.ClE_0):((TM__GYgvYKeHVTEls0AcywABHQ_10)(T46_.ClP_0))();
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		}
LA44_: ;
		T47_.len = 0; T47_.p = NIM_NIL;
		T47_ = substr__system_u8688((*colonenv__1).cmd1, (*colonenv__1).i0);
		eqsink___system_u2700((&(*p_p0).val), T47_);
		advance__pureZparseopt_u333(p_p0, ((NI)1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		eqdestroy___pureZparseopt_u733(colonenv__1);
		goto BeforeRet_;
	}
	goto LA19_;
LA40_: ;
	{
		NIM_BOOL T49_;
		NIM_BOOL T50_;
		NIM_BOOL T51_;
		NIM_BOOL T52_;
		NI T56_;
		NIM_BOOL T58_;
		NIM_BOOL T60_;
		T49_ = (NIM_BOOL)0;
		T50_ = (NIM_BOOL)0;
		T51_ = (NIM_BOOL)0;
		T52_ = (NIM_BOOL)0;
		T52_ = canTakeVal_1;
		if (!(T52_)) goto LA53_;
		T52_ = (((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)5)))&15U)))!=0);
LA53_: ;
		T51_ = T52_;
		if (!(T51_)) goto LA54_;
		T51_ = ((*colonenv__1).cmd1.len <= (*colonenv__1).i0);
LA54_: ;
		T50_ = T51_;
		if (!(T50_)) goto LA55_;
		T56_ = (*p_p0).cmds.len;
		T50_ = ((NI)((*p_p0).idx + ((NI)1)) < T56_);
LA55_: ;
		T49_ = T50_;
		if (!(T49_)) goto LA57_;
		T58_ = (NIM_BOOL)0;
		T58_ = (((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)6)))&15U)))!=0);
		if (T58_) goto LA59_;
		T60_ = (NIM_BOOL)0;
		T60_ = (((NI)0) < (*p_p0).cmds.p->data[(NI)((*p_p0).idx + ((NI)1))].len);
		if (!(T60_)) goto LA61_;
		T60_ = ((NU8)((*p_p0).cmds.p->data[(NI)((*p_p0).idx + ((NI)1))].p->data[((NI)0)]) == (NU8)(45));
LA61_: ;
		T58_ = !(T60_);
LA59_: ;
		T49_ = T58_;
LA57_: ;
		if (!T49_) goto LA62_;
		eqcopy___system_u2694((&(*p_p0).val), (*p_p0).cmds.p->data[(NI)((*p_p0).idx + ((NI)1))]);
		advance__pureZparseopt_u333(p_p0, ((NI)2));
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		eqdestroy___pureZparseopt_u733(colonenv__1);
		goto BeforeRet_;
	}
	goto LA19_;
LA62_: ;
LA19_: ;
	(*p_p0).pos = (*colonenv__1).i0;
	{
		if (!((*colonenv__1).cmd1.len <= (*colonenv__1).i0)) goto LA66_;
		advance__pureZparseopt_u333(p_p0, ((NI)1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	}
LA66_: ;
	{
		LA1_:;
	}
	{
		eqdestroy___pureZparseopt_u733(colonenv__1);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, advance__pureZparseopt_u406)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0, NI n_p1) {
	(*p_p0).pos = ((NI)0);
	(*p_p0).idx += n_p1;
}
N_LIB_PRIVATE N_NIMCALL(NI, parseWord__pureZparseopt_u91)(NimStringV2 s_p0, NI i_p1, NimStringV2* w_p2, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw delim_p3) {
	NI result;
	result = i_p1;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (result < s_p0.len);
		if (!(T3_)) goto LA4_;
		T3_ = ((NU8)(s_p0.p->data[result]) == (NU8)(34));
LA4_: ;
		if (!T3_) goto LA5_;
		result += ((NI)1);
		{
			while (1) {
				if (!(result < s_p0.len)) goto LA8;
				{
					if (!((NU8)(s_p0.p->data[result]) == (NU8)(34))) goto LA11_;
					result += ((NI)1);
					goto LA7;
				}
LA11_: ;
				nimAddCharV1((&(*w_p2)), s_p0.p->data[result]);
				result += ((NI)1);
			} LA8: ;
		} LA7: ;
	}
	goto LA1_;
LA5_: ;
	{
		{
			while (1) {
				NIM_BOOL T16_;
				T16_ = (NIM_BOOL)0;
				T16_ = (result < s_p0.len);
				if (!(T16_)) goto LA17_;
				T16_ = !(((delim_p3[(NU)((((NU8)(s_p0.p->data[result]))))>>3] &(1U<<((NU)((((NU8)(s_p0.p->data[result]))))&7U)))!=0));
LA17_: ;
				if (!T16_) goto LA15;
				nimAddCharV1((&(*w_p2)), s_p0.p->data[result]);
				result += ((NI)1);
			} LA15: ;
		}
	}
LA1_: ;
	return result;
}
static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2) {
	int result;
	result = memcmp(a_p0, b_p1, ((size_t) (size_p2)));
	return result;
}
static N_INLINE(NIM_BOOL, equalMem__system_u1750)(void* a_p0, void* b_p1, NI size_p2) {
	NIM_BOOL result;
	int T1_;
	T1_ = (int)0;
	T1_ = nimCmpMem(a_p0, b_p1, size_p2);
	result = (T1_ == ((NI32)0));
	return result;
}
static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1) {
	NIM_BOOL result;
	NI alen_1;
	NI blen_1;
{	result = NIM_FALSE;
	alen_1 = a_p0.len;
	blen_1 = b_p1.len;
	{
		if (!(alen_1 == blen_1)) goto LA3_;
		{
			if (!(alen_1 == ((NI)0))) goto LA7_;
			result = NIM_TRUE;
			goto BeforeRet_;
		}
LA7_: ;
		result = equalMem__system_u1750(((void*) ((&a_p0.p->data[((NI)0)]))), ((void*) ((&b_p1.p->data[((NI)0)]))), (alen_1));
		goto BeforeRet_;
	}
LA3_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, find__stdZenumutils_u56)(NimStringV2* a_p0, NI a_p0Len_0, NimStringV2 item_p1) {
	NI result;
{	result = ((NI)0);
	{
		NimStringV2* i_1;
		NI i_2;
		i_1 = (NimStringV2*)0;
		i_2 = ((NI)0);
		{
			while (1) {
				if (!(i_2 < a_p0Len_0)) goto LA3;
				i_1 = (&a_p0[i_2]);
				{
					if (!eqStrings((*i_1), item_p1)) goto LA6_;
					goto BeforeRet_;
				}
LA6_: ;
				result += ((NI)1);
				i_2 += ((NI)1);
			} LA3: ;
		}
	}
	result = ((NI)-1);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, contains__stdZenumutils_u51)(NimStringV2* a_p0, NI a_p0Len_0, NimStringV2 item_p1) {
	NIM_BOOL result;
	NI T1_;
{	T1_ = (NI)0;
	T1_ = find__stdZenumutils_u56(a_p0, a_p0Len_0, item_p1);
	result = (((NI)0) <= T1_);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nponext)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0) {
	tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA* colonenv__1;
	tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA* T2_;
	tyProc__uxPpwEu9apdQMAlJaIm3TyA T8_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	colonenv__1 = NIM_NIL;
	T2_ = NIM_NIL;
	T2_ = (tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA*) nimNewObj(sizeof(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA), NIM_ALIGNOF(tyObject_Env_parseoptdotnim_next___1dc9bVA27M6Aug9b3w8mCoIA));
	(*T2_).Sup.m_type = (&NTIv2__1dc9bVA27M6Aug9b3w8mCoIA_);
	colonenv__1 = T2_;
	{
		NI T5_;
		T5_ = (*p_p0).cmds.len;
		if (!(T5_ <= (*p_p0).idx)) goto LA6_;
		(*p_p0).kind = ((tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg)0);
		eqdestroy___pureZparseopt_u661(colonenv__1);
		goto BeforeRet_;
	}
LA6_: ;
	(*colonenv__1).i0 = (*p_p0).pos;
	nimZeroMem((void*)(&T8_), sizeof(tyProc__uxPpwEu9apdQMAlJaIm3TyA));
	T8_.ClP_0 = consumeDelims__pureZparseopt_u394; T8_.ClE_0 = colonenv__1;
	T8_.ClE_0? T8_.ClP_0((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx, T8_.ClE_0):((TM__GYgvYKeHVTEls0AcywABHQ_7)(T8_.ClP_0))((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	(*p_p0).pos = (*colonenv__1).i0;
	setLengthStrV2((&(*p_p0).key), ((NI)0));
	setLengthStrV2((&(*p_p0).val), ((NI)0));
	{
		if (!(*p_p0).inShortState) goto LA11_;
		(*p_p0).inShortState = NIM_FALSE;
		{
			if (!((*colonenv__1).i0 < (*p_p0).cmds.p->data[(*p_p0).idx].len)) goto LA15_;
			handleShortOption__pureZparseopt_u301(p_p0, (*p_p0).cmds.p->data[(*p_p0).idx]);
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
			eqdestroy___pureZparseopt_u661(colonenv__1);
			goto BeforeRet_;
		}
		goto LA13_;
LA15_: ;
		{
			advance__pureZparseopt_u406(p_p0, ((NI)1));
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
			{
				NI T20_;
				T20_ = (*p_p0).cmds.len;
				if (!(T20_ <= (*p_p0).idx)) goto LA21_;
				(*p_p0).kind = ((tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg)0);
				eqdestroy___pureZparseopt_u661(colonenv__1);
				goto BeforeRet_;
			}
LA21_: ;
		}
LA13_: ;
	}
LA11_: ;
	{
		NIM_BOOL T25_;
		T25_ = (NIM_BOOL)0;
		T25_ = ((*colonenv__1).i0 < (*p_p0).cmds.p->data[(*p_p0).idx].len);
		if (!(T25_)) goto LA26_;
		T25_ = ((NU8)((*p_p0).cmds.p->data[(*p_p0).idx].p->data[(*colonenv__1).i0]) == (NU8)(45));
LA26_: ;
		if (!T25_) goto LA27_;
		(*colonenv__1).i0 += ((NI)1);
		{
			NIM_BOOL T31_;
			tySet_tyChar__nmiMWKVIe46vacnhAFrQvw colontmpD_;
			tySet_tyChar__nmiMWKVIe46vacnhAFrQvw colontmpD__2;
			NimStringV2 T35_;
			NI T36_;
			tySet_tyChar__nmiMWKVIe46vacnhAFrQvw T37_;
			tySet_tyChar__nmiMWKVIe46vacnhAFrQvw T43_;
			NI T44_;
			T31_ = (NIM_BOOL)0;
			T31_ = ((*colonenv__1).i0 < (*p_p0).cmds.p->data[(*p_p0).idx].len);
			if (!(T31_)) goto LA32_;
			T31_ = ((NU8)((*p_p0).cmds.p->data[(*p_p0).idx].p->data[(*colonenv__1).i0]) == (NU8)(45));
LA32_: ;
			if (!T31_) goto LA33_;
			nimZeroMem((void*)colontmpD_, sizeof(tySet_tyChar__nmiMWKVIe46vacnhAFrQvw));
			nimZeroMem((void*)colontmpD__2, sizeof(tySet_tyChar__nmiMWKVIe46vacnhAFrQvw));
			(*p_p0).kind = ((tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg)2);
			(*colonenv__1).i0 += ((NI)1);
			T35_.len = 0; T35_.p = NIM_NIL;
			T35_ = (*p_p0).cmds.p->data[(*p_p0).idx];
			T36_ = (NI)0;
			{
				if (!(((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)7)))&15U)))!=0)) goto LA40_;
				nimCopyMem((void*)colontmpD_, (NIM_CONST void*)(*p_p0).separators, 32);
				nimCopyMem((void*)T37_, (NIM_CONST void*)colontmpD_, 32);
			}
			goto LA38_;
LA40_: ;
			{
				nimZeroMem(colontmpD__2, sizeof(tySet_tyChar__nmiMWKVIe46vacnhAFrQvw));
				nimCopyMem((void*)T37_, (NIM_CONST void*)colontmpD__2, 32);
			}
LA38_: ;
			for (T36_ = 0; T36_ < 32; T36_++) 
  T43_[T36_] = TM__GYgvYKeHVTEls0AcywABHQ_11[T36_] | T37_[T36_];
			T44_ = (NI)0;
			T44_ = parseWord__pureZparseopt_u91(T35_, (*colonenv__1).i0, (&(*p_p0).key), T43_);
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
			(*colonenv__1).i0 = T44_;
			{
				tyProc__uxPpwEu9apdQMAlJaIm3TyA T49_;
				if (!(((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)0)))&15U)))!=0)) goto LA47_;
				nimZeroMem((void*)(&T49_), sizeof(tyProc__uxPpwEu9apdQMAlJaIm3TyA));
				T49_.ClP_0 = consumeDelims__pureZparseopt_u394; T49_.ClE_0 = colonenv__1;
				T49_.ClE_0? T49_.ClP_0((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx, T49_.ClE_0):((TM__GYgvYKeHVTEls0AcywABHQ_12)(T49_.ClP_0))((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx);
				if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
			}
LA47_: ;
			{
				NIM_BOOL T52_;
				NIM_BOOL T53_;
				T52_ = (NIM_BOOL)0;
				T53_ = (NIM_BOOL)0;
				T53_ = (((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)7)))&15U)))!=0);
				if (!(T53_)) goto LA54_;
				T53_ = ((*colonenv__1).i0 < (*p_p0).cmds.p->data[(*p_p0).idx].len);
LA54_: ;
				T52_ = T53_;
				if (!(T52_)) goto LA55_;
				T52_ = (((*p_p0).separators[(NU)((((NU8)((*p_p0).cmds.p->data[(*p_p0).idx].p->data[(*colonenv__1).i0]))))>>3] &(1U<<((NU)((((NU8)((*p_p0).cmds.p->data[(*p_p0).idx].p->data[(*colonenv__1).i0]))))&7U)))!=0);
LA55_: ;
				if (!T52_) goto LA56_;
				(*colonenv__1).i0 += ((NI)1);
				{
					tyProc__uxPpwEu9apdQMAlJaIm3TyA T62_;
					if (!(((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)1)))&15U)))!=0)) goto LA60_;
					nimZeroMem((void*)(&T62_), sizeof(tyProc__uxPpwEu9apdQMAlJaIm3TyA));
					T62_.ClP_0 = consumeDelims__pureZparseopt_u394; T62_.ClE_0 = colonenv__1;
					T62_.ClE_0? T62_.ClP_0((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx, T62_.ClE_0):((TM__GYgvYKeHVTEls0AcywABHQ_13)(T62_.ClP_0))((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx);
					if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				}
LA60_: ;
				{
					NIM_BOOL T65_;
					NIM_BOOL T66_;
					NI T68_;
					T65_ = (NIM_BOOL)0;
					T66_ = (NIM_BOOL)0;
					T66_ = ((*p_p0).cmds.p->data[(*p_p0).idx].len <= (*colonenv__1).i0);
					if (!(T66_)) goto LA67_;
					T68_ = (*p_p0).cmds.len;
					T66_ = ((NI)((*p_p0).idx + ((NI)1)) < T68_);
LA67_: ;
					T65_ = T66_;
					if (!(T65_)) goto LA69_;
					T65_ = (((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)1)))&15U)))!=0);
LA69_: ;
					if (!T65_) goto LA70_;
					eqcopy___system_u2694((&(*p_p0).val), (*p_p0).cmds.p->data[(NI)((*p_p0).idx + ((NI)1))]);
					advance__pureZparseopt_u406(p_p0, ((NI)2));
					if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				}
				goto LA63_;
LA70_: ;
				{
					NimStringV2 T73_;
					T73_.len = 0; T73_.p = NIM_NIL;
					T73_ = substr__system_u8688((*p_p0).cmds.p->data[(*p_p0).idx], (*colonenv__1).i0);
					eqsink___system_u2700((&(*p_p0).val), T73_);
					advance__pureZparseopt_u406(p_p0, ((NI)1));
					if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				}
LA63_: ;
			}
			goto LA50_;
LA56_: ;
			{
				NIM_BOOL T75_;
				NIM_BOOL T76_;
				NIM_BOOL T77_;
				NI T79_;
				NIM_BOOL T81_;
				NI T83_;
				T75_ = (NIM_BOOL)0;
				T76_ = (NIM_BOOL)0;
				T77_ = (NIM_BOOL)0;
				T77_ = (((*p_p0).rules &((NU16)1<<((NU)((((tyEnum_ParserRules__uEyHTc9b9aq9acVuwJNR0YL9cw)8)))&15U)))!=0);
				if (!(T77_)) goto LA78_;
				T79_ = (*p_p0).longNoVal.len;
				T77_ = (((NI)0) < T79_);
LA78_: ;
				T76_ = T77_;
				if (!(T76_)) goto LA80_;
				T81_ = (NIM_BOOL)0;
				T81_ = contains__stdZenumutils_u51((((*p_p0).longNoVal).p) ? ((*p_p0).longNoVal.p->data) : NIM_NIL, (*p_p0).longNoVal.len, (*p_p0).key);
				T76_ = !(T81_);
LA80_: ;
				T75_ = T76_;
				if (!(T75_)) goto LA82_;
				T83_ = (*p_p0).cmds.len;
				T75_ = ((NI)((*p_p0).idx + ((NI)1)) < T83_);
LA82_: ;
				if (!T75_) goto LA84_;
				eqcopy___system_u2694((&(*p_p0).val), (*p_p0).cmds.p->data[(NI)((*p_p0).idx + ((NI)1))]);
				advance__pureZparseopt_u406(p_p0, ((NI)2));
				if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
			}
			goto LA50_;
LA84_: ;
			{
				{
					tyProc__uxPpwEu9apdQMAlJaIm3TyA T91_;
					NimStringV2 T92_;
					if (!((*colonenv__1).i0 < (*p_p0).cmds.p->data[(*p_p0).idx].len)) goto LA89_;
					nimZeroMem((void*)(&T91_), sizeof(tyProc__uxPpwEu9apdQMAlJaIm3TyA));
					T91_.ClP_0 = consumeDelims__pureZparseopt_u394; T91_.ClE_0 = colonenv__1;
					T91_.ClE_0? T91_.ClP_0((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx, T91_.ClE_0):((TM__GYgvYKeHVTEls0AcywABHQ_14)(T91_.ClP_0))((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, (*p_p0).idx);
					if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
					T92_.len = 0; T92_.p = NIM_NIL;
					T92_ = substr__system_u8688((*p_p0).cmds.p->data[(*p_p0).idx], (*colonenv__1).i0);
					eqsink___system_u2700((&(*p_p0).cmds.p->data[(*p_p0).idx]), T92_);
				}
				goto LA87_;
LA89_: ;
				{
					advance__pureZparseopt_u406(p_p0, ((NI)1));
					if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				}
LA87_: ;
			}
LA50_: ;
		}
		goto LA29_;
LA33_: ;
		{
			(*p_p0).pos = (*colonenv__1).i0;
			handleShortOption__pureZparseopt_u301(p_p0, (*p_p0).cmds.p->data[(*p_p0).idx]);
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		}
LA29_: ;
	}
	goto LA23_;
LA27_: ;
	{
		(*p_p0).kind = ((tyEnum_CmdLineKind__HBxufsKJDla5VnYoM9ck1bg)1);
		eqcopy___system_u2694((&(*p_p0).key), (*p_p0).cmds.p->data[(*p_p0).idx]);
		advance__pureZparseopt_u406(p_p0, ((NI)1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	}
LA23_: ;
	{
		LA1_:;
	}
	{
		eqdestroy___pureZparseopt_u661(colonenv__1);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
static N_INLINE(tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig, dotdot___stdZenumutils_u106)(NI a_p0, NI b_p1) {
	tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig result;
	result.a = a_p0;
	result.b = b_p1;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, npocmdLineRest)(tyObject_OptParser__pqMTtVZW7HhFSYkGtStiLg* p_p0) {
	NimStringV2 result;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ colontmpD_;
	tyObject_HSlice__JgojxK65oMA6E0HRsL2Wig T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	T1_ = dotdot___stdZenumutils_u106((*p_p0).idx, ((NI)1));
	colontmpD_ = X5BX5D___pureZparseopt_u489((((*p_p0).cmds).p) ? ((*p_p0).cmds.p->data) : NIM_NIL, (*p_p0).cmds.len, T1_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = quoteShellCommand__pureZos_u60(((colontmpD_).p) ? (colontmpD_.p->data) : NIM_NIL, colontmpD_.len);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	eqdestroy___system_u5530(colontmpD_);
	}BeforeRet_: ;
	return result;
}
