/* testdata.c generated by valac 0.36.11, the Vala compiler
 * generated from testdata.vala, do not modify */

/* testcollection.vala
 *
 * Copyright (C) 2012  Maciej Piechotka
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 *      Maciej Piechotka <uzytkownik2@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>


#define TYPE_TEST_DATA (test_data_get_type ())
#define TEST_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_DATA, TestData))
#define TEST_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_DATA, TestDataClass))
#define IS_TEST_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_DATA))
#define IS_TEST_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_DATA))
#define TEST_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_DATA, TestDataClass))

typedef struct _TestData TestData;
typedef struct _TestDataClass TestDataClass;
typedef struct _TestDataPrivate TestDataPrivate;
#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block7Data Block7Data;
typedef struct _ParamSpecTestData ParamSpecTestData;

struct _TestData {
	GTypeInstance parent_instance;
	volatile int ref_count;
	TestDataPrivate * priv;
};

struct _TestDataClass {
	GTypeClass parent_class;
	void (*finalize) (TestData *self);
};

struct _Block7Data {
	int _ref_count_;
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	GCompareDataFunc compare_func;
	gpointer compare_func_target;
};

struct _ParamSpecTestData {
	GParamSpec parent_instance;
};


static gpointer test_data_parent_class = NULL;
static gchar** test_data_ones;
static gint test_data_ones_length1;
static gchar** test_data_ones = NULL;
static gint test_data_ones_length1 = 0;
static gint _test_data_ones_size_ = 0;
static gchar** test_data_tens;
static gint test_data_tens_length1;
static gchar** test_data_tens = NULL;
static gint test_data_tens_length1 = 0;
static gint _test_data_tens_size_ = 0;
static gchar* test_data_hundred;
static gchar* test_data_hundred = NULL;
static gchar** test_data_thousands;
static gint test_data_thousands_length1;
static gchar** test_data_thousands = NULL;
static gint test_data_thousands_length1 = 0;
static gint _test_data_thousands_size_ = 0;
static guint test_data_DATA_SIZE;
static guint test_data_DATA_SIZE = 0U;
static gchar** test_data_data;
static gint test_data_data_length1;
static gchar** test_data_data = NULL;
static gint test_data_data_length1 = 0;
static gint _test_data_data_size_ = 0;
static gchar** test_data_sorted_data;
static gint test_data_sorted_data_length1;
static gchar** test_data_sorted_data = NULL;
static gint test_data_sorted_data_length1 = 0;
static gint _test_data_sorted_data_size_ = 0;
static guint* test_data_random_idx;
static gint test_data_random_idx_length1;
static guint* test_data_random_idx = NULL;
static gint test_data_random_idx_length1 = 0;
static gint _test_data_random_idx_size_ = 0;

gpointer test_data_ref (gpointer instance);
void test_data_unref (gpointer instance);
GParamSpec* param_spec_test_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_test_data (GValue* value, gpointer v_object);
void value_take_test_data (GValue* value, gpointer v_object);
gpointer value_get_test_data (const GValue* value);
GType test_data_get_type (void) G_GNUC_CONST;
enum  {
	TEST_DATA_0_PROPERTY
};
static guint test_data_data_size (void);
static gchar** test_data_create_data (guint count, int* result_length1);
static gchar** test_data_sort_array (gchar** array, int array_length1, int* result_length1);
static gchar** _vala_array_dup1 (gchar** self, int length);
static guint* test_data_draw_numbers (guint n, guint k, int* result_length1);
#define TEST_DATA_RND_IDX_SIZE ((guint) 8)
gchar** test_data_get_data (int* result_length1);
gchar** test_data_get_sorted_data (int* result_length1);
guint* test_data_get_drawn_numbers (int* result_length1);
static gchar* test_data_print3digit (guint n);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static gint ___lambda3__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
static gint __lambda4_ (const gchar* a, const gchar* b);
static gint ___lambda4__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
TestData* test_data_new (void);
TestData* test_data_construct (GType object_type);
static void test_data_finalize (TestData * obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static gchar** _vala_array_dup1 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static guint test_data_data_size (void) {
	guint result = 0U;
	gint _tmp0_ = 0;
	gboolean _tmp1_;
	_tmp1_ = g_test_quick ();
	if (_tmp1_) {
		_tmp0_ = 128;
	} else {
		_tmp0_ = 1024;
	}
	result = (guint) _tmp0_;
	return result;
}


gchar** test_data_get_data (int* result_length1) {
	gchar** result = NULL;
	GTypeClass* klass = NULL;
	GTypeClass* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	_tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
	klass = _tmp0_;
	G_TYPE_FROM_CLASS (klass);
	_tmp1_ = test_data_data;
	_tmp1__length1 = test_data_data_length1;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	_g_type_class_unref0 (klass);
	return result;
}


gchar** test_data_get_sorted_data (int* result_length1) {
	gchar** result = NULL;
	GTypeClass* klass = NULL;
	GTypeClass* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	_tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
	klass = _tmp0_;
	G_TYPE_FROM_CLASS (klass);
	_tmp1_ = test_data_sorted_data;
	_tmp1__length1 = test_data_sorted_data_length1;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	_g_type_class_unref0 (klass);
	return result;
}


guint* test_data_get_drawn_numbers (int* result_length1) {
	guint* result = NULL;
	GTypeClass* klass = NULL;
	GTypeClass* _tmp0_;
	guint* _tmp1_;
	gint _tmp1__length1;
	guint* _tmp2_;
	gint _tmp2__length1;
	_tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
	klass = _tmp0_;
	G_TYPE_FROM_CLASS (klass);
	_tmp1_ = test_data_random_idx;
	_tmp1__length1 = test_data_random_idx_length1;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	_g_type_class_unref0 (klass);
	return result;
}


static guint* test_data_draw_numbers (guint n, guint k, int* result_length1) {
	guint* result = NULL;
	guint* _result_ = NULL;
	guint _tmp0_;
	guint* _tmp1_;
	gint _result__length1;
	gint __result__size_;
	guint _tmp29_;
	gint _tmp30_;
	guint* _tmp31_;
	gint _tmp31__length1;
	guint* _tmp32_;
	gint _tmp32__length1;
	_tmp0_ = n;
	_tmp1_ = g_new0 (guint, _tmp0_);
	_result_ = _tmp1_;
	_result__length1 = _tmp0_;
	__result__size_ = _result__length1;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				guint _tmp4_;
				guint _tmp5_;
				guint* _tmp6_;
				gint _tmp6__length1;
				guint _tmp7_;
				guint _tmp8_;
				guint _tmp9_;
				if (!_tmp2_) {
					guint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = n;
				if (!(_tmp4_ < _tmp5_)) {
					break;
				}
				_tmp6_ = _result_;
				_tmp6__length1 = _result__length1;
				_tmp7_ = i;
				_tmp8_ = i;
				_tmp6_[_tmp7_] = _tmp8_;
				_tmp9_ = _tmp6_[_tmp7_];
			}
		}
	}
	{
		guint i = 0U;
		guint _tmp10_;
		_tmp10_ = n;
		i = _tmp10_ - 1;
		{
			gboolean _tmp11_ = FALSE;
			_tmp11_ = TRUE;
			while (TRUE) {
				guint _tmp13_;
				gint j = 0;
				guint _tmp14_;
				gint32 _tmp15_;
				guint tmp = 0U;
				guint* _tmp16_;
				gint _tmp16__length1;
				guint _tmp17_;
				guint _tmp18_;
				guint* _tmp19_;
				gint _tmp19__length1;
				guint _tmp20_;
				guint* _tmp21_;
				gint _tmp21__length1;
				gint _tmp22_;
				guint _tmp23_;
				guint _tmp24_;
				guint* _tmp25_;
				gint _tmp25__length1;
				gint _tmp26_;
				guint _tmp27_;
				guint _tmp28_;
				if (!_tmp11_) {
					guint _tmp12_;
					_tmp12_ = i;
					i = _tmp12_ - 1;
				}
				_tmp11_ = FALSE;
				_tmp13_ = i;
				if (!(_tmp13_ >= ((guint) 1))) {
					break;
				}
				_tmp14_ = i;
				_tmp15_ = g_test_rand_int_range ((gint32) 0, (gint32) (_tmp14_ + 1));
				j = (gint) _tmp15_;
				_tmp16_ = _result_;
				_tmp16__length1 = _result__length1;
				_tmp17_ = i;
				_tmp18_ = _tmp16_[_tmp17_];
				tmp = _tmp18_;
				_tmp19_ = _result_;
				_tmp19__length1 = _result__length1;
				_tmp20_ = i;
				_tmp21_ = _result_;
				_tmp21__length1 = _result__length1;
				_tmp22_ = j;
				_tmp23_ = _tmp21_[_tmp22_];
				_tmp19_[_tmp20_] = _tmp23_;
				_tmp24_ = _tmp19_[_tmp20_];
				_tmp25_ = _result_;
				_tmp25__length1 = _result__length1;
				_tmp26_ = j;
				_tmp27_ = tmp;
				_tmp25_[_tmp26_] = _tmp27_;
				_tmp28_ = _tmp25_[_tmp26_];
			}
		}
	}
	_tmp29_ = k;
	_tmp30_ = (gint) _tmp29_;
	_result_ = g_renew (guint, _result_, (gint) _tmp29_);
	(_tmp30_ > _result__length1) ? memset (_result_ + _result__length1, 0, sizeof (guint) * (_tmp30_ - _result__length1)) : NULL;
	_result__length1 = _tmp30_;
	__result__size_ = _tmp30_;
	_tmp31_ = _result_;
	_tmp31__length1 = _result__length1;
	_result_ = NULL;
	_result__length1 = 0;
	_tmp32_ = _tmp31_;
	_tmp32__length1 = _tmp31__length1;
	if (result_length1) {
		*result_length1 = _tmp32__length1;
	}
	result = _tmp32_;
	_result_ = (g_free (_result_), NULL);
	return result;
}


static gchar* test_data_print3digit (guint n) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	guint _tmp1_;
	gchar* h = NULL;
	gchar* _tmp11_;
	guint _tmp12_;
	const gchar* t = NULL;
	gchar** _tmp13_;
	gint _tmp13__length1;
	guint _tmp14_;
	const gchar* _tmp15_;
	guint _tmp16_ = 0U;
	guint _tmp17_;
	gchar** _tmp18_;
	gint _tmp18__length1;
	const gchar* o = NULL;
	gchar** _tmp21_;
	gint _tmp21__length1;
	guint _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_ = NULL;
	const gchar* _tmp25_;
	const gchar* _tmp27_ = NULL;
	gboolean _tmp28_ = FALSE;
	const gchar* _tmp29_;
	const gchar* _tmp33_ = NULL;
	const gchar* _tmp34_;
	const gchar* _tmp36_ = NULL;
	gboolean _tmp37_ = FALSE;
	const gchar* _tmp38_;
	const gchar* _tmp40_ = NULL;
	const gchar* _tmp41_;
	gchar* _tmp43_;
	_tmp1_ = n;
	if (_tmp1_ >= ((guint) 200)) {
		gchar** _tmp2_;
		gint _tmp2__length1;
		guint _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp2_ = test_data_ones;
		_tmp2__length1 = test_data_ones_length1;
		_tmp3_ = n;
		_tmp4_ = _tmp2_[_tmp3_ / 100];
		_tmp5_ = test_data_hundred;
		_tmp6_ = g_strdup_printf ("%s %s", _tmp4_, _tmp5_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp6_;
	} else {
		const gchar* _tmp7_ = NULL;
		guint _tmp8_;
		gchar* _tmp10_;
		_tmp8_ = n;
		if (_tmp8_ >= ((guint) 100)) {
			const gchar* _tmp9_;
			_tmp9_ = test_data_hundred;
			_tmp7_ = _tmp9_;
		} else {
			_tmp7_ = NULL;
		}
		_tmp10_ = g_strdup (_tmp7_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp10_;
	}
	_tmp11_ = g_strdup (_tmp0_);
	h = _tmp11_;
	_tmp12_ = n;
	n = _tmp12_ % 100;
	_tmp13_ = test_data_tens;
	_tmp13__length1 = test_data_tens_length1;
	_tmp14_ = n;
	_tmp15_ = _tmp13_[_tmp14_ / 10];
	t = _tmp15_;
	_tmp17_ = n;
	_tmp18_ = test_data_ones;
	_tmp18__length1 = test_data_ones_length1;
	if (_tmp17_ >= ((guint) _tmp18__length1)) {
		guint _tmp19_;
		_tmp19_ = n;
		_tmp16_ = _tmp19_ % 10;
	} else {
		guint _tmp20_;
		_tmp20_ = n;
		_tmp16_ = _tmp20_;
	}
	n = _tmp16_;
	_tmp21_ = test_data_ones;
	_tmp21__length1 = test_data_ones_length1;
	_tmp22_ = n;
	_tmp23_ = _tmp21_[_tmp22_];
	o = _tmp23_;
	_tmp25_ = h;
	if (_tmp25_ != NULL) {
		const gchar* _tmp26_;
		_tmp26_ = h;
		_tmp24_ = _tmp26_;
	} else {
		_tmp24_ = "";
	}
	_tmp29_ = h;
	if (_tmp29_ != NULL) {
		gboolean _tmp30_ = FALSE;
		const gchar* _tmp31_;
		_tmp31_ = t;
		if (_tmp31_ != NULL) {
			_tmp30_ = TRUE;
		} else {
			const gchar* _tmp32_;
			_tmp32_ = o;
			_tmp30_ = _tmp32_ != NULL;
		}
		_tmp28_ = _tmp30_;
	} else {
		_tmp28_ = FALSE;
	}
	if (_tmp28_) {
		_tmp27_ = " ";
	} else {
		_tmp27_ = "";
	}
	_tmp34_ = t;
	if (_tmp34_ != NULL) {
		const gchar* _tmp35_;
		_tmp35_ = t;
		_tmp33_ = _tmp35_;
	} else {
		_tmp33_ = "";
	}
	_tmp38_ = t;
	if (_tmp38_ != NULL) {
		const gchar* _tmp39_;
		_tmp39_ = o;
		_tmp37_ = _tmp39_ != NULL;
	} else {
		_tmp37_ = FALSE;
	}
	if (_tmp37_) {
		_tmp36_ = "-";
	} else {
		_tmp36_ = "";
	}
	_tmp41_ = o;
	if (_tmp41_ != NULL) {
		const gchar* _tmp42_;
		_tmp42_ = o;
		_tmp40_ = _tmp42_;
	} else {
		_tmp40_ = "";
	}
	_tmp43_ = g_strdup_printf ("%s%s%s%s%s", _tmp24_, _tmp27_, _tmp33_, _tmp36_, _tmp40_);
	result = _tmp43_;
	_g_free0 (h);
	_g_free0 (_tmp0_);
	return result;
}


static gchar** test_data_create_data (guint count, int* result_length1) {
	gchar** result = NULL;
	gchar** numbers = NULL;
	guint _tmp0_;
	gchar** _tmp1_;
	gint numbers_length1;
	gint _numbers_size_;
	gchar** _tmp35_;
	gint _tmp35__length1;
	gchar** _tmp36_;
	gint _tmp36__length1;
	_tmp0_ = count;
	_tmp1_ = g_new0 (gchar*, _tmp0_ + 1);
	numbers = _tmp1_;
	numbers_length1 = _tmp0_;
	_numbers_size_ = numbers_length1;
	{
		guint idx = 0U;
		idx = (guint) 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				guint _tmp4_;
				guint _tmp5_;
				guint n = 0U;
				guint _tmp6_;
				gchar* num = NULL;
				guint th = 0U;
				const gchar* _tmp29_;
				gchar** _tmp31_;
				gint _tmp31__length1;
				guint _tmp32_;
				gchar* _tmp33_;
				gchar* _tmp34_;
				if (!_tmp2_) {
					guint _tmp3_;
					_tmp3_ = idx;
					idx = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = idx;
				_tmp5_ = count;
				if (!(_tmp4_ < _tmp5_)) {
					break;
				}
				_tmp6_ = idx;
				n = _tmp6_ + 1;
				num = NULL;
				th = (guint) 0;
				while (TRUE) {
					guint _tmp7_;
					guint _tmp8_;
					guint _tmp27_;
					guint _tmp28_;
					_tmp7_ = n;
					if (!(_tmp7_ != ((guint) 0))) {
						break;
					}
					_tmp8_ = n;
					if ((_tmp8_ % 1000) != ((guint) 0)) {
						gchar* t = NULL;
						gchar** _tmp9_;
						gint _tmp9__length1;
						guint _tmp10_;
						const gchar* _tmp11_;
						gchar* _tmp12_;
						gchar* c = NULL;
						guint _tmp13_;
						gchar* _tmp14_;
						const gchar* _tmp15_ = NULL;
						const gchar* _tmp16_;
						const gchar* _tmp17_ = NULL;
						const gchar* _tmp18_;
						const gchar* _tmp20_ = NULL;
						const gchar* _tmp21_;
						const gchar* _tmp22_ = NULL;
						const gchar* _tmp23_;
						const gchar* _tmp25_;
						gchar* _tmp26_;
						_tmp9_ = test_data_thousands;
						_tmp9__length1 = test_data_thousands_length1;
						_tmp10_ = th;
						_tmp11_ = _tmp9_[_tmp10_];
						_tmp12_ = g_strdup (_tmp11_);
						t = _tmp12_;
						_tmp13_ = n;
						_tmp14_ = test_data_print3digit (_tmp13_ % 1000);
						c = _tmp14_;
						_tmp16_ = t;
						if (_tmp16_ != NULL) {
							_tmp15_ = " ";
						} else {
							_tmp15_ = "";
						}
						_tmp18_ = t;
						if (_tmp18_ != NULL) {
							const gchar* _tmp19_;
							_tmp19_ = t;
							_tmp17_ = _tmp19_;
						} else {
							_tmp17_ = "";
						}
						_tmp21_ = num;
						if (_tmp21_ != NULL) {
							_tmp20_ = " ";
						} else {
							_tmp20_ = "";
						}
						_tmp23_ = num;
						if (_tmp23_ != NULL) {
							const gchar* _tmp24_;
							_tmp24_ = num;
							_tmp22_ = _tmp24_;
						} else {
							_tmp22_ = "";
						}
						_tmp25_ = c;
						_tmp26_ = g_strdup_printf ("%s%s%s%s%s", _tmp25_, _tmp15_, _tmp17_, _tmp20_, _tmp22_);
						_g_free0 (num);
						num = _tmp26_;
						_g_free0 (c);
						_g_free0 (t);
					}
					_tmp27_ = n;
					n = _tmp27_ / 1000;
					_tmp28_ = th;
					th = _tmp28_ + 1;
				}
				_tmp29_ = num;
				if (_tmp29_ == NULL) {
					gchar* _tmp30_;
					_tmp30_ = g_strdup ("zero");
					_g_free0 (num);
					num = _tmp30_;
				}
				_tmp31_ = numbers;
				_tmp31__length1 = numbers_length1;
				_tmp32_ = idx;
				_tmp33_ = num;
				num = NULL;
				_g_free0 (_tmp31_[_tmp32_]);
				_tmp31_[_tmp32_] = _tmp33_;
				_tmp34_ = _tmp31_[_tmp32_];
				_g_free0 (num);
			}
		}
	}
	_tmp35_ = numbers;
	_tmp35__length1 = numbers_length1;
	numbers = NULL;
	numbers_length1 = 0;
	_tmp36_ = _tmp35_;
	_tmp36__length1 = _tmp35__length1;
	if (result_length1) {
		*result_length1 = _tmp36__length1;
	}
	result = _tmp36_;
	numbers = (_vala_array_free (numbers, numbers_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


static Block7Data* block7_data_ref (Block7Data* _data7_) {
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}


static void block7_data_unref (void * _userdata_) {
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		GType t_type;
		GBoxedCopyFunc t_dup_func;
		GDestroyNotify t_destroy_func;
		t_type = _data7_->t_type;
		t_dup_func = _data7_->t_dup_func;
		t_destroy_func = _data7_->t_destroy_func;
		g_slice_free (Block7Data, _data7_);
	}
}


static gint __lambda3_ (Block7Data* _data7_, gconstpointer* a, gconstpointer* b) {
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	gint result = 0;
	GCompareDataFunc _tmp0_;
	void* _tmp0__target;
	gconstpointer* _tmp1_;
	gconstpointer* _tmp2_;
	gint _tmp3_;
	t_type = _data7_->t_type;
	t_dup_func = _data7_->t_dup_func;
	t_destroy_func = _data7_->t_destroy_func;
	_tmp0_ = _data7_->compare_func;
	_tmp0__target = _data7_->compare_func_target;
	_tmp1_ = a;
	_tmp2_ = b;
	_tmp3_ = _tmp0_ (*_tmp1_, *_tmp2_, _tmp0__target);
	result = _tmp3_;
	return result;
}


static gint ___lambda3__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = __lambda3_ (self, a, b);
	return result;
}


static void _vala_g_qsort_with_data (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, gpointer* elems, int elems_length1, gsize size, GCompareDataFunc compare_func, void* compare_func_target) {
	Block7Data* _data7_;
	GCompareDataFunc _tmp0_;
	void* _tmp0__target;
	gpointer* _tmp1_;
	gint _tmp1__length1;
	gsize _tmp2_;
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->t_type = t_type;
	_data7_->t_dup_func = t_dup_func;
	_data7_->t_destroy_func = t_destroy_func;
	_tmp0_ = compare_func;
	_tmp0__target = compare_func_target;
	_data7_->compare_func = (GCompareDataFunc) _tmp0_;
	_data7_->compare_func_target = _tmp0__target;
	_tmp1_ = elems;
	_tmp1__length1 = elems_length1;
	_tmp2_ = size;
	g_qsort_with_data (_tmp1_, _tmp1__length1, _tmp2_, (GCompareDataFunc) ___lambda3__gcompare_data_func, _data7_);
	block7_data_unref (_data7_);
	_data7_ = NULL;
}


static gint __lambda4_ (const gchar* a, const gchar* b) {
	gint result = 0;
	GCompareFunc _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = g_strcmp0;
	_tmp1_ = a;
	_tmp2_ = b;
	_tmp3_ = _tmp0_ (_tmp1_, _tmp2_);
	result = _tmp3_;
	return result;
}


static gint ___lambda4__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = __lambda4_ ((const gchar*) a, (const gchar*) b);
	return result;
}


static gchar** test_data_sort_array (gchar** array, int array_length1, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	_tmp0_ = array;
	_tmp0__length1 = array_length1;
	_vala_g_qsort_with_data (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp0_, _tmp0__length1, (gsize) sizeof (gchar*), (GCompareDataFunc) ___lambda4__gcompare_data_func, NULL);
	_tmp1_ = array;
	_tmp1__length1 = array_length1;
	array = NULL;
	array_length1 = 0;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


TestData* test_data_construct (GType object_type) {
	TestData* self = NULL;
	self = (TestData*) g_type_create_instance (object_type);
	return self;
}


TestData* test_data_new (void) {
	return test_data_construct (TYPE_TEST_DATA);
}


static void value_test_data_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_test_data_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		test_data_unref (value->data[0].v_pointer);
	}
}


static void value_test_data_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = test_data_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_test_data_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_test_data_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		TestData * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = test_data_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_test_data_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	TestData ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = test_data_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_test_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecTestData* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_TEST_DATA), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_test_data (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA), NULL);
	return value->data[0].v_pointer;
}


void value_set_test_data (GValue* value, gpointer v_object) {
	TestData * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_DATA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		test_data_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		test_data_unref (old);
	}
}


void value_take_test_data (GValue* value, gpointer v_object) {
	TestData * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_DATA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		test_data_unref (old);
	}
}


static void test_data_class_init (TestDataClass * klass) {
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar** _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar** _tmp34_;
	guint _tmp35_;
	guint _tmp36_;
	gint _tmp37_;
	gchar** _tmp38_;
	gchar** _tmp39_;
	gint _tmp39__length1;
	gchar** _tmp40_;
	gint _tmp40__length1;
	gint _tmp41_;
	gchar** _tmp42_;
	guint _tmp43_;
	gint _tmp44_;
	guint* _tmp45_;
	test_data_parent_class = g_type_class_peek_parent (klass);
	((TestDataClass *) klass)->finalize = test_data_finalize;
	_tmp0_ = g_strdup ("one");
	_tmp1_ = g_strdup ("two");
	_tmp2_ = g_strdup ("three");
	_tmp3_ = g_strdup ("four");
	_tmp4_ = g_strdup ("five");
	_tmp5_ = g_strdup ("six");
	_tmp6_ = g_strdup ("seven");
	_tmp7_ = g_strdup ("eight");
	_tmp8_ = g_strdup ("nine");
	_tmp9_ = g_strdup ("ten");
	_tmp10_ = g_strdup ("eleven");
	_tmp11_ = g_strdup ("twelve");
	_tmp12_ = g_strdup ("thirteen");
	_tmp13_ = g_strdup ("fourteen");
	_tmp14_ = g_strdup ("fifteen");
	_tmp15_ = g_strdup ("sixteen");
	_tmp16_ = g_strdup ("seventeen");
	_tmp17_ = g_strdup ("eighteen");
	_tmp18_ = g_strdup ("nineteen");
	_tmp19_ = g_new0 (gchar*, 20 + 1);
	_tmp19_[0] = NULL;
	_tmp19_[1] = _tmp0_;
	_tmp19_[2] = _tmp1_;
	_tmp19_[3] = _tmp2_;
	_tmp19_[4] = _tmp3_;
	_tmp19_[5] = _tmp4_;
	_tmp19_[6] = _tmp5_;
	_tmp19_[7] = _tmp6_;
	_tmp19_[8] = _tmp7_;
	_tmp19_[9] = _tmp8_;
	_tmp19_[10] = _tmp9_;
	_tmp19_[11] = _tmp10_;
	_tmp19_[12] = _tmp11_;
	_tmp19_[13] = _tmp12_;
	_tmp19_[14] = _tmp13_;
	_tmp19_[15] = _tmp14_;
	_tmp19_[16] = _tmp15_;
	_tmp19_[17] = _tmp16_;
	_tmp19_[18] = _tmp17_;
	_tmp19_[19] = _tmp18_;
	test_data_ones = _tmp19_;
	test_data_ones_length1 = 20;
	_tmp20_ = g_strdup ("twenty");
	_tmp21_ = g_strdup ("thirty");
	_tmp22_ = g_strdup ("forty");
	_tmp23_ = g_strdup ("fifty");
	_tmp24_ = g_strdup ("sixty");
	_tmp25_ = g_strdup ("seventy");
	_tmp26_ = g_strdup ("eighty");
	_tmp27_ = g_strdup ("ninety");
	_tmp28_ = g_new0 (gchar*, 10 + 1);
	_tmp28_[0] = NULL;
	_tmp28_[1] = NULL;
	_tmp28_[2] = _tmp20_;
	_tmp28_[3] = _tmp21_;
	_tmp28_[4] = _tmp22_;
	_tmp28_[5] = _tmp23_;
	_tmp28_[6] = _tmp24_;
	_tmp28_[7] = _tmp25_;
	_tmp28_[8] = _tmp26_;
	_tmp28_[9] = _tmp27_;
	test_data_tens = _tmp28_;
	test_data_tens_length1 = 10;
	_tmp29_ = g_strdup ("hundred");
	test_data_hundred = _tmp29_;
	_tmp30_ = g_strdup ("thousand");
	_tmp31_ = g_strdup ("million");
	_tmp32_ = g_strdup ("billion");
	_tmp33_ = g_strdup ("trillion");
	_tmp34_ = g_new0 (gchar*, 5 + 1);
	_tmp34_[0] = NULL;
	_tmp34_[1] = _tmp30_;
	_tmp34_[2] = _tmp31_;
	_tmp34_[3] = _tmp32_;
	_tmp34_[4] = _tmp33_;
	test_data_thousands = _tmp34_;
	test_data_thousands_length1 = 5;
	_tmp35_ = test_data_data_size ();
	test_data_DATA_SIZE = _tmp35_;
	_tmp36_ = test_data_DATA_SIZE;
	_tmp38_ = test_data_create_data (_tmp36_, &_tmp37_);
	test_data_data = _tmp38_;
	test_data_data_length1 = _tmp37_;
	_tmp39_ = test_data_data;
	_tmp39__length1 = test_data_data_length1;
	_tmp40_ = (_tmp39_ != NULL) ? _vala_array_dup1 (_tmp39_, _tmp39__length1) : ((gpointer) _tmp39_);
	_tmp40__length1 = _tmp39__length1;
	_tmp42_ = test_data_sort_array (_tmp40_, _tmp40__length1, &_tmp41_);
	test_data_sorted_data = _tmp42_;
	test_data_sorted_data_length1 = _tmp41_;
	_tmp43_ = test_data_DATA_SIZE;
	_tmp45_ = test_data_draw_numbers (_tmp43_, TEST_DATA_RND_IDX_SIZE, &_tmp44_);
	test_data_random_idx = _tmp45_;
	test_data_random_idx_length1 = _tmp44_;
}


static void test_data_instance_init (TestData * self) {
	self->ref_count = 1;
}


static void test_data_finalize (TestData * obj) {
	TestData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEST_DATA, TestData);
	g_signal_handlers_destroy (self);
}


GType test_data_get_type (void) {
	static volatile gsize test_data_type_id__volatile = 0;
	if (g_once_init_enter (&test_data_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_test_data_init, value_test_data_free_value, value_test_data_copy_value, value_test_data_peek_pointer, "p", value_test_data_collect_value, "p", value_test_data_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (TestDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TestData), 0, (GInstanceInitFunc) test_data_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType test_data_type_id;
		test_data_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TestData", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&test_data_type_id__volatile, test_data_type_id);
	}
	return test_data_type_id__volatile;
}


gpointer test_data_ref (gpointer instance) {
	TestData * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void test_data_unref (gpointer instance) {
	TestData * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		TEST_DATA_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



