/* steam-registry.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from steam-registry.vala, do not modify */

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>
#include "games-steam-plugin.h"

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

#define GAMES_TYPE_STEAM_REGISTRY (games_steam_registry_get_type ())
#define GAMES_STEAM_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistry))
#define GAMES_STEAM_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistryClass))
#define GAMES_IS_STEAM_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY))
#define GAMES_IS_STEAM_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY))
#define GAMES_STEAM_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistryClass))

typedef struct _GamesSteamRegistry GamesSteamRegistry;
typedef struct _GamesSteamRegistryClass GamesSteamRegistryClass;
typedef struct _GamesSteamRegistryPrivate GamesSteamRegistryPrivate;

#define GAMES_TYPE_STEAM_REGISTRY_VALUE (games_steam_registry_value_get_type ())
#define GAMES_STEAM_REGISTRY_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue))
#define GAMES_STEAM_REGISTRY_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValueClass))
#define GAMES_IS_STEAM_REGISTRY_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY_VALUE))
#define GAMES_IS_STEAM_REGISTRY_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY_VALUE))
#define GAMES_STEAM_REGISTRY_VALUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValueClass))

typedef struct _GamesSteamRegistryValue GamesSteamRegistryValue;
typedef struct _GamesSteamRegistryValueClass GamesSteamRegistryValueClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _games_steam_registry_unref0(var) ((var == NULL) ? NULL : (var = (games_steam_registry_unref (var), NULL)))

#define GAMES_TYPE_STEAM_REGISTRY_NODE (games_steam_registry_node_get_type ())
#define GAMES_STEAM_REGISTRY_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNode))
#define GAMES_STEAM_REGISTRY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNodeClass))
#define GAMES_IS_STEAM_REGISTRY_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY_NODE))
#define GAMES_IS_STEAM_REGISTRY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY_NODE))
#define GAMES_STEAM_REGISTRY_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNodeClass))

typedef struct _GamesSteamRegistryNode GamesSteamRegistryNode;
typedef struct _GamesSteamRegistryNodeClass GamesSteamRegistryNodeClass;

#define GAMES_TYPE_STEAM_REGISTRY_ERROR (games_steam_registry_error_get_type ())

#define GAMES_TYPE_STEAM_REGISTRY_DATA (games_steam_registry_data_get_type ())
#define GAMES_STEAM_REGISTRY_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData))
#define GAMES_STEAM_REGISTRY_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryDataClass))
#define GAMES_IS_STEAM_REGISTRY_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY_DATA))
#define GAMES_IS_STEAM_REGISTRY_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY_DATA))
#define GAMES_STEAM_REGISTRY_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryDataClass))

