/* pcre2-16-demo.c generated by valac 0.56.18, the Vala compiler
 * generated from pcre2-16-demo.vala, do not modify */

/* pcre2-16-demo: Demo of pcre2.vapi used with 16-bit libpcre2.*/
/**/
/* © 2025 Reuben Thomas <rrt@sc3d.org>*/
/**/
/* This program is in the public domain.*/

#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <pcre2.h>
#include <stdio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _g_free0(var) (var = (g_free (var), NULL))
#define _pcre2_match_data_free0(var) ((var == NULL) ? NULL : (var = (pcre2_match_data_free (var), NULL)))
#define _pcre2_code_free0(var) ((var == NULL) ? NULL : (var = (pcre2_code_free (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

static gint _vala_main (void);

static guint8*
g_string_get_data (GString* self,
                   gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	const gchar* _tmp0_;
	gint res_length1;
	gint _res_size_;
	guint8* _tmp1_;
	gint _tmp1__length1;
#line 5825 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 5826 "glib-2.0.vapi"
	_tmp0_ = self->str;
#line 5826 "glib-2.0.vapi"
	res = (guint8*) _tmp0_;
#line 5826 "glib-2.0.vapi"
	res_length1 = -1;
#line 5826 "glib-2.0.vapi"
	_res_size_ = res_length1;
#line 5827 "glib-2.0.vapi"
	res_length1 = (gint) self->len;
#line 5828 "glib-2.0.vapi"
	_tmp1_ = res;
#line 5828 "glib-2.0.vapi"
	_tmp1__length1 = res_length1;
#line 5828 "glib-2.0.vapi"
	if (result_length1) {
#line 5828 "glib-2.0.vapi"
		*result_length1 = _tmp1__length1;
#line 64 "pcre2-16-demo.c"
	}
#line 5828 "glib-2.0.vapi"
	result = _tmp1_;
#line 5828 "glib-2.0.vapi"
	return result;
#line 70 "pcre2-16-demo.c"
}

static pcre2_match_data*
_vala_pcre2_match (pcre2_code* self,
                   GString* subject,
                   gsize startoffset,
                   guint32 options,
                   gint* rc)
{
	gint _vala_rc = 0;
	pcre2_match_data* match = NULL;
	pcre2_match_data* _tmp0_;
	pcre2_match_data* _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	gint _tmp3_ = 0;
	guint8* _tmp4_;
	gint _tmp4__length1;
	pcre2_match_data* _tmp5_;
	pcre2_match_data* result;
#line 436 "pcre2.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 436 "pcre2.vapi"
	g_return_val_if_fail (subject != NULL, NULL);
#line 437 "pcre2.vapi"
	_tmp0_ = pcre2_match_data_create_from_pattern (self, NULL);
#line 437 "pcre2.vapi"
	match = _tmp0_;
#line 438 "pcre2.vapi"
	_tmp1_ = match;
#line 438 "pcre2.vapi"
	if (_tmp1_ == NULL) {
#line 439 "pcre2.vapi"
		_vala_rc = (gint) PCRE2_ERROR_NOMEMORY;
#line 440 "pcre2.vapi"
		result = NULL;
#line 440 "pcre2.vapi"
		_pcre2_match_data_free0 (match);
#line 440 "pcre2.vapi"
		if (rc) {
#line 440 "pcre2.vapi"
			*rc = _vala_rc;
#line 113 "pcre2-16-demo.c"
		}
#line 440 "pcre2.vapi"
		return result;
#line 117 "pcre2-16-demo.c"
	}
#line 442 "pcre2.vapi"
	_tmp2_ = g_string_get_data (subject, &_tmp3_);
#line 442 "pcre2.vapi"
	_tmp2__length1 = _tmp3_;
#line 442 "pcre2.vapi"
	_tmp4_ = _tmp2_;
#line 442 "pcre2.vapi"
	_tmp4__length1 = _tmp2__length1;
#line 442 "pcre2.vapi"
	_tmp5_ = match;
#line 442 "pcre2.vapi"
	_vala_rc = pcre2_match (self, (PCRE2_UCHAR*) _tmp4_, (gsize) (subject->len / sizeof (PCRE2_UCHAR)), startoffset, options, _tmp5_, NULL);
#line 443 "pcre2.vapi"
	result = match;
#line 443 "pcre2.vapi"
	if (rc) {
#line 443 "pcre2.vapi"
		*rc = _vala_rc;
#line 137 "pcre2-16-demo.c"
	}
#line 443 "pcre2.vapi"
	return result;
#line 141 "pcre2-16-demo.c"
}

