/* Generated by re2c */
#line 1 "encodings/unicode_group_Zs_x.re"
// re2c $INPUT -o $OUTPUT -x
#include <stdint.h>
#include <stdio.h>
#include "utf16.h"
#define YYCTYPE uint16_t

bool scan(const YYCTYPE* start, const YYCTYPE* const limit) {
	__attribute__((unused)) const YYCTYPE* YYMARKER;
#define YYCURSOR start
Zs:

#line 15 "encodings/unicode_group_Zs_x.c"
{
	YYCTYPE yych;
	yych = *YYCURSOR;
	if (yych <= 0x1FFF) {
		if (yych <= 0x009F) {
			if (yych == ' ') goto yy1;
		} else {
			if (yych <= 0x00A0) goto yy1;
			if (yych == 0x1680) goto yy1;
		}
	} else {
		if (yych <= 0x205E) {
			if (yych <= 0x200A) goto yy1;
			if (yych == 0x202F) goto yy1;
		} else {
			if (yych <= 0x205F) goto yy1;
			if (yych == 0x3000) goto yy1;
		}
	}
	++YYCURSOR;
#line 15 "encodings/unicode_group_Zs_x.re"
	{ return YYCURSOR - 1 == limit; }
#line 38 "encodings/unicode_group_Zs_x.c"
yy1:
	++YYCURSOR;
#line 14 "encodings/unicode_group_Zs_x.re"
	{ goto Zs; }
#line 43 "encodings/unicode_group_Zs_x.c"
}
#line 16 "encodings/unicode_group_Zs_x.re"

}

static const uint32_t chars_Zs[] = {0x20,0x20,0xa0,0xa0,0x1680,0x1680,0x2000,0x200a,0x202f,0x202f,0x205f,0x205f,0x3000,0x3000,};

static uint32_t encode_utf16(const uint32_t* ranges, uint32_t ranges_count, uint16_t* s) {
	uint16_t* const s0 = s;
	for (uint32_t i = 0; i < ranges_count; i += 2)
		for (uint32_t j = ranges[i]; j <= ranges[i + 1]; ++j)
			if (j <= re2c::utf16::MAX_1WORD_RUNE) {
				*s++ = j;
			} else {
				*s++ = re2c::utf16::lead_surr(j);
				*s++ = re2c::utf16::trail_surr(j);
			}
	for (uint32_t i = 0; i < 2; ++i) s[i] = 0;
	return s - s0;
}

int main() {
	YYCTYPE* buffer_Zs = new YYCTYPE[36];
	uint32_t buffer_Zs_len = encode_utf16(chars_Zs, sizeof(chars_Zs) / sizeof(uint32_t), buffer_Zs);
	if (!scan(buffer_Zs, buffer_Zs + buffer_Zs_len)) printf("test 'Zs' failed\n");
	delete[] buffer_Zs;
	return 0;
}
