/* ai-profile.c generated by valac 0.34.2.2-0a595, the Vala compiler
 * generated from ai-profile.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * Copyright (C) 2010-2013 Robert Ancell
 * Copyright (C) 2013-2016 Michael Catanzaro
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_AI_PROFILE (ai_profile_get_type ())
#define AI_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AI_PROFILE, AIProfile))
#define AI_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AI_PROFILE, AIProfileClass))
#define IS_AI_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AI_PROFILE))
#define IS_AI_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AI_PROFILE))
#define AI_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AI_PROFILE, AIProfileClass))

typedef struct _AIProfile AIProfile;
typedef struct _AIProfileClass AIProfileClass;
typedef struct _AIProfilePrivate AIProfilePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_key_file_unref0(var) ((var == NULL) ? NULL : (var = (g_key_file_unref (var), NULL)))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _AIProfile {
	GObject parent_instance;
	AIProfilePrivate * priv;
};

struct _AIProfileClass {
	GObjectClass parent_class;
};

struct _AIProfilePrivate {
	gchar* _name;
	gchar* _protocol;
	gchar* _binary;
	gchar* _path;
	guint _delay_seconds;
	gchar** _easy_args;
	gint _easy_args_length1;
	gint __easy_args_size_;
	gchar** _normal_args;
	gint _normal_args_length1;
	gint __normal_args_size_;
	gchar** _hard_args;
	gint _hard_args_length1;
	gint __hard_args_size_;
	gchar** _easy_options;
	gint _easy_options_length1;
	gint __easy_options_size_;
	gchar** _normal_options;
	gint _normal_options_length1;
	gint __normal_options_size_;
	gchar** _hard_options;
	gint _hard_options_length1;
	gint __hard_options_size_;
	gchar** _easy_uci_go_options;
	gint _easy_uci_go_options_length1;
	gint __easy_uci_go_options_size_;
	gchar** _normal_uci_go_options;
	gint _normal_uci_go_options_length1;
	gint __normal_uci_go_options_size_;
	gchar** _hard_uci_go_options;
	gint _hard_uci_go_options_length1;
	gint __hard_uci_go_options_size_;
};


static gpointer ai_profile_parent_class = NULL;

GType ai_profile_get_type (void) G_GNUC_CONST;
#define AI_PROFILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_AI_PROFILE, AIProfilePrivate))
enum  {
	AI_PROFILE_DUMMY_PROPERTY,
	AI_PROFILE_NAME,
	AI_PROFILE_PROTOCOL,
	AI_PROFILE_BINARY,
	AI_PROFILE_PATH,
	AI_PROFILE_DELAY_SECONDS,
	AI_PROFILE_EASY_ARGS,
	AI_PROFILE_NORMAL_ARGS,
	AI_PROFILE_HARD_ARGS,
	AI_PROFILE_EASY_OPTIONS,
	AI_PROFILE_NORMAL_OPTIONS,
	AI_PROFILE_HARD_OPTIONS,
	AI_PROFILE_EASY_UCI_GO_OPTIONS,
	AI_PROFILE_NORMAL_UCI_GO_OPTIONS,
	AI_PROFILE_HARD_UCI_GO_OPTIONS
};
GList* ai_profile_load_ai_profiles (const gchar* filename);
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
AIProfile* ai_profile_new (void);
AIProfile* ai_profile_construct (GType object_type);
static void ai_profile_set_name (AIProfile* self, const gchar* value);
static void ai_profile_set_protocol (AIProfile* self, const gchar* value);
static void ai_profile_set_binary (AIProfile* self, const gchar* value);
static gchar** ai_profile_load_array (GKeyFile* file, const gchar* name, const gchar* type, const gchar* difficulty, int* result_length1, GError** error);
static void ai_profile_set_easy_args (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_normal_args (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_hard_args (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_easy_options (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_normal_options (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_hard_options (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_easy_uci_go_options (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_normal_uci_go_options (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_hard_uci_go_options (AIProfile* self, gchar** value, int value_length1);
static void ai_profile_set_delay_seconds (AIProfile* self, guint value);
const gchar* ai_profile_get_binary (AIProfile* self);
static void ai_profile_set_path (AIProfile* self, const gchar* value);
const gchar* ai_profile_get_name (AIProfile* self);
const gchar* ai_profile_get_protocol (AIProfile* self);
const gchar* ai_profile_get_path (AIProfile* self);
guint ai_profile_get_delay_seconds (AIProfile* self);
gchar** ai_profile_get_easy_args (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup10 (gchar** self, int length);
gchar** ai_profile_get_normal_args (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup11 (gchar** self, int length);
gchar** ai_profile_get_hard_args (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup12 (gchar** self, int length);
gchar** ai_profile_get_easy_options (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup13 (gchar** self, int length);
gchar** ai_profile_get_normal_options (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup14 (gchar** self, int length);
gchar** ai_profile_get_hard_options (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup15 (gchar** self, int length);
gchar** ai_profile_get_easy_uci_go_options (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup16 (gchar** self, int length);
gchar** ai_profile_get_normal_uci_go_options (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup17 (gchar** self, int length);
gchar** ai_profile_get_hard_uci_go_options (AIProfile* self, int* result_length1);
static gchar** _vala_array_dup18 (gchar** self, int length);
static void ai_profile_finalize (GObject* obj);
static void _vala_ai_profile_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_ai_profile_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
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 void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


GList* ai_profile_load_ai_profiles (const gchar* filename) {
	GList* result = NULL;
	GList* profiles = NULL;
	GKeyFile* file = NULL;
	GKeyFile* _tmp0_ = NULL;
	GKeyFile* _tmp7_ = NULL;
	gsize _tmp8_;
	gchar** _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (filename != NULL, NULL);
	profiles = NULL;
	_tmp0_ = g_key_file_new ();
	file = _tmp0_;
	{
		GKeyFile* _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
		_tmp1_ = file;
		_tmp2_ = filename;
		g_key_file_load_from_file (_tmp1_, _tmp2_, G_KEY_FILE_NONE, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch8_g_key_file_error;
			}
			if (_inner_error_->domain == G_FILE_ERROR) {
				goto __catch8_g_file_error;
			}
			_g_key_file_unref0 (file);
			__g_list_free__g_object_unref0_0 (profiles);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	goto __finally8;
	__catch8_g_key_file_error:
	{
		GError* e = NULL;
		GError* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("ai-profile.vala:41: Failed to load AI profiles: %s", _tmp4_);
		result = profiles;
		_g_error_free0 (e);
		_g_key_file_unref0 (file);
		return result;
	}
	goto __finally8;
	__catch8_g_file_error:
	{
		GError* e = NULL;
		GError* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp5_ = e;
		_tmp6_ = _tmp5_->message;
		g_warning ("ai-profile.vala:46: Failed to load AI profiles: %s", _tmp6_);
		result = profiles;
		_g_error_free0 (e);
		_g_key_file_unref0 (file);
		return result;
	}
	__finally8:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_key_file_unref0 (file);
		__g_list_free__g_object_unref0_0 (profiles);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp7_ = file;
	_tmp9_ = g_key_file_get_groups (_tmp7_, &_tmp8_);
	{
		gchar** name_collection = NULL;
		gint name_collection_length1 = 0;
		gint _name_collection_size_ = 0;
		gint name_it = 0;
		name_collection = _tmp9_;
		name_collection_length1 = _tmp8_;
		for (name_it = 0; name_it < _tmp8_; name_it = name_it + 1) {
			gchar* _tmp10_ = NULL;
			gchar* name = NULL;
			_tmp10_ = g_strdup (name_collection[name_it]);
			name = _tmp10_;
			{
				const gchar* _tmp11_ = NULL;
				AIProfile* profile = NULL;
				AIProfile* _tmp12_ = NULL;
				gchar* path = NULL;
				AIProfile* _tmp90_ = NULL;
				const gchar* _tmp91_ = NULL;
				gchar* _tmp92_ = NULL;
				const gchar* _tmp93_ = NULL;
				_tmp11_ = name;
				g_debug ("ai-profile.vala:52: Loading AI profile %s", _tmp11_);
				_tmp12_ = ai_profile_new ();
				profile = _tmp12_;
				{
					AIProfile* _tmp13_ = NULL;
					const gchar* _tmp14_ = NULL;
					gchar* _tmp15_ = NULL;
					GKeyFile* _tmp16_ = NULL;
					const gchar* _tmp17_ = NULL;
					gchar* _tmp18_ = NULL;
					AIProfile* _tmp19_ = NULL;
					gchar* _tmp20_ = NULL;
					GKeyFile* _tmp21_ = NULL;
					const gchar* _tmp22_ = NULL;
					gchar* _tmp23_ = NULL;
					AIProfile* _tmp24_ = NULL;
					gchar** _tmp25_ = NULL;
					GKeyFile* _tmp26_ = NULL;
					const gchar* _tmp27_ = NULL;
					gint _tmp28_ = 0;
					gchar** _tmp29_ = NULL;
					gint _tmp25__length1 = 0;
					gint __tmp25__size_ = 0;
					AIProfile* _tmp30_ = NULL;
					gchar** _tmp31_ = NULL;
					GKeyFile* _tmp32_ = NULL;
					const gchar* _tmp33_ = NULL;
					gint _tmp34_ = 0;
					gchar** _tmp35_ = NULL;
					gint _tmp31__length1 = 0;
					gint __tmp31__size_ = 0;
					AIProfile* _tmp36_ = NULL;
					gchar** _tmp37_ = NULL;
					GKeyFile* _tmp38_ = NULL;
					const gchar* _tmp39_ = NULL;
					gint _tmp40_ = 0;
					gchar** _tmp41_ = NULL;
					gint _tmp37__length1 = 0;
					gint __tmp37__size_ = 0;
					AIProfile* _tmp42_ = NULL;
					gchar** _tmp43_ = NULL;
					GKeyFile* _tmp44_ = NULL;
					const gchar* _tmp45_ = NULL;
					gint _tmp46_ = 0;
					gchar** _tmp47_ = NULL;
					gint _tmp43__length1 = 0;
					gint __tmp43__size_ = 0;
					AIProfile* _tmp48_ = NULL;
					gchar** _tmp49_ = NULL;
					GKeyFile* _tmp50_ = NULL;
					const gchar* _tmp51_ = NULL;
					gint _tmp52_ = 0;
					gchar** _tmp53_ = NULL;
					gint _tmp49__length1 = 0;
					gint __tmp49__size_ = 0;
					AIProfile* _tmp54_ = NULL;
					gchar** _tmp55_ = NULL;
					GKeyFile* _tmp56_ = NULL;
					const gchar* _tmp57_ = NULL;
					gint _tmp58_ = 0;
					gchar** _tmp59_ = NULL;
					gint _tmp55__length1 = 0;
					gint __tmp55__size_ = 0;
					AIProfile* _tmp60_ = NULL;
					gchar** _tmp61_ = NULL;
					GKeyFile* _tmp62_ = NULL;
					const gchar* _tmp63_ = NULL;
					gint _tmp64_ = 0;
					gchar** _tmp65_ = NULL;
					gint _tmp61__length1 = 0;
					gint __tmp61__size_ = 0;
					AIProfile* _tmp66_ = NULL;
					gchar** _tmp67_ = NULL;
					GKeyFile* _tmp68_ = NULL;
					const gchar* _tmp69_ = NULL;
					gint _tmp70_ = 0;
					gchar** _tmp71_ = NULL;
					gint _tmp67__length1 = 0;
					gint __tmp67__size_ = 0;
					AIProfile* _tmp72_ = NULL;
					gchar** _tmp73_ = NULL;
					GKeyFile* _tmp74_ = NULL;
					const gchar* _tmp75_ = NULL;
					gint _tmp76_ = 0;
					gchar** _tmp77_ = NULL;
					gint _tmp73__length1 = 0;
					gint __tmp73__size_ = 0;
					AIProfile* _tmp78_ = NULL;
					gboolean _tmp79_ = FALSE;
					GKeyFile* _tmp80_ = NULL;
					const gchar* _tmp81_ = NULL;
					gboolean _tmp82_ = FALSE;
					_tmp13_ = profile;
					_tmp14_ = name;
					ai_profile_set_name (_tmp13_, _tmp14_);
					_tmp16_ = file;
					_tmp17_ = name;
					_tmp18_ = g_key_file_get_value (_tmp16_, _tmp17_, "protocol", &_inner_error_);
					_tmp15_ = _tmp18_;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp19_ = profile;
					ai_profile_set_protocol (_tmp19_, _tmp15_);
					_tmp21_ = file;
					_tmp22_ = name;
					_tmp23_ = g_key_file_get_value (_tmp21_, _tmp22_, "binary", &_inner_error_);
					_tmp20_ = _tmp23_;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp24_ = profile;
					ai_profile_set_binary (_tmp24_, _tmp20_);
					_tmp26_ = file;
					_tmp27_ = name;
					_tmp29_ = ai_profile_load_array (_tmp26_, _tmp27_, "arg", "easy", &_tmp28_, &_inner_error_);
					_tmp25_ = _tmp29_;
					_tmp25__length1 = _tmp28_;
					__tmp25__size_ = _tmp25__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp30_ = profile;
					ai_profile_set_easy_args (_tmp30_, _tmp25_, _tmp25__length1);
					_tmp32_ = file;
					_tmp33_ = name;
					_tmp35_ = ai_profile_load_array (_tmp32_, _tmp33_, "arg", "normal", &_tmp34_, &_inner_error_);
					_tmp31_ = _tmp35_;
					_tmp31__length1 = _tmp34_;
					__tmp31__size_ = _tmp31__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp36_ = profile;
					ai_profile_set_normal_args (_tmp36_, _tmp31_, _tmp31__length1);
					_tmp38_ = file;
					_tmp39_ = name;
					_tmp41_ = ai_profile_load_array (_tmp38_, _tmp39_, "arg", "hard", &_tmp40_, &_inner_error_);
					_tmp37_ = _tmp41_;
					_tmp37__length1 = _tmp40_;
					__tmp37__size_ = _tmp37__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp42_ = profile;
					ai_profile_set_hard_args (_tmp42_, _tmp37_, _tmp37__length1);
					_tmp44_ = file;
					_tmp45_ = name;
					_tmp47_ = ai_profile_load_array (_tmp44_, _tmp45_, "option", "easy", &_tmp46_, &_inner_error_);
					_tmp43_ = _tmp47_;
					_tmp43__length1 = _tmp46_;
					__tmp43__size_ = _tmp43__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp48_ = profile;
					ai_profile_set_easy_options (_tmp48_, _tmp43_, _tmp43__length1);
					_tmp50_ = file;
					_tmp51_ = name;
					_tmp53_ = ai_profile_load_array (_tmp50_, _tmp51_, "option", "normal", &_tmp52_, &_inner_error_);
					_tmp49_ = _tmp53_;
					_tmp49__length1 = _tmp52_;
					__tmp49__size_ = _tmp49__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp54_ = profile;
					ai_profile_set_normal_options (_tmp54_, _tmp49_, _tmp49__length1);
					_tmp56_ = file;
					_tmp57_ = name;
					_tmp59_ = ai_profile_load_array (_tmp56_, _tmp57_, "option", "hard", &_tmp58_, &_inner_error_);
					_tmp55_ = _tmp59_;
					_tmp55__length1 = _tmp58_;
					__tmp55__size_ = _tmp55__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp60_ = profile;
					ai_profile_set_hard_options (_tmp60_, _tmp55_, _tmp55__length1);
					_tmp62_ = file;
					_tmp63_ = name;
					_tmp65_ = ai_profile_load_array (_tmp62_, _tmp63_, "uci-go-option", "easy", &_tmp64_, &_inner_error_);
					_tmp61_ = _tmp65_;
					_tmp61__length1 = _tmp64_;
					__tmp61__size_ = _tmp61__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp66_ = profile;
					ai_profile_set_easy_uci_go_options (_tmp66_, _tmp61_, _tmp61__length1);
					_tmp68_ = file;
					_tmp69_ = name;
					_tmp71_ = ai_profile_load_array (_tmp68_, _tmp69_, "uci-go-option", "normal", &_tmp70_, &_inner_error_);
					_tmp67_ = _tmp71_;
					_tmp67__length1 = _tmp70_;
					__tmp67__size_ = _tmp67__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp72_ = profile;
					ai_profile_set_normal_uci_go_options (_tmp72_, _tmp67_, _tmp67__length1);
					_tmp74_ = file;
					_tmp75_ = name;
					_tmp77_ = ai_profile_load_array (_tmp74_, _tmp75_, "uci-go-option", "hard", &_tmp76_, &_inner_error_);
					_tmp73_ = _tmp77_;
					_tmp73__length1 = _tmp76_;
					__tmp73__size_ = _tmp73__length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp67_ = (_vala_array_free (_tmp67_, _tmp67__length1, (GDestroyNotify) g_free), NULL);
						_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp67_ = (_vala_array_free (_tmp67_, _tmp67__length1, (GDestroyNotify) g_free), NULL);
						_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp78_ = profile;
					ai_profile_set_hard_uci_go_options (_tmp78_, _tmp73_, _tmp73__length1);
					_tmp80_ = file;
					_tmp81_ = name;
					_tmp82_ = g_key_file_has_key (_tmp80_, _tmp81_, "delay-before-move", &_inner_error_);
					_tmp79_ = _tmp82_;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_tmp73_ = (_vala_array_free (_tmp73_, _tmp73__length1, (GDestroyNotify) g_free), NULL);
						_tmp67_ = (_vala_array_free (_tmp67_, _tmp67__length1, (GDestroyNotify) g_free), NULL);
						_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch9_g_key_file_error;
						}
						_tmp73_ = (_vala_array_free (_tmp73_, _tmp73__length1, (GDestroyNotify) g_free), NULL);
						_tmp67_ = (_vala_array_free (_tmp67_, _tmp67__length1, (GDestroyNotify) g_free), NULL);
						_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
						_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
						_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
						_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
						_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
						_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
						_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (_tmp20_);
						_g_free0 (_tmp15_);
						_g_object_unref0 (profile);
						_g_free0 (name);
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_key_file_unref0 (file);
						__g_list_free__g_object_unref0_0 (profiles);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					if (_tmp79_) {
						gint _tmp83_ = 0;
						GKeyFile* _tmp84_ = NULL;
						const gchar* _tmp85_ = NULL;
						gint _tmp86_ = 0;
						AIProfile* _tmp87_ = NULL;
						_tmp84_ = file;
						_tmp85_ = name;
						_tmp86_ = g_key_file_get_integer (_tmp84_, _tmp85_, "delay-before-move", &_inner_error_);
						_tmp83_ = _tmp86_;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							_tmp73_ = (_vala_array_free (_tmp73_, _tmp73__length1, (GDestroyNotify) g_free), NULL);
							_tmp67_ = (_vala_array_free (_tmp67_, _tmp67__length1, (GDestroyNotify) g_free), NULL);
							_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
							_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
							_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
							_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
							_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
							_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
							_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
							_g_free0 (_tmp20_);
							_g_free0 (_tmp15_);
							if (_inner_error_->domain == G_KEY_FILE_ERROR) {
								goto __catch9_g_key_file_error;
							}
							_tmp73_ = (_vala_array_free (_tmp73_, _tmp73__length1, (GDestroyNotify) g_free), NULL);
							_tmp67_ = (_vala_array_free (_tmp67_, _tmp67__length1, (GDestroyNotify) g_free), NULL);
							_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
							_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
							_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
							_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
							_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
							_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
							_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
							_g_free0 (_tmp20_);
							_g_free0 (_tmp15_);
							_g_object_unref0 (profile);
							_g_free0 (name);
							name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
							_g_key_file_unref0 (file);
							__g_list_free__g_object_unref0_0 (profiles);
							g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
							g_clear_error (&_inner_error_);
							return NULL;
						}
						_tmp87_ = profile;
						ai_profile_set_delay_seconds (_tmp87_, (guint) _tmp83_);
					}
					_tmp73_ = (_vala_array_free (_tmp73_, _tmp73__length1, (GDestroyNotify) g_free), NULL);
					_tmp67_ = (_vala_array_free (_tmp67_, _tmp67__length1, (GDestroyNotify) g_free), NULL);
					_tmp61_ = (_vala_array_free (_tmp61_, _tmp61__length1, (GDestroyNotify) g_free), NULL);
					_tmp55_ = (_vala_array_free (_tmp55_, _tmp55__length1, (GDestroyNotify) g_free), NULL);
					_tmp49_ = (_vala_array_free (_tmp49_, _tmp49__length1, (GDestroyNotify) g_free), NULL);
					_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) g_free), NULL);
					_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
					_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_free), NULL);
					_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (_tmp20_);
					_g_free0 (_tmp15_);
				}
				goto __finally9;
				__catch9_g_key_file_error:
				{
					GError* e = NULL;
					GError* _tmp88_ = NULL;
					const gchar* _tmp89_ = NULL;
					e = _inner_error_;
					_inner_error_ = NULL;
					_tmp88_ = e;
					_tmp89_ = _tmp88_->message;
					g_warning ("ai-profile.vala:74: Error reading AI profiles: %s", _tmp89_);
					_g_error_free0 (e);
					_g_object_unref0 (profile);
					_g_free0 (name);
					continue;
				}
				__finally9:
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					_g_object_unref0 (profile);
					_g_free0 (name);
					name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
					_g_key_file_unref0 (file);
					__g_list_free__g_object_unref0_0 (profiles);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
					g_clear_error (&_inner_error_);
					return NULL;
				}
				_tmp90_ = profile;
				_tmp91_ = _tmp90_->priv->_binary;
				_tmp92_ = g_find_program_in_path (_tmp91_);
				path = _tmp92_;
				_tmp93_ = path;
				if (_tmp93_ != NULL) {
					AIProfile* _tmp94_ = NULL;
					const gchar* _tmp95_ = NULL;
					AIProfile* _tmp96_ = NULL;
					AIProfile* _tmp97_ = NULL;
					_tmp94_ = profile;
					_tmp95_ = path;
					ai_profile_set_path (_tmp94_, _tmp95_);
					_tmp96_ = profile;
					_tmp97_ = _g_object_ref0 (_tmp96_);
					profiles = g_list_append (profiles, _tmp97_);
				}
				_g_free0 (path);
				_g_object_unref0 (profile);
				_g_free0 (name);
			}
		}
		name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = profiles;
	_g_key_file_unref0 (file);
	return result;
}


static gchar** ai_profile_load_array (GKeyFile* file, const gchar* name, const gchar* type, const gchar* difficulty, int* result_length1, GError** error) {
	gchar** result = NULL;
	gint count = 0;
	gchar** options = NULL;
	gint _tmp11_ = 0;
	gchar** _tmp12_ = NULL;
	gint options_length1 = 0;
	gint _options_size_ = 0;
	gchar** _tmp31_ = NULL;
	gint _tmp31__length1 = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (file != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (type != NULL, NULL);
	g_return_val_if_fail (difficulty != NULL, NULL);
	count = 0;
	while (TRUE) {
		gboolean _tmp0_ = FALSE;
		GKeyFile* _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		gboolean _tmp8_ = FALSE;
		gboolean _tmp9_ = FALSE;
		gint _tmp10_ = 0;
		_tmp1_ = file;
		_tmp2_ = name;
		_tmp3_ = type;
		_tmp4_ = difficulty;
		_tmp5_ = count;
		_tmp6_ = g_strdup_printf ("%s-%s-%d", _tmp3_, _tmp4_, _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_key_file_has_key (_tmp1_, _tmp2_, _tmp7_, &_inner_error_);
		_tmp9_ = _tmp8_;
		_g_free0 (_tmp7_);
		_tmp0_ = _tmp9_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				g_propagate_error (error, _inner_error_);
				return NULL;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return NULL;
			}
		}
		if (!_tmp0_) {
			break;
		}
		_tmp10_ = count;
		count = _tmp10_ + 1;
	}
	_tmp11_ = count;
	_tmp12_ = g_new0 (gchar*, _tmp11_ + 1);
	options = _tmp12_;
	options_length1 = _tmp11_;
	_options_size_ = options_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp13_ = FALSE;
			_tmp13_ = TRUE;
			while (TRUE) {
				gint _tmp15_ = 0;
				gint _tmp16_ = 0;
				gchar* _tmp17_ = NULL;
				GKeyFile* _tmp18_ = NULL;
				const gchar* _tmp19_ = NULL;
				const gchar* _tmp20_ = NULL;
				const gchar* _tmp21_ = NULL;
				gint _tmp22_ = 0;
				gchar* _tmp23_ = NULL;
				gchar* _tmp24_ = NULL;
				gchar* _tmp25_ = NULL;
				gchar* _tmp26_ = NULL;
				gchar** _tmp27_ = NULL;
				gint _tmp27__length1 = 0;
				gint _tmp28_ = 0;
				gchar* _tmp29_ = NULL;
				gchar* _tmp30_ = NULL;
				if (!_tmp13_) {
					gint _tmp14_ = 0;
					_tmp14_ = i;
					i = _tmp14_ + 1;
				}
				_tmp13_ = FALSE;
				_tmp15_ = i;
				_tmp16_ = count;
				if (!(_tmp15_ < _tmp16_)) {
					break;
				}
				_tmp18_ = file;
				_tmp19_ = name;
				_tmp20_ = type;
				_tmp21_ = difficulty;
				_tmp22_ = i;
				_tmp23_ = g_strdup_printf ("%s-%s-%d", _tmp20_, _tmp21_, _tmp22_);
				_tmp24_ = _tmp23_;
				_tmp25_ = g_key_file_get_value (_tmp18_, _tmp19_, _tmp24_, &_inner_error_);
				_tmp26_ = _tmp25_;
				_g_free0 (_tmp24_);
				_tmp17_ = _tmp26_;
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					if (_inner_error_->domain == G_KEY_FILE_ERROR) {
						g_propagate_error (error, _inner_error_);
						options = (_vala_array_free (options, options_length1, (GDestroyNotify) g_free), NULL);
						return NULL;
					} else {
						options = (_vala_array_free (options, options_length1, (GDestroyNotify) g_free), NULL);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
				}
				_tmp27_ = options;
				_tmp27__length1 = options_length1;
				_tmp28_ = i;
				_tmp29_ = _tmp17_;
				_tmp17_ = NULL;
				_g_free0 (_tmp27_[_tmp28_]);
				_tmp27_[_tmp28_] = _tmp29_;
				_tmp30_ = _tmp27_[_tmp28_];
				_g_free0 (_tmp17_);
			}
		}
	}
	_tmp31_ = options;
	_tmp31__length1 = options_length1;
	if (result_length1) {
		*result_length1 = _tmp31__length1;
	}
	result = _tmp31_;
	return result;
}


AIProfile* ai_profile_construct (GType object_type) {
	AIProfile * self = NULL;
	self = (AIProfile*) g_object_new (object_type, NULL);
	return self;
}


AIProfile* ai_profile_new (void) {
	return ai_profile_construct (TYPE_AI_PROFILE);
}


const gchar* ai_profile_get_name (AIProfile* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}


static void ai_profile_set_name (AIProfile* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp1_;
	g_object_notify ((GObject *) self, "name");
}


const gchar* ai_profile_get_protocol (AIProfile* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_protocol;
	result = _tmp0_;
	return result;
}


static void ai_profile_set_protocol (AIProfile* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_protocol);
	self->priv->_protocol = _tmp1_;
	g_object_notify ((GObject *) self, "protocol");
}


const gchar* ai_profile_get_binary (AIProfile* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_binary;
	result = _tmp0_;
	return result;
}


static void ai_profile_set_binary (AIProfile* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_binary);
	self->priv->_binary = _tmp1_;
	g_object_notify ((GObject *) self, "binary");
}


const gchar* ai_profile_get_path (AIProfile* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_path;
	result = _tmp0_;
	return result;
}


static void ai_profile_set_path (AIProfile* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_path);
	self->priv->_path = _tmp1_;
	g_object_notify ((GObject *) self, "path");
}


guint ai_profile_get_delay_seconds (AIProfile* self) {
	guint result;
	guint _tmp0_ = 0U;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->_delay_seconds;
	result = _tmp0_;
	return result;
}


static void ai_profile_set_delay_seconds (AIProfile* self, guint value) {
	guint _tmp0_ = 0U;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_delay_seconds = _tmp0_;
	g_object_notify ((GObject *) self, "delay-seconds");
}


gchar** ai_profile_get_easy_args (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_easy_args;
	_tmp0__length1 = self->priv->_easy_args_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_easy_args (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup10 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_easy_args = (_vala_array_free (self->priv->_easy_args, self->priv->_easy_args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_easy_args = _tmp1_;
	self->priv->_easy_args_length1 = _tmp1__length1;
	self->priv->__easy_args_size_ = self->priv->_easy_args_length1;
	g_object_notify ((GObject *) self, "easy-args");
}


gchar** ai_profile_get_normal_args (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_normal_args;
	_tmp0__length1 = self->priv->_normal_args_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_normal_args (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup11 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_normal_args = (_vala_array_free (self->priv->_normal_args, self->priv->_normal_args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_normal_args = _tmp1_;
	self->priv->_normal_args_length1 = _tmp1__length1;
	self->priv->__normal_args_size_ = self->priv->_normal_args_length1;
	g_object_notify ((GObject *) self, "normal-args");
}


gchar** ai_profile_get_hard_args (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_hard_args;
	_tmp0__length1 = self->priv->_hard_args_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_hard_args (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup12 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_hard_args = (_vala_array_free (self->priv->_hard_args, self->priv->_hard_args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_hard_args = _tmp1_;
	self->priv->_hard_args_length1 = _tmp1__length1;
	self->priv->__hard_args_size_ = self->priv->_hard_args_length1;
	g_object_notify ((GObject *) self, "hard-args");
}


gchar** ai_profile_get_easy_options (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_easy_options;
	_tmp0__length1 = self->priv->_easy_options_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_easy_options (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup13 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_easy_options = (_vala_array_free (self->priv->_easy_options, self->priv->_easy_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_easy_options = _tmp1_;
	self->priv->_easy_options_length1 = _tmp1__length1;
	self->priv->__easy_options_size_ = self->priv->_easy_options_length1;
	g_object_notify ((GObject *) self, "easy-options");
}


gchar** ai_profile_get_normal_options (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_normal_options;
	_tmp0__length1 = self->priv->_normal_options_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_normal_options (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup14 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_normal_options = (_vala_array_free (self->priv->_normal_options, self->priv->_normal_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_normal_options = _tmp1_;
	self->priv->_normal_options_length1 = _tmp1__length1;
	self->priv->__normal_options_size_ = self->priv->_normal_options_length1;
	g_object_notify ((GObject *) self, "normal-options");
}


gchar** ai_profile_get_hard_options (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_hard_options;
	_tmp0__length1 = self->priv->_hard_options_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_hard_options (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup15 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_hard_options = (_vala_array_free (self->priv->_hard_options, self->priv->_hard_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_hard_options = _tmp1_;
	self->priv->_hard_options_length1 = _tmp1__length1;
	self->priv->__hard_options_size_ = self->priv->_hard_options_length1;
	g_object_notify ((GObject *) self, "hard-options");
}


gchar** ai_profile_get_easy_uci_go_options (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_easy_uci_go_options;
	_tmp0__length1 = self->priv->_easy_uci_go_options_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_easy_uci_go_options (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup16 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_easy_uci_go_options = (_vala_array_free (self->priv->_easy_uci_go_options, self->priv->_easy_uci_go_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_easy_uci_go_options = _tmp1_;
	self->priv->_easy_uci_go_options_length1 = _tmp1__length1;
	self->priv->__easy_uci_go_options_size_ = self->priv->_easy_uci_go_options_length1;
	g_object_notify ((GObject *) self, "easy-uci-go-options");
}


gchar** ai_profile_get_normal_uci_go_options (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_normal_uci_go_options;
	_tmp0__length1 = self->priv->_normal_uci_go_options_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_normal_uci_go_options (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup17 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_normal_uci_go_options = (_vala_array_free (self->priv->_normal_uci_go_options, self->priv->_normal_uci_go_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_normal_uci_go_options = _tmp1_;
	self->priv->_normal_uci_go_options_length1 = _tmp1__length1;
	self->priv->__normal_uci_go_options_size_ = self->priv->_normal_uci_go_options_length1;
	g_object_notify ((GObject *) self, "normal-uci-go-options");
}


gchar** ai_profile_get_hard_uci_go_options (AIProfile* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_hard_uci_go_options;
	_tmp0__length1 = self->priv->_hard_uci_go_options_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


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


static void ai_profile_set_hard_uci_go_options (AIProfile* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup18 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_hard_uci_go_options = (_vala_array_free (self->priv->_hard_uci_go_options, self->priv->_hard_uci_go_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_hard_uci_go_options = _tmp1_;
	self->priv->_hard_uci_go_options_length1 = _tmp1__length1;
	self->priv->__hard_uci_go_options_size_ = self->priv->_hard_uci_go_options_length1;
	g_object_notify ((GObject *) self, "hard-uci-go-options");
}


static void ai_profile_class_init (AIProfileClass * klass) {
	ai_profile_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (AIProfilePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_ai_profile_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ai_profile_set_property;
	G_OBJECT_CLASS (klass)->finalize = ai_profile_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_PROTOCOL, g_param_spec_string ("protocol", "protocol", "protocol", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_BINARY, g_param_spec_string ("binary", "binary", "binary", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_PATH, g_param_spec_string ("path", "path", "path", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_DELAY_SECONDS, g_param_spec_uint ("delay-seconds", "delay-seconds", "delay-seconds", 0, G_MAXUINT, (guint) 2, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_EASY_ARGS, g_param_spec_boxed ("easy-args", "easy-args", "easy-args", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_NORMAL_ARGS, g_param_spec_boxed ("normal-args", "normal-args", "normal-args", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_HARD_ARGS, g_param_spec_boxed ("hard-args", "hard-args", "hard-args", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_EASY_OPTIONS, g_param_spec_boxed ("easy-options", "easy-options", "easy-options", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_NORMAL_OPTIONS, g_param_spec_boxed ("normal-options", "normal-options", "normal-options", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_HARD_OPTIONS, g_param_spec_boxed ("hard-options", "hard-options", "hard-options", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_EASY_UCI_GO_OPTIONS, g_param_spec_boxed ("easy-uci-go-options", "easy-uci-go-options", "easy-uci-go-options", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_NORMAL_UCI_GO_OPTIONS, g_param_spec_boxed ("normal-uci-go-options", "normal-uci-go-options", "normal-uci-go-options", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), AI_PROFILE_HARD_UCI_GO_OPTIONS, g_param_spec_boxed ("hard-uci-go-options", "hard-uci-go-options", "hard-uci-go-options", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void ai_profile_instance_init (AIProfile * self) {
	self->priv = AI_PROFILE_GET_PRIVATE (self);
	self->priv->_delay_seconds = (guint) 2;
}


static void ai_profile_finalize (GObject* obj) {
	AIProfile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_AI_PROFILE, AIProfile);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_protocol);
	_g_free0 (self->priv->_binary);
	_g_free0 (self->priv->_path);
	self->priv->_easy_args = (_vala_array_free (self->priv->_easy_args, self->priv->_easy_args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_normal_args = (_vala_array_free (self->priv->_normal_args, self->priv->_normal_args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_hard_args = (_vala_array_free (self->priv->_hard_args, self->priv->_hard_args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_easy_options = (_vala_array_free (self->priv->_easy_options, self->priv->_easy_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_normal_options = (_vala_array_free (self->priv->_normal_options, self->priv->_normal_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_hard_options = (_vala_array_free (self->priv->_hard_options, self->priv->_hard_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_easy_uci_go_options = (_vala_array_free (self->priv->_easy_uci_go_options, self->priv->_easy_uci_go_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_normal_uci_go_options = (_vala_array_free (self->priv->_normal_uci_go_options, self->priv->_normal_uci_go_options_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_hard_uci_go_options = (_vala_array_free (self->priv->_hard_uci_go_options, self->priv->_hard_uci_go_options_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (ai_profile_parent_class)->finalize (obj);
}


GType ai_profile_get_type (void) {
	static volatile gsize ai_profile_type_id__volatile = 0;
	if (g_once_init_enter (&ai_profile_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AIProfileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ai_profile_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AIProfile), 0, (GInstanceInitFunc) ai_profile_instance_init, NULL };
		GType ai_profile_type_id;
		ai_profile_type_id = g_type_register_static (G_TYPE_OBJECT, "AIProfile", &g_define_type_info, 0);
		g_once_init_leave (&ai_profile_type_id__volatile, ai_profile_type_id);
	}
	return ai_profile_type_id__volatile;
}


static void _vala_ai_profile_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	AIProfile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_AI_PROFILE, AIProfile);
	switch (property_id) {
		case AI_PROFILE_NAME:
		g_value_set_string (value, ai_profile_get_name (self));
		break;
		case AI_PROFILE_PROTOCOL:
		g_value_set_string (value, ai_profile_get_protocol (self));
		break;
		case AI_PROFILE_BINARY:
		g_value_set_string (value, ai_profile_get_binary (self));
		break;
		case AI_PROFILE_PATH:
		g_value_set_string (value, ai_profile_get_path (self));
		break;
		case AI_PROFILE_DELAY_SECONDS:
		g_value_set_uint (value, ai_profile_get_delay_seconds (self));
		break;
		case AI_PROFILE_EASY_ARGS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_easy_args (self, &length));
		}
		break;
		case AI_PROFILE_NORMAL_ARGS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_normal_args (self, &length));
		}
		break;
		case AI_PROFILE_HARD_ARGS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_hard_args (self, &length));
		}
		break;
		case AI_PROFILE_EASY_OPTIONS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_easy_options (self, &length));
		}
		break;
		case AI_PROFILE_NORMAL_OPTIONS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_normal_options (self, &length));
		}
		break;
		case AI_PROFILE_HARD_OPTIONS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_hard_options (self, &length));
		}
		break;
		case AI_PROFILE_EASY_UCI_GO_OPTIONS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_easy_uci_go_options (self, &length));
		}
		break;
		case AI_PROFILE_NORMAL_UCI_GO_OPTIONS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_normal_uci_go_options (self, &length));
		}
		break;
		case AI_PROFILE_HARD_UCI_GO_OPTIONS:
		{
			int length;
			g_value_set_boxed (value, ai_profile_get_hard_uci_go_options (self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_ai_profile_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	AIProfile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_AI_PROFILE, AIProfile);
	switch (property_id) {
		case AI_PROFILE_NAME:
		ai_profile_set_name (self, g_value_get_string (value));
		break;
		case AI_PROFILE_PROTOCOL:
		ai_profile_set_protocol (self, g_value_get_string (value));
		break;
		case AI_PROFILE_BINARY:
		ai_profile_set_binary (self, g_value_get_string (value));
		break;
		case AI_PROFILE_PATH:
		ai_profile_set_path (self, g_value_get_string (value));
		break;
		case AI_PROFILE_DELAY_SECONDS:
		ai_profile_set_delay_seconds (self, g_value_get_uint (value));
		break;
		case AI_PROFILE_EASY_ARGS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_easy_args (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_NORMAL_ARGS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_normal_args (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_HARD_ARGS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_hard_args (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_EASY_OPTIONS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_easy_options (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_NORMAL_OPTIONS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_normal_options (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_HARD_OPTIONS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_hard_options (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_EASY_UCI_GO_OPTIONS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_easy_uci_go_options (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_NORMAL_UCI_GO_OPTIONS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_normal_uci_go_options (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case AI_PROFILE_HARD_UCI_GO_OPTIONS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ai_profile_set_hard_uci_go_options (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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);
}