static gsize*
pcre2_get_ovector (pcre2_match_data* self,
                   gint* result_length1)
{
	gsize* result;
	gsize* vec = NULL;
	gsize* _tmp0_;
	gint vec_length1;
	gint _vec_size_;
	gsize* _tmp1_;
	gint _tmp1__length1;
#line 525 "pcre2.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 526 "pcre2.vapi"
	_tmp0_ = pcre2_get_ovector_pointer (self);
#line 526 "pcre2.vapi"
	vec = (gsize*) _tmp0_;
#line 526 "pcre2.vapi"
	vec_length1 = sizeof (gsize) / sizeof (gsize);
#line 526 "pcre2.vapi"
	_vec_size_ = vec_length1;
#line 527 "pcre2.vapi"
	vec_length1 = ((gint) pcre2_get_ovector_count (self)) * 2;
#line 528 "pcre2.vapi"
	_tmp1_ = vec;
#line 528 "pcre2.vapi"
	_tmp1__length1 = vec_length1;
#line 528 "pcre2.vapi"
	if (result_length1) {
#line 528 "pcre2.vapi"
		*result_length1 = _tmp1__length1;
#line 175 "pcre2-16-demo.c"
	}
#line 528 "pcre2.vapi"
	result = _tmp1_;
#line 528 "pcre2.vapi"
	return result;
#line 181 "pcre2-16-demo.c"
}

static gsize
pcre2_group_end (pcre2_match_data* self,
                 guint32 n)
{
	gsize* _tmp0_;
	gint _tmp0__length1;
	gint _tmp1_ = 0;
	gsize* _tmp2_;
	gint _tmp2__length1;
	gsize _tmp3_;
	gsize result;
#line 539 "pcre2.vapi"
	g_return_val_if_fail (self != NULL, 0UL);
#line 540 "pcre2.vapi"
	if (n > pcre2_get_ovector_count (self)) {
#line 541 "pcre2.vapi"
		result = (gsize) G_MAXSIZE;
#line 541 "pcre2.vapi"
		return result;
#line 203 "pcre2-16-demo.c"
	}
#line 543 "pcre2.vapi"
	_tmp0_ = pcre2_get_ovector (self, &_tmp1_);
#line 543 "pcre2.vapi"
	_tmp0__length1 = _tmp1_;
#line 543 "pcre2.vapi"
	_tmp2_ = _tmp0_;
#line 543 "pcre2.vapi"
	_tmp2__length1 = _tmp0__length1;
#line 543 "pcre2.vapi"
	_tmp3_ = _tmp2_[(n * 2) + 1];
#line 543 "pcre2.vapi"
	result = _tmp3_;
#line 543 "pcre2.vapi"
	return result;
#line 219 "pcre2-16-demo.c"
}