typedef struct _GamesSteamRegistryData GamesSteamRegistryData;
typedef struct _GamesSteamRegistryDataClass GamesSteamRegistryDataClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_match_info_unref0(var) ((var == NULL) ? NULL : (var = (g_match_info_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _GamesParamSpecSteamRegistry GamesParamSpecSteamRegistry;
typedef struct _GamesSteamRegistryValuePrivate GamesSteamRegistryValuePrivate;
enum  {
	GAMES_STEAM_REGISTRY_VALUE_0_PROPERTY,
	GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY,
	GAMES_STEAM_REGISTRY_VALUE_NUM_PROPERTIES
};
static GParamSpec* games_steam_registry_value_properties[GAMES_STEAM_REGISTRY_VALUE_NUM_PROPERTIES];
typedef struct _GamesSteamRegistryNodePrivate GamesSteamRegistryNodePrivate;
enum  {
	GAMES_STEAM_REGISTRY_NODE_0_PROPERTY,
	GAMES_STEAM_REGISTRY_NODE_NUM_PROPERTIES
};
static GParamSpec* games_steam_registry_node_properties[GAMES_STEAM_REGISTRY_NODE_NUM_PROPERTIES];
typedef struct _GamesSteamRegistryDataPrivate GamesSteamRegistryDataPrivate;
enum  {
	GAMES_STEAM_REGISTRY_DATA_0_PROPERTY,
	GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY,
	GAMES_STEAM_REGISTRY_DATA_NUM_PROPERTIES
};
static GParamSpec* games_steam_registry_data_properties[GAMES_STEAM_REGISTRY_DATA_NUM_PROPERTIES];

struct _GamesSteamRegistry {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GamesSteamRegistryPrivate * priv;
};

struct _GamesSteamRegistryClass {
	GTypeClass parent_class;
	void (*finalize) (GamesSteamRegistry *self);
};

struct _GamesSteamRegistryPrivate {
	GamesSteamRegistryValue* tree;
};

typedef enum  {
	GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN,
	GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_END
} GamesSteamRegistryError;
#define GAMES_STEAM_REGISTRY_ERROR games_steam_registry_error_quark ()

struct _GamesParamSpecSteamRegistry {
	GParamSpec parent_instance;
};

struct _GamesSteamRegistryValue {
	GObject parent_instance;
	GamesSteamRegistryValuePrivate * priv;
};

struct _GamesSteamRegistryValueClass {
	GObjectClass parent_class;
};

struct _GamesSteamRegistryValuePrivate {
	gchar* _tag;
};

struct _GamesSteamRegistryNode {
	GamesSteamRegistryValue parent_instance;
	GamesSteamRegistryNodePrivate * priv;
};

struct _GamesSteamRegistryNodeClass {
	GamesSteamRegistryValueClass parent_class;
};

struct _GamesSteamRegistryNodePrivate {
	GList* children;
};

struct _GamesSteamRegistryData {
	GamesSteamRegistryValue parent_instance;
	GamesSteamRegistryDataPrivate * priv;
};

struct _GamesSteamRegistryDataClass {
	GamesSteamRegistryValueClass parent_class;
};

struct _GamesSteamRegistryDataPrivate {
	gchar* _data;
};

static gint GamesSteamRegistry_private_offset;
static gpointer games_steam_registry_parent_class = NULL;
static GType games_steam_registry_type_id = 0;
static gint GamesSteamRegistryValue_private_offset;
static gpointer games_steam_registry_value_parent_class = NULL;
static GType games_steam_registry_value_type_id = 0;
static gint GamesSteamRegistryNode_private_offset;
static gpointer games_steam_registry_node_parent_class = NULL;
static GType games_steam_registry_node_type_id = 0;
static gint GamesSteamRegistryData_private_offset;
static gpointer games_steam_registry_data_parent_class = NULL;
static GType games_steam_registry_data_type_id = 0;

VALA_EXTERN gpointer games_steam_registry_ref (gpointer instance);
VALA_EXTERN void games_steam_registry_unref (gpointer instance);
VALA_EXTERN GParamSpec* games_param_spec_steam_registry (const gchar* name,
                                             const gchar* nick,
                                             const gchar* blurb,
                                             GType object_type,
                                             GParamFlags flags);
VALA_EXTERN void games_value_set_steam_registry (GValue* value,
                                     gpointer v_object);
VALA_EXTERN void games_value_take_steam_registry (GValue* value,
                                      gpointer v_object);
VALA_EXTERN gpointer games_value_get_steam_registry (const GValue* value);
GType games_steam_registry_register_type (GTypeModule * module);
VALA_EXTERN GType games_steam_registry_get_type (void) G_GNUC_CONST ;
GType games_steam_registry_value_register_type (GTypeModule * module);
VALA_EXTERN GType games_steam_registry_value_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesSteamRegistry* games_steam_registry_new (const gchar* appmanifest_path,
                                              GError** error);
VALA_EXTERN GamesSteamRegistry* games_steam_registry_construct (GType object_type,
                                                    const gchar* appmanifest_path,
                                                    GError** error);
static gchar** games_steam_registry_tokenize (GamesSteamRegistry* self,
                                       const gchar* appmanifest_path,
                                       gint* result_length1,
                                       GError** error);
GType games_steam_registry_node_register_type (GTypeModule * module);
VALA_EXTERN GType games_steam_registry_node_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GQuark games_steam_registry_error_quark (void);
VALA_EXTERN GType games_steam_registry_error_get_type (void) G_GNUC_CONST ;
static GamesSteamRegistryValue* games_steam_registry_parse_tokens (GamesSteamRegistry* self,
                                                            GamesSteamRegistryNode* parent,
                                                            gchar** tokens,
                                                            gint tokens_length1,
                                                            gsize* index,
                                                            GError** error);
VALA_EXTERN gchar** games_steam_registry_get_children (GamesSteamRegistry* self,
                                           gchar** path,
                                           gint path_length1,
                                           gint* result_length1);
VALA_EXTERN const gchar* games_steam_registry_value_get_tag (GamesSteamRegistryValue* self);
VALA_EXTERN GamesSteamRegistryValue* games_steam_registry_node_get_child (GamesSteamRegistryNode* self,
                                                              const gchar* tag);
VALA_EXTERN gchar** games_steam_registry_node_get_children (GamesSteamRegistryNode* self,
                                                gint* result_length1);
VALA_EXTERN gchar* games_steam_registry_get_data (GamesSteamRegistry* self,
                                      gchar** path,
                                      gint path_length1);
GType games_steam_registry_data_register_type (GTypeModule * module);
VALA_EXTERN GType games_steam_registry_data_get_type (void) G_GNUC_CONST ;
VALA_EXTERN const gchar* games_steam_registry_data_get_data (GamesSteamRegistryData* self);
static void _vala_array_add4 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
VALA_EXTERN GamesSteamRegistryNode* games_steam_registry_node_new (const gchar* tag);
VALA_EXTERN GamesSteamRegistryNode* games_steam_registry_node_construct (GType object_type,
                                                             const gchar* tag);
VALA_EXTERN void games_steam_registry_node_add_child (GamesSteamRegistryNode* self,
                                          GamesSteamRegistryValue* child);
VALA_EXTERN GamesSteamRegistryData* games_steam_registry_data_new (const gchar* tag,
                                                       const gchar* data);
VALA_EXTERN GamesSteamRegistryData* games_steam_registry_data_construct (GType object_type,
                                                             const gchar* tag,
                                                             const gchar* data);
static void games_steam_registry_finalize (GamesSteamRegistry * obj);
VALA_EXTERN GamesSteamRegistryValue* games_steam_registry_value_construct (GType object_type);
static void games_steam_registry_value_set_tag (GamesSteamRegistryValue* self,
                                         const gchar* value);
static void games_steam_registry_value_finalize (GObject * obj);
static void _vala_games_steam_registry_value_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_games_steam_registry_value_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void _vala_array_add5 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void games_steam_registry_node_finalize (GObject * obj);
static void games_steam_registry_data_set_data (GamesSteamRegistryData* self,
                                         const gchar* value);
static void games_steam_registry_data_finalize (GObject * obj);
static void _vala_games_steam_registry_data_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_games_steam_registry_data_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static GRegex* _tmp_regex_0 = NULL;

static inline gpointer
games_steam_registry_get_instance_private (GamesSteamRegistry* self)
{
	return G_STRUCT_MEMBER_P (self, GamesSteamRegistry_private_offset);
}

GamesSteamRegistry*
games_steam_registry_construct (GType object_type,
                                const gchar* appmanifest_path,
                                GError** error)
{
	GamesSteamRegistry* self = NULL;
	gchar** tokens = NULL;
	gint _tmp0_ = 0;
	gchar** _tmp1_;
	gint tokens_length1;
	gint _tokens_size_;
	gsize index = 0UL;
	GamesSteamRegistryValue* _tmp2_ = NULL;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GamesSteamRegistryValue* _tmp4_;
	GamesSteamRegistryValue* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (appmanifest_path != NULL, NULL);
	self = (GamesSteamRegistry*) g_type_create_instance (object_type);
	_tmp1_ = games_steam_registry_tokenize (self, appmanifest_path, &_tmp0_, &_inner_error0_);
	tokens = _tmp1_;
	tokens_length1 = _tmp0_;
	_tokens_size_ = tokens_length1;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_games_steam_registry_unref0 (self);
		return NULL;
	}
	index = (gsize) 0;
	_tmp3_ = tokens;
	_tmp3__length1 = tokens_length1;
	_tmp4_ = games_steam_registry_parse_tokens (self, NULL, _tmp3_, (gint) _tmp3__length1, &index, &_inner_error0_);
	_tmp2_ = _tmp4_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		_games_steam_registry_unref0 (self);
		return NULL;
	}
	_tmp5_ = _tmp2_;
	_tmp2_ = NULL;
	_g_object_unref0 (self->priv->tree);
	self->priv->tree = _tmp5_;
	_g_object_unref0 (_tmp2_);
	tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
	return self;
}

GamesSteamRegistry*
games_steam_registry_new (const gchar* appmanifest_path,
                          GError** error)
{
	return games_steam_registry_construct (GAMES_TYPE_STEAM_REGISTRY, appmanifest_path, error);
}

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

gchar**
games_steam_registry_get_children (GamesSteamRegistry* self,
                                   gchar** path,
                                   gint path_length1,
                                   gint* result_length1)
{
	GamesSteamRegistryValue* current_value = NULL;
	GamesSteamRegistryValue* _tmp0_;
	GamesSteamRegistryValue* _tmp1_;
	gchar** _tmp25_;
	gchar** _tmp26_;
	gint _tmp26__length1;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->tree;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	current_value = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GamesSteamRegistryValue* _tmp4_;
				GamesSteamRegistryValue* _tmp7_;
				const gchar* _tmp8_;
				const gchar* _tmp9_;
				const gchar* _tmp10_;
				GamesSteamRegistryNode* node = NULL;
				GamesSteamRegistryValue* _tmp13_;
				GamesSteamRegistryNode* _tmp14_;
				GamesSteamRegistryNode* _tmp15_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				if (!(i < path_length1)) {
					break;
				}
				_tmp4_ = current_value;
				if (_tmp4_ == NULL) {
					gchar** _tmp5_;
					gchar** _tmp6_;
					gint _tmp6__length1;
					_tmp5_ = g_new0 (gchar*, 0 + 1);
					_tmp6_ = _tmp5_;
					_tmp6__length1 = 0;
					if (result_length1) {
						*result_length1 = _tmp6__length1;
					}
					result = _tmp6_;
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp7_ = current_value;
				_tmp8_ = games_steam_registry_value_get_tag (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = path[i];
				if (g_strcmp0 (_tmp9_, _tmp10_) != 0) {
					gchar** _tmp11_;
					gchar** _tmp12_;
					gint _tmp12__length1;
					_tmp11_ = g_new0 (gchar*, 0 + 1);
					_tmp12_ = _tmp11_;
					_tmp12__length1 = 0;
					if (result_length1) {
						*result_length1 = _tmp12__length1;
					}
					result = _tmp12_;
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp13_ = current_value;
				_tmp14_ = _g_object_ref0 (GAMES_IS_STEAM_REGISTRY_NODE (_tmp13_) ? ((GamesSteamRegistryNode*) _tmp13_) : NULL);
				node = _tmp14_;
				_tmp15_ = node;
				if (_tmp15_ == NULL) {
					gchar** _tmp16_;
					gchar** _tmp17_;
					gint _tmp17__length1;
					_tmp16_ = g_new0 (gchar*, 0 + 1);
					_tmp17_ = _tmp16_;
					_tmp17__length1 = 0;
					if (result_length1) {
						*result_length1 = _tmp17__length1;
					}
					result = _tmp17_;
					_g_object_unref0 (node);
					_g_object_unref0 (current_value);
					return result;
				}
				if (i < (path_length1 - 1)) {
					GamesSteamRegistryNode* _tmp18_;
					const gchar* _tmp19_;
					GamesSteamRegistryValue* _tmp20_;
					_tmp18_ = node;
					_tmp19_ = path[i + 1];
					_tmp20_ = games_steam_registry_node_get_child (_tmp18_, _tmp19_);
					_g_object_unref0 (current_value);
					current_value = _tmp20_;
				} else {
					GamesSteamRegistryNode* _tmp21_;
					gint _tmp22_ = 0;
					gchar** _tmp23_;
					gchar** _tmp24_;
					gint _tmp24__length1;
					_tmp21_ = node;
					_tmp23_ = games_steam_registry_node_get_children (_tmp21_, &_tmp22_);
					_tmp24_ = _tmp23_;
					_tmp24__length1 = _tmp22_;
					if (result_length1) {
						*result_length1 = _tmp24__length1;
					}
					result = _tmp24_;
					_g_object_unref0 (node);
					_g_object_unref0 (current_value);
					return result;
				}
				_g_object_unref0 (node);
			}
		}
	}
	_tmp25_ = g_new0 (gchar*, 0 + 1);
	_tmp26_ = _tmp25_;
	_tmp26__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp26__length1;
	}
	result = _tmp26_;
	_g_object_unref0 (current_value);
	return result;
}

