/* Generated by re2c */
#line 1 "encodings/unicode_group_Co_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
Co:

#line 15 "encodings/unicode_group_Co_x.c"
{
	YYCTYPE yych;
	yych = *YYCURSOR;
	if (yych <= 0xDBFE) {
		if (yych <= 0xDB7F) goto yy1;
		if (yych == 0xDBBF) goto yy4;
		goto yy3;
	} else {
		if (yych <= 0xDBFF) goto yy4;
		if (yych <= 0xDFFF) goto yy1;
		if (yych <= 0xF8FF) goto yy5;
	}
yy1:
	++YYCURSOR;
yy2:
#line 15 "encodings/unicode_group_Co_x.re"
	{ return YYCURSOR - 1 == limit; }
#line 33 "encodings/unicode_group_Co_x.c"
yy3:
	yych = *++YYCURSOR;
	if (yych <= 0xDBFF) goto yy2;
	if (yych <= 0xDFFF) goto yy5;
	goto yy2;
yy4:
	yych = *++YYCURSOR;
	if (yych <= 0xDBFF) goto yy2;
	if (yych >= 0xDFFE) goto yy2;
yy5:
	++YYCURSOR;
#line 14 "encodings/unicode_group_Co_x.re"
	{ goto Co; }
#line 47 "encodings/unicode_group_Co_x.c"
}
#line 16 "encodings/unicode_group_Co_x.re"

}

static const uint32_t chars_Co[] = {0xe000,0xf8ff,0xf0000,0xffffd,0x100000,0x10fffd,};

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_Co = new YYCTYPE[274938];
	uint32_t buffer_Co_len = encode_utf16(chars_Co, sizeof(chars_Co) / sizeof(uint32_t), buffer_Co);
	if (!scan(buffer_Co, buffer_Co + buffer_Co_len)) printf("test 'Co' failed\n");
	delete[] buffer_Co;
	return 0;
}