static gsize
pcre2_group_start (pcre2_match_data* self,
                   guint32 n)
{
	gsize* _tmp0_;
	gint _tmp0__length1;
	gint _tmp1_ = 0;
	gsize* _tmp2_;
	gint _tmp2__length1;
	gsize _tmp3_;
	gsize result;
#line 532 "pcre2.vapi"
	g_return_val_if_fail (self != NULL, 0UL);
#line 533 "pcre2.vapi"
	if (n > pcre2_get_ovector_count (self)) {
#line 534 "pcre2.vapi"
		result = (gsize) G_MAXSIZE;
#line 534 "pcre2.vapi"
		return result;
#line 241 "pcre2-16-demo.c"
	}
#line 536 "pcre2.vapi"
	_tmp0_ = pcre2_get_ovector (self, &_tmp1_);
#line 536 "pcre2.vapi"
	_tmp0__length1 = _tmp1_;
#line 536 "pcre2.vapi"
	_tmp2_ = _tmp0_;
#line 536 "pcre2.vapi"
	_tmp2__length1 = _tmp0__length1;
#line 536 "pcre2.vapi"
	_tmp3_ = _tmp2_[n * 2];
#line 536 "pcre2.vapi"
	result = _tmp3_;
#line 536 "pcre2.vapi"
	return result;
#line 257 "pcre2-16-demo.c"
}