gchar*
games_steam_registry_get_data (GamesSteamRegistry* self,
                               gchar** path,
                               gint path_length1)
{
	GamesSteamRegistryValue* current_value = NULL;
	GamesSteamRegistryValue* _tmp0_;
	GamesSteamRegistryValue* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->tree;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	current_value = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GamesSteamRegistryValue* _tmp4_;
				GamesSteamRegistryValue* _tmp5_;
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				const gchar* _tmp8_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				if (!(i < path_length1)) {
					break;
				}
				_tmp4_ = current_value;
				if (_tmp4_ == NULL) {
					result = NULL;
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp5_ = current_value;
				_tmp6_ = games_steam_registry_value_get_tag (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = path[i];
				if (g_strcmp0 (_tmp7_, _tmp8_) != 0) {
					result = NULL;
					_g_object_unref0 (current_value);
					return result;
				}
				if (i < (path_length1 - 1)) {
					GamesSteamRegistryNode* node = NULL;
					GamesSteamRegistryValue* _tmp9_;
					GamesSteamRegistryNode* _tmp10_;
					GamesSteamRegistryNode* _tmp11_;
					GamesSteamRegistryNode* _tmp12_;
					const gchar* _tmp13_;
					GamesSteamRegistryValue* _tmp14_;
					_tmp9_ = current_value;
					_tmp10_ = _g_object_ref0 (GAMES_IS_STEAM_REGISTRY_NODE (_tmp9_) ? ((GamesSteamRegistryNode*) _tmp9_) : NULL);
					node = _tmp10_;
					_tmp11_ = node;
					if (_tmp11_ == NULL) {
						result = NULL;
						_g_object_unref0 (node);
						_g_object_unref0 (current_value);
						return result;
					}
					_tmp12_ = node;
					_tmp13_ = path[i + 1];
					_tmp14_ = games_steam_registry_node_get_child (_tmp12_, _tmp13_);
					_g_object_unref0 (current_value);
					current_value = _tmp14_;
					_g_object_unref0 (node);
				} else {
					GamesSteamRegistryData* data = NULL;
					GamesSteamRegistryValue* _tmp15_;
					GamesSteamRegistryData* _tmp16_;
					GamesSteamRegistryData* _tmp17_;
					GamesSteamRegistryData* _tmp18_;
					const gchar* _tmp19_;
					const gchar* _tmp20_;
					gchar* _tmp21_;
					_tmp15_ = current_value;
					_tmp16_ = _g_object_ref0 (GAMES_IS_STEAM_REGISTRY_DATA (_tmp15_) ? ((GamesSteamRegistryData*) _tmp15_) : NULL);
					data = _tmp16_;
					_tmp17_ = data;
					if (_tmp17_ == NULL) {
						result = NULL;
						_g_object_unref0 (data);
						_g_object_unref0 (current_value);
						return result;
					}
					_tmp18_ = data;
					_tmp19_ = games_steam_registry_data_get_data (_tmp18_);
					_tmp20_ = _tmp19_;
					_tmp21_ = g_strdup (_tmp20_);
					result = _tmp21_;
					_g_object_unref0 (data);
					_g_object_unref0 (current_value);
					return result;
				}
			}
		}
	}
	result = NULL;
	_g_object_unref0 (current_value);
	return result;
}

