/* game.c generated by valac 0.26.0.30-a52f5a, the Vala compiler
 * generated from game.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * Copyright (C) 2010-2013 Robert Ancell
 *
 * 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 2 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_GAME (game_get_type ())
#define GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAME, Game))
#define GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAME, GameClass))
#define IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAME))
#define IS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAME))
#define GAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAME, GameClass))

typedef struct _Game Game;
typedef struct _GameClass GameClass;
typedef struct _GamePrivate GamePrivate;

#define TYPE_PLAYER (player_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))

struct _Game {
	GObject parent_instance;
	GamePrivate * priv;
};

struct _GameClass {
	GObjectClass parent_class;
};

typedef enum  {
	PLAYER_NONE,
	PLAYER_DARK,
	PLAYER_LIGHT
} Player;

struct _GamePrivate {
	Player* tiles;
	gint tiles_length1;
	gint tiles_length2;
	gint undo_history[1344];
	gint undo_index;
	Player _current_color;
};


static gpointer game_parent_class = NULL;

GType game_get_type (void) G_GNUC_CONST;
GType player_get_type (void) G_GNUC_CONST;
#define GAME_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_GAME, GamePrivate))
enum  {
	GAME_DUMMY_PROPERTY,
	GAME_WIDTH,
	GAME_HEIGHT,
	GAME_CURRENT_COLOR,
	GAME_N_TILES,
	GAME_N_LIGHT_TILES,
	GAME_N_DARK_TILES
};
Game* game_new (gint width, gint height);
Game* game_construct (GType object_type, gint width, gint height);
static void game_set_tile (Game* self, gint x, gint y, Player color, gboolean update_history);
static void game_set_current_color (Game* self, Player value);
Game* game_new_from_strings (gchar** setup, int setup_length1, Player to_move, gint width, gint height);
Game* game_construct_from_strings (GType object_type, gchar** setup, int setup_length1, Player to_move, gint width, gint height);
Player player_from_char (gchar c);
gchar* game_to_string (Game* self);
Game* game_new_copy (Game* game);
Game* game_construct_copy (GType object_type, Game* game);
gint game_get_width (Game* self);
gint game_get_height (Game* self);
Player game_get_current_color (Game* self);
Player game_get_owner (Game* self, gint x, gint y);
static gboolean game_is_valid_location (Game* self, gint x, gint y);
gboolean game_is_complete (Game* self);
gboolean game_can_move (Game* self, Player color);
gint game_get_n_tiles (Game* self);
gboolean game_can_place (Game* self, gint x, gint y, Player color);
static gint game_place (Game* self, gint x, gint y, Player color, gboolean apply);
gint game_place_tile (Game* self, gint x, gint y);
Player player_flip_color (Player p);
void game_pass (Game* self);
static gint game_flip_tiles (Game* self, gint x, gint y, gint x_step, gint y_step, Player color, gboolean apply);
gint game_count_tiles (Game* self, Player color);
gboolean game_can_undo (Game* self, gint count);
void game_undo (Game* self, gint count);
gchar* player_to_string (Player self);
gint game_get_n_light_tiles (Game* self);
gint game_get_n_dark_tiles (Game* self);
static void g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void game_finalize (GObject* obj);
static void _vala_game_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_game_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


Game* game_construct (GType object_type, gint width, gint height) {
	Game * self = NULL;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	Player* _tmp2_ = NULL;
#line 63 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self = (Game*) g_object_new (object_type, NULL);
#line 66 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = width;
#line 66 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = height;
#line 66 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = g_new0 (Player, _tmp0_ * _tmp1_);
#line 66 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles = (g_free (self->priv->tiles), NULL);
#line 66 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles = _tmp2_;
#line 66 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles_length1 = _tmp0_;
#line 66 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles_length2 = _tmp1_;
#line 132 "game.c"
	{
		gint x = 0;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		x = 0;
#line 137 "game.c"
		{
			gboolean _tmp3_ = FALSE;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp3_ = TRUE;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 144 "game.c"
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp3_) {
#line 149 "game.c"
					gint _tmp4_ = 0;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp4_ = x;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					x = _tmp4_ + 1;
#line 155 "game.c"
				}
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp3_ = FALSE;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp5_ = x;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp6_ = width;
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp5_ < _tmp6_)) {
#line 67 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 167 "game.c"
				}
				{
					gint y = 0;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					y = 0;
#line 173 "game.c"
					{
						gboolean _tmp7_ = FALSE;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp7_ = TRUE;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						while (TRUE) {
#line 180 "game.c"
							gint _tmp9_ = 0;
							gint _tmp10_ = 0;
							Player* _tmp11_ = NULL;
							gint _tmp11__length1 = 0;
							gint _tmp11__length2 = 0;
							gint _tmp12_ = 0;
							gint _tmp13_ = 0;
							Player _tmp14_ = 0;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!_tmp7_) {
#line 191 "game.c"
								gint _tmp8_ = 0;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp8_ = y;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								y = _tmp8_ + 1;
#line 197 "game.c"
							}
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp7_ = FALSE;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp9_ = y;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp10_ = height;
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!(_tmp9_ < _tmp10_)) {
#line 68 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								break;
#line 209 "game.c"
							}
#line 69 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11_ = self->priv->tiles;
#line 69 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11__length1 = self->priv->tiles_length1;
#line 69 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11__length2 = self->priv->tiles_length2;
#line 69 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp12_ = x;
#line 69 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp13_ = y;
#line 69 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11_[(_tmp12_ * _tmp11__length2) + _tmp13_] = PLAYER_NONE;
#line 69 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp14_ = _tmp11_[(_tmp12_ * _tmp11__length2) + _tmp13_];
#line 225 "game.c"
						}
					}
				}
			}
		}
	}
#line 70 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_tile (self, 3, 3, PLAYER_LIGHT, FALSE);
#line 71 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_tile (self, 3, 4, PLAYER_DARK, FALSE);
#line 72 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_tile (self, 4, 3, PLAYER_DARK, FALSE);
#line 73 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_tile (self, 4, 4, PLAYER_LIGHT, FALSE);
#line 76 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_current_color (self, PLAYER_DARK);
#line 63 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return self;
#line 244 "game.c"
}


Game* game_new (gint width, gint height) {
#line 63 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return game_construct (TYPE_GAME, width, height);
#line 251 "game.c"
}


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_ = 0L;
	gchar _tmp1_ = '\0';
#line 996 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, '\0');
#line 997 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp0_ = index;
#line 997 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp1_ = ((gchar*) self)[_tmp0_];
#line 997 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	result = _tmp1_;
#line 997 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	return result;
#line 269 "game.c"
}


static gchar* _vala_g_strjoinv (const gchar* separator, gchar** str_array, int str_array_length1) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
#line 964 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp0_ = separator;
#line 964 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	if (_tmp0_ == NULL) {
#line 965 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		separator = "";
#line 286 "game.c"
	}
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp3_ = str_array;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp3__length1 = str_array_length1;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp2_ = TRUE;
#line 296 "game.c"
	} else {
		gchar** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp4_ = str_array;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp4__length1 = str_array_length1;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp2_ = _tmp4__length1 > 0;
#line 306 "game.c"
	}
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	if (_tmp2_) {
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp1_ = TRUE;
#line 312 "game.c"
	} else {
		gboolean _tmp5_ = FALSE;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp6_ = str_array;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp6__length1 = str_array_length1;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		if (_tmp6__length1 == (-1)) {
#line 323 "game.c"
			gchar** _tmp7_ = NULL;
			gint _tmp7__length1 = 0;
			const gchar* _tmp8_ = NULL;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp7_ = str_array;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp7__length1 = str_array_length1;
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp8_ = _tmp7_[0];
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp5_ = _tmp8_ != NULL;
#line 335 "game.c"
		} else {
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp5_ = FALSE;
#line 339 "game.c"
		}
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp1_ = _tmp5_;
#line 343 "game.c"
	}
#line 967 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	if (_tmp1_) {
#line 347 "game.c"
		gint i = 0;
		gsize len = 0UL;
		gint _tmp31_ = 0;
		gint _tmp33_ = 0;
		gint _tmp34_ = 0;
		gsize _tmp35_ = 0UL;
		const gchar* _tmp36_ = NULL;
		gint _tmp37_ = 0;
		gint _tmp38_ = 0;
		gint _tmp39_ = 0;
		const gchar* res = NULL;
		gsize _tmp40_ = 0UL;
		void* _tmp41_ = NULL;
		void* ptr = NULL;
		const gchar* _tmp42_ = NULL;
		gchar** _tmp43_ = NULL;
		gint _tmp43__length1 = 0;
		const gchar* _tmp44_ = NULL;
		void* _tmp45_ = NULL;
		const gchar* _tmp62_ = NULL;
#line 969 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		len = (gsize) 1;
#line 370 "game.c"
		{
			gboolean _tmp9_ = FALSE;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			i = 0;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp9_ = TRUE;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			while (TRUE) {
#line 379 "game.c"
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				gchar** _tmp13_ = NULL;
				gint _tmp13__length1 = 0;
				gint _tmp21_ = 0;
				gchar** _tmp22_ = NULL;
				gint _tmp22__length1 = 0;
				gint _tmp23_ = 0;
				const gchar* _tmp24_ = NULL;
				gsize _tmp30_ = 0UL;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (!_tmp9_) {
#line 392 "game.c"
					gint _tmp10_ = 0;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp10_ = i;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					i = _tmp10_ + 1;
#line 398 "game.c"
				}
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp9_ = FALSE;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp13_ = str_array;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp13__length1 = str_array_length1;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (_tmp13__length1 != (-1)) {
#line 408 "game.c"
					gint _tmp14_ = 0;
					gchar** _tmp15_ = NULL;
					gint _tmp15__length1 = 0;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp14_ = i;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp15_ = str_array;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp15__length1 = str_array_length1;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp12_ = _tmp14_ < _tmp15__length1;
#line 420 "game.c"
				} else {
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp12_ = FALSE;
#line 424 "game.c"
				}
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (_tmp12_) {
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp11_ = TRUE;
#line 430 "game.c"
				} else {
					gboolean _tmp16_ = FALSE;
					gchar** _tmp17_ = NULL;
					gint _tmp17__length1 = 0;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp17_ = str_array;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp17__length1 = str_array_length1;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					if (_tmp17__length1 == (-1)) {
#line 441 "game.c"
						gchar** _tmp18_ = NULL;
						gint _tmp18__length1 = 0;
						gint _tmp19_ = 0;
						const gchar* _tmp20_ = NULL;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
						_tmp18_ = str_array;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
						_tmp18__length1 = str_array_length1;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
						_tmp19_ = i;
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
						_tmp20_ = _tmp18_[_tmp19_];
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
						_tmp16_ = _tmp20_ != NULL;
#line 456 "game.c"
					} else {
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
						_tmp16_ = FALSE;
#line 460 "game.c"
					}
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp11_ = _tmp16_;
#line 464 "game.c"
				}
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (!_tmp11_) {
#line 970 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					break;
#line 470 "game.c"
				}
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp22_ = str_array;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp22__length1 = str_array_length1;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp23_ = i;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp24_ = _tmp22_[_tmp23_];
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (_tmp24_ != NULL) {
#line 482 "game.c"
					gchar** _tmp25_ = NULL;
					gint _tmp25__length1 = 0;
					gint _tmp26_ = 0;
					const gchar* _tmp27_ = NULL;
					gint _tmp28_ = 0;
					gint _tmp29_ = 0;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp25_ = str_array;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp25__length1 = str_array_length1;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp26_ = i;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp27_ = _tmp25_[_tmp26_];
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp28_ = strlen ((const gchar*) _tmp27_);
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp29_ = _tmp28_;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp21_ = _tmp29_;
#line 503 "game.c"
				} else {
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp21_ = 0;
#line 507 "game.c"
				}
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp30_ = len;
#line 971 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				len = _tmp30_ + _tmp21_;
#line 513 "game.c"
			}
		}
#line 973 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp31_ = i;
#line 973 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		if (_tmp31_ == 0) {
#line 520 "game.c"
			gchar* _tmp32_ = NULL;
#line 974 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp32_ = g_strdup ("");
#line 974 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			result = _tmp32_;
#line 974 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			return result;
#line 528 "game.c"
		}
#line 976 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp33_ = i;
#line 976 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		str_array_length1 = _tmp33_;
#line 976 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp34_ = str_array_length1;
#line 977 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp35_ = len;
#line 977 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp36_ = separator;
#line 977 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp37_ = strlen ((const gchar*) _tmp36_);
#line 977 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp38_ = _tmp37_;
#line 977 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp39_ = i;
#line 977 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		len = _tmp35_ + (_tmp38_ * (_tmp39_ - 1));
#line 979 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp40_ = len;
#line 979 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp41_ = g_malloc (_tmp40_);
#line 979 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		res = _tmp41_;
#line 980 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp42_ = res;
#line 980 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp43_ = str_array;
#line 980 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp43__length1 = str_array_length1;
#line 980 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp44_ = _tmp43_[0];
#line 980 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp45_ = g_stpcpy ((void*) _tmp42_, (const gchar*) _tmp44_);
#line 980 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		ptr = _tmp45_;
#line 566 "game.c"
		{
			gboolean _tmp46_ = FALSE;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			i = 1;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			_tmp46_ = TRUE;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
			while (TRUE) {
#line 575 "game.c"
				gint _tmp48_ = 0;
				gchar** _tmp49_ = NULL;
				gint _tmp49__length1 = 0;
				void* _tmp50_ = NULL;
				const gchar* _tmp51_ = NULL;
				void* _tmp52_ = NULL;
				const gchar* _tmp53_ = NULL;
				gchar** _tmp54_ = NULL;
				gint _tmp54__length1 = 0;
				gint _tmp55_ = 0;
				const gchar* _tmp56_ = NULL;
				void* _tmp60_ = NULL;
				void* _tmp61_ = NULL;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (!_tmp46_) {
#line 591 "game.c"
					gint _tmp47_ = 0;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp47_ = i;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					i = _tmp47_ + 1;
#line 597 "game.c"
				}
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp46_ = FALSE;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp48_ = i;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp49_ = str_array;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp49__length1 = str_array_length1;
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (!(_tmp48_ < _tmp49__length1)) {
#line 981 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					break;
#line 611 "game.c"
				}
#line 982 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp50_ = ptr;
#line 982 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp51_ = separator;
#line 982 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp52_ = g_stpcpy (_tmp50_, (const gchar*) _tmp51_);
#line 982 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				ptr = _tmp52_;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp54_ = str_array;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp54__length1 = str_array_length1;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp55_ = i;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp56_ = _tmp54_[_tmp55_];
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				if (_tmp56_ != NULL) {
#line 631 "game.c"
					gchar** _tmp57_ = NULL;
					gint _tmp57__length1 = 0;
					gint _tmp58_ = 0;
					const gchar* _tmp59_ = NULL;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp57_ = str_array;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp57__length1 = str_array_length1;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp58_ = i;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp59_ = _tmp57_[_tmp58_];
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp53_ = (const gchar*) _tmp59_;
#line 646 "game.c"
				} else {
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
					_tmp53_ = "";
#line 650 "game.c"
				}
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp60_ = ptr;
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				_tmp61_ = g_stpcpy (_tmp60_, _tmp53_);
#line 983 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
				ptr = _tmp61_;
#line 658 "game.c"
			}
		}
#line 986 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp62_ = res;
#line 986 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		res = NULL;
#line 986 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		result = (gchar*) _tmp62_;
#line 986 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		return result;
#line 669 "game.c"
	} else {
		gchar* _tmp63_ = NULL;
#line 988 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		_tmp63_ = g_strdup ("");
#line 988 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		result = _tmp63_;
#line 988 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
		return result;
#line 678 "game.c"
	}
}


static gchar* string_strip (const gchar* self) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
#line 1115 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1116 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1116 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1117 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp1_ = _result_;
#line 1117 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	g_strstrip (_tmp1_);
#line 1118 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	result = _result_;
#line 1118 "/home/mcatanzaro/jhbuild/install/share/vala-0.28/vapi/glib-2.0.vapi"
	return result;
#line 702 "game.c"
}


Game* game_construct_from_strings (GType object_type, gchar** setup, int setup_length1, Player to_move, gint width, gint height) {
	Game * self = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp1_ = 0;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	const gchar* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	Player* _tmp9_ = NULL;
	Player _tmp28_ = 0;
	gchar** _tmp29_ = NULL;
	gint _tmp29__length1 = 0;
	gchar* _tmp30_ = NULL;
	gchar* _tmp31_ = NULL;
	gchar* _tmp32_ = NULL;
	gchar* _tmp33_ = NULL;
	gchar* _tmp34_ = NULL;
	gchar* _tmp35_ = NULL;
	gchar* _tmp36_ = NULL;
	gchar* _tmp37_ = NULL;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = setup;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0__length1 = setup_length1;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = height;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (_tmp0__length1 == _tmp1_, NULL);
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = setup;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2__length1 = setup_length1;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = _tmp2_[0];
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp4_ = strlen (_tmp3_);
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp5_ = _tmp4_;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp6_ = width;
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (_tmp5_ == _tmp6_, NULL);
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self = (Game*) g_object_new (object_type, NULL);
#line 83 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp7_ = width;
#line 83 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp8_ = height;
#line 83 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp9_ = g_new0 (Player, _tmp7_ * _tmp8_);
#line 83 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles = (g_free (self->priv->tiles), NULL);
#line 83 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles = _tmp9_;
#line 83 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles_length1 = _tmp7_;
#line 83 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles_length2 = _tmp8_;
#line 769 "game.c"
	{
		gint y = 0;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		y = 0;
#line 774 "game.c"
		{
			gboolean _tmp10_ = FALSE;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp10_ = TRUE;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 781 "game.c"
				gint _tmp12_ = 0;
				gint _tmp13_ = 0;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp10_) {
#line 786 "game.c"
					gint _tmp11_ = 0;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp11_ = y;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					y = _tmp11_ + 1;
#line 792 "game.c"
				}
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp10_ = FALSE;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp12_ = y;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp13_ = height;
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp12_ < _tmp13_)) {
#line 85 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 804 "game.c"
				}
				{
					gint x = 0;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					x = 0;
#line 810 "game.c"
					{
						gboolean _tmp14_ = FALSE;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp14_ = TRUE;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						while (TRUE) {
#line 817 "game.c"
							gint _tmp16_ = 0;
							gint _tmp17_ = 0;
							Player* _tmp18_ = NULL;
							gint _tmp18__length1 = 0;
							gint _tmp18__length2 = 0;
							gint _tmp19_ = 0;
							gint _tmp20_ = 0;
							gchar** _tmp21_ = NULL;
							gint _tmp21__length1 = 0;
							gint _tmp22_ = 0;
							const gchar* _tmp23_ = NULL;
							gint _tmp24_ = 0;
							gchar _tmp25_ = '\0';
							Player _tmp26_ = 0;
							Player _tmp27_ = 0;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!_tmp14_) {
#line 835 "game.c"
								gint _tmp15_ = 0;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp15_ = x;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								x = _tmp15_ + 1;
#line 841 "game.c"
							}
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp14_ = FALSE;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp16_ = x;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp17_ = width;
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!(_tmp16_ < _tmp17_)) {
#line 86 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								break;
#line 853 "game.c"
							}
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp18_ = self->priv->tiles;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp18__length1 = self->priv->tiles_length1;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp18__length2 = self->priv->tiles_length2;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp19_ = x;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp20_ = y;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp21_ = setup;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp21__length1 = setup_length1;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp22_ = y;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp23_ = _tmp21_[_tmp22_];
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp24_ = x;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp25_ = string_get (_tmp23_, (glong) _tmp24_);
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp26_ = player_from_char (_tmp25_);
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp18_[(_tmp19_ * _tmp18__length2) + _tmp20_] = _tmp26_;
#line 87 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp27_ = _tmp18_[(_tmp19_ * _tmp18__length2) + _tmp20_];
#line 883 "game.c"
						}
					}
				}
			}
		}
	}
#line 89 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp28_ = to_move;
#line 89 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_current_color (self, _tmp28_);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp29_ = setup;
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp29__length1 = setup_length1;
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp30_ = _vala_g_strjoinv ("\n", _tmp29_, _tmp29__length1);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp31_ = _tmp30_;
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp32_ = string_strip (_tmp31_);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp33_ = _tmp32_;
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp34_ = game_to_string (self);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp35_ = _tmp34_;
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp36_ = string_strip (_tmp35_);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp37_ = _tmp36_;
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_warn_if_fail (g_strcmp0 (_tmp33_, _tmp37_) == 0);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_g_free0 (_tmp37_);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_g_free0 (_tmp35_);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_g_free0 (_tmp33_);
#line 91 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_g_free0 (_tmp31_);
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return self;
#line 926 "game.c"
}


Game* game_new_from_strings (gchar** setup, int setup_length1, Player to_move, gint width, gint height) {
#line 79 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return game_construct_from_strings (TYPE_GAME, setup, setup_length1, to_move, width, height);
#line 933 "game.c"
}


Game* game_construct_copy (GType object_type, Game* game) {
	Game * self = NULL;
	Game* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	Game* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	Player* _tmp6_ = NULL;
	Game* _tmp36_ = NULL;
	gint _tmp37_ = 0;
	Game* _tmp38_ = NULL;
	Player _tmp39_ = 0;
#line 94 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (game != NULL, NULL);
#line 94 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self = (Game*) g_object_new (object_type, NULL);
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = game;
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = game_get_width (_tmp0_);
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = _tmp1_;
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = game;
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp4_ = game_get_height (_tmp3_);
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp5_ = _tmp4_;
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp6_ = g_new0 (Player, _tmp2_ * _tmp5_);
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles = (g_free (self->priv->tiles), NULL);
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles = _tmp6_;
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles_length1 = _tmp2_;
#line 96 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles_length2 = _tmp5_;
#line 976 "game.c"
	{
		gint x = 0;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		x = 0;
#line 981 "game.c"
		{
			gboolean _tmp7_ = FALSE;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp7_ = TRUE;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 988 "game.c"
				gint _tmp9_ = 0;
				gint _tmp10_ = 0;
				gint _tmp11_ = 0;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp7_) {
#line 994 "game.c"
					gint _tmp8_ = 0;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp8_ = x;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					x = _tmp8_ + 1;
#line 1000 "game.c"
				}
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp7_ = FALSE;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp9_ = x;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp10_ = game_get_width (self);
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp11_ = _tmp10_;
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp9_ < _tmp11_)) {
#line 97 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 1014 "game.c"
				}
				{
					gint y = 0;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					y = 0;
#line 1020 "game.c"
					{
						gboolean _tmp12_ = FALSE;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp12_ = TRUE;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						while (TRUE) {
#line 1027 "game.c"
							gint _tmp14_ = 0;
							gint _tmp15_ = 0;
							gint _tmp16_ = 0;
							Player* _tmp17_ = NULL;
							gint _tmp17__length1 = 0;
							gint _tmp17__length2 = 0;
							gint _tmp18_ = 0;
							gint _tmp19_ = 0;
							Game* _tmp20_ = NULL;
							Player* _tmp21_ = NULL;
							gint _tmp21__length1 = 0;
							gint _tmp21__length2 = 0;
							gint _tmp22_ = 0;
							gint _tmp23_ = 0;
							Player _tmp24_ = 0;
							Player _tmp25_ = 0;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!_tmp12_) {
#line 1046 "game.c"
								gint _tmp13_ = 0;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp13_ = y;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								y = _tmp13_ + 1;
#line 1052 "game.c"
							}
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp12_ = FALSE;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp14_ = y;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp15_ = game_get_height (self);
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp16_ = _tmp15_;
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!(_tmp14_ < _tmp16_)) {
#line 98 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								break;
#line 1066 "game.c"
							}
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp17_ = self->priv->tiles;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp17__length1 = self->priv->tiles_length1;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp17__length2 = self->priv->tiles_length2;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp18_ = x;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp19_ = y;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp20_ = game;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp21_ = _tmp20_->priv->tiles;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp21__length1 = _tmp20_->priv->tiles_length1;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp21__length2 = _tmp20_->priv->tiles_length2;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp22_ = x;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp23_ = y;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp24_ = _tmp21_[(_tmp22_ * _tmp21__length2) + _tmp23_];
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp17_[(_tmp18_ * _tmp17__length2) + _tmp19_] = _tmp24_;
#line 99 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp25_ = _tmp17_[(_tmp18_ * _tmp17__length2) + _tmp19_];
#line 1096 "game.c"
						}
					}
				}
			}
		}
	}
	{
		gint i = 0;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		i = 0;
#line 1107 "game.c"
		{
			gboolean _tmp26_ = FALSE;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp26_ = TRUE;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 1114 "game.c"
				gint _tmp28_ = 0;
				Game* _tmp29_ = NULL;
				gint _tmp30_ = 0;
				gint _tmp31_ = 0;
				Game* _tmp32_ = NULL;
				gint _tmp33_ = 0;
				gint _tmp34_ = 0;
				gint _tmp35_ = 0;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp26_) {
#line 1125 "game.c"
					gint _tmp27_ = 0;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp27_ = i;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					i = _tmp27_ + 1;
#line 1131 "game.c"
				}
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp26_ = FALSE;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp28_ = i;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp29_ = game;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp30_ = _tmp29_->priv->undo_index;
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp28_ < _tmp30_)) {
#line 100 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 1145 "game.c"
				}
#line 101 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp31_ = i;
#line 101 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp32_ = game;
#line 101 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp33_ = i;
#line 101 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp34_ = _tmp32_->priv->undo_history[_tmp33_];
#line 101 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				self->priv->undo_history[_tmp31_] = _tmp34_;
#line 101 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp35_ = self->priv->undo_history[_tmp31_];
#line 1159 "game.c"
			}
		}
	}
#line 102 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp36_ = game;
#line 102 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp37_ = _tmp36_->priv->undo_index;
#line 102 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->undo_index = _tmp37_;
#line 103 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp38_ = game;
#line 103 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp39_ = _tmp38_->priv->_current_color;
#line 103 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_current_color (self, _tmp39_);
#line 94 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return self;
#line 1177 "game.c"
}


Game* game_new_copy (Game* game) {
#line 94 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return game_construct_copy (TYPE_GAME, game);
#line 1184 "game.c"
}


Player game_get_owner (Game* self, gint x, gint y) {
	Player result = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gboolean _tmp2_ = FALSE;
#line 106 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 108 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = x;
#line 108 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = y;
#line 108 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = game_is_valid_location (self, _tmp0_, _tmp1_);
#line 108 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp2_) {
#line 1203 "game.c"
		Player* _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		gint _tmp3__length2 = 0;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		Player _tmp6_ = 0;
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp3_ = self->priv->tiles;
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp3__length1 = self->priv->tiles_length1;
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp3__length2 = self->priv->tiles_length2;
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp4_ = x;
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp5_ = y;
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp6_ = _tmp3_[(_tmp4_ * _tmp3__length2) + _tmp5_];
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		result = _tmp6_;
#line 109 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return result;
#line 1226 "game.c"
	} else {
#line 111 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		result = PLAYER_NONE;
#line 111 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return result;
#line 1232 "game.c"
	}
}


gboolean game_is_complete (Game* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	gboolean _tmp10_ = FALSE;
	gint _tmp11_ = 0;
	gint _tmp12_ = 0;
	gint _tmp13_ = 0;
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	gint _tmp16_ = 0;
#line 114 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = game_can_move (self, PLAYER_LIGHT);
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (!_tmp1_) {
#line 1261 "game.c"
		gboolean _tmp2_ = FALSE;
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp2_ = game_can_move (self, PLAYER_DARK);
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp0_ = !_tmp2_;
#line 1267 "game.c"
	} else {
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp0_ = FALSE;
#line 1271 "game.c"
	}
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp0_;
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = result;
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp4_ = game_get_n_tiles (self);
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp5_ = _tmp4_;
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp6_ = game_get_width (self);
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp7_ = _tmp6_;
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp8_ = game_get_height (self);
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp9_ = _tmp8_;
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_warn_if_fail (_tmp3_ || (_tmp5_ < (_tmp7_ * _tmp9_)));
#line 117 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 1293 "game.c"
}


gboolean game_can_move (Game* self, Player color) {
	gboolean result = FALSE;
#line 120 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1301 "game.c"
	{
		gint x = 0;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		x = 0;
#line 1306 "game.c"
		{
			gboolean _tmp0_ = FALSE;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp0_ = TRUE;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 1313 "game.c"
				gint _tmp2_ = 0;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp0_) {
#line 1319 "game.c"
					gint _tmp1_ = 0;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp1_ = x;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					x = _tmp1_ + 1;
#line 1325 "game.c"
				}
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp0_ = FALSE;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp2_ = x;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp3_ = game_get_width (self);
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp4_ = _tmp3_;
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp2_ < _tmp4_)) {
#line 122 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 1339 "game.c"
				}
				{
					gint y = 0;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					y = 0;
#line 1345 "game.c"
					{
						gboolean _tmp5_ = FALSE;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp5_ = TRUE;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						while (TRUE) {
#line 1352 "game.c"
							gint _tmp7_ = 0;
							gint _tmp8_ = 0;
							gint _tmp9_ = 0;
							gint _tmp10_ = 0;
							gint _tmp11_ = 0;
							Player _tmp12_ = 0;
							gboolean _tmp13_ = FALSE;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!_tmp5_) {
#line 1362 "game.c"
								gint _tmp6_ = 0;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp6_ = y;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								y = _tmp6_ + 1;
#line 1368 "game.c"
							}
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp5_ = FALSE;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp7_ = y;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp8_ = game_get_height (self);
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp9_ = _tmp8_;
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!(_tmp7_ < _tmp9_)) {
#line 123 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								break;
#line 1382 "game.c"
							}
#line 124 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp10_ = x;
#line 124 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11_ = y;
#line 124 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp12_ = color;
#line 124 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp13_ = game_can_place (self, _tmp10_, _tmp11_, _tmp12_);
#line 124 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (_tmp13_) {
#line 125 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								result = TRUE;
#line 125 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								return result;
#line 1398 "game.c"
							}
						}
					}
				}
			}
		}
	}
#line 126 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = FALSE;
#line 126 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 1410 "game.c"
}


gboolean game_can_place (Game* self, gint x, gint y, Player color) {
	gboolean result = FALSE;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	Player _tmp2_ = 0;
	gint _tmp3_ = 0;
#line 129 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 131 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = x;
#line 131 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = y;
#line 131 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = color;
#line 131 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = game_place (self, _tmp0_, _tmp1_, _tmp2_, FALSE);
#line 131 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp3_ > 0;
#line 131 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 1434 "game.c"
}


gint game_place_tile (Game* self, gint x, gint y) {
	gint result = 0;
	gint n_tiles = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	Player _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	Player _tmp5_ = 0;
	Player _tmp6_ = 0;
	gboolean _tmp7_ = FALSE;
#line 134 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 136 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = x;
#line 136 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = y;
#line 136 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = self->priv->_current_color;
#line 136 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = game_place (self, _tmp0_, _tmp1_, _tmp2_, TRUE);
#line 136 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_tiles = _tmp3_;
#line 137 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp4_ = n_tiles;
#line 137 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp4_ == 0) {
#line 138 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		result = 0;
#line 138 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return result;
#line 1469 "game.c"
	}
#line 140 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp5_ = self->priv->_current_color;
#line 140 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp6_ = player_flip_color (_tmp5_);
#line 140 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_current_color (self, _tmp6_);
#line 142 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp7_ = game_is_complete (self);
#line 142 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp7_) {
#line 143 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_signal_emit_by_name (self, "complete");
#line 1483 "game.c"
	} else {
#line 145 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_signal_emit_by_name (self, "move");
#line 1487 "game.c"
	}
#line 147 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = n_tiles;
#line 147 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 1493 "game.c"
}


void game_pass (Game* self) {
	Player _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	Player _tmp5_ = 0;
	Player _tmp6_ = 0;
#line 150 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_if_fail (self != NULL);
#line 150 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = self->priv->_current_color;
#line 150 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = game_can_move (self, _tmp0_);
#line 150 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_if_fail (!_tmp1_);
#line 153 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = self->priv->undo_index;
#line 153 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->undo_history[_tmp2_] = 0;
#line 153 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = self->priv->undo_history[_tmp2_];
#line 154 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp4_ = self->priv->undo_index;
#line 154 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->undo_index = _tmp4_ + 1;
#line 155 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp5_ = self->priv->_current_color;
#line 155 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp6_ = player_flip_color (_tmp5_);
#line 155 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_set_current_color (self, _tmp6_);
#line 156 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_signal_emit_by_name (self, "move");
#line 1531 "game.c"
}


static gint game_place (Game* self, gint x, gint y, Player color, gboolean apply) {
	gint result = 0;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gboolean _tmp3_ = FALSE;
	gint n_flips = 0;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
	Player _tmp11_ = 0;
	gboolean _tmp12_ = FALSE;
	gint _tmp13_ = 0;
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	gint _tmp16_ = 0;
	Player _tmp17_ = 0;
	gboolean _tmp18_ = FALSE;
	gint _tmp19_ = 0;
	gint _tmp20_ = 0;
	gint _tmp21_ = 0;
	gint _tmp22_ = 0;
	Player _tmp23_ = 0;
	gboolean _tmp24_ = FALSE;
	gint _tmp25_ = 0;
	gint _tmp26_ = 0;
	gint _tmp27_ = 0;
	gint _tmp28_ = 0;
	Player _tmp29_ = 0;
	gboolean _tmp30_ = FALSE;
	gint _tmp31_ = 0;
	gint _tmp32_ = 0;
	gint _tmp33_ = 0;
	gint _tmp34_ = 0;
	Player _tmp35_ = 0;
	gboolean _tmp36_ = FALSE;
	gint _tmp37_ = 0;
	gint _tmp38_ = 0;
	gint _tmp39_ = 0;
	gint _tmp40_ = 0;
	Player _tmp41_ = 0;
	gboolean _tmp42_ = FALSE;
	gint _tmp43_ = 0;
	gint _tmp44_ = 0;
	gint _tmp45_ = 0;
	gint _tmp46_ = 0;
	Player _tmp47_ = 0;
	gboolean _tmp48_ = FALSE;
	gint _tmp49_ = 0;
	gint _tmp50_ = 0;
	gint _tmp51_ = 0;
	gint _tmp52_ = 0;
	Player _tmp53_ = 0;
	gboolean _tmp54_ = FALSE;
	gint _tmp55_ = 0;
	gboolean _tmp56_ = FALSE;
	gboolean _tmp57_ = FALSE;
#line 159 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = x;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = y;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = game_is_valid_location (self, _tmp1_, _tmp2_);
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (!_tmp3_) {
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp0_ = TRUE;
#line 1604 "game.c"
	} else {
		Player* _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
		gint _tmp4__length2 = 0;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		Player _tmp7_ = 0;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp4_ = self->priv->tiles;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp4__length1 = self->priv->tiles_length1;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp4__length2 = self->priv->tiles_length2;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp5_ = x;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp6_ = y;
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp7_ = _tmp4_[(_tmp5_ * _tmp4__length2) + _tmp6_];
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp0_ = _tmp7_ != PLAYER_NONE;
#line 1626 "game.c"
	}
#line 162 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp0_) {
#line 163 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		result = 0;
#line 163 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return result;
#line 1634 "game.c"
	}
#line 165 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = 0;
#line 166 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp8_ = n_flips;
#line 166 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp9_ = x;
#line 166 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp10_ = y;
#line 166 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp11_ = color;
#line 166 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp12_ = apply;
#line 166 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp13_ = game_flip_tiles (self, _tmp9_, _tmp10_, 1, 0, _tmp11_, _tmp12_);
#line 166 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp8_ + _tmp13_;
#line 167 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp14_ = n_flips;
#line 167 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp15_ = x;
#line 167 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp16_ = y;
#line 167 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp17_ = color;
#line 167 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp18_ = apply;
#line 167 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp19_ = game_flip_tiles (self, _tmp15_, _tmp16_, 1, 1, _tmp17_, _tmp18_);
#line 167 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp14_ + _tmp19_;
#line 168 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp20_ = n_flips;
#line 168 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp21_ = x;
#line 168 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp22_ = y;
#line 168 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp23_ = color;
#line 168 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp24_ = apply;
#line 168 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp25_ = game_flip_tiles (self, _tmp21_, _tmp22_, 0, 1, _tmp23_, _tmp24_);
#line 168 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp20_ + _tmp25_;
#line 169 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp26_ = n_flips;
#line 169 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp27_ = x;
#line 169 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp28_ = y;
#line 169 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp29_ = color;
#line 169 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp30_ = apply;
#line 169 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp31_ = game_flip_tiles (self, _tmp27_, _tmp28_, -1, 1, _tmp29_, _tmp30_);
#line 169 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp26_ + _tmp31_;
#line 170 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp32_ = n_flips;
#line 170 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp33_ = x;
#line 170 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp34_ = y;
#line 170 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp35_ = color;
#line 170 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp36_ = apply;
#line 170 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp37_ = game_flip_tiles (self, _tmp33_, _tmp34_, -1, 0, _tmp35_, _tmp36_);
#line 170 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp32_ + _tmp37_;
#line 171 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp38_ = n_flips;
#line 171 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp39_ = x;
#line 171 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp40_ = y;
#line 171 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp41_ = color;
#line 171 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp42_ = apply;
#line 171 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp43_ = game_flip_tiles (self, _tmp39_, _tmp40_, -1, -1, _tmp41_, _tmp42_);
#line 171 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp38_ + _tmp43_;
#line 172 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp44_ = n_flips;
#line 172 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp45_ = x;
#line 172 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp46_ = y;
#line 172 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp47_ = color;
#line 172 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp48_ = apply;
#line 172 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp49_ = game_flip_tiles (self, _tmp45_, _tmp46_, 0, -1, _tmp47_, _tmp48_);
#line 172 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp44_ + _tmp49_;
#line 173 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp50_ = n_flips;
#line 173 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp51_ = x;
#line 173 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp52_ = y;
#line 173 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp53_ = color;
#line 173 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp54_ = apply;
#line 173 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp55_ = game_flip_tiles (self, _tmp51_, _tmp52_, 1, -1, _tmp53_, _tmp54_);
#line 173 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	n_flips = _tmp50_ + _tmp55_;
#line 176 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp57_ = apply;
#line 176 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp57_) {
#line 1754 "game.c"
		gint _tmp58_ = 0;
#line 176 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp58_ = n_flips;
#line 176 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp56_ = _tmp58_ > 0;
#line 1760 "game.c"
	} else {
#line 176 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp56_ = FALSE;
#line 1764 "game.c"
	}
#line 176 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp56_) {
#line 1768 "game.c"
		gint _tmp59_ = 0;
		gint _tmp60_ = 0;
		gint _tmp61_ = 0;
		gint _tmp62_ = 0;
#line 178 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp59_ = self->priv->undo_index;
#line 178 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp60_ = n_flips;
#line 178 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		self->priv->undo_history[_tmp59_] = _tmp60_ + 1;
#line 178 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp61_ = self->priv->undo_history[_tmp59_];
#line 179 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp62_ = self->priv->undo_index;
#line 179 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		self->priv->undo_index = _tmp62_ + 1;
#line 1785 "game.c"
	}
#line 182 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = n_flips;
#line 182 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 1791 "game.c"
}


gint game_count_tiles (Game* self, Player color) {
	gint result = 0;
	gint count = 0;
#line 185 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 187 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	count = 0;
#line 1802 "game.c"
	{
		gint x = 0;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		x = 0;
#line 1807 "game.c"
		{
			gboolean _tmp0_ = FALSE;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp0_ = TRUE;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 1814 "game.c"
				gint _tmp2_ = 0;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp0_) {
#line 1820 "game.c"
					gint _tmp1_ = 0;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp1_ = x;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					x = _tmp1_ + 1;
#line 1826 "game.c"
				}
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp0_ = FALSE;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp2_ = x;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp3_ = game_get_width (self);
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp4_ = _tmp3_;
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp2_ < _tmp4_)) {
#line 188 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 1840 "game.c"
				}
				{
					gint y = 0;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					y = 0;
#line 1846 "game.c"
					{
						gboolean _tmp5_ = FALSE;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp5_ = TRUE;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						while (TRUE) {
#line 1853 "game.c"
							gint _tmp7_ = 0;
							gint _tmp8_ = 0;
							gint _tmp9_ = 0;
							Player* _tmp10_ = NULL;
							gint _tmp10__length1 = 0;
							gint _tmp10__length2 = 0;
							gint _tmp11_ = 0;
							gint _tmp12_ = 0;
							Player _tmp13_ = 0;
							Player _tmp14_ = 0;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!_tmp5_) {
#line 1866 "game.c"
								gint _tmp6_ = 0;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp6_ = y;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								y = _tmp6_ + 1;
#line 1872 "game.c"
							}
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp5_ = FALSE;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp7_ = y;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp8_ = game_get_height (self);
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp9_ = _tmp8_;
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!(_tmp7_ < _tmp9_)) {
#line 189 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								break;
#line 1886 "game.c"
							}
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp10_ = self->priv->tiles;
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp10__length1 = self->priv->tiles_length1;
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp10__length2 = self->priv->tiles_length2;
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11_ = x;
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp12_ = y;
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp13_ = _tmp10_[(_tmp11_ * _tmp10__length2) + _tmp12_];
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp14_ = color;
#line 190 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (_tmp13_ == _tmp14_) {
#line 1904 "game.c"
								gint _tmp15_ = 0;
#line 191 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp15_ = count;
#line 191 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								count = _tmp15_ + 1;
#line 1910 "game.c"
							}
						}
					}
				}
			}
		}
	}
#line 192 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = count;
#line 192 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 1922 "game.c"
}


static gboolean game_is_valid_location (Game* self, gint x, gint y) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gint _tmp3_ = 0;
#line 195 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = x;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp3_ >= 0) {
#line 1938 "game.c"
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp4_ = x;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp5_ = game_get_width (self);
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp6_ = _tmp5_;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp2_ = _tmp4_ < _tmp6_;
#line 1950 "game.c"
	} else {
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp2_ = FALSE;
#line 1954 "game.c"
	}
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp2_) {
#line 1958 "game.c"
		gint _tmp7_ = 0;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp7_ = y;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp1_ = _tmp7_ >= 0;
#line 1964 "game.c"
	} else {
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp1_ = FALSE;
#line 1968 "game.c"
	}
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp1_) {
#line 1972 "game.c"
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp8_ = y;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp9_ = game_get_height (self);
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp10_ = _tmp9_;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp0_ = _tmp8_ < _tmp10_;
#line 1984 "game.c"
	} else {
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp0_ = FALSE;
#line 1988 "game.c"
	}
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp0_;
#line 197 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 1994 "game.c"
}


static gint game_flip_tiles (Game* self, gint x, gint y, gint x_step, gint y_step, Player color, gboolean apply) {
	gint result = 0;
	Player enemy = 0;
	Player _tmp0_ = 0;
	gint enemy_count = 0;
	gint xt = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint yt = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	gint _tmp20_ = 0;
	gboolean _tmp29_ = FALSE;
#line 200 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 202 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	enemy = PLAYER_LIGHT;
#line 203 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = color;
#line 203 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp0_ == PLAYER_LIGHT) {
#line 204 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		enemy = PLAYER_DARK;
#line 2023 "game.c"
	}
#line 207 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	enemy_count = 0;
#line 208 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = x;
#line 208 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = x_step;
#line 208 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	xt = _tmp1_ + _tmp2_;
#line 209 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = y;
#line 209 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp4_ = y_step;
#line 209 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	yt = _tmp3_ + _tmp4_;
#line 210 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	while (TRUE) {
#line 2041 "game.c"
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		gboolean _tmp7_ = FALSE;
		Player* _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		gint _tmp8__length2 = 0;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
		Player _tmp11_ = 0;
		Player _tmp12_ = 0;
		gint _tmp13_ = 0;
		gint _tmp14_ = 0;
		gint _tmp15_ = 0;
		gint _tmp16_ = 0;
		gint _tmp17_ = 0;
#line 210 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp5_ = xt;
#line 210 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp6_ = yt;
#line 210 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp7_ = game_is_valid_location (self, _tmp5_, _tmp6_);
#line 210 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		if (!_tmp7_) {
#line 210 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			break;
#line 2067 "game.c"
		}
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp8_ = self->priv->tiles;
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp8__length1 = self->priv->tiles_length1;
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp8__length2 = self->priv->tiles_length2;
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp9_ = xt;
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp10_ = yt;
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp11_ = _tmp8_[(_tmp9_ * _tmp8__length2) + _tmp10_];
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp12_ = enemy;
#line 212 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		if (_tmp11_ != _tmp12_) {
#line 213 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			break;
#line 2087 "game.c"
		}
#line 214 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp13_ = enemy_count;
#line 214 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		enemy_count = _tmp13_ + 1;
#line 215 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp14_ = xt;
#line 215 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp15_ = x_step;
#line 215 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		xt = _tmp14_ + _tmp15_;
#line 216 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp16_ = yt;
#line 216 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp17_ = y_step;
#line 216 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		yt = _tmp16_ + _tmp17_;
#line 2105 "game.c"
	}
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp20_ = enemy_count;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp20_ == 0) {
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp19_ = TRUE;
#line 2113 "game.c"
	} else {
		gint _tmp21_ = 0;
		gint _tmp22_ = 0;
		gboolean _tmp23_ = FALSE;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp21_ = xt;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp22_ = yt;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp23_ = game_is_valid_location (self, _tmp21_, _tmp22_);
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp19_ = !_tmp23_;
#line 2126 "game.c"
	}
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp19_) {
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp18_ = TRUE;
#line 2132 "game.c"
	} else {
		Player* _tmp24_ = NULL;
		gint _tmp24__length1 = 0;
		gint _tmp24__length2 = 0;
		gint _tmp25_ = 0;
		gint _tmp26_ = 0;
		Player _tmp27_ = 0;
		Player _tmp28_ = 0;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp24_ = self->priv->tiles;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp24__length1 = self->priv->tiles_length1;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp24__length2 = self->priv->tiles_length2;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp25_ = xt;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp26_ = yt;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp27_ = _tmp24_[(_tmp25_ * _tmp24__length2) + _tmp26_];
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp28_ = color;
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp18_ = _tmp27_ != _tmp28_;
#line 2157 "game.c"
	}
#line 220 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp18_) {
#line 221 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		result = 0;
#line 221 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return result;
#line 2165 "game.c"
	}
#line 224 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp29_ = apply;
#line 224 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp29_) {
#line 2171 "game.c"
		{
			gint i = 0;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			i = 0;
#line 2176 "game.c"
			{
				gboolean _tmp30_ = FALSE;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp30_ = TRUE;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				while (TRUE) {
#line 2183 "game.c"
					gint _tmp32_ = 0;
					gint _tmp33_ = 0;
					gint _tmp34_ = 0;
					gint _tmp35_ = 0;
					gint _tmp36_ = 0;
					gint _tmp37_ = 0;
					gint _tmp38_ = 0;
					gint _tmp39_ = 0;
					Player _tmp40_ = 0;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					if (!_tmp30_) {
#line 2195 "game.c"
						gint _tmp31_ = 0;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp31_ = i;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						i = _tmp31_ + 1;
#line 2201 "game.c"
					}
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp30_ = FALSE;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp32_ = i;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp33_ = enemy_count;
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					if (!(_tmp32_ <= _tmp33_)) {
#line 225 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						break;
#line 2213 "game.c"
					}
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp34_ = x;
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp35_ = i;
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp36_ = x_step;
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp37_ = y;
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp38_ = i;
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp39_ = y_step;
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp40_ = color;
#line 226 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					game_set_tile (self, _tmp34_ + (_tmp35_ * _tmp36_), _tmp37_ + (_tmp38_ * _tmp39_), _tmp40_, TRUE);
#line 2231 "game.c"
				}
			}
		}
	}
#line 228 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = enemy_count;
#line 228 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2240 "game.c"
}


gboolean game_can_undo (Game* self, gint count) {
	gboolean result = FALSE;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
#line 231 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 231 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = count;
#line 231 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = count;
#line 231 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail ((_tmp0_ == 1) || (_tmp1_ == 2), FALSE);
#line 235 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = count;
#line 235 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp2_ == 1) {
#line 2261 "game.c"
		gint _tmp3_ = 0;
#line 236 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp3_ = self->priv->undo_index;
#line 236 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		result = _tmp3_ > 0;
#line 236 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return result;
#line 2269 "game.c"
	} else {
		gint _tmp4_ = 0;
#line 238 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp4_ = self->priv->undo_index;
#line 238 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		result = _tmp4_ > 3;
#line 238 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return result;
#line 2278 "game.c"
	}
}


void game_undo (Game* self, gint count) {
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gboolean _tmp3_ = FALSE;
#line 241 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_if_fail (self != NULL);
#line 241 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = count;
#line 241 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = count;
#line 241 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_if_fail ((_tmp0_ == 1) || (_tmp1_ == 2));
#line 244 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = count;
#line 244 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = game_can_undo (self, _tmp2_);
#line 244 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (!_tmp3_) {
#line 245 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return;
#line 2304 "game.c"
	}
	{
		gint i = 0;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		i = 0;
#line 2310 "game.c"
		{
			gboolean _tmp4_ = FALSE;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp4_ = TRUE;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 2317 "game.c"
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				gint n_changes = 0;
				gint _tmp8_ = 0;
				gint _tmp9_ = 0;
				gint _tmp10_ = 0;
				Player _tmp27_ = 0;
				Player _tmp28_ = 0;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp4_) {
#line 2328 "game.c"
					gint _tmp5_ = 0;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp5_ = i;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					i = _tmp5_ + 1;
#line 2334 "game.c"
				}
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp4_ = FALSE;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp6_ = i;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp7_ = count;
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp6_ < _tmp7_)) {
#line 247 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 2346 "game.c"
				}
#line 249 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp8_ = self->priv->undo_index;
#line 249 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp9_ = self->priv->undo_history[_tmp8_ - 1];
#line 249 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				n_changes = _tmp9_;
#line 250 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp10_ = self->priv->undo_index;
#line 250 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				self->priv->undo_index = _tmp10_ - 1;
#line 2358 "game.c"
				{
					gint j = 0;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					j = 0;
#line 2363 "game.c"
					{
						gboolean _tmp11_ = FALSE;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp11_ = TRUE;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						while (TRUE) {
#line 2370 "game.c"
							gint _tmp13_ = 0;
							gint _tmp14_ = 0;
							gint n = 0;
							gint _tmp15_ = 0;
							gint _tmp16_ = 0;
							gint _tmp17_ = 0;
							Player c = 0;
							gint _tmp18_ = 0;
							gint xy = 0;
							gint _tmp19_ = 0;
							gint _tmp20_ = 0;
							gint _tmp21_ = 0;
							gint _tmp22_ = 0;
							gint _tmp23_ = 0;
							gint _tmp24_ = 0;
							gint _tmp25_ = 0;
							Player _tmp26_ = 0;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!_tmp11_) {
#line 2390 "game.c"
								gint _tmp12_ = 0;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp12_ = j;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								j = _tmp12_ + 1;
#line 2396 "game.c"
							}
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11_ = FALSE;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp13_ = j;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp14_ = n_changes;
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!(_tmp13_ < _tmp14_)) {
#line 253 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								break;
#line 2408 "game.c"
							}
#line 255 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp15_ = self->priv->undo_index;
#line 255 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp16_ = self->priv->undo_history[_tmp15_ - 1];
#line 255 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							n = _tmp16_;
#line 256 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp17_ = self->priv->undo_index;
#line 256 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							self->priv->undo_index = _tmp17_ - 1;
#line 257 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp18_ = n;
#line 257 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							c = (Player) (_tmp18_ >> 6);
#line 258 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp19_ = n;
#line 258 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							xy = _tmp19_ & 0x3F;
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp20_ = xy;
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp21_ = game_get_width (self);
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp22_ = _tmp21_;
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp23_ = xy;
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp24_ = game_get_width (self);
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp25_ = _tmp24_;
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp26_ = c;
#line 259 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							game_set_tile (self, _tmp20_ % _tmp22_, _tmp23_ / _tmp25_, _tmp26_, FALSE);
#line 2444 "game.c"
						}
					}
				}
#line 263 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp27_ = self->priv->_current_color;
#line 263 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp28_ = player_flip_color (_tmp27_);
#line 263 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				game_set_current_color (self, _tmp28_);
#line 2454 "game.c"
			}
		}
	}
}


static void game_set_tile (Game* self, gint x, gint y, Player color, gboolean update_history) {
	Player* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp0__length2 = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	Player _tmp3_ = 0;
	Player _tmp4_ = 0;
	gboolean _tmp5_ = FALSE;
	Player* _tmp17_ = NULL;
	gint _tmp17__length1 = 0;
	gint _tmp17__length2 = 0;
	gint _tmp18_ = 0;
	gint _tmp19_ = 0;
	Player _tmp20_ = 0;
	Player _tmp21_ = 0;
	gint _tmp22_ = 0;
	gint _tmp23_ = 0;
#line 267 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_if_fail (self != NULL);
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = self->priv->tiles;
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0__length1 = self->priv->tiles_length1;
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0__length2 = self->priv->tiles_length2;
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = x;
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = y;
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = _tmp0_[(_tmp1_ * _tmp0__length2) + _tmp2_];
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp4_ = color;
#line 269 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp3_ == _tmp4_) {
#line 270 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		return;
#line 2499 "game.c"
	}
#line 273 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp5_ = update_history;
#line 273 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (_tmp5_) {
#line 2505 "game.c"
		gint _tmp6_ = 0;
		Player* _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
		gint _tmp7__length2 = 0;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		Player _tmp10_ = 0;
		gint _tmp11_ = 0;
		gint _tmp12_ = 0;
		gint _tmp13_ = 0;
		gint _tmp14_ = 0;
		gint _tmp15_ = 0;
		gint _tmp16_ = 0;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp6_ = self->priv->undo_index;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp7_ = self->priv->tiles;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp7__length1 = self->priv->tiles_length1;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp7__length2 = self->priv->tiles_length2;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp8_ = x;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp9_ = y;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp10_ = _tmp7_[(_tmp8_ * _tmp7__length2) + _tmp9_];
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp11_ = y;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp12_ = game_get_width (self);
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp13_ = _tmp12_;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp14_ = x;
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		self->priv->undo_history[_tmp6_] = (((gint) _tmp10_) << 6) | ((_tmp11_ * _tmp13_) + _tmp14_);
#line 275 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp15_ = self->priv->undo_history[_tmp6_];
#line 276 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		_tmp16_ = self->priv->undo_index;
#line 276 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		self->priv->undo_index = _tmp16_ + 1;
#line 2549 "game.c"
	}
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp17_ = self->priv->tiles;
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp17__length1 = self->priv->tiles_length1;
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp17__length2 = self->priv->tiles_length2;
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp18_ = x;
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp19_ = y;
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp20_ = color;
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp17_[(_tmp18_ * _tmp17__length2) + _tmp19_] = _tmp20_;
#line 279 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp21_ = _tmp17_[(_tmp18_ * _tmp17__length2) + _tmp19_];
#line 280 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp22_ = x;
#line 280 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp23_ = y;
#line 280 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_signal_emit_by_name (self, "square-changed", _tmp22_, _tmp23_);
#line 2573 "game.c"
}


gchar* game_to_string (Game* self) {
	gchar* result = NULL;
	gchar* s = NULL;
	gchar* _tmp0_ = NULL;
#line 283 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 285 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = g_strdup ("\n");
#line 285 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	s = _tmp0_;
#line 2587 "game.c"
	{
		gint y = 0;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		y = 0;
#line 2592 "game.c"
		{
			gboolean _tmp1_ = FALSE;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			_tmp1_ = TRUE;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
			while (TRUE) {
#line 2599 "game.c"
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
				gint _tmp5_ = 0;
				const gchar* _tmp19_ = NULL;
				gchar* _tmp20_ = NULL;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!_tmp1_) {
#line 2607 "game.c"
					gint _tmp2_ = 0;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					_tmp2_ = y;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					y = _tmp2_ + 1;
#line 2613 "game.c"
				}
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp1_ = FALSE;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp3_ = y;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp4_ = game_get_height (self);
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp5_ = _tmp4_;
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				if (!(_tmp3_ < _tmp5_)) {
#line 287 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					break;
#line 2627 "game.c"
				}
				{
					gint x = 0;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
					x = 0;
#line 2633 "game.c"
					{
						gboolean _tmp6_ = FALSE;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						_tmp6_ = TRUE;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
						while (TRUE) {
#line 2640 "game.c"
							gint _tmp8_ = 0;
							gint _tmp9_ = 0;
							gint _tmp10_ = 0;
							const gchar* _tmp11_ = NULL;
							Player* _tmp12_ = NULL;
							gint _tmp12__length1 = 0;
							gint _tmp12__length2 = 0;
							gint _tmp13_ = 0;
							gint _tmp14_ = 0;
							Player _tmp15_ = 0;
							gchar* _tmp16_ = NULL;
							gchar* _tmp17_ = NULL;
							gchar* _tmp18_ = NULL;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!_tmp6_) {
#line 2656 "game.c"
								gint _tmp7_ = 0;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								_tmp7_ = x;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								x = _tmp7_ + 1;
#line 2662 "game.c"
							}
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp6_ = FALSE;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp8_ = x;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp9_ = game_get_width (self);
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp10_ = _tmp9_;
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							if (!(_tmp8_ < _tmp10_)) {
#line 289 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
								break;
#line 2676 "game.c"
							}
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp11_ = s;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp12_ = self->priv->tiles;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp12__length1 = self->priv->tiles_length1;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp12__length2 = self->priv->tiles_length2;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp13_ = x;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp14_ = y;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp15_ = _tmp12_[(_tmp13_ * _tmp12__length2) + _tmp14_];
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp16_ = player_to_string (_tmp15_);
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp17_ = _tmp16_;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_tmp18_ = g_strconcat (_tmp11_, _tmp17_, NULL);
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_g_free0 (s);
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							s = _tmp18_;
#line 290 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
							_g_free0 (_tmp17_);
#line 2704 "game.c"
						}
					}
				}
#line 291 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp19_ = s;
#line 291 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_tmp20_ = g_strconcat (_tmp19_, "\n", NULL);
#line 291 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				_g_free0 (s);
#line 291 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
				s = _tmp20_;
#line 2716 "game.c"
			}
		}
	}
#line 294 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = s;
#line 294 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2724 "game.c"
}


gint game_get_width (Game* self) {
	gint result;
	Player* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp0__length2 = 0;
	gint _tmp1_ = 0;
#line 19 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 19 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = self->priv->tiles;
#line 19 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0__length1 = self->priv->tiles_length1;
#line 19 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0__length2 = self->priv->tiles_length2;
#line 19 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = _tmp0__length1;
#line 19 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp1_;
#line 19 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2748 "game.c"
}


gint game_get_height (Game* self) {
	gint result;
	Player* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp0__length2 = 0;
	gint _tmp1_ = 0;
#line 24 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 24 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = self->priv->tiles;
#line 24 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0__length1 = self->priv->tiles_length1;
#line 24 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0__length2 = self->priv->tiles_length2;
#line 24 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = _tmp0__length2;
#line 24 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp1_;
#line 24 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2772 "game.c"
}


Player game_get_current_color (Game* self) {
	Player result;
	Player _tmp0_ = 0;
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = self->priv->_current_color;
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp0_;
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2787 "game.c"
}


static void game_set_current_color (Game* self, Player value) {
	Player _tmp0_ = 0;
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_if_fail (self != NULL);
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = value;
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->_current_color = _tmp0_;
#line 36 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_object_notify ((GObject *) self, "current-color");
#line 2801 "game.c"
}


gint game_get_n_tiles (Game* self) {
	gint result;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
#line 50 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 50 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = game_get_n_light_tiles (self);
#line 50 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp1_ = _tmp0_;
#line 50 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp2_ = game_get_n_dark_tiles (self);
#line 50 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp3_ = _tmp2_;
#line 50 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp1_ + _tmp3_;
#line 50 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2825 "game.c"
}


gint game_get_n_light_tiles (Game* self) {
	gint result;
	gint _tmp0_ = 0;
#line 55 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 55 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = game_count_tiles (self, PLAYER_LIGHT);
#line 55 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp0_;
#line 55 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2840 "game.c"
}


gint game_get_n_dark_tiles (Game* self) {
	gint result;
	gint _tmp0_ = 0;
#line 60 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 60 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	_tmp0_ = game_count_tiles (self, PLAYER_DARK);
#line 60 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	result = _tmp0_;
#line 60 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	return result;
#line 2855 "game.c"
}


static void g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, gint arg_1, gint arg_2, gpointer data2);
	register GMarshalFunc_VOID__INT_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_return_if_fail (n_param_values == 3);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		data1 = closure->data;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		data2 = param_values->data[0].v_pointer;
#line 2874 "game.c"
	} else {
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		data1 = param_values->data[0].v_pointer;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		data2 = closure->data;
#line 2880 "game.c"
	}
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	callback (data1, g_value_get_int (param_values + 1), g_value_get_int (param_values + 2), data2);
#line 2886 "game.c"
}


static void game_class_init (GameClass * klass) {
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	game_parent_class = g_type_class_peek_parent (klass);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_type_class_add_private (klass, sizeof (GamePrivate));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_game_get_property;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_game_set_property;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	G_OBJECT_CLASS (klass)->finalize = game_finalize;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_CURRENT_COLOR, g_param_spec_enum ("current-color", "current-color", "current-color", TYPE_PLAYER, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_N_TILES, g_param_spec_int ("n-tiles", "n-tiles", "n-tiles", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_N_LIGHT_TILES, g_param_spec_int ("n-light-tiles", "n-light-tiles", "n-light-tiles", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_N_DARK_TILES, g_param_spec_int ("n-dark-tiles", "n-dark-tiles", "n-dark-tiles", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_signal_new ("move", TYPE_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_signal_new ("square_changed", TYPE_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	g_signal_new ("complete", TYPE_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 2919 "game.c"
}


static void game_instance_init (Game * self) {
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv = GAME_GET_PRIVATE (self);
#line 33 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->undo_index = 0;
#line 2928 "game.c"
}


static void game_finalize (GObject* obj) {
	Game * self;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GAME, Game);
#line 15 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	self->priv->tiles = (g_free (self->priv->tiles), NULL);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	G_OBJECT_CLASS (game_parent_class)->finalize (obj);
#line 2940 "game.c"
}


GType game_get_type (void) {
	static volatile gsize game_type_id__volatile = 0;
	if (g_once_init_enter (&game_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GameClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) game_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Game), 0, (GInstanceInitFunc) game_instance_init, NULL };
		GType game_type_id;
		game_type_id = g_type_register_static (G_TYPE_OBJECT, "Game", &g_define_type_info, 0);
		g_once_init_leave (&game_type_id__volatile, game_type_id);
	}
	return game_type_id__volatile;
}


static void _vala_game_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	Game * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_GAME, Game);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	switch (property_id) {
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		case GAME_WIDTH:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_value_set_int (value, game_get_width (self));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		case GAME_HEIGHT:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_value_set_int (value, game_get_height (self));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		case GAME_CURRENT_COLOR:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_value_set_enum (value, game_get_current_color (self));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		case GAME_N_TILES:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_value_set_int (value, game_get_n_tiles (self));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		case GAME_N_LIGHT_TILES:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_value_set_int (value, game_get_n_light_tiles (self));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		case GAME_N_DARK_TILES:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		g_value_set_int (value, game_get_n_dark_tiles (self));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 2997 "game.c"
		default:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 3003 "game.c"
	}
}


static void _vala_game_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	Game * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_GAME, Game);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
	switch (property_id) {
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		case GAME_CURRENT_COLOR:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		game_set_current_color (self, g_value_get_enum (value));
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 3019 "game.c"
		default:
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 12 "/home/mcatanzaro/jhbuild/checkout/iagno/src/game.vala"
		break;
#line 3025 "game.c"
	}
}



