/* chess-engine-uci.c generated by valac 0.36.1.2-2a0ee, the Vala compiler
 * generated from chess-engine-uci.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 "libchess.h"
#include <stdlib.h>
#include <string.h>


#define TYPE_CHESS_ENGINE (chess_engine_get_type ())
#define CHESS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CHESS_ENGINE, ChessEngine))
#define CHESS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CHESS_ENGINE, ChessEngineClass))
#define IS_CHESS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CHESS_ENGINE))
#define IS_CHESS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CHESS_ENGINE))
#define CHESS_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CHESS_ENGINE, ChessEngineClass))

typedef struct _ChessEngine ChessEngine;
typedef struct _ChessEngineClass ChessEngineClass;
typedef struct _ChessEnginePrivate ChessEnginePrivate;

#define TYPE_CHESS_ENGINE_UCI (chess_engine_uci_get_type ())
#define CHESS_ENGINE_UCI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CHESS_ENGINE_UCI, ChessEngineUCI))
#define CHESS_ENGINE_UCI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CHESS_ENGINE_UCI, ChessEngineUCIClass))
#define IS_CHESS_ENGINE_UCI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CHESS_ENGINE_UCI))
#define IS_CHESS_ENGINE_UCI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CHESS_ENGINE_UCI))
#define CHESS_ENGINE_UCI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CHESS_ENGINE_UCI, ChessEngineUCIClass))

typedef struct _ChessEngineUCI ChessEngineUCI;
typedef struct _ChessEngineUCIClass ChessEngineUCIClass;
typedef struct _ChessEngineUCIPrivate ChessEngineUCIPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ChessEngine {
	GObject parent_instance;
	ChessEnginePrivate * priv;
};

struct _ChessEngineClass {
	GObjectClass parent_class;
	void (*process_input) (ChessEngine* self, gchar* data, int data_length1);
	void (*start_game) (ChessEngine* self);
	void (*report_move) (ChessEngine* self, ChessMove* move);
	void (*do_undo) (ChessEngine* self);
	void (*request_move) (ChessEngine* self);
};

struct _ChessEngineUCI {
	ChessEngine parent_instance;
	ChessEngineUCIPrivate * priv;
};

struct _ChessEngineUCIClass {
	ChessEngineClass parent_class;
};

struct _ChessEngineUCIPrivate {
	gchar* buffer;
	gint buffer_length1;
	gint _buffer_size_;
	gchar* moves;
	gchar** options;
	gint options_length1;
	gint _options_size_;
	gchar* go_options;
	gboolean waiting_for_move;
};


static gpointer chess_engine_uci_parent_class = NULL;

GType chess_engine_get_type (void) G_GNUC_CONST;
GType chess_engine_uci_get_type (void) G_GNUC_CONST;
#define CHESS_ENGINE_UCI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CHESS_ENGINE_UCI, ChessEngineUCIPrivate))
enum  {
	CHESS_ENGINE_UCI_DUMMY_PROPERTY
};
ChessEngineUCI* chess_engine_uci_new (const gchar* binary, gchar** args, int args_length1, guint delay_seconds, gchar** options, int options_length1, gchar** go_options, int go_options_length1);
ChessEngineUCI* chess_engine_uci_construct (GType object_type, const gchar* binary, gchar** args, int args_length1, guint delay_seconds, gchar** options, int options_length1, gchar** go_options, int go_options_length1);
ChessEngine* chess_engine_construct (GType object_type, const gchar* binary, gchar** args, int args_length1, guint delay_seconds);
static gchar** _vala_array_dup22 (gchar** self, int length);
static void chess_engine_uci_start_cb (ChessEngineUCI* self);
static void _chess_engine_uci_start_cb_chess_engine_starting (ChessEngine* _sender, gpointer self);
void chess_engine_write_line (ChessEngine* self, const gchar* line);
static void chess_engine_uci_real_start_game (ChessEngine* base);
static void chess_engine_uci_real_request_move (ChessEngine* base);
static void chess_engine_uci_real_report_move (ChessEngine* base, ChessMove* move);
static void chess_engine_uci_real_do_undo (ChessEngine* base);
static void chess_engine_uci_real_process_input (ChessEngine* base, gchar* data, int data_length1);
static void chess_engine_uci_configure (ChessEngineUCI* self);
void chess_engine_set_ready (ChessEngine* self, gboolean value);
static gchar* _vala_array_dup23 (gchar* self, int length);
static gchar** _vala_array_dup24 (gchar** self, int length);
static void chess_engine_uci_finalize (GObject * 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 gint _vala_array_length (gpointer array);


static gchar** _vala_array_dup22 (gchar** self, int length) {
	gchar** result;
	int i;
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	result = g_new0 (gchar*, length + 1);
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	for (i = 0; i < length; i++) {
#line 120 "chess-engine-uci.c"
		gchar* _tmp0_;
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp0_ = g_strdup (self[i]);
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		result[i] = _tmp0_;
#line 126 "chess-engine-uci.c"
	}
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	return result;
#line 130 "chess-engine-uci.c"
}


static gchar* _vala_g_strjoinv (const gchar* separator, gchar** str_array, int str_array_length1) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp3_;
	gint _tmp3__length1;
#line 1078 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = separator;
#line 1078 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp0_ == NULL) {
#line 1079 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		separator = "";
#line 147 "chess-engine-uci.c"
	}
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3_ = str_array;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3__length1 = str_array_length1;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp2_ = TRUE;
#line 157 "chess-engine-uci.c"
	} else {
		gchar** _tmp4_;
		gint _tmp4__length1;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = str_array;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4__length1 = str_array_length1;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp2_ = _tmp4__length1 > 0;
#line 167 "chess-engine-uci.c"
	}
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp2_) {
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp1_ = TRUE;
#line 173 "chess-engine-uci.c"
	} else {
		gboolean _tmp5_ = FALSE;
		gchar** _tmp6_;
		gint _tmp6__length1;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp6_ = str_array;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp6__length1 = str_array_length1;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		if (_tmp6__length1 == -1) {
#line 184 "chess-engine-uci.c"
			gchar** _tmp7_;
			gint _tmp7__length1;
			const gchar* _tmp8_;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp7_ = str_array;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp7__length1 = str_array_length1;
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp8_ = _tmp7_[0];
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp5_ = _tmp8_ != NULL;
#line 196 "chess-engine-uci.c"
		} else {
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp5_ = FALSE;
#line 200 "chess-engine-uci.c"
		}
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp1_ = _tmp5_;
#line 204 "chess-engine-uci.c"
	}
#line 1081 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp1_) {
#line 208 "chess-engine-uci.c"
		gint i = 0;
		gsize len;
		gint _tmp31_;
		gint _tmp33_;
		gint _tmp34_;
		gsize _tmp35_;
		const gchar* _tmp36_;
		gint _tmp37_;
		gint _tmp38_;
		gint _tmp39_;
		const gchar* res;
		gsize _tmp40_;
		void* _tmp41_;
		void* ptr;
		const gchar* _tmp42_;
		gchar** _tmp43_;
		gint _tmp43__length1;
		const gchar* _tmp44_;
		void* _tmp45_;
		const gchar* _tmp62_;
#line 1083 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		len = (gsize) 1;
#line 231 "chess-engine-uci.c"
		{
			gboolean _tmp9_;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			i = 0;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp9_ = TRUE;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			while (TRUE) {
#line 240 "chess-engine-uci.c"
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				gchar** _tmp13_;
				gint _tmp13__length1;
				gint _tmp21_ = 0;
				gchar** _tmp22_;
				gint _tmp22__length1;
				gint _tmp23_;
				const gchar* _tmp24_;
				gsize _tmp30_;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (!_tmp9_) {
#line 253 "chess-engine-uci.c"
					gint _tmp10_;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp10_ = i;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					i = _tmp10_ + 1;
#line 259 "chess-engine-uci.c"
				}
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp9_ = FALSE;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp13_ = str_array;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp13__length1 = str_array_length1;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (_tmp13__length1 != -1) {
#line 269 "chess-engine-uci.c"
					gint _tmp14_;
					gchar** _tmp15_;
					gint _tmp15__length1;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp14_ = i;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp15_ = str_array;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp15__length1 = str_array_length1;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp12_ = _tmp14_ < _tmp15__length1;
#line 281 "chess-engine-uci.c"
				} else {
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp12_ = FALSE;
#line 285 "chess-engine-uci.c"
				}
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (_tmp12_) {
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp11_ = TRUE;
#line 291 "chess-engine-uci.c"
				} else {
					gboolean _tmp16_ = FALSE;
					gchar** _tmp17_;
					gint _tmp17__length1;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp17_ = str_array;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp17__length1 = str_array_length1;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					if (_tmp17__length1 == -1) {
#line 302 "chess-engine-uci.c"
						gchar** _tmp18_;
						gint _tmp18__length1;
						gint _tmp19_;
						const gchar* _tmp20_;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
						_tmp18_ = str_array;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
						_tmp18__length1 = str_array_length1;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
						_tmp19_ = i;
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
						_tmp20_ = _tmp18_[_tmp19_];
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
						_tmp16_ = _tmp20_ != NULL;
#line 317 "chess-engine-uci.c"
					} else {
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
						_tmp16_ = FALSE;
#line 321 "chess-engine-uci.c"
					}
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp11_ = _tmp16_;
#line 325 "chess-engine-uci.c"
				}
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (!_tmp11_) {
#line 1084 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					break;
#line 331 "chess-engine-uci.c"
				}
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp22_ = str_array;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp22__length1 = str_array_length1;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp23_ = i;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp24_ = _tmp22_[_tmp23_];
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (_tmp24_ != NULL) {
#line 343 "chess-engine-uci.c"
					gchar** _tmp25_;
					gint _tmp25__length1;
					gint _tmp26_;
					const gchar* _tmp27_;
					gint _tmp28_;
					gint _tmp29_;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp25_ = str_array;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp25__length1 = str_array_length1;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp26_ = i;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp27_ = _tmp25_[_tmp26_];
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp28_ = strlen ((const gchar*) _tmp27_);
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp29_ = _tmp28_;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp21_ = _tmp29_;
#line 364 "chess-engine-uci.c"
				} else {
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp21_ = 0;
#line 368 "chess-engine-uci.c"
				}
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp30_ = len;
#line 1085 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				len = _tmp30_ + _tmp21_;
#line 374 "chess-engine-uci.c"
			}
		}
#line 1087 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp31_ = i;
#line 1087 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		if (_tmp31_ == 0) {
#line 381 "chess-engine-uci.c"
			gchar* _tmp32_;
#line 1088 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp32_ = g_strdup ("");
#line 1088 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			result = _tmp32_;
#line 1088 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			return result;
#line 389 "chess-engine-uci.c"
		}
#line 1090 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp33_ = i;
#line 1090 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		str_array_length1 = _tmp33_;
#line 1090 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp34_ = str_array_length1;
#line 1091 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp35_ = len;
#line 1091 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp36_ = separator;
#line 1091 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp37_ = strlen ((const gchar*) _tmp36_);
#line 1091 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp38_ = _tmp37_;
#line 1091 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp39_ = i;
#line 1091 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		len = _tmp35_ + (_tmp38_ * (_tmp39_ - 1));
#line 1093 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp40_ = len;
#line 1093 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp41_ = g_malloc (_tmp40_);
#line 1093 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		res = _tmp41_;
#line 1094 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp42_ = res;
#line 1094 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp43_ = str_array;
#line 1094 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp43__length1 = str_array_length1;
#line 1094 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp44_ = _tmp43_[0];
#line 1094 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp45_ = g_stpcpy ((void*) _tmp42_, (const gchar*) _tmp44_);
#line 1094 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		ptr = _tmp45_;
#line 427 "chess-engine-uci.c"
		{
			gboolean _tmp46_;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			i = 1;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			_tmp46_ = TRUE;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
			while (TRUE) {
#line 436 "chess-engine-uci.c"
				gint _tmp48_;
				gchar** _tmp49_;
				gint _tmp49__length1;
				void* _tmp50_;
				const gchar* _tmp51_;
				void* _tmp52_;
				const gchar* _tmp53_ = NULL;
				gchar** _tmp54_;
				gint _tmp54__length1;
				gint _tmp55_;
				const gchar* _tmp56_;
				void* _tmp60_;
				void* _tmp61_;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (!_tmp46_) {
#line 452 "chess-engine-uci.c"
					gint _tmp47_;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp47_ = i;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					i = _tmp47_ + 1;
#line 458 "chess-engine-uci.c"
				}
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp46_ = FALSE;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp48_ = i;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp49_ = str_array;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp49__length1 = str_array_length1;
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (!(_tmp48_ < _tmp49__length1)) {
#line 1095 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					break;
#line 472 "chess-engine-uci.c"
				}
#line 1096 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp50_ = ptr;
#line 1096 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp51_ = separator;
#line 1096 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp52_ = g_stpcpy (_tmp50_, (const gchar*) _tmp51_);
#line 1096 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				ptr = _tmp52_;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp54_ = str_array;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp54__length1 = str_array_length1;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp55_ = i;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp56_ = _tmp54_[_tmp55_];
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				if (_tmp56_ != NULL) {
#line 492 "chess-engine-uci.c"
					gchar** _tmp57_;
					gint _tmp57__length1;
					gint _tmp58_;
					const gchar* _tmp59_;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp57_ = str_array;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp57__length1 = str_array_length1;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp58_ = i;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp59_ = _tmp57_[_tmp58_];
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp53_ = (const gchar*) _tmp59_;
#line 507 "chess-engine-uci.c"
				} else {
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
					_tmp53_ = "";
#line 511 "chess-engine-uci.c"
				}
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp60_ = ptr;
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				_tmp61_ = g_stpcpy (_tmp60_, _tmp53_);
#line 1097 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
				ptr = _tmp61_;
#line 519 "chess-engine-uci.c"
			}
		}
#line 1100 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp62_ = res;
#line 1100 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		res = NULL;
#line 1100 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		result = (gchar*) _tmp62_;
#line 1100 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 530 "chess-engine-uci.c"
	} else {
		gchar* _tmp63_;
#line 1102 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp63_ = g_strdup ("");
#line 1102 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		result = _tmp63_;
#line 1102 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 539 "chess-engine-uci.c"
	}
}


static void _chess_engine_uci_start_cb_chess_engine_starting (ChessEngine* _sender, gpointer self) {
#line 28 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	chess_engine_uci_start_cb ((ChessEngineUCI*) self);
#line 547 "chess-engine-uci.c"
}


ChessEngineUCI* chess_engine_uci_construct (GType object_type, const gchar* binary, gchar** args, int args_length1, guint delay_seconds, gchar** options, int options_length1, gchar** go_options, int go_options_length1) {
	ChessEngineUCI * self = NULL;
	const gchar* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	guint _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
#line 21 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	g_return_val_if_fail (binary != NULL, NULL);
#line 23 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0_ = binary;
#line 23 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp1_ = args;
#line 23 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp1__length1 = args_length1;
#line 23 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp2_ = delay_seconds;
#line 23 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self = (ChessEngineUCI*) chess_engine_construct (object_type, _tmp0_, _tmp1_, _tmp1__length1, _tmp2_);
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp3_ = options;
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp3__length1 = options_length1;
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup22 (_tmp3_, _tmp3__length1) : ((gpointer) _tmp3_);
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp4__length1 = _tmp3__length1;
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->options = (_vala_array_free (self->priv->options, self->priv->options_length1, (GDestroyNotify) g_free), NULL);
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->options = _tmp4_;
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->options_length1 = _tmp4__length1;
#line 24 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->_options_size_ = self->priv->options_length1;
#line 25 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp5_ = go_options;
#line 25 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp5__length1 = go_options_length1;
#line 25 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp6_ = _vala_g_strjoinv (" ", _tmp5_, _tmp5__length1);
#line 25 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (self->priv->go_options);
#line 25 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->go_options = _tmp6_;
#line 26 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp7_ = g_new0 (gchar, 0);
#line 26 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->buffer = (g_free (self->priv->buffer), NULL);
#line 26 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->buffer = _tmp7_;
#line 26 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->buffer_length1 = 0;
#line 26 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->_buffer_size_ = self->priv->buffer_length1;
#line 27 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp8_ = g_strdup ("");
#line 27 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (self->priv->moves);
#line 27 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->moves = _tmp8_;
#line 28 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	g_signal_connect_object ((ChessEngine*) self, "starting", (GCallback) _chess_engine_uci_start_cb_chess_engine_starting, self, 0);
#line 21 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	return self;
#line 624 "chess-engine-uci.c"
}


ChessEngineUCI* chess_engine_uci_new (const gchar* binary, gchar** args, int args_length1, guint delay_seconds, gchar** options, int options_length1, gchar** go_options, int go_options_length1) {
#line 21 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	return chess_engine_uci_construct (TYPE_CHESS_ENGINE_UCI, binary, args, args_length1, delay_seconds, options, options_length1, go_options, go_options_length1);
#line 631 "chess-engine-uci.c"
}


static void chess_engine_uci_start_cb (ChessEngineUCI* self) {
#line 31 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	g_return_if_fail (self != NULL);
#line 33 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	chess_engine_write_line ((ChessEngine*) self, "uci");
#line 640 "chess-engine-uci.c"
}


static void chess_engine_uci_real_start_game (ChessEngine* base) {
	ChessEngineUCI * self;
#line 36 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self = (ChessEngineUCI*) base;
#line 38 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	chess_engine_write_line ((ChessEngine*) self, "ucinewgame");
#line 650 "chess-engine-uci.c"
}


static void chess_engine_uci_real_request_move (ChessEngine* base) {
	ChessEngineUCI * self;
	const gchar* _tmp0_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
#line 41 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self = (ChessEngineUCI*) base;
#line 43 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0_ = self->priv->moves;
#line 43 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	if (g_strcmp0 (_tmp0_, "") != 0) {
#line 666 "chess-engine-uci.c"
		const gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
#line 44 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp1_ = self->priv->moves;
#line 44 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp2_ = g_strconcat ("position startpos moves", _tmp1_, NULL);
#line 44 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp3_ = _tmp2_;
#line 44 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		chess_engine_write_line ((ChessEngine*) self, _tmp3_);
#line 44 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_g_free0 (_tmp3_);
#line 680 "chess-engine-uci.c"
	} else {
#line 46 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		chess_engine_write_line ((ChessEngine*) self, "position startpos");
#line 684 "chess-engine-uci.c"
	}
#line 47 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->waiting_for_move = TRUE;
#line 48 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp4_ = self->priv->go_options;
#line 48 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp5_ = g_strdup_printf ("go wtime 30000 btime 30000 %s", _tmp4_);
#line 48 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp6_ = _tmp5_;
#line 48 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	chess_engine_write_line ((ChessEngine*) self, _tmp6_);
#line 48 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (_tmp6_);
#line 698 "chess-engine-uci.c"
}


static void chess_engine_uci_real_report_move (ChessEngine* base, ChessMove* move) {
	ChessEngineUCI * self;
	const gchar* _tmp0_;
	ChessMove* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
#line 51 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self = (ChessEngineUCI*) base;
#line 51 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	g_return_if_fail (move != NULL);
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0_ = self->priv->moves;
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp1_ = move;
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp2_ = chess_move_get_engine (_tmp1_);
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp3_ = _tmp2_;
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp4_ = g_strconcat (" ", _tmp3_, NULL);
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp5_ = _tmp4_;
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp6_ = g_strconcat (_tmp0_, _tmp5_, NULL);
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (self->priv->moves);
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->moves = _tmp6_;
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (_tmp5_);
#line 53 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (_tmp3_);
#line 737 "chess-engine-uci.c"
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	glong string_length;
	gint _tmp0_;
	gint _tmp1_;
	glong _tmp2_;
	glong _tmp5_;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_;
	gboolean _tmp12_ = FALSE;
	glong _tmp13_;
	glong _tmp16_;
	glong _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	gchar* _tmp21_;
#line 1355 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1356 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1356 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1356 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	string_length = (glong) _tmp1_;
#line 1357 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = start;
#line 1357 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp2_ < ((glong) 0)) {
#line 770 "chess-engine-uci.c"
		glong _tmp3_;
		glong _tmp4_;
#line 1358 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp3_ = string_length;
#line 1358 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = start;
#line 1358 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		start = _tmp3_ + _tmp4_;
#line 779 "chess-engine-uci.c"
	}
#line 1360 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp5_ = end;
#line 1360 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp5_ < ((glong) 0)) {
#line 785 "chess-engine-uci.c"
		glong _tmp6_;
		glong _tmp7_;
#line 1361 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp6_ = string_length;
#line 1361 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp7_ = end;
#line 1361 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		end = _tmp6_ + _tmp7_;
#line 794 "chess-engine-uci.c"
	}
#line 1363 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp9_ = start;
#line 1363 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp9_ >= ((glong) 0)) {
#line 800 "chess-engine-uci.c"
		glong _tmp10_;
		glong _tmp11_;
#line 1363 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp10_ = start;
#line 1363 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp11_ = string_length;
#line 1363 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp8_ = _tmp10_ <= _tmp11_;
#line 809 "chess-engine-uci.c"
	} else {
#line 1363 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp8_ = FALSE;
#line 813 "chess-engine-uci.c"
	}
#line 1363 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp8_, NULL);
#line 1364 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp13_ = end;
#line 1364 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp13_ >= ((glong) 0)) {
#line 821 "chess-engine-uci.c"
		glong _tmp14_;
		glong _tmp15_;
#line 1364 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp14_ = end;
#line 1364 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1364 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp12_ = _tmp14_ <= _tmp15_;
#line 830 "chess-engine-uci.c"
	} else {
#line 1364 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp12_ = FALSE;
#line 834 "chess-engine-uci.c"
	}
#line 1364 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp12_, NULL);
#line 1365 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp16_ = start;
#line 1365 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp17_ = end;
#line 1365 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL);
#line 1366 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp18_ = start;
#line 1366 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp19_ = end;
#line 1366 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp20_ = start;
#line 1366 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_));
#line 1366 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	result = _tmp21_;
#line 1366 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	return result;
#line 856 "chess-engine-uci.c"
}


static gint string_last_index_of (const gchar* self, const gchar* needle, gint start_index) {
	gint result = 0;
	gchar* _result_;
	gint _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1021 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1021 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, 0);
#line 1022 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = start_index;
#line 1022 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = needle;
#line 1022 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = g_strrstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
#line 1022 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_result_ = _tmp2_;
#line 1024 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3_ = _result_;
#line 1024 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 883 "chess-engine-uci.c"
		gchar* _tmp4_;
#line 1025 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = _result_;
#line 1025 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		result = (gint) (_tmp4_ - ((gchar*) self));
#line 1025 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 891 "chess-engine-uci.c"
	} else {
#line 1027 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		result = -1;
#line 1027 "/home/mcatanzaro/Projects/GNOME/install/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 897 "chess-engine-uci.c"
	}
}


static void chess_engine_uci_real_do_undo (ChessEngine* base) {
	ChessEngineUCI * self;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
#line 56 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self = (ChessEngineUCI*) base;
#line 58 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0_ = self->priv->waiting_for_move;
#line 58 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	if (_tmp0_) {
#line 59 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		chess_engine_write_line ((ChessEngine*) self, "stop");
#line 917 "chess-engine-uci.c"
	}
#line 60 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->waiting_for_move = FALSE;
#line 61 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp1_ = self->priv->moves;
#line 61 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp2_ = self->priv->moves;
#line 61 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp3_ = string_last_index_of (_tmp2_, " ", 0);
#line 61 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp4_ = string_slice (_tmp1_, (glong) 0, (glong) _tmp3_);
#line 61 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (self->priv->moves);
#line 61 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->moves = _tmp4_;
#line 933 "chess-engine-uci.c"
}


static gchar* _vala_array_dup23 (gchar* self, int length) {
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	return g_memdup (self, length * sizeof (gchar));
#line 940 "chess-engine-uci.c"
}


static void chess_engine_uci_real_process_input (ChessEngine* base, gchar* data, int data_length1) {
	ChessEngineUCI * self;
	gint current;
	gchar* _tmp0_;
	gint _tmp0__length1;
	gchar* _tmp1_;
	gint _tmp1__length1;
	gchar* _tmp2_;
	gint _tmp2__length1;
	gint _tmp3_;
#line 64 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self = (ChessEngineUCI*) base;
#line 67 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0_ = self->priv->buffer;
#line 67 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0__length1 = self->priv->buffer_length1;
#line 67 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	current = _tmp0__length1;
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp1_ = self->priv->buffer;
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp1__length1 = self->priv->buffer_length1;
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp2_ = data;
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp2__length1 = data_length1;
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp3_ = (gint) (_tmp1__length1 + _tmp2__length1);
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->buffer = g_renew (gchar, self->priv->buffer, (gint) (_tmp1__length1 + _tmp2__length1));
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	(_tmp3_ > self->priv->buffer_length1) ? memset (self->priv->buffer + self->priv->buffer_length1, 0, sizeof (gchar) * (_tmp3_ - self->priv->buffer_length1)) : NULL;
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->buffer_length1 = _tmp3_;
#line 68 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->_buffer_size_ = _tmp3_;
#line 980 "chess-engine-uci.c"
	{
		gint i;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		i = 0;
#line 985 "chess-engine-uci.c"
		{
			gboolean _tmp4_;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp4_ = TRUE;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			while (TRUE) {
#line 992 "chess-engine-uci.c"
				gint _tmp6_;
				gchar* _tmp7_;
				gint _tmp7__length1;
				gchar* _tmp8_;
				gint _tmp8__length1;
				gint _tmp9_;
				gint _tmp10_;
				gchar* _tmp11_;
				gint _tmp11__length1;
				gint _tmp12_;
				gchar _tmp13_;
				gchar _tmp14_;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				if (!_tmp4_) {
#line 1007 "chess-engine-uci.c"
					gint _tmp5_;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp5_ = i;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					i = _tmp5_ + 1;
#line 1013 "chess-engine-uci.c"
				}
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp4_ = FALSE;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp6_ = i;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp7_ = data;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp7__length1 = data_length1;
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				if (!(_tmp6_ < _tmp7__length1)) {
#line 69 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					break;
#line 1027 "chess-engine-uci.c"
				}
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp8_ = self->priv->buffer;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp8__length1 = self->priv->buffer_length1;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp9_ = current;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp10_ = i;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp11_ = data;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp11__length1 = data_length1;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp12_ = i;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp13_ = _tmp11_[_tmp12_];
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp8_[_tmp9_ + _tmp10_] = _tmp13_;
#line 70 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp14_ = _tmp8_[_tmp9_ + _tmp10_];
#line 1049 "chess-engine-uci.c"
			}
		}
	}
#line 73 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	while (TRUE) {
#line 1055 "chess-engine-uci.c"
		gint offset = 0;
		gint _tmp23_;
		gchar* _tmp24_;
		gint _tmp24__length1;
		gchar* _tmp25_;
		gint _tmp25__length1;
		gint _tmp26_;
		gchar _tmp27_;
		gchar* line;
		gchar* _tmp28_;
		gint _tmp28__length1;
		gchar* _tmp29_;
		const gchar* _tmp30_;
		gchar** tokens;
		const gchar* _tmp31_;
		gchar** _tmp32_;
		gchar** _tmp33_;
		gint tokens_length1;
		gint _tokens_size_;
		gchar** _tmp34_;
		gint _tmp34__length1;
		gchar* _tmp53_;
		gint _tmp53__length1;
		gint _tmp54_;
		gchar* _tmp55_;
		gint _tmp55__length1;
		gchar* _tmp56_;
		gint _tmp56__length1;
		{
			gboolean _tmp15_;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			offset = 0;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp15_ = TRUE;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			while (TRUE) {
#line 1092 "chess-engine-uci.c"
				gboolean _tmp17_ = FALSE;
				gint _tmp18_;
				gchar* _tmp19_;
				gint _tmp19__length1;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				if (!_tmp15_) {
#line 1099 "chess-engine-uci.c"
					gint _tmp16_;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp16_ = offset;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					offset = _tmp16_ + 1;
#line 1105 "chess-engine-uci.c"
				}
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp15_ = FALSE;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp18_ = offset;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp19_ = self->priv->buffer;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp19__length1 = self->priv->buffer_length1;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				if (_tmp18_ < _tmp19__length1) {
#line 1117 "chess-engine-uci.c"
					gchar* _tmp20_;
					gint _tmp20__length1;
					gint _tmp21_;
					gchar _tmp22_;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp20_ = self->priv->buffer;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp20__length1 = self->priv->buffer_length1;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp21_ = offset;
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp22_ = _tmp20_[_tmp21_];
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp17_ = _tmp22_ != '\n';
#line 1132 "chess-engine-uci.c"
				} else {
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					_tmp17_ = FALSE;
#line 1136 "chess-engine-uci.c"
				}
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				if (!_tmp17_) {
#line 77 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
					break;
#line 1142 "chess-engine-uci.c"
				}
			}
		}
#line 78 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp23_ = offset;
#line 78 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp24_ = self->priv->buffer;
#line 78 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp24__length1 = self->priv->buffer_length1;
#line 78 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		if (_tmp23_ >= _tmp24__length1) {
#line 79 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			return;
#line 1156 "chess-engine-uci.c"
		}
#line 81 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp25_ = self->priv->buffer;
#line 81 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp25__length1 = self->priv->buffer_length1;
#line 81 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp26_ = offset;
#line 81 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp25_[_tmp26_] = '\0';
#line 81 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp27_ = _tmp25_[_tmp26_];
#line 82 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp28_ = self->priv->buffer;
#line 82 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp28__length1 = self->priv->buffer_length1;
#line 82 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp29_ = g_strdup ((const gchar*) _tmp28_);
#line 82 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		line = _tmp29_;
#line 84 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp30_ = line;
#line 84 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		g_debug ("chess-engine-uci.vala:84: Read from engine: '%s'", _tmp30_);
#line 86 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp31_ = line;
#line 86 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp33_ = _tmp32_ = g_strsplit (_tmp31_, " ", 0);
#line 86 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		tokens = _tmp33_;
#line 86 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		tokens_length1 = _vala_array_length (_tmp32_);
#line 86 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tokens_size_ = tokens_length1;
#line 87 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp34_ = tokens;
#line 87 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp34__length1 = tokens_length1;
#line 87 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		if (_tmp34__length1 > 0) {
#line 1196 "chess-engine-uci.c"
			gchar** _tmp35_;
			gint _tmp35__length1;
			const gchar* _tmp36_;
			const gchar* _tmp37_;
			GQuark _tmp39_ = 0U;
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			static GQuark _tmp38_label0 = 0;
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			static GQuark _tmp38_label1 = 0;
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			static GQuark _tmp38_label2 = 0;
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp35_ = tokens;
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp35__length1 = tokens_length1;
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp36_ = _tmp35_[0];
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp37_ = _tmp36_;
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp39_ = (NULL == _tmp37_) ? 0 : g_quark_from_string (_tmp37_);
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			if (_tmp39_ == ((0 != _tmp38_label0) ? _tmp38_label0 : (_tmp38_label0 = g_quark_from_static_string ("uciok")))) {
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				switch (0) {
#line 1222 "chess-engine-uci.c"
					default:
					{
						gchar** _tmp40_;
						gint _tmp40__length1;
#line 92 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						_tmp40_ = tokens;
#line 92 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						_tmp40__length1 = tokens_length1;
#line 92 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						if (_tmp40__length1 != 1) {
#line 1233 "chess-engine-uci.c"
							const gchar* _tmp41_;
#line 93 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp41_ = line;
#line 93 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							g_warning ("chess-engine-uci.vala:93: Unexpected arguments on uciok: %s", _tmp41_);
#line 1239 "chess-engine-uci.c"
						}
#line 95 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						chess_engine_uci_configure (self);
#line 96 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						break;
#line 1245 "chess-engine-uci.c"
					}
				}
			} else if (_tmp39_ == ((0 != _tmp38_label1) ? _tmp38_label1 : (_tmp38_label1 = g_quark_from_static_string ("readyok")))) {
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				switch (0) {
#line 1251 "chess-engine-uci.c"
					default:
					{
						gchar** _tmp42_;
						gint _tmp42__length1;
#line 99 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						_tmp42_ = tokens;
#line 99 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						_tmp42__length1 = tokens_length1;
#line 99 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						if (_tmp42__length1 != 1) {
#line 1262 "chess-engine-uci.c"
							const gchar* _tmp43_;
#line 100 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp43_ = line;
#line 100 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							g_warning ("chess-engine-uci.vala:100: Unexpected arguments on readyok: %s", _tmp43_);
#line 1268 "chess-engine-uci.c"
						}
#line 102 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						chess_engine_set_ready ((ChessEngine*) self, TRUE);
#line 103 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						break;
#line 1274 "chess-engine-uci.c"
					}
				}
			} else if (_tmp39_ == ((0 != _tmp38_label2) ? _tmp38_label2 : (_tmp38_label2 = g_quark_from_static_string ("bestmove")))) {
#line 89 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				switch (0) {
#line 1280 "chess-engine-uci.c"
					default:
					{
						gchar** _tmp44_;
						gint _tmp44__length1;
						gboolean _tmp46_;
#line 106 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						_tmp44_ = tokens;
#line 106 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						_tmp44__length1 = tokens_length1;
#line 106 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						if (_tmp44__length1 < 2) {
#line 1292 "chess-engine-uci.c"
							const gchar* _tmp45_;
#line 107 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp45_ = line;
#line 107 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							g_warning ("chess-engine-uci.vala:107: No move with bestmove: %s", _tmp45_);
#line 1298 "chess-engine-uci.c"
						}
#line 115 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						_tmp46_ = self->priv->waiting_for_move;
#line 115 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						if (_tmp46_) {
#line 1304 "chess-engine-uci.c"
							gchar** _tmp47_;
							gint _tmp47__length1;
							const gchar* _tmp48_;
							gchar** _tmp49_;
							gint _tmp49__length1;
							const gchar* _tmp50_;
#line 117 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp47_ = tokens;
#line 117 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp47__length1 = tokens_length1;
#line 117 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp48_ = _tmp47_[1];
#line 117 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							g_debug ("chess-engine-uci.vala:117: Engine moves %s", _tmp48_);
#line 118 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							self->priv->waiting_for_move = FALSE;
#line 119 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp49_ = tokens;
#line 119 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp49__length1 = tokens_length1;
#line 119 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp50_ = _tmp49_[1];
#line 119 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							g_signal_emit_by_name ((ChessEngine*) self, "moved", _tmp50_);
#line 1329 "chess-engine-uci.c"
						} else {
							gchar** _tmp51_;
							gint _tmp51__length1;
							const gchar* _tmp52_;
#line 123 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp51_ = tokens;
#line 123 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp51__length1 = tokens_length1;
#line 123 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							_tmp52_ = _tmp51_[1];
#line 123 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
							g_debug ("chess-engine-uci.vala:123: Discarding engine move %s during human's tu" \
"rn", _tmp52_);
#line 1342 "chess-engine-uci.c"
						}
#line 125 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
						break;
#line 1346 "chess-engine-uci.c"
					}
				}
			}
		}
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp53_ = self->priv->buffer;
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp53__length1 = self->priv->buffer_length1;
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp54_ = offset;
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp55_ = self->priv->buffer;
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp55__length1 = self->priv->buffer_length1;
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp56_ = ((_tmp53_ + (_tmp54_ + 1)) != NULL) ? _vala_array_dup23 (_tmp53_ + (_tmp54_ + 1), _tmp55__length1 - (_tmp54_ + 1)) : ((gpointer) (_tmp53_ + (_tmp54_ + 1)));
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp56__length1 = _tmp55__length1 - (_tmp54_ + 1);
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		self->priv->buffer = (g_free (self->priv->buffer), NULL);
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		self->priv->buffer = _tmp56_;
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		self->priv->buffer_length1 = _tmp56__length1;
#line 129 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		self->priv->_buffer_size_ = self->priv->buffer_length1;
#line 73 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
#line 73 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_g_free0 (line);
#line 1377 "chess-engine-uci.c"
	}
}


static gchar** _vala_array_dup24 (gchar** self, int length) {
	gchar** result;
	int i;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	result = g_new0 (gchar*, length + 1);
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	for (i = 0; i < length; i++) {
#line 1389 "chess-engine-uci.c"
		gchar* _tmp0_;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		_tmp0_ = g_strdup (self[i]);
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		result[i] = _tmp0_;
#line 1395 "chess-engine-uci.c"
	}
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	return result;
#line 1399 "chess-engine-uci.c"
}


static void chess_engine_uci_configure (ChessEngineUCI* self) {
	gchar** _tmp0_;
	gint _tmp0__length1;
#line 133 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	g_return_if_fail (self != NULL);
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0_ = self->priv->options;
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_tmp0__length1 = self->priv->options_length1;
#line 1412 "chess-engine-uci.c"
	{
		gchar** o_collection = NULL;
		gint o_collection_length1 = 0;
		gint _o_collection_size_ = 0;
		gint o_it = 0;
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		o_collection = _tmp0_;
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		o_collection_length1 = _tmp0__length1;
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
		for (o_it = 0; o_it < _tmp0__length1; o_it = o_it + 1) {
#line 1424 "chess-engine-uci.c"
			gchar* _tmp1_;
			gchar* o = NULL;
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			_tmp1_ = g_strdup (o_collection[o_it]);
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
			o = _tmp1_;
#line 1431 "chess-engine-uci.c"
			{
				gchar** line;
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_;
				gint line_length1;
				gint _line_size_;
				gchar* option_value;
				gchar** _tmp5_;
				gint _tmp5__length1;
				gchar** _tmp6_;
				gint _tmp6__length1;
				const gchar* _tmp7_;
				gchar* _tmp8_;
				gchar** _tmp9_;
				gint _tmp9__length1;
				gchar** _tmp10_;
				gint _tmp10__length1;
				gchar** _tmp11_;
				gint _tmp11__length1;
				gchar* option_name;
				gchar** _tmp12_;
				gint _tmp12__length1;
				gchar* _tmp13_;
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				gchar* _tmp16_;
				gchar* _tmp17_;
#line 137 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp2_ = o;
#line 137 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, " ", 0);
#line 137 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				line = _tmp4_;
#line 137 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				line_length1 = _vala_array_length (_tmp3_);
#line 137 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_line_size_ = line_length1;
#line 138 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp5_ = line;
#line 138 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp5__length1 = line_length1;
#line 138 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp6_ = line;
#line 138 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp6__length1 = line_length1;
#line 138 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp7_ = _tmp5_[_tmp6__length1 - 1];
#line 138 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp8_ = g_strdup (_tmp7_);
#line 138 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				option_value = _tmp8_;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp9_ = line;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp9__length1 = line_length1;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp10_ = line;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp10__length1 = line_length1;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp11_ = ((_tmp9_ + 0) != NULL) ? _vala_array_dup24 (_tmp9_ + 0, (_tmp10__length1 - 1) - 0) : ((gpointer) (_tmp9_ + 0));
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp11__length1 = (_tmp10__length1 - 1) - 0;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				line = (_vala_array_free (line, line_length1, (GDestroyNotify) g_free), NULL);
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				line = _tmp11_;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				line_length1 = _tmp11__length1;
#line 139 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_line_size_ = line_length1;
#line 140 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp12_ = line;
#line 140 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp12__length1 = line_length1;
#line 140 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp13_ = _vala_g_strjoinv (" ", _tmp12_, _tmp12__length1);
#line 140 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				option_name = _tmp13_;
#line 141 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp14_ = option_name;
#line 141 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp15_ = option_value;
#line 141 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp16_ = g_strdup_printf ("setoption name %s value %s", _tmp14_, _tmp15_);
#line 141 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_tmp17_ = _tmp16_;
#line 141 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				chess_engine_write_line ((ChessEngine*) self, _tmp17_);
#line 141 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_g_free0 (_tmp17_);
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_g_free0 (option_name);
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_g_free0 (option_value);
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				line = (_vala_array_free (line, line_length1, (GDestroyNotify) g_free), NULL);
#line 135 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
				_g_free0 (o);
#line 1532 "chess-engine-uci.c"
			}
		}
	}
#line 143 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	chess_engine_write_line ((ChessEngine*) self, "isready");
#line 1538 "chess-engine-uci.c"
}


static void chess_engine_uci_class_init (ChessEngineUCIClass * klass) {
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	chess_engine_uci_parent_class = g_type_class_peek_parent (klass);
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	g_type_class_add_private (klass, sizeof (ChessEngineUCIPrivate));
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	((ChessEngineClass *) klass)->start_game = (void (*) (ChessEngine *)) chess_engine_uci_real_start_game;
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	((ChessEngineClass *) klass)->request_move = (void (*) (ChessEngine *)) chess_engine_uci_real_request_move;
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	((ChessEngineClass *) klass)->report_move = (void (*) (ChessEngine *, ChessMove*)) chess_engine_uci_real_report_move;
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	((ChessEngineClass *) klass)->do_undo = (void (*) (ChessEngine *)) chess_engine_uci_real_do_undo;
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	((ChessEngineClass *) klass)->process_input = (void (*) (ChessEngine *, gchar*, int)) chess_engine_uci_real_process_input;
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	G_OBJECT_CLASS (klass)->finalize = chess_engine_uci_finalize;
#line 1559 "chess-engine-uci.c"
}


static void chess_engine_uci_instance_init (ChessEngineUCI * self) {
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv = CHESS_ENGINE_UCI_GET_PRIVATE (self);
#line 1566 "chess-engine-uci.c"
}


static void chess_engine_uci_finalize (GObject * obj) {
	ChessEngineUCI * self;
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CHESS_ENGINE_UCI, ChessEngineUCI);
#line 15 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->buffer = (g_free (self->priv->buffer), NULL);
#line 16 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (self->priv->moves);
#line 17 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	self->priv->options = (_vala_array_free (self->priv->options, self->priv->options_length1, (GDestroyNotify) g_free), NULL);
#line 18 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	_g_free0 (self->priv->go_options);
#line 13 "/home/mcatanzaro/Projects/GNOME/gnome-chess/src/chess-engine-uci.vala"
	G_OBJECT_CLASS (chess_engine_uci_parent_class)->finalize (obj);
#line 1584 "chess-engine-uci.c"
}


GType chess_engine_uci_get_type (void) {
	static volatile gsize chess_engine_uci_type_id__volatile = 0;
	if (g_once_init_enter (&chess_engine_uci_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ChessEngineUCIClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) chess_engine_uci_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ChessEngineUCI), 0, (GInstanceInitFunc) chess_engine_uci_instance_init, NULL };
		GType chess_engine_uci_type_id;
		chess_engine_uci_type_id = g_type_register_static (TYPE_CHESS_ENGINE, "ChessEngineUCI", &g_define_type_info, 0);
		g_once_init_leave (&chess_engine_uci_type_id__volatile, chess_engine_uci_type_id);
	}
	return chess_engine_uci_type_id__volatile;
}


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


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