static inline GRegex*
_thread_safe_regex_init (GRegex** re,
                         const gchar * pattern,
                         GRegexCompileFlags compile_flags)
{
	if (g_once_init_enter ((volatile gsize*) re)) {
		GRegex* val = g_regex_new (pattern, compile_flags, 0, NULL);
		g_once_init_leave ((volatile gsize*) re, (gsize) val);
	}
	return *re;
}

static gpointer
_g_regex_ref0 (gpointer self)
{
	return self ? g_regex_ref (self) : NULL;
}

static void
_vala_array_add4 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar**
games_steam_registry_tokenize (GamesSteamRegistry* self,
                               const gchar* appmanifest_path,
                               gint* result_length1,
                               GError** error)
{
	GFile* file = NULL;
	GFile* _tmp0_;
	GFileInputStream* _tmp5_ = NULL;
	GFileInputStream* _tmp6_;
	GDataInputStream* dis = NULL;
	GDataInputStream* _tmp7_;
	gchar** tokens = NULL;
	gchar** _tmp8_;
	gint tokens_length1;
	gint _tokens_size_;
	GRegex* regex = NULL;
	GRegex* _tmp9_;
	gchar* line = NULL;
	GMatchInfo* match_info = NULL;
	gchar** _tmp25_;
	gint _tmp25__length1;
	GError* _inner_error0_ = NULL;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (appmanifest_path != NULL, NULL);
	_tmp0_ = g_file_new_for_path (appmanifest_path);
	file = _tmp0_;
	if (!g_file_query_exists (file, NULL)) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		GError* _tmp3_;
		GError* _tmp4_;
		_tmp1_ = g_file_get_path (file);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_error_new (G_IO_ERROR, G_IO_ERROR_NOT_FOUND, "File “%s” doesn’t exist.", _tmp2_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		_inner_error0_ = _tmp4_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (file);
		return NULL;
	}
	_tmp6_ = g_file_read (file, NULL, &_inner_error0_);
	_tmp5_ = _tmp6_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (file);
		return NULL;
	}
	_tmp7_ = g_data_input_stream_new ((GInputStream*) _tmp5_);
	dis = _tmp7_;
	_tmp8_ = g_new0 (gchar*, 0 + 1);
	tokens = _tmp8_;
	tokens_length1 = 0;
	_tokens_size_ = tokens_length1;
	_tmp9_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_0, "({|}|(?:\".*?\"))", 0));
	regex = _tmp9_;
	while (TRUE) {
		gchar* _tmp10_ = NULL;
		GDataInputStream* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		const gchar* _tmp14_;
		gint start_position = 0;
		_tmp11_ = dis;
		_tmp12_ = g_data_input_stream_read_line (_tmp11_, NULL, NULL, &_inner_error0_);
		_tmp10_ = _tmp12_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			_g_match_info_unref0 (match_info);
			_g_free0 (line);
			_g_regex_unref0 (regex);
			tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (dis);
			_g_object_unref0 (_tmp5_);
			_g_object_unref0 (file);
			return NULL;
		}
		_tmp13_ = _tmp10_;
		_tmp10_ = NULL;
		_g_free0 (line);
		line = _tmp13_;
		_tmp14_ = line;
		if (!(_tmp14_ != NULL)) {
			_g_free0 (_tmp10_);
			break;
		}
		start_position = 0;
		while (TRUE) {
			gboolean _tmp15_ = FALSE;
			GRegex* _tmp16_;
			const gchar* _tmp17_;
			GMatchInfo* _tmp18_ = NULL;
			gboolean _tmp19_;
			GMatchInfo* _tmp20_;
			gchar* _tmp21_;
			gint dummy = 0;
			GMatchInfo* _tmp22_;
			gint _tmp23_ = 0;
			gint _tmp24_ = 0;
			_tmp16_ = regex;
			_tmp17_ = line;
			_tmp19_ = g_regex_match_full (_tmp16_, _tmp17_, (gssize) -1, start_position, 0, &_tmp18_, &_inner_error0_);
			_g_match_info_unref0 (match_info);
			match_info = _tmp18_;
			_tmp15_ = _tmp19_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (_tmp10_);
				_g_match_info_unref0 (match_info);
				_g_free0 (line);
				_g_regex_unref0 (regex);
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (dis);
				_g_object_unref0 (_tmp5_);
				_g_object_unref0 (file);
				return NULL;
			}
			if (!_tmp15_) {
				break;
			}
			_tmp20_ = match_info;
			_tmp21_ = g_match_info_fetch (_tmp20_, 1);
			_vala_array_add4 (&tokens, &tokens_length1, &_tokens_size_, _tmp21_);
			dummy = 0;
			_tmp22_ = match_info;
			g_match_info_fetch_pos (_tmp22_, 1, &_tmp23_, &_tmp24_);
			dummy = _tmp23_;
			start_position = _tmp24_;
		}
		_g_free0 (_tmp10_);
	}
	_tmp25_ = tokens;
	_tmp25__length1 = tokens_length1;
	if (result_length1) {
		*result_length1 = _tmp25__length1;
	}
	result = _tmp25_;
	_g_match_info_unref0 (match_info);
	_g_free0 (line);
	_g_regex_unref0 (regex);
	_g_object_unref0 (dis);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (file);
	return result;
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static GamesSteamRegistryValue*
games_steam_registry_parse_tokens (GamesSteamRegistry* self,
                                   GamesSteamRegistryNode* parent,
                                   gchar** tokens,
                                   gint tokens_length1,
                                   gsize* index,
                                   GError** error)
{
	GamesSteamRegistryValue* to_return = NULL;
	GError* _inner_error0_ = NULL;
	GamesSteamRegistryValue* result;
	g_return_val_if_fail (self != NULL, NULL);
	to_return = NULL;
	while (TRUE) {
		const gchar* _tmp0_;
		const gchar* _tmp2_;
		gchar* tag = NULL;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gsize _tmp8_;
		const gchar* _tmp10_;
		const gchar* _tmp12_;
		if (!((*index) < ((gsize) tokens_length1))) {
			break;
		}
		_tmp0_ = tokens[*index];
		if (g_strcmp0 (_tmp0_, "{") == 0) {
			GError* _tmp1_;
			_tmp1_ = g_error_new_literal (GAMES_STEAM_REGISTRY_ERROR, GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN, "Unexpected token '{'.");
			_inner_error0_ = _tmp1_;
			if (_inner_error0_->domain == GAMES_STEAM_REGISTRY_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_object_unref0 (to_return);
				return NULL;
			} else {
				_g_object_unref0 (to_return);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
		}
		_tmp2_ = tokens[*index];
		if (g_strcmp0 (_tmp2_, "}") == 0) {
			gsize _tmp3_;
			_tmp3_ = *index;
			*index = _tmp3_ + 1;
			break;
		}
		_tmp4_ = tokens[*index];
		_tmp5_ = g_strdup (_tmp4_);
		tag = _tmp5_;
		_tmp6_ = tag;
		_tmp7_ = string_slice (_tmp6_, (glong) 1, (glong) -1);
		_g_free0 (tag);
		tag = _tmp7_;
		_tmp8_ = *index;
		*index = _tmp8_ + 1;
		if ((*index) >= ((gsize) tokens_length1)) {
			GError* _tmp9_;
			_tmp9_ = g_error_new_literal (GAMES_STEAM_REGISTRY_ERROR, GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_END, "Unexpected end of tokens.");
			_inner_error0_ = _tmp9_;
			if (_inner_error0_->domain == GAMES_STEAM_REGISTRY_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				return NULL;
			} else {
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
		}
		_tmp10_ = tokens[*index];
		if (g_strcmp0 (_tmp10_, "}") == 0) {
			GError* _tmp11_;
			_tmp11_ = g_error_new_literal (GAMES_STEAM_REGISTRY_ERROR, GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN, "Unexpected token '}'.");
			_inner_error0_ = _tmp11_;
			if (_inner_error0_->domain == GAMES_STEAM_REGISTRY_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				return NULL;
			} else {
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
		}
		_tmp12_ = tokens[*index];
		if (g_strcmp0 (_tmp12_, "{") == 0) {
			gsize _tmp13_;
			GamesSteamRegistryNode* node = NULL;
			const gchar* _tmp14_;
			GamesSteamRegistryNode* _tmp15_;
			GamesSteamRegistryNode* _tmp16_;
			GamesSteamRegistryValue* _tmp17_;
			GamesSteamRegistryValue* _tmp18_;
			GamesSteamRegistryNode* _tmp20_;
			GamesSteamRegistryValue* _tmp21_;
			_tmp13_ = *index;
			*index = _tmp13_ + 1;
			_tmp14_ = tag;
			_tmp15_ = games_steam_registry_node_new (_tmp14_);
			node = _tmp15_;
			_tmp16_ = node;
			_tmp17_ = games_steam_registry_parse_tokens (self, _tmp16_, tokens, (gint) tokens_length1, index, &_inner_error0_);
			_tmp18_ = _tmp17_;
			_g_object_unref0 (_tmp18_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == GAMES_STEAM_REGISTRY_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_g_object_unref0 (node);
					_g_free0 (tag);
					_g_object_unref0 (to_return);
					return NULL;
				} else {
					_g_object_unref0 (node);
					_g_free0 (tag);
					_g_object_unref0 (to_return);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			if (parent != NULL) {
				GamesSteamRegistryNode* _tmp19_;
				_tmp19_ = node;
				games_steam_registry_node_add_child (parent, (GamesSteamRegistryValue*) _tmp19_);
			}
			_tmp20_ = node;
			_tmp21_ = _g_object_ref0 ((GamesSteamRegistryValue*) _tmp20_);
			_g_object_unref0 (to_return);
			to_return = _tmp21_;
			_g_object_unref0 (node);
		} else {
			gchar* data = NULL;
			const gchar* _tmp22_;
			gchar* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			gsize _tmp26_;
			GamesSteamRegistryData* node = NULL;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			GamesSteamRegistryData* _tmp29_;
			GamesSteamRegistryData* _tmp31_;
			GamesSteamRegistryValue* _tmp32_;
			_tmp22_ = tokens[*index];
			_tmp23_ = g_strdup (_tmp22_);
			data = _tmp23_;
			_tmp24_ = data;
			_tmp25_ = string_slice (_tmp24_, (glong) 1, (glong) -1);
			_g_free0 (data);
			data = _tmp25_;
			_tmp26_ = *index;
			*index = _tmp26_ + 1;
			_tmp27_ = tag;
			_tmp28_ = data;
			_tmp29_ = games_steam_registry_data_new (_tmp27_, _tmp28_);
			node = _tmp29_;
			if (parent != NULL) {
				GamesSteamRegistryData* _tmp30_;
				_tmp30_ = node;
				games_steam_registry_node_add_child (parent, (GamesSteamRegistryValue*) _tmp30_);
			}
			_tmp31_ = node;
			_tmp32_ = _g_object_ref0 ((GamesSteamRegistryValue*) _tmp31_);
			_g_object_unref0 (to_return);
			to_return = _tmp32_;
			_g_object_unref0 (node);
			_g_free0 (data);
		}
		_g_free0 (tag);
	}
	result = to_return;
	return result;
}

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

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

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

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

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

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

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

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

void
games_value_set_steam_registry (GValue* value,
                                gpointer v_object)
{
	GamesSteamRegistry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GAMES_TYPE_STEAM_REGISTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GAMES_TYPE_STEAM_REGISTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		games_steam_registry_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		games_steam_registry_unref (old);
	}
}

void
games_value_take_steam_registry (GValue* value,
                                 gpointer v_object)
{
	GamesSteamRegistry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GAMES_TYPE_STEAM_REGISTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GAMES_TYPE_STEAM_REGISTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		games_steam_registry_unref (old);
	}
}

static void
games_steam_registry_class_init (GamesSteamRegistryClass * klass,
                                 gpointer klass_data)
{
	games_steam_registry_parent_class = g_type_class_peek_parent (klass);
	((GamesSteamRegistryClass *) klass)->finalize = games_steam_registry_finalize;
	g_type_class_adjust_private_offset (klass, &GamesSteamRegistry_private_offset);
}

static void
games_steam_registry_instance_init (GamesSteamRegistry * self,
                                    gpointer klass)
{
	self->priv = games_steam_registry_get_instance_private (self);
	self->ref_count = 1;
}

static void
games_steam_registry_finalize (GamesSteamRegistry * obj)
{
	GamesSteamRegistry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistry);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->tree);
}

