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

#include "nimbase.h"
#include <unistd.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
static N_INLINE(NI, countProcessorsImpl__pureZconcurrencyZcpuinfo_u6)(void);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
extern NIM_BOOL nimInErrorMode__system_u4143;
static N_INLINE(NI, countProcessorsImpl__pureZconcurrencyZcpuinfo_u6)(void) {
	NI result;
	result = sysconf(_SC_NPROCESSORS_ONLN);
	{
		if (!(result < ((NI)0))) goto LA3_;
		result = ((NI)0);
	}
LA3_: ;
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4143);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, ncpicountProcessors)(void) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	result = countProcessorsImpl__pureZconcurrencyZcpuinfo_u6();
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