static gint
_vala_main (void)
{
	gchar* hello_world = NULL;
	gchar* _tmp0_;
	gunichar2* hello_world_utf16 = NULL;
	gchar* search = NULL;
	gchar* _tmp1_;
	gunichar2* search_utf16 = NULL;
	guint16* search_utf16_arr = NULL;
	const gchar* _tmp2_;
	guint16* _tmp3_;
	gint search_utf16_arr_length1;
	gint _search_utf16_arr_size_;
	guint16* _tmp15_;
	gint _tmp15__length1;
	const gunichar2* _tmp16_;
	const gchar* _tmp17_;
	GString* subject = NULL;
	GString* _tmp18_;
	GString* _tmp19_;
	const gunichar2* _tmp20_;
	const gchar* _tmp21_;
	GString* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	guint16* _tmp27_;
	gint _tmp27__length1;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gint errorcode = 0;
	gsize erroroffset = 0UL;
	pcre2_code* re = NULL;
	guint16* _tmp32_;
	gint _tmp32__length1;
	gint _tmp33_ = 0;
	gsize _tmp34_ = 0UL;
	pcre2_code* _tmp35_;
	gint rc = 0;
	GError* _inner_error0_ = NULL;
	gint result;
#line 11 "pcre2-16-demo.vala"
	_tmp0_ = g_strdup ("helló, wórld!");
#line 11 "pcre2-16-demo.vala"
	hello_world = _tmp0_;
#line 12 "pcre2-16-demo.vala"
	hello_world_utf16 = NULL;
#line 13 "pcre2-16-demo.vala"
	_tmp1_ = g_strdup ("ó");
#line 13 "pcre2-16-demo.vala"
	search = _tmp1_;
#line 14 "pcre2-16-demo.vala"
	search_utf16 = NULL;
#line 15 "pcre2-16-demo.vala"
	_tmp2_ = search;
#line 15 "pcre2-16-demo.vala"
	_tmp3_ = g_new0 (guint16, g_utf8_strlen (_tmp2_, (gssize) -1));
#line 15 "pcre2-16-demo.vala"
	search_utf16_arr = _tmp3_;
#line 15 "pcre2-16-demo.vala"
	search_utf16_arr_length1 = g_utf8_strlen (_tmp2_, (gssize) -1);
#line 15 "pcre2-16-demo.vala"
	_search_utf16_arr_size_ = search_utf16_arr_length1;
#line 327 "pcre2-16-demo.c"
	{
		gunichar2* _tmp4_ = NULL;
		const gchar* _tmp5_;
		gunichar2* _tmp6_;
		gunichar2* _tmp8_;
		gunichar2* _tmp9_ = NULL;
		const gchar* _tmp10_;
		gunichar2* _tmp11_;
		gunichar2* _tmp13_;
#line 17 "pcre2-16-demo.vala"
		_tmp5_ = hello_world;
#line 17 "pcre2-16-demo.vala"
		_tmp6_ = g_utf8_to_utf16 (_tmp5_, (glong) -1, NULL, NULL, &_inner_error0_);
#line 17 "pcre2-16-demo.vala"
		_tmp4_ = _tmp6_;
#line 17 "pcre2-16-demo.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 345 "pcre2-16-demo.c"
			gint _tmp7_ = -1;
#line 17 "pcre2-16-demo.vala"
			if (_inner_error0_->domain == G_CONVERT_ERROR) {
#line 349 "pcre2-16-demo.c"
				goto __catch0_g_convert_error;
			}
#line 17 "pcre2-16-demo.vala"
			search_utf16_arr = (g_free (search_utf16_arr), NULL);
#line 17 "pcre2-16-demo.vala"
			_g_free0 (search_utf16);
#line 17 "pcre2-16-demo.vala"
			_g_free0 (search);
#line 17 "pcre2-16-demo.vala"
			_g_free0 (hello_world_utf16);
#line 17 "pcre2-16-demo.vala"
			_g_free0 (hello_world);
#line 17 "pcre2-16-demo.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 17 "pcre2-16-demo.vala"
			g_clear_error (&_inner_error0_);
#line 17 "pcre2-16-demo.vala"
			return _tmp7_;
#line 368 "pcre2-16-demo.c"
		}
#line 17 "pcre2-16-demo.vala"
		_tmp8_ = _tmp4_;
#line 17 "pcre2-16-demo.vala"
		_tmp4_ = NULL;
#line 17 "pcre2-16-demo.vala"
		_g_free0 (hello_world_utf16);
#line 17 "pcre2-16-demo.vala"
		hello_world_utf16 = _tmp8_;
#line 18 "pcre2-16-demo.vala"
		_tmp10_ = search;
#line 18 "pcre2-16-demo.vala"
		_tmp11_ = g_utf8_to_utf16 (_tmp10_, (glong) -1, NULL, NULL, &_inner_error0_);
#line 18 "pcre2-16-demo.vala"
		_tmp9_ = _tmp11_;
#line 18 "pcre2-16-demo.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 386 "pcre2-16-demo.c"
			gint _tmp12_ = -1;
#line 18 "pcre2-16-demo.vala"
			_g_free0 (_tmp4_);
#line 18 "pcre2-16-demo.vala"
			if (_inner_error0_->domain == G_CONVERT_ERROR) {
#line 392 "pcre2-16-demo.c"
				goto __catch0_g_convert_error;
			}
#line 18 "pcre2-16-demo.vala"
			search_utf16_arr = (g_free (search_utf16_arr), NULL);
#line 18 "pcre2-16-demo.vala"
			_g_free0 (search_utf16);
#line 18 "pcre2-16-demo.vala"
			_g_free0 (search);
#line 18 "pcre2-16-demo.vala"
			_g_free0 (hello_world_utf16);
#line 18 "pcre2-16-demo.vala"
			_g_free0 (hello_world);
#line 18 "pcre2-16-demo.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 18 "pcre2-16-demo.vala"
			g_clear_error (&_inner_error0_);
#line 18 "pcre2-16-demo.vala"
			return _tmp12_;
#line 411 "pcre2-16-demo.c"
		}
#line 18 "pcre2-16-demo.vala"
		_tmp13_ = _tmp9_;
#line 18 "pcre2-16-demo.vala"
		_tmp9_ = NULL;
#line 18 "pcre2-16-demo.vala"
		_g_free0 (search_utf16);
#line 18 "pcre2-16-demo.vala"
		search_utf16 = _tmp13_;
#line 16 "pcre2-16-demo.vala"
		_g_free0 (_tmp9_);
#line 16 "pcre2-16-demo.vala"
		_g_free0 (_tmp4_);
#line 425 "pcre2-16-demo.c"
	}
	goto __finally0;
	__catch0_g_convert_error:
	{
#line 16 "pcre2-16-demo.vala"
		g_clear_error (&_inner_error0_);
#line 432 "pcre2-16-demo.c"
	}
	__finally0:
#line 16 "pcre2-16-demo.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 437 "pcre2-16-demo.c"
		gint _tmp14_ = -1;
#line 16 "pcre2-16-demo.vala"
		search_utf16_arr = (g_free (search_utf16_arr), NULL);
#line 16 "pcre2-16-demo.vala"
		_g_free0 (search_utf16);
#line 16 "pcre2-16-demo.vala"
		_g_free0 (search);
#line 16 "pcre2-16-demo.vala"
		_g_free0 (hello_world_utf16);
#line 16 "pcre2-16-demo.vala"
		_g_free0 (hello_world);
#line 16 "pcre2-16-demo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 16 "pcre2-16-demo.vala"
		g_clear_error (&_inner_error0_);
#line 16 "pcre2-16-demo.vala"
		return _tmp14_;
#line 455 "pcre2-16-demo.c"
	}
#line 20 "pcre2-16-demo.vala"
	_tmp15_ = search_utf16_arr;
#line 20 "pcre2-16-demo.vala"
	_tmp15__length1 = search_utf16_arr_length1;
#line 20 "pcre2-16-demo.vala"
	_tmp16_ = search_utf16;
#line 20 "pcre2-16-demo.vala"
	_tmp17_ = search;
#line 20 "pcre2-16-demo.vala"
	memmove (_tmp15_, _tmp16_, (gsize) (g_utf8_strlen (_tmp17_, (gssize) -1) * sizeof (guint16)));
#line 21 "pcre2-16-demo.vala"
	_tmp18_ = g_string_new ("");
#line 21 "pcre2-16-demo.vala"
	subject = _tmp18_;
#line 22 "pcre2-16-demo.vala"
	_tmp19_ = subject;
#line 22 "pcre2-16-demo.vala"
	_tmp20_ = hello_world_utf16;
#line 22 "pcre2-16-demo.vala"
	_tmp21_ = hello_world;
#line 22 "pcre2-16-demo.vala"
	g_string_append_len (_tmp19_, (const gchar*) _tmp20_, (gssize) (g_utf8_strlen (_tmp21_, (gssize) -1) * sizeof (guint16)));
#line 23 "pcre2-16-demo.vala"
	_tmp22_ = subject;
#line 23 "pcre2-16-demo.vala"
	_tmp23_ = g_strdup_printf ("%lu", _tmp22_->len / sizeof (guint16));
#line 23 "pcre2-16-demo.vala"
	_tmp24_ = _tmp23_;
#line 23 "pcre2-16-demo.vala"
	_tmp25_ = g_strconcat ("subject length (characters): ", _tmp24_, "\n", NULL);
#line 23 "pcre2-16-demo.vala"
	_tmp26_ = _tmp25_;
#line 23 "pcre2-16-demo.vala"
	g_print ("%s", _tmp26_);
#line 23 "pcre2-16-demo.vala"
	_g_free0 (_tmp26_);
#line 23 "pcre2-16-demo.vala"
	_g_free0 (_tmp24_);
#line 24 "pcre2-16-demo.vala"
	_tmp27_ = search_utf16_arr;
#line 24 "pcre2-16-demo.vala"
	_tmp27__length1 = search_utf16_arr_length1;
#line 24 "pcre2-16-demo.vala"
	_tmp28_ = g_strdup_printf ("%i", _tmp27__length1);
#line 24 "pcre2-16-demo.vala"
	_tmp29_ = _tmp28_;
#line 24 "pcre2-16-demo.vala"
	_tmp30_ = g_strconcat ("search length (characters): ", _tmp29_, "\n", NULL);
#line 24 "pcre2-16-demo.vala"
	_tmp31_ = _tmp30_;
#line 24 "pcre2-16-demo.vala"
	g_print ("%s", _tmp31_);
#line 24 "pcre2-16-demo.vala"
	_g_free0 (_tmp31_);
#line 24 "pcre2-16-demo.vala"
	_g_free0 (_tmp29_);