GType
games_steam_registry_get_type (void)
{
	return games_steam_registry_type_id;
}

GType
games_steam_registry_register_type (GTypeModule * module)
{
	static const GTypeValueTable g_define_type_value_table = { games_value_steam_registry_init, games_value_steam_registry_free_value, games_value_steam_registry_copy_value, games_value_steam_registry_peek_pointer, "p", games_value_steam_registry_collect_value, "p", games_value_steam_registry_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistry), 0, (GInstanceInitFunc) games_steam_registry_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	games_steam_registry_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GamesSteamRegistry", &g_define_type_info, &g_define_type_fundamental_info, 0);
	GamesSteamRegistry_private_offset = sizeof (GamesSteamRegistryPrivate);
	return games_steam_registry_type_id;
}

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

void
games_steam_registry_unref (gpointer instance)
{
	GamesSteamRegistry * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GAMES_STEAM_REGISTRY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
games_steam_registry_value_get_instance_private (GamesSteamRegistryValue* self)
{
	return G_STRUCT_MEMBER_P (self, GamesSteamRegistryValue_private_offset);
}

GamesSteamRegistryValue*
games_steam_registry_value_construct (GType object_type)
{
	GamesSteamRegistryValue * self = NULL;
	self = (GamesSteamRegistryValue*) g_object_new (object_type, NULL);
	return self;
}

const gchar*
games_steam_registry_value_get_tag (GamesSteamRegistryValue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tag;
	result = _tmp0_;
	return result;
}

static void
games_steam_registry_value_set_tag (GamesSteamRegistryValue* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_steam_registry_value_get_tag (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tag);
		self->priv->_tag = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_steam_registry_value_properties[GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY]);
	}
}

static void
games_steam_registry_value_class_init (GamesSteamRegistryValueClass * klass,
                                       gpointer klass_data)
{
	games_steam_registry_value_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesSteamRegistryValue_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_steam_registry_value_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_steam_registry_value_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_steam_registry_value_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY, games_steam_registry_value_properties[GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY] = g_param_spec_string ("tag", "tag", "tag", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
games_steam_registry_value_instance_init (GamesSteamRegistryValue * self,
                                          gpointer klass)
{
	self->priv = games_steam_registry_value_get_instance_private (self);
}

static void
games_steam_registry_value_finalize (GObject * obj)
{
	GamesSteamRegistryValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue);
	_g_free0 (self->priv->_tag);
	G_OBJECT_CLASS (games_steam_registry_value_parent_class)->finalize (obj);
}

GType
games_steam_registry_value_get_type (void)
{
	return games_steam_registry_value_type_id;
}

GType
games_steam_registry_value_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistryValue), 0, (GInstanceInitFunc) games_steam_registry_value_instance_init, NULL };
	games_steam_registry_value_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "GamesSteamRegistryValue", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	GamesSteamRegistryValue_private_offset = sizeof (GamesSteamRegistryValuePrivate);
	return games_steam_registry_value_type_id;
}

static void
_vala_games_steam_registry_value_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	GamesSteamRegistryValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY:
		g_value_set_string (value, games_steam_registry_value_get_tag (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_steam_registry_value_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	GamesSteamRegistryValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY:
		games_steam_registry_value_set_tag (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
games_steam_registry_node_get_instance_private (GamesSteamRegistryNode* self)
{
	return G_STRUCT_MEMBER_P (self, GamesSteamRegistryNode_private_offset);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

GamesSteamRegistryNode*
games_steam_registry_node_construct (GType object_type,
                                     const gchar* tag)
{
	GamesSteamRegistryNode * self = NULL;
	g_return_val_if_fail (tag != NULL, NULL);
	self = (GamesSteamRegistryNode*) g_object_new (object_type, "tag", tag, NULL);
	return self;
}

GamesSteamRegistryNode*
games_steam_registry_node_new (const gchar* tag)
{
	return games_steam_registry_node_construct (GAMES_TYPE_STEAM_REGISTRY_NODE, tag);
}

void
games_steam_registry_node_add_child (GamesSteamRegistryNode* self,
                                     GamesSteamRegistryValue* child)
{
	GamesSteamRegistryValue* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (child != NULL);
	_tmp0_ = _g_object_ref0 (child);
	self->priv->children = g_list_append (self->priv->children, _tmp0_);
}

GamesSteamRegistryValue*
games_steam_registry_node_get_child (GamesSteamRegistryNode* self,
                                     const gchar* tag)
{
	GList* _tmp0_;
	GamesSteamRegistryValue* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (tag != NULL, NULL);
	_tmp0_ = self->priv->children;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp0_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GamesSteamRegistryValue* _tmp1_;
			GamesSteamRegistryValue* child = NULL;
			_tmp1_ = _g_object_ref0 ((GamesSteamRegistryValue*) child_it->data);
			child = _tmp1_;
			{
				GamesSteamRegistryValue* _tmp2_;
				const gchar* _tmp3_;
				const gchar* _tmp4_;
				_tmp2_ = child;
				_tmp3_ = games_steam_registry_value_get_tag (_tmp2_);
				_tmp4_ = _tmp3_;
				if (g_strcmp0 (_tmp4_, tag) == 0) {
					result = child;
					return result;
				}
				_g_object_unref0 (child);
			}
		}
	}
	result = NULL;
	return result;
}

static void
_vala_array_add5 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

gchar**
games_steam_registry_node_get_children (GamesSteamRegistryNode* self,
                                        gint* result_length1)
{
	gchar** children_tags = NULL;
	gchar** _tmp0_;
	gint children_tags_length1;
	gint _children_tags_size_;
	GList* _tmp1_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	children_tags = _tmp0_;
	children_tags_length1 = 0;
	_children_tags_size_ = children_tags_length1;
	_tmp1_ = self->priv->children;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp1_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GamesSteamRegistryValue* _tmp2_;
			GamesSteamRegistryValue* child = NULL;
			_tmp2_ = _g_object_ref0 ((GamesSteamRegistryValue*) child_it->data);
			child = _tmp2_;
			{
				GamesSteamRegistryValue* _tmp3_;
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				gchar* _tmp6_;
				_tmp3_ = child;
				_tmp4_ = games_steam_registry_value_get_tag (_tmp3_);
				_tmp5_ = _tmp4_;
				_tmp6_ = g_strdup (_tmp5_);
				_vala_array_add5 (&children_tags, &children_tags_length1, &_children_tags_size_, _tmp6_);
				_g_object_unref0 (child);
			}
		}
	}
	_tmp7_ = children_tags;
	_tmp7__length1 = children_tags_length1;
	if (result_length1) {
		*result_length1 = _tmp7__length1;
	}
	result = _tmp7_;
	return result;
}