#line 28 "pcre2-16-demo.vala"
	_tmp32_ = search_utf16_arr;
#line 28 "pcre2-16-demo.vala"
	_tmp32__length1 = search_utf16_arr_length1;
#line 28 "pcre2-16-demo.vala"
	_tmp35_ = pcre2_compile ((PCRE2_UCHAR*) _tmp32_, (size_t) ((_tmp32__length1 * sizeof (guint16)) / sizeof (PCRE2_UCHAR)), 0, &_tmp33_, &_tmp34_, NULL);
#line 28 "pcre2-16-demo.vala"
	errorcode = _tmp33_;
#line 28 "pcre2-16-demo.vala"
	erroroffset = _tmp34_;
#line 28 "pcre2-16-demo.vala"
	re = _tmp35_;
#line 30 "pcre2-16-demo.vala"
	rc = 0;
#line 527 "pcre2-16-demo.c"
	{
		gsize offset = 0UL;
#line 31 "pcre2-16-demo.vala"
		offset = (gsize) 0;
#line 532 "pcre2-16-demo.c"
		{
			gboolean _tmp36_ = FALSE;
#line 31 "pcre2-16-demo.vala"
			_tmp36_ = TRUE;
#line 31 "pcre2-16-demo.vala"
			while (TRUE) {
#line 539 "pcre2-16-demo.c"
				const gchar* _tmp37_;
				gchar* _tmp38_;
				gchar* _tmp39_;
				gchar* _tmp40_;
				gchar* _tmp41_;
				pcre2_match_data* match = NULL;
				pcre2_code* _tmp42_;
				GString* _tmp43_;
				gint _tmp44_ = 0;
				pcre2_match_data* _tmp45_;
				pcre2_match_data* _tmp51_;
				pcre2_match_data* _tmp52_;
				gchar* _tmp53_;
				gchar* _tmp54_;
				gchar* _tmp55_;
				gchar* _tmp56_;
#line 31 "pcre2-16-demo.vala"
				if (!_tmp36_) {
#line 558 "pcre2-16-demo.c"
				}
#line 31 "pcre2-16-demo.vala"
				_tmp36_ = FALSE;
#line 31 "pcre2-16-demo.vala"
				_tmp37_ = hello_world;
#line 31 "pcre2-16-demo.vala"
				if (!(offset < ((gsize) (g_utf8_strlen (_tmp37_, (gssize) -1) * sizeof (guint16))))) {
#line 31 "pcre2-16-demo.vala"
					break;
#line 568 "pcre2-16-demo.c"
				}
#line 32 "pcre2-16-demo.vala"
				_tmp38_ = g_strdup_printf ("%" G_GSIZE_FORMAT, offset);
#line 32 "pcre2-16-demo.vala"
				_tmp39_ = _tmp38_;
#line 32 "pcre2-16-demo.vala"
				_tmp40_ = g_strconcat ("offset: ", _tmp39_, "\n", NULL);
#line 32 "pcre2-16-demo.vala"
				_tmp41_ = _tmp40_;
#line 32 "pcre2-16-demo.vala"
				g_print ("%s", _tmp41_);
#line 32 "pcre2-16-demo.vala"
				_g_free0 (_tmp41_);
#line 32 "pcre2-16-demo.vala"
				_g_free0 (_tmp39_);
#line 33 "pcre2-16-demo.vala"
				_tmp42_ = re;
#line 33 "pcre2-16-demo.vala"
				_tmp43_ = subject;
#line 33 "pcre2-16-demo.vala"
				_tmp45_ = _vala_pcre2_match (_tmp42_, _tmp43_, offset, (guint32) 0, &_tmp44_);
#line 33 "pcre2-16-demo.vala"
				rc = _tmp44_;
#line 33 "pcre2-16-demo.vala"
				match = _tmp45_;
#line 34 "pcre2-16-demo.vala"
				if (rc == ((gint) PCRE2_ERROR_NOMATCH)) {
#line 35 "pcre2-16-demo.vala"
					g_print ("no match\n");
#line 36 "pcre2-16-demo.vala"
					_pcre2_match_data_free0 (match);
#line 36 "pcre2-16-demo.vala"
					break;
#line 602 "pcre2-16-demo.c"
				} else {
#line 37 "pcre2-16-demo.vala"
					if (rc < 0) {
#line 606 "pcre2-16-demo.c"
						FILE* _tmp46_;
						gchar* _tmp47_;
						gchar* _tmp48_;
						gchar* _tmp49_;
						gchar* _tmp50_;
#line 38 "pcre2-16-demo.vala"
						_tmp46_ = stderr;
#line 38 "pcre2-16-demo.vala"
						_tmp47_ = g_strdup_printf ("%i", rc);
#line 38 "pcre2-16-demo.vala"
						_tmp48_ = _tmp47_;
#line 38 "pcre2-16-demo.vala"
						_tmp49_ = g_strconcat ("match returned error ", _tmp48_, "\n", NULL);
#line 38 "pcre2-16-demo.vala"
						_tmp50_ = _tmp49_;
#line 38 "pcre2-16-demo.vala"
						fprintf (_tmp46_, "%s", _tmp50_);
#line 38 "pcre2-16-demo.vala"
						_g_free0 (_tmp50_);
#line 38 "pcre2-16-demo.vala"
						_g_free0 (_tmp48_);
#line 39 "pcre2-16-demo.vala"
						_pcre2_match_data_free0 (match);
#line 39 "pcre2-16-demo.vala"
						break;
#line 632 "pcre2-16-demo.c"
					}
				}
#line 41 "pcre2-16-demo.vala"
				_tmp51_ = match;
#line 41 "pcre2-16-demo.vala"
				offset = pcre2_group_end (_tmp51_, (guint32) 0);
#line 42 "pcre2-16-demo.vala"
				_tmp52_ = match;
#line 42 "pcre2-16-demo.vala"
				_tmp53_ = g_strdup_printf ("%" G_GSIZE_FORMAT, pcre2_group_start (_tmp52_, (guint32) 0));
#line 42 "pcre2-16-demo.vala"
				_tmp54_ = _tmp53_;
#line 42 "pcre2-16-demo.vala"
				_tmp55_ = g_strconcat ("found a match at position ", _tmp54_, "\n", NULL);
#line 42 "pcre2-16-demo.vala"
				_tmp56_ = _tmp55_;
#line 42 "pcre2-16-demo.vala"
				g_print ("%s", _tmp56_);
#line 42 "pcre2-16-demo.vala"
				_g_free0 (_tmp56_);
#line 42 "pcre2-16-demo.vala"
				_g_free0 (_tmp54_);
#line 31 "pcre2-16-demo.vala"
				_pcre2_match_data_free0 (match);
#line 657 "pcre2-16-demo.c"
			}
		}
	}
#line 45 "pcre2-16-demo.vala"
	result = 0;
#line 45 "pcre2-16-demo.vala"
	_pcre2_code_free0 (re);
#line 45 "pcre2-16-demo.vala"
	_g_string_free0 (subject);
#line 45 "pcre2-16-demo.vala"
	search_utf16_arr = (g_free (search_utf16_arr), NULL);
#line 45 "pcre2-16-demo.vala"
	_g_free0 (search_utf16);
#line 45 "pcre2-16-demo.vala"
	_g_free0 (search);
#line 45 "pcre2-16-demo.vala"
	_g_free0 (hello_world_utf16);
#line 45 "pcre2-16-demo.vala"
	_g_free0 (hello_world);
#line 45 "pcre2-16-demo.vala"
	return result;
#line 679 "pcre2-16-demo.c"
}

int
main (int argc,
      char ** argv)
{
#line 10 "pcre2-16-demo.vala"
	return _vala_main ();
#line 688 "pcre2-16-demo.c"
}