static void
games_steam_registry_node_class_init (GamesSteamRegistryNodeClass * klass,
                                      gpointer klass_data)
{
	games_steam_registry_node_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesSteamRegistryNode_private_offset);
	G_OBJECT_CLASS (klass)->finalize = games_steam_registry_node_finalize;
}

static void
games_steam_registry_node_instance_init (GamesSteamRegistryNode * self,
                                         gpointer klass)
{
	self->priv = games_steam_registry_node_get_instance_private (self);
}

static void
games_steam_registry_node_finalize (GObject * obj)
{
	GamesSteamRegistryNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNode);
	(self->priv->children == NULL) ? NULL : (self->priv->children = (_g_list_free__g_object_unref0_ (self->priv->children), NULL));
	G_OBJECT_CLASS (games_steam_registry_node_parent_class)->finalize (obj);
}

GType
games_steam_registry_node_get_type (void)
{
	return games_steam_registry_node_type_id;
}

GType
games_steam_registry_node_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistryNode), 0, (GInstanceInitFunc) games_steam_registry_node_instance_init, NULL };
	games_steam_registry_node_type_id = g_type_module_register_type (module, GAMES_TYPE_STEAM_REGISTRY_VALUE, "GamesSteamRegistryNode", &g_define_type_info, 0);
	GamesSteamRegistryNode_private_offset = sizeof (GamesSteamRegistryNodePrivate);
	return games_steam_registry_node_type_id;
}

static inline gpointer
games_steam_registry_data_get_instance_private (GamesSteamRegistryData* self)
{
	return G_STRUCT_MEMBER_P (self, GamesSteamRegistryData_private_offset);
}

GamesSteamRegistryData*
games_steam_registry_data_construct (GType object_type,
                                     const gchar* tag,
                                     const gchar* data)
{
	GamesSteamRegistryData * self = NULL;
	g_return_val_if_fail (tag != NULL, NULL);
	g_return_val_if_fail (data != NULL, NULL);
	self = (GamesSteamRegistryData*) g_object_new (object_type, "tag", tag, "data", data, NULL);
	return self;
}

GamesSteamRegistryData*
games_steam_registry_data_new (const gchar* tag,
                               const gchar* data)
{
	return games_steam_registry_data_construct (GAMES_TYPE_STEAM_REGISTRY_DATA, tag, data);
}

const gchar*
games_steam_registry_data_get_data (GamesSteamRegistryData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data;
	result = _tmp0_;
	return result;
}

static void
games_steam_registry_data_set_data (GamesSteamRegistryData* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_steam_registry_data_get_data (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_data);
		self->priv->_data = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_steam_registry_data_properties[GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY]);
	}
}

static void
games_steam_registry_data_class_init (GamesSteamRegistryDataClass * klass,
                                      gpointer klass_data)
{
	games_steam_registry_data_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesSteamRegistryData_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_steam_registry_data_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_steam_registry_data_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_steam_registry_data_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY, games_steam_registry_data_properties[GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY] = g_param_spec_string ("data", "data", "data", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
games_steam_registry_data_instance_init (GamesSteamRegistryData * self,
                                         gpointer klass)
{
	self->priv = games_steam_registry_data_get_instance_private (self);
}

static void
games_steam_registry_data_finalize (GObject * obj)
{
	GamesSteamRegistryData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData);
	_g_free0 (self->priv->_data);
	G_OBJECT_CLASS (games_steam_registry_data_parent_class)->finalize (obj);
}

GType
games_steam_registry_data_get_type (void)
{
	return games_steam_registry_data_type_id;
}

GType
games_steam_registry_data_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistryData), 0, (GInstanceInitFunc) games_steam_registry_data_instance_init, NULL };
	games_steam_registry_data_type_id = g_type_module_register_type (module, GAMES_TYPE_STEAM_REGISTRY_VALUE, "GamesSteamRegistryData", &g_define_type_info, 0);
	GamesSteamRegistryData_private_offset = sizeof (GamesSteamRegistryDataPrivate);
	return games_steam_registry_data_type_id;
}

static void
_vala_games_steam_registry_data_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	GamesSteamRegistryData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY:
		g_value_set_string (value, games_steam_registry_data_get_data (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_steam_registry_data_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	GamesSteamRegistryData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY:
		games_steam_registry_data_set_data (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

GQuark
games_steam_registry_error_quark (void)
{
	return g_quark_from_static_string ("games-steam-registry-error-quark");
}

static GType
games_steam_registry_error_get_type_once (void)
{
	static const GEnumValue values[] = {{GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN, "GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN", "unexpected-token"}, {GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_END, "GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_END", "unexpected-end"}, {0, NULL, NULL}};
	GType games_steam_registry_error_type_id;
	games_steam_registry_error_type_id = g_enum_register_static ("GamesSteamRegistryError", values);
	return games_steam_registry_error_type_id;
}

GType
games_steam_registry_error_get_type (void)
{
	static volatile gsize games_steam_registry_error_type_id__once = 0;
	if (g_once_init_enter (&games_steam_registry_error_type_id__once)) {
		GType games_steam_registry_error_type_id;
		games_steam_registry_error_type_id = games_steam_registry_error_get_type_once ();
		g_once_init_leave (&games_steam_registry_error_type_id__once, games_steam_registry_error_type_id);
	}
	return games_steam_registry_error_type_id__once;
}

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

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

