/* steam-profile.c generated by valac 0.56.19, the Vala compiler
 * generated from steam-profile.vala, do not modify */

#include "protonplus_core.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
#include <gee.h>
#include <errno.h>
#include <math.h>
#include <float.h>

#define PROTON_PLUS_MODELS_STEAM_PROFILE_steamid64ident 76561197960265728LL
#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

enum  {
	PROTON_PLUS_MODELS_STEAM_PROFILE_0_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_LAUNCHER_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_USERDATA_PATH_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_LOCALCONFIG_PATH_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_SHORTCUTS_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_STEAM_ID_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_ACCOUNT_ID_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_USERNAME_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_IMAGE_PATH_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_DEFAULT_COMPATIBILITY_TOOL_PROPERTY,
	PROTON_PLUS_MODELS_STEAM_PROFILE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _proton_plus_utils_vdf_binary_unref0(var) ((var == NULL) ? NULL : (var = (proton_plus_utils_vdf_binary_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ProtonPlusModelsSteamProfileLoadExtraDataData ProtonPlusModelsSteamProfileLoadExtraDataData;
typedef struct _ProtonPlusModelsSteamProfileLoadLaunchOptionsData ProtonPlusModelsSteamProfileLoadLaunchOptionsData;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _ProtonPlusModelsSteamProfileLoadNonSteamGamesData ProtonPlusModelsSteamProfileLoadNonSteamGamesData;
#define _g_dir_close0(var) ((var == NULL) ? NULL : (var = (g_dir_close (var), NULL)))

struct _ProtonPlusModelsSteamProfilePrivate {
	ProtonPlusModelsLaunchersSteam* _launcher;
	gchar* _userdata_path;
	gchar* _localconfig_path;
	ProtonPlusUtilsVDFShortcuts* _shortcuts;
	gchar* _steam_id;
	gchar* _account_id;
	gchar* _username;
	gchar* _image_path;
	gchar* _default_compatibility_tool;
};

struct _ProtonPlusModelsSteamProfileLoadExtraDataData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusModelsSteamProfile* self;
	gboolean result;
	gboolean launch_options_loaded;
	gboolean non_steam_games_loaded;
	ProtonPlusServicesSteamConfigurationService* configuration;
	ProtonPlusServicesSteamConfigurationService* _tmp0_;
	ProtonPlusServicesSteamConfigurationService* _tmp1_;
	ProtonPlusServicesSteamConfigurationService* _tmp2_;
	ProtonPlusServicesSteamConfigurationService* _tmp3_;
	ProtonPlusServicesSteamConfigurationService* _tmp4_;
};

struct _ProtonPlusModelsSteamProfileLoadLaunchOptionsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusModelsSteamProfile* self;
	gboolean result;
	GHashTable* _tmp0_;
	gchar* content;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	ProtonPlusUtilsVDFVdfDocument* document;
	const gchar* _tmp3_;
	ProtonPlusUtilsVDFVdfDocument* _tmp4_;
	ProtonPlusUtilsVDFVdfDocument* _tmp5_;
	ProtonPlusUtilsVDFVdfEntry* config_store;
	ProtonPlusUtilsVDFVdfDocument* _tmp6_;
	ProtonPlusUtilsVDFVdfEntry* _tmp7_;
	ProtonPlusUtilsVDFVdfEntry* _tmp8_;
	ProtonPlusUtilsVDFVdfEntry* _tmp9_;
	ProtonPlusUtilsVDFVdfEntry* _tmp10_;
	ProtonPlusUtilsVDFVdfEntry* _tmp11_;
	ProtonPlusUtilsVDFVdfEntry* _tmp12_;
	ProtonPlusUtilsVDFVdfEntry* _tmp13_;
	ProtonPlusUtilsVDFVdfEntry* software;
	ProtonPlusUtilsVDFVdfEntry* _tmp14_;
	ProtonPlusUtilsVDFVdfEntry* _tmp15_;
	ProtonPlusUtilsVDFVdfEntry* _tmp16_;
	ProtonPlusUtilsVDFVdfEntry* _tmp17_;
	ProtonPlusUtilsVDFVdfEntry* _tmp18_;
	ProtonPlusUtilsVDFVdfEntry* valve;
	ProtonPlusUtilsVDFVdfEntry* _tmp19_;
	ProtonPlusUtilsVDFVdfEntry* _tmp20_;
	ProtonPlusUtilsVDFVdfEntry* _tmp21_;
	ProtonPlusUtilsVDFVdfEntry* _tmp22_;
	ProtonPlusUtilsVDFVdfEntry* _tmp23_;
	ProtonPlusUtilsVDFVdfEntry* steam;
	ProtonPlusUtilsVDFVdfEntry* _tmp24_;
	ProtonPlusUtilsVDFVdfEntry* _tmp25_;
	ProtonPlusUtilsVDFVdfEntry* _tmp26_;
	ProtonPlusUtilsVDFVdfEntry* _tmp27_;
	ProtonPlusUtilsVDFVdfEntry* _tmp28_;
	ProtonPlusUtilsVDFVdfEntry* apps;
	ProtonPlusUtilsVDFVdfEntry* _tmp29_;
	ProtonPlusUtilsVDFVdfEntry* _tmp30_;
	GeeArrayList* _app_list;
	ProtonPlusUtilsVDFVdfEntry* _tmp31_;
	GeeArrayList* _tmp32_;
	GeeArrayList* _tmp33_;
	gint _app_size;
	GeeArrayList* _tmp34_;
	gint _tmp35_;
	gint _tmp36_;
	gint _app_index;
	gint _tmp37_;
	gint _tmp38_;
	ProtonPlusUtilsVDFVdfEntry* app;
	GeeArrayList* _tmp39_;
	gpointer _tmp40_;
	guint appid;
	ProtonPlusUtilsVDFVdfEntry* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	guint _tmp44_;
	gboolean _tmp45_;
	ProtonPlusUtilsVDFVdfEntry* launch_options;
	ProtonPlusUtilsVDFVdfEntry* _tmp46_;
	ProtonPlusUtilsVDFVdfEntry* _tmp47_;
	gboolean _tmp48_;
	ProtonPlusUtilsVDFVdfEntry* _tmp49_;
	ProtonPlusUtilsVDFVdfEntry* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	GHashTable* _tmp53_;
	ProtonPlusUtilsVDFVdfEntry* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	gchar* _tmp57_;
	ProtonPlusModelsLaunchersSteam* _tmp58_;
	GList* _tmp59_;
	GList* game_collection;
	GList* game_it;
	ProtonPlusModelsGamesSteam* _tmp60_;
	ProtonPlusModelsGamesSteam* game;
	gchar* _vala1_launch_options;
	GHashTable* _tmp61_;
	ProtonPlusModelsGamesSteam* _tmp62_;
	guint _tmp63_;
	guint _tmp64_;
	gconstpointer _tmp65_;
	gchar* _tmp66_;
	const gchar* _tmp67_;
	gchar* _tmp68_;
	GHashTable* _tmp69_;
	ProtonPlusModelsGamesSteam* _tmp70_;
	guint _tmp71_;
	guint _tmp72_;
	const gchar* _tmp73_;
	gchar* _tmp74_;
	ProtonPlusServicesSteamConfigurationService* configuration;
	ProtonPlusServicesSteamConfigurationService* _tmp75_;
	ProtonPlusServicesSteamConfigurationService* _tmp76_;
	ProtonPlusServicesSteamConfigurationService* _tmp77_;
	ProtonPlusServicesSteamConfigurationService* _tmp78_;
	ProtonPlusServicesSteamConfigurationService* _tmp79_;
};

struct _ProtonPlusModelsSteamProfileLoadNonSteamGamesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusModelsSteamProfile* self;
	gboolean result;
	ProtonPlusUtilsVDFShortcuts* shortcuts;
	ProtonPlusUtilsVDFShortcuts* _tmp0_;
	ProtonPlusUtilsVDFShortcuts* _tmp1_;
	ProtonPlusUtilsVDFShortcuts* _tmp2_;
	GeeIterator* _entry_it;
	ProtonPlusUtilsVDFShortcuts* _tmp3_;
	GeeTreeMap* _tmp4_;
	GeeTreeMap* _tmp5_;
	GeeSet* _tmp6_;
	GeeSet* _tmp7_;
	GeeSet* _tmp8_;
	GeeIterator* _tmp9_;
	GeeIterator* _tmp10_;
	GeeIterator* _tmp11_;
	GeeMapEntry* entry;
	GeeIterator* _tmp12_;
	gpointer _tmp13_;
	GeeMapEntry* _tmp14_;
	gconstpointer _tmp15_;
	gconstpointer _tmp16_;
	GVariant* appid_value;
	GeeMapEntry* _tmp17_;
	gconstpointer _tmp18_;
	gconstpointer _tmp19_;
	const GVariantType* _tmp20_;
	GVariant* _tmp21_;
	GVariant* name_value;
	GeeMapEntry* _tmp22_;
	gconstpointer _tmp23_;
	gconstpointer _tmp24_;
	const GVariantType* _tmp25_;
	GVariant* _tmp26_;
	GVariant* launch_options_value;
	GeeMapEntry* _tmp27_;
	gconstpointer _tmp28_;
	gconstpointer _tmp29_;
	const GVariantType* _tmp30_;
	GVariant* _tmp31_;
	gboolean _tmp32_;
	gboolean _tmp33_;
	GVariant* _tmp34_;
	GVariant* _tmp35_;
	GVariant* _tmp36_;
	guint appid;
	GVariant* _tmp37_;
	gchar* name;
	GVariant* _tmp38_;
	const gchar* _tmp39_;
	gchar* _tmp40_;
	const gchar* _tmp41_;
	gchar* launch_options;
	GVariant* _tmp42_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* compatibility_tool;
	ProtonPlusModelsLaunchersSteam* _tmp45_;
	GHashTable* _tmp46_;
	gconstpointer _tmp47_;
	gchar* _tmp48_;
	const gchar* _tmp49_;
	gchar* _tmp50_;
	ProtonPlusModelsGamesSteam* game;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	ProtonPlusModelsLaunchersSteam* _tmp54_;
	ProtonPlusModelsGamesSteam* _tmp55_;
	ProtonPlusModelsGamesSteam* _tmp56_;
	ProtonPlusModelsGamesSteam* _tmp57_;
};

static gint ProtonPlusModelsSteamProfile_private_offset;
static gpointer proton_plus_models_steam_profile_parent_class = NULL;

static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void _g_free0_ (gpointer var);
static gchar* proton_plus_models_steam_profile_steam_id_to_account_id (const gchar* steam_id);
static void proton_plus_models_steam_profile_load_extra_data_data_free (gpointer _data);
static gboolean proton_plus_models_steam_profile_load_extra_data_co (ProtonPlusModelsSteamProfileLoadExtraDataData* _data_);
static void proton_plus_models_steam_profile_load_launch_options (ProtonPlusModelsSteamProfile* self,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
static gboolean proton_plus_models_steam_profile_load_launch_options_finish (ProtonPlusModelsSteamProfile* self,
                                                                      GAsyncResult* _res_);
static void proton_plus_models_steam_profile_load_extra_data_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_);
static void proton_plus_models_steam_profile_load_non_steam_games (ProtonPlusModelsSteamProfile* self,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static gboolean proton_plus_models_steam_profile_load_non_steam_games_finish (ProtonPlusModelsSteamProfile* self,
                                                                       GAsyncResult* _res_);
static void proton_plus_models_steam_profile_load_launch_options_data_free (gpointer _data);
static gboolean proton_plus_models_steam_profile_load_launch_options_co (ProtonPlusModelsSteamProfileLoadLaunchOptionsData* _data_);
static void proton_plus_models_steam_profile_load_non_steam_games_data_free (gpointer _data);
static gboolean proton_plus_models_steam_profile_load_non_steam_games_co (ProtonPlusModelsSteamProfileLoadNonSteamGamesData* _data_);
static gboolean proton_plus_models_steam_profile_is_shortcut_node_path (const gchar* path);
static GVariant* proton_plus_models_steam_profile_get_shortcut_field (ProtonPlusUtilsVDFNode* node,
                                                               const gchar* name,
                                                               const GVariantType* type);
static GHashTable* proton_plus_models_steam_profile_get_userdata_hashtable (ProtonPlusModelsLaunchersSteam* launcher);
static void proton_plus_models_steam_profile_finalize (GObject * obj);
static GType proton_plus_models_steam_profile_get_type_once (void);
static void _vala_proton_plus_models_steam_profile_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_proton_plus_models_steam_profile_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 gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_models_steam_profile_get_instance_private (ProtonPlusModelsSteamProfile* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsSteamProfile_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_);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

ProtonPlusModelsSteamProfile*
proton_plus_models_steam_profile_construct (GType object_type,
                                            ProtonPlusModelsLaunchersSteam* launcher,
                                            const gchar* username,
                                            const gchar* steam_id,
                                            const gchar* userdata_path)
{
	ProtonPlusModelsSteamProfile * self = NULL;
	GHashTable* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (launcher != NULL, NULL);
	g_return_val_if_fail (username != NULL, NULL);
	g_return_val_if_fail (steam_id != NULL, NULL);
	g_return_val_if_fail (userdata_path != NULL, NULL);
	self = (ProtonPlusModelsSteamProfile*) g_object_new (object_type, NULL);
	proton_plus_models_steam_profile_set_launcher (self, launcher);
	proton_plus_models_steam_profile_set_steam_id (self, steam_id);
	proton_plus_models_steam_profile_set_username (self, username);
	proton_plus_models_steam_profile_set_userdata_path (self, userdata_path);
	_tmp0_ = g_hash_table_new_full (NULL, NULL, NULL, _g_free0_);
	_g_hash_table_unref0 (self->launch_options_hashtable);
	self->launch_options_hashtable = _tmp0_;
	(self->non_steam_games == NULL) ? NULL : (self->non_steam_games = (_g_list_free__g_object_unref0_ (self->non_steam_games), NULL));
	self->non_steam_games = NULL;
	_tmp1_ = proton_plus_models_steam_profile_steam_id_to_account_id (steam_id);
	_tmp2_ = _tmp1_;
	proton_plus_models_steam_profile_set_account_id (self, _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = g_strdup_printf ("%s/config/localconfig.vdf", userdata_path);
	_tmp4_ = _tmp3_;
	proton_plus_models_steam_profile_set_localconfig_path (self, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = ((ProtonPlusModelsLauncher*) launcher)->directory;
	_tmp6_ = g_strdup_printf ("%s/config/avatarcache/%s.png", _tmp5_, steam_id);
	_tmp7_ = _tmp6_;
	proton_plus_models_steam_profile_set_image_path (self, _tmp7_);
	_g_free0 (_tmp7_);
	{
		gchar* shortcuts_file_path = NULL;
		gchar* _tmp8_;
		ProtonPlusUtilsVDFShortcuts* _tmp9_ = NULL;
		const gchar* _tmp10_;
		_tmp8_ = g_strdup_printf ("%s/config/shortcuts.vdf", userdata_path);
		shortcuts_file_path = _tmp8_;
		_tmp10_ = shortcuts_file_path;
		if (g_file_test (_tmp10_, G_FILE_TEST_IS_REGULAR)) {
			const gchar* _tmp11_;
			ProtonPlusUtilsVDFShortcuts* _tmp12_;
			_tmp11_ = shortcuts_file_path;
			_tmp12_ = proton_plus_utils_vdf_shortcuts_load (_tmp11_, &_inner_error0_);
			_proton_plus_utils_vdf_binary_unref0 (_tmp9_);
			_tmp9_ = _tmp12_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_proton_plus_utils_vdf_binary_unref0 (_tmp9_);
				_g_free0 (shortcuts_file_path);
				goto __catch0_g_error;
			}
		} else {
			const gchar* _tmp13_;
			ProtonPlusUtilsVDFShortcuts* _tmp14_;
			_tmp13_ = shortcuts_file_path;
			_tmp14_ = proton_plus_utils_vdf_shortcuts_empty (_tmp13_);
			_proton_plus_utils_vdf_binary_unref0 (_tmp9_);
			_tmp9_ = _tmp14_;
		}
		proton_plus_models_steam_profile_set_shortcuts (self, _tmp9_);
		_proton_plus_utils_vdf_binary_unref0 (_tmp9_);
		_g_free0 (shortcuts_file_path);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp15_;
		const gchar* _tmp16_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp15_ = e;
		_tmp16_ = _tmp15_->message;
		g_warning ("steam-profile.vala:37: %s", _tmp16_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
	return self;
}

ProtonPlusModelsSteamProfile*
proton_plus_models_steam_profile_new (ProtonPlusModelsLaunchersSteam* launcher,
                                      const gchar* username,
                                      const gchar* steam_id,
                                      const gchar* userdata_path)
{
	return proton_plus_models_steam_profile_construct (PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, launcher, username, steam_id, userdata_path);
}

static void
proton_plus_models_steam_profile_load_extra_data_data_free (gpointer _data)
{
	ProtonPlusModelsSteamProfileLoadExtraDataData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusModelsSteamProfileLoadExtraDataData, _data_);
}

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

void
proton_plus_models_steam_profile_load_extra_data (ProtonPlusModelsSteamProfile* self,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_)
{
	ProtonPlusModelsSteamProfileLoadExtraDataData* _data_;
	ProtonPlusModelsSteamProfile* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusModelsSteamProfileLoadExtraDataData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_models_steam_profile_load_extra_data_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_models_steam_profile_load_extra_data_co (_data_);
}

gboolean
proton_plus_models_steam_profile_load_extra_data_finish (ProtonPlusModelsSteamProfile* self,
                                                         GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusModelsSteamProfileLoadExtraDataData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_models_steam_profile_load_extra_data_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_)
{
	ProtonPlusModelsSteamProfileLoadExtraDataData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_models_steam_profile_load_extra_data_co (_data_);
}

static gboolean
proton_plus_models_steam_profile_load_extra_data_co (ProtonPlusModelsSteamProfileLoadExtraDataData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	proton_plus_models_steam_profile_load_launch_options (_data_->self, proton_plus_models_steam_profile_load_extra_data_ready, _data_);
	return FALSE;
	_state_1:
	_data_->launch_options_loaded = proton_plus_models_steam_profile_load_launch_options_finish (_data_->self, _data_->_res_);
	if (!_data_->launch_options_loaded) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 2;
	proton_plus_models_steam_profile_load_non_steam_games (_data_->self, proton_plus_models_steam_profile_load_extra_data_ready, _data_);
	return FALSE;
	_state_2:
	_data_->non_steam_games_loaded = proton_plus_models_steam_profile_load_non_steam_games_finish (_data_->self, _data_->_res_);
	if (!_data_->non_steam_games_loaded) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = proton_plus_services_steam_configuration_service_get_instance ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
	_data_->configuration = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->configuration;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = _data_->configuration;
		proton_plus_services_steam_configuration_service_overlay_profile_effective_state (_data_->_tmp4_, _data_->self);
	}
	_data_->result = TRUE;
	_g_object_unref0 (_data_->configuration);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_models_steam_profile_load_launch_options_data_free (gpointer _data)
{
	ProtonPlusModelsSteamProfileLoadLaunchOptionsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusModelsSteamProfileLoadLaunchOptionsData, _data_);
}

static void
proton_plus_models_steam_profile_load_launch_options (ProtonPlusModelsSteamProfile* self,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	ProtonPlusModelsSteamProfileLoadLaunchOptionsData* _data_;
	ProtonPlusModelsSteamProfile* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusModelsSteamProfileLoadLaunchOptionsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_models_steam_profile_load_launch_options_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_models_steam_profile_load_launch_options_co (_data_);
}

static gboolean
proton_plus_models_steam_profile_load_launch_options_finish (ProtonPlusModelsSteamProfile* self,
                                                             GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusModelsSteamProfileLoadLaunchOptionsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static gboolean
uint_try_parse (const gchar* str,
                guint* _result_,
                const gchar** unparsed,
                guint _base)
{
	guint _vala__result_ = 0U;
	const gchar* _vala_unparsed = NULL;
	gchar* endptr = NULL;
	gulong ulong_result = 0UL;
	gchar* _tmp0_ = NULL;
	gulong _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gulong _tmp6_;
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	errno = 0;
	_tmp1_ = strtoul (str, &_tmp0_, (gint) _base);
	endptr = _tmp0_;
	ulong_result = _tmp1_;
	_tmp2_ = endptr;
	_tmp3_ = strlen (str);
	_tmp4_ = _tmp3_;
	if (_tmp2_ == (((gchar*) str) + _tmp4_)) {
		_vala_unparsed = "";
	} else {
		gchar* _tmp5_;
		_tmp5_ = endptr;
		_vala_unparsed = (const gchar*) _tmp5_;
	}
	_tmp6_ = ulong_result;
	if ((((gulong) 0) <= _tmp6_) && (_tmp6_ <= ((gulong) G_MAXUINT))) {
		gboolean _tmp7_ = FALSE;
		gboolean _tmp8_ = FALSE;
		_vala__result_ = (guint) ulong_result;
		if (errno != ERANGE) {
			_tmp8_ = errno != EINVAL;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			const gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp9_ = _vala_unparsed;
			_tmp10_ = endptr;
			_tmp7_ = _tmp9_ != _tmp10_;
		} else {
			_tmp7_ = FALSE;
		}
		result = _tmp7_;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	} else {
		_vala__result_ = G_MAXUINT;
		result = FALSE;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	}
}

static gboolean
proton_plus_models_steam_profile_load_launch_options_co (ProtonPlusModelsSteamProfileLoadLaunchOptionsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_hash_table_new_full (NULL, NULL, NULL, _g_free0_);
	_g_hash_table_unref0 (_data_->self->launch_options_hashtable);
	_data_->self->launch_options_hashtable = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_localconfig_path;
	_data_->_tmp2_ = proton_plus_utils_filesystem_get_file_content (_data_->_tmp1_, FALSE);
	_data_->content = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->content;
	_data_->_tmp4_ = proton_plus_utils_vdf_vdf_parser_parse_document (_data_->_tmp3_);
	_data_->document = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->document;
	if (_data_->_tmp5_ == NULL) {
		_data_->result = FALSE;
		_g_object_unref0 (_data_->document);
		_g_free0 (_data_->content);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->document;
	_data_->_tmp7_ = proton_plus_utils_vdf_vdf_document_get_root (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = proton_plus_utils_vdf_vdf_entry_get_child (_data_->_tmp8_, "UserLocalConfigStore");
	_data_->config_store = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->config_store;
	if (_data_->_tmp11_ != NULL) {
		_data_->_tmp12_ = _data_->config_store;
		_data_->_tmp13_ = proton_plus_utils_vdf_vdf_entry_get_child (_data_->_tmp12_, "Software");
		_g_object_unref0 (_data_->_tmp10_);
		_data_->_tmp10_ = _data_->_tmp13_;
	} else {
		_g_object_unref0 (_data_->_tmp10_);
		_data_->_tmp10_ = NULL;
	}
	_data_->_tmp14_ = _data_->_tmp10_;
	_data_->_tmp10_ = NULL;
	_data_->software = _data_->_tmp14_;
	_data_->_tmp16_ = _data_->software;
	if (_data_->_tmp16_ != NULL) {
		_data_->_tmp17_ = _data_->software;
		_data_->_tmp18_ = proton_plus_utils_vdf_vdf_entry_get_child (_data_->_tmp17_, "Valve");
		_g_object_unref0 (_data_->_tmp15_);
		_data_->_tmp15_ = _data_->_tmp18_;
	} else {
		_g_object_unref0 (_data_->_tmp15_);
		_data_->_tmp15_ = NULL;
	}
	_data_->_tmp19_ = _data_->_tmp15_;
	_data_->_tmp15_ = NULL;
	_data_->valve = _data_->_tmp19_;
	_data_->_tmp21_ = _data_->valve;
	if (_data_->_tmp21_ != NULL) {
		_data_->_tmp22_ = _data_->valve;
		_data_->_tmp23_ = proton_plus_utils_vdf_vdf_entry_get_child (_data_->_tmp22_, "Steam");
		_g_object_unref0 (_data_->_tmp20_);
		_data_->_tmp20_ = _data_->_tmp23_;
	} else {
		_g_object_unref0 (_data_->_tmp20_);
		_data_->_tmp20_ = NULL;
	}
	_data_->_tmp24_ = _data_->_tmp20_;
	_data_->_tmp20_ = NULL;
	_data_->steam = _data_->_tmp24_;
	_data_->_tmp26_ = _data_->steam;
	if (_data_->_tmp26_ != NULL) {
		_data_->_tmp27_ = _data_->steam;
		_data_->_tmp28_ = proton_plus_utils_vdf_vdf_entry_get_child (_data_->_tmp27_, "apps");
		_g_object_unref0 (_data_->_tmp25_);
		_data_->_tmp25_ = _data_->_tmp28_;
	} else {
		_g_object_unref0 (_data_->_tmp25_);
		_data_->_tmp25_ = NULL;
	}
	_data_->_tmp29_ = _data_->_tmp25_;
	_data_->_tmp25_ = NULL;
	_data_->apps = _data_->_tmp29_;
	_data_->_tmp30_ = _data_->apps;
	if (_data_->_tmp30_ == NULL) {
		_data_->result = FALSE;
		_g_object_unref0 (_data_->apps);
		_g_object_unref0 (_data_->_tmp25_);
		_g_object_unref0 (_data_->steam);
		_g_object_unref0 (_data_->_tmp20_);
		_g_object_unref0 (_data_->valve);
		_g_object_unref0 (_data_->_tmp15_);
		_g_object_unref0 (_data_->software);
		_g_object_unref0 (_data_->_tmp10_);
		_g_object_unref0 (_data_->config_store);
		_g_object_unref0 (_data_->document);
		_g_free0 (_data_->content);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp31_ = _data_->apps;
		_data_->_tmp32_ = proton_plus_utils_vdf_vdf_entry_get_children (_data_->_tmp31_);
		_data_->_tmp33_ = _data_->_tmp32_;
		_data_->_app_list = _data_->_tmp33_;
		_data_->_tmp34_ = _data_->_app_list;
		_data_->_tmp35_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp34_);
		_data_->_tmp36_ = _data_->_tmp35_;
		_data_->_app_size = _data_->_tmp36_;
		_data_->_app_index = -1;
		while (TRUE) {
			_data_->_app_index = _data_->_app_index + 1;
			_data_->_tmp37_ = _data_->_app_index;
			_data_->_tmp38_ = _data_->_app_size;
			if (!(_data_->_tmp37_ < _data_->_tmp38_)) {
				break;
			}
			_data_->_tmp39_ = _data_->_app_list;
			_data_->_tmp40_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp39_, _data_->_app_index);
			_data_->app = (ProtonPlusUtilsVDFVdfEntry*) _data_->_tmp40_;
			_data_->_tmp41_ = _data_->app;
			_data_->_tmp42_ = proton_plus_utils_vdf_vdf_entry_get_key (_data_->_tmp41_);
			_data_->_tmp43_ = _data_->_tmp42_;
			_data_->_tmp44_ = 0U;
			_data_->_tmp45_ = uint_try_parse (_data_->_tmp43_, &_data_->_tmp44_, NULL, (guint) 0);
			_data_->appid = _data_->_tmp44_;
			if (!_data_->_tmp45_) {
				_g_object_unref0 (_data_->app);
				continue;
			}
			_data_->_tmp46_ = _data_->app;
			_data_->_tmp47_ = proton_plus_utils_vdf_vdf_entry_get_child (_data_->_tmp46_, "LaunchOptions");
			_data_->launch_options = _data_->_tmp47_;
			_data_->_tmp49_ = _data_->launch_options;
			if (_data_->_tmp49_ == NULL) {
				_data_->_tmp48_ = TRUE;
			} else {
				_data_->_tmp50_ = _data_->launch_options;
				_data_->_tmp51_ = proton_plus_utils_vdf_vdf_entry_get_value (_data_->_tmp50_);
				_data_->_tmp52_ = _data_->_tmp51_;
				_data_->_tmp48_ = _data_->_tmp52_ == NULL;
			}
			if (_data_->_tmp48_) {
				_g_object_unref0 (_data_->launch_options);
				_g_object_unref0 (_data_->app);
				continue;
			}
			_data_->_tmp53_ = _data_->self->launch_options_hashtable;
			_data_->_tmp54_ = _data_->launch_options;
			_data_->_tmp55_ = proton_plus_utils_vdf_vdf_entry_get_value (_data_->_tmp54_);
			_data_->_tmp56_ = _data_->_tmp55_;
			_data_->_tmp57_ = g_strdup (_data_->_tmp56_);
			g_hash_table_insert (_data_->_tmp53_, (gpointer) ((guintptr) _data_->appid), _data_->_tmp57_);
			_g_object_unref0 (_data_->launch_options);
			_g_object_unref0 (_data_->app);
		}
	}
	_data_->_tmp58_ = _data_->self->priv->_launcher;
	_data_->_tmp59_ = ((ProtonPlusModelsLauncher*) _data_->_tmp58_)->games;
	{
		_data_->game_collection = (GList*) _data_->_tmp59_;
		for (_data_->game_it = _data_->game_collection; _data_->game_it != NULL; _data_->game_it = _data_->game_it->next) {
			_data_->_tmp60_ = _g_object_ref0 ((ProtonPlusModelsGamesSteam*) _data_->game_it->data);
			_data_->game = _data_->_tmp60_;
			{
				_data_->_tmp61_ = _data_->self->launch_options_hashtable;
				_data_->_tmp62_ = _data_->game;
				_data_->_tmp63_ = proton_plus_models_games_steam_get_appid (_data_->_tmp62_);
				_data_->_tmp64_ = _data_->_tmp63_;
				_data_->_tmp65_ = g_hash_table_lookup (_data_->_tmp61_, (gpointer) ((guintptr) _data_->_tmp64_));
				_data_->_tmp66_ = g_strdup ((const gchar*) _data_->_tmp65_);
				_data_->_vala1_launch_options = _data_->_tmp66_;
				_data_->_tmp67_ = _data_->_vala1_launch_options;
				if (_data_->_tmp67_ == NULL) {
					_data_->_tmp68_ = g_strdup ("");
					_g_free0 (_data_->_vala1_launch_options);
					_data_->_vala1_launch_options = _data_->_tmp68_;
				}
				_data_->_tmp69_ = _data_->self->launch_options_hashtable;
				_data_->_tmp70_ = _data_->game;
				_data_->_tmp71_ = proton_plus_models_games_steam_get_appid (_data_->_tmp70_);
				_data_->_tmp72_ = _data_->_tmp71_;
				_data_->_tmp73_ = _data_->_vala1_launch_options;
				_data_->_tmp74_ = g_strdup (_data_->_tmp73_);
				g_hash_table_insert (_data_->_tmp69_, (gpointer) ((guintptr) _data_->_tmp72_), _data_->_tmp74_);
				_g_free0 (_data_->_vala1_launch_options);
				_g_object_unref0 (_data_->game);
			}
		}
	}
	_data_->_tmp75_ = proton_plus_services_steam_configuration_service_get_instance ();
	_data_->_tmp76_ = _data_->_tmp75_;
	_data_->_tmp77_ = _g_object_ref0 (_data_->_tmp76_);
	_data_->configuration = _data_->_tmp77_;
	_data_->_tmp78_ = _data_->configuration;
	if (_data_->_tmp78_ != NULL) {
		_data_->_tmp79_ = _data_->configuration;
		proton_plus_services_steam_configuration_service_overlay_profile_effective_state (_data_->_tmp79_, _data_->self);
	}
	_data_->result = TRUE;
	_g_object_unref0 (_data_->configuration);
	_g_object_unref0 (_data_->apps);
	_g_object_unref0 (_data_->_tmp25_);
	_g_object_unref0 (_data_->steam);
	_g_object_unref0 (_data_->_tmp20_);
	_g_object_unref0 (_data_->valve);
	_g_object_unref0 (_data_->_tmp15_);
	_g_object_unref0 (_data_->software);
	_g_object_unref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->config_store);
	_g_object_unref0 (_data_->document);
	_g_free0 (_data_->content);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_models_steam_profile_load_non_steam_games_data_free (gpointer _data)
{
	ProtonPlusModelsSteamProfileLoadNonSteamGamesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusModelsSteamProfileLoadNonSteamGamesData, _data_);
}

static void
proton_plus_models_steam_profile_load_non_steam_games (ProtonPlusModelsSteamProfile* self,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	ProtonPlusModelsSteamProfileLoadNonSteamGamesData* _data_;
	ProtonPlusModelsSteamProfile* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusModelsSteamProfileLoadNonSteamGamesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_models_steam_profile_load_non_steam_games_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_models_steam_profile_load_non_steam_games_co (_data_);
}

static gboolean
proton_plus_models_steam_profile_load_non_steam_games_finish (ProtonPlusModelsSteamProfile* self,
                                                              GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusModelsSteamProfileLoadNonSteamGamesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static gpointer
_proton_plus_utils_vdf_binary_ref0 (gpointer self)
{
	return self ? proton_plus_utils_vdf_binary_ref (self) : NULL;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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;
}

static gboolean
proton_plus_models_steam_profile_load_non_steam_games_co (ProtonPlusModelsSteamProfileLoadNonSteamGamesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	(_data_->self->non_steam_games == NULL) ? NULL : (_data_->self->non_steam_games = (_g_list_free__g_object_unref0_ (_data_->self->non_steam_games), NULL));
	_data_->self->non_steam_games = NULL;
	_data_->_tmp0_ = _data_->self->priv->_shortcuts;
	_data_->_tmp1_ = _proton_plus_utils_vdf_binary_ref0 (_data_->_tmp0_);
	_data_->shortcuts = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->shortcuts;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = FALSE;
		_proton_plus_utils_vdf_binary_unref0 (_data_->shortcuts);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp3_ = _data_->shortcuts;
		_data_->_tmp4_ = proton_plus_utils_vdf_binary_get_nodes ((ProtonPlusUtilsVDFBinary*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp9_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_g_object_unref0 (_data_->_tmp8_);
		_data_->_entry_it = _data_->_tmp10_;
		while (TRUE) {
			_data_->_tmp11_ = _data_->_entry_it;
			if (!gee_iterator_next (_data_->_tmp11_)) {
				break;
			}
			_data_->_tmp12_ = _data_->_entry_it;
			_data_->_tmp13_ = gee_iterator_get (_data_->_tmp12_);
			_data_->entry = (GeeMapEntry*) _data_->_tmp13_;
			_data_->_tmp14_ = _data_->entry;
			_data_->_tmp15_ = gee_map_entry_get_key (_data_->_tmp14_);
			_data_->_tmp16_ = _data_->_tmp15_;
			if (!proton_plus_models_steam_profile_is_shortcut_node_path ((const gchar*) _data_->_tmp16_)) {
				_g_object_unref0 (_data_->entry);
				continue;
			}
			_data_->_tmp17_ = _data_->entry;
			_data_->_tmp18_ = gee_map_entry_get_value (_data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			_data_->_tmp20_ = G_VARIANT_TYPE_INT32;
			_data_->_tmp21_ = proton_plus_models_steam_profile_get_shortcut_field ((ProtonPlusUtilsVDFNode*) _data_->_tmp19_, "appid", _data_->_tmp20_);
			_data_->appid_value = _data_->_tmp21_;
			_data_->_tmp22_ = _data_->entry;
			_data_->_tmp23_ = gee_map_entry_get_value (_data_->_tmp22_);
			_data_->_tmp24_ = _data_->_tmp23_;
			_data_->_tmp25_ = G_VARIANT_TYPE_STRING;
			_data_->_tmp26_ = proton_plus_models_steam_profile_get_shortcut_field ((ProtonPlusUtilsVDFNode*) _data_->_tmp24_, "AppName", _data_->_tmp25_);
			_data_->name_value = _data_->_tmp26_;
			_data_->_tmp27_ = _data_->entry;
			_data_->_tmp28_ = gee_map_entry_get_value (_data_->_tmp27_);
			_data_->_tmp29_ = _data_->_tmp28_;
			_data_->_tmp30_ = G_VARIANT_TYPE_STRING;
			_data_->_tmp31_ = proton_plus_models_steam_profile_get_shortcut_field ((ProtonPlusUtilsVDFNode*) _data_->_tmp29_, "LaunchOptions", _data_->_tmp30_);
			_data_->launch_options_value = _data_->_tmp31_;
			_data_->_tmp34_ = _data_->appid_value;
			if (_data_->_tmp34_ == NULL) {
				_data_->_tmp33_ = TRUE;
			} else {
				_data_->_tmp35_ = _data_->name_value;
				_data_->_tmp33_ = _data_->_tmp35_ == NULL;
			}
			if (_data_->_tmp33_) {
				_data_->_tmp32_ = TRUE;
			} else {
				_data_->_tmp36_ = _data_->launch_options_value;
				_data_->_tmp32_ = _data_->_tmp36_ == NULL;
			}
			if (_data_->_tmp32_) {
				_g_variant_unref0 (_data_->launch_options_value);
				_g_variant_unref0 (_data_->name_value);
				_g_variant_unref0 (_data_->appid_value);
				_g_object_unref0 (_data_->entry);
				continue;
			}
			_data_->_tmp37_ = _data_->appid_value;
			_data_->appid = (guint) g_variant_get_int32 (_data_->_tmp37_);
			_data_->_tmp38_ = _data_->name_value;
			_data_->_tmp39_ = g_variant_get_string (_data_->_tmp38_, NULL);
			_data_->_tmp40_ = g_strdup (_data_->_tmp39_);
			_data_->name = _data_->_tmp40_;
			_data_->_tmp41_ = _data_->name;
			if (g_strcmp0 (_data_->_tmp41_, "ProtonPlus") == 0) {
				_g_free0 (_data_->name);
				_g_variant_unref0 (_data_->launch_options_value);
				_g_variant_unref0 (_data_->name_value);
				_g_variant_unref0 (_data_->appid_value);
				_g_object_unref0 (_data_->entry);
				continue;
			}
			_data_->_tmp42_ = _data_->launch_options_value;
			_data_->_tmp43_ = g_variant_get_string (_data_->_tmp42_, NULL);
			_data_->_tmp44_ = string_replace (_data_->_tmp43_, "\\\"", "\"");
			_data_->launch_options = _data_->_tmp44_;
			_data_->_tmp45_ = _data_->self->priv->_launcher;
			_data_->_tmp46_ = _data_->_tmp45_->compatibility_tool_hashtable;
			_data_->_tmp47_ = g_hash_table_lookup (_data_->_tmp46_, (gpointer) ((guintptr) _data_->appid));
			_data_->_tmp48_ = g_strdup ((const gchar*) _data_->_tmp47_);
			_data_->compatibility_tool = _data_->_tmp48_;
			_data_->_tmp49_ = _data_->compatibility_tool;
			if (_data_->_tmp49_ == NULL) {
				_data_->_tmp50_ = g_strdup ("Default");
				_g_free0 (_data_->compatibility_tool);
				_data_->compatibility_tool = _data_->_tmp50_;
			}
			_data_->_tmp51_ = _data_->name;
			_data_->_tmp52_ = _data_->launch_options;
			_data_->_tmp53_ = _data_->compatibility_tool;
			_data_->_tmp54_ = _data_->self->priv->_launcher;
			_data_->_tmp55_ = proton_plus_models_games_steam_new_non_steam (_data_->appid, _data_->_tmp51_, _data_->_tmp52_, _data_->_tmp53_, _data_->_tmp54_);
			_data_->game = _data_->_tmp55_;
			_data_->_tmp56_ = _data_->game;
			_data_->_tmp57_ = _g_object_ref0 (_data_->_tmp56_);
			_data_->self->non_steam_games = g_list_append (_data_->self->non_steam_games, _data_->_tmp57_);
			_g_object_unref0 (_data_->game);
			_g_free0 (_data_->compatibility_tool);
			_g_free0 (_data_->launch_options);
			_g_free0 (_data_->name);
			_g_variant_unref0 (_data_->launch_options_value);
			_g_variant_unref0 (_data_->name_value);
			_g_variant_unref0 (_data_->appid_value);
			_g_object_unref0 (_data_->entry);
		}
		_g_object_unref0 (_data_->_entry_it);
	}
	_data_->result = TRUE;
	_proton_plus_utils_vdf_binary_unref0 (_data_->shortcuts);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
int_try_parse (const gchar* str,
               gint* _result_,
               const gchar** unparsed,
               guint _base)
{
	gint _vala__result_ = 0;
	const gchar* _vala_unparsed = NULL;
	gchar* endptr = NULL;
	glong long_result = 0L;
	gchar* _tmp0_ = NULL;
	glong _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	glong _tmp6_;
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	errno = 0;
	_tmp1_ = strtol (str, &_tmp0_, (gint) _base);
	endptr = _tmp0_;
	long_result = _tmp1_;
	_tmp2_ = endptr;
	_tmp3_ = strlen (str);
	_tmp4_ = _tmp3_;
	if (_tmp2_ == (((gchar*) str) + _tmp4_)) {
		_vala_unparsed = "";
	} else {
		gchar* _tmp5_;
		_tmp5_ = endptr;
		_vala_unparsed = (const gchar*) _tmp5_;
	}
	_tmp6_ = long_result;
	if ((((glong) G_MININT) <= _tmp6_) && (_tmp6_ <= ((glong) G_MAXINT))) {
		gboolean _tmp7_ = FALSE;
		gboolean _tmp8_ = FALSE;
		_vala__result_ = (gint) long_result;
		if (errno != ERANGE) {
			_tmp8_ = errno != EINVAL;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			const gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp9_ = _vala_unparsed;
			_tmp10_ = endptr;
			_tmp7_ = _tmp9_ != _tmp10_;
		} else {
			_tmp7_ = FALSE;
		}
		result = _tmp7_;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	} else {
		_vala__result_ = G_MAXINT;
		result = FALSE;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	}
}

static gboolean
proton_plus_models_steam_profile_is_shortcut_node_path (const gchar* path)
{
	gchar** components = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint components_length1;
	gint _components_size_;
	gint id = 0;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gboolean result;
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp1_ = _tmp0_ = g_strsplit (path, ".", 0);
	components = _tmp1_;
	components_length1 = _vala_array_length (_tmp0_);
	_components_size_ = components_length1;
	id = -1;
	_tmp5_ = components;
	_tmp5__length1 = components_length1;
	if (_tmp5__length1 == 2) {
		gchar** _tmp6_;
		gint _tmp6__length1;
		const gchar* _tmp7_;
		_tmp6_ = components;
		_tmp6__length1 = components_length1;
		_tmp7_ = _tmp6_[0];
		_tmp4_ = g_strcmp0 (_tmp7_, "shortcuts") == 0;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		gchar** _tmp8_;
		gint _tmp8__length1;
		const gchar* _tmp9_;
		gint _tmp10_ = 0;
		gboolean _tmp11_;
		_tmp8_ = components;
		_tmp8__length1 = components_length1;
		_tmp9_ = _tmp8_[1];
		_tmp11_ = int_try_parse (_tmp9_, &_tmp10_, NULL, (guint) 0);
		id = _tmp10_;
		_tmp3_ = _tmp11_;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = id >= 0;
	} else {
		_tmp2_ = FALSE;
	}
	result = _tmp2_;
	components = (_vala_array_free (components, components_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

static GVariant*
proton_plus_models_steam_profile_get_shortcut_field (ProtonPlusUtilsVDFNode* node,
                                                     const gchar* name,
                                                     const GVariantType* type)
{
	GVariant* value = NULL;
	gpointer _tmp0_;
	GVariant* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GVariant* _tmp3_;
	GVariant* _tmp6_;
	GVariant* result;
	g_return_val_if_fail (node != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (type != NULL, NULL);
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) node, name)) {
		result = NULL;
		return result;
	}
	_tmp0_ = gee_abstract_map_get ((GeeAbstractMap*) node, name);
	value = (GVariant*) _tmp0_;
	_tmp3_ = value;
	if (_tmp3_ != NULL) {
		GVariant* _tmp4_;
		_tmp4_ = value;
		_tmp2_ = g_variant_is_of_type (_tmp4_, type);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GVariant* _tmp5_;
		_tmp5_ = value;
		_tmp1_ = _tmp5_;
	} else {
		_tmp1_ = NULL;
	}
	_tmp6_ = _g_variant_ref0 (_tmp1_);
	result = _tmp6_;
	_g_variant_unref0 (value);
	return result;
}

static gint64
int64_parse (const gchar* str,
             guint _base)
{
	gint64 result;
	g_return_val_if_fail (str != NULL, -1LL);
	result = g_ascii_strtoll (str, NULL, _base);
	return result;
}

static gchar*
double_to_string (gdouble self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint _tmp1__length1;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = G_ASCII_DTOSTR_BUF_SIZE;
	_tmp2_ = g_ascii_dtostr (_tmp1_, (gint) G_ASCII_DTOSTR_BUF_SIZE, self);
	_tmp3_ = g_strdup (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp1_ = (g_free (_tmp1_), NULL);
	result = _tmp4_;
	return result;
}

static gchar*
proton_plus_models_steam_profile_steam_id_to_account_id (const gchar* steam_id)
{
	gchar* steam_id2 = NULL;
	gchar* _tmp0_;
	gint64 steam_id2_account = 0LL;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar** steam_id2_split = NULL;
	const gchar* _tmp9_;
	gchar** _tmp10_;
	gchar** _tmp11_;
	gint steam_id2_split_length1;
	gint _steam_id2_split_size_;
	gchar* steam_id3 = NULL;
	gchar* _tmp12_;
	gint y = 0;
	const gchar* _tmp13_;
	gint z = 0;
	const gchar* _tmp14_;
	gint account_id = 0;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* result;
	g_return_val_if_fail (steam_id != NULL, NULL);
	_tmp0_ = g_strdup ("STEAM_0:");
	steam_id2 = _tmp0_;
	steam_id2_account = int64_parse (steam_id, (guint) 0) - PROTON_PLUS_MODELS_STEAM_PROFILE_steamid64ident;
	if ((steam_id2_account % 2) == ((gint64) 0)) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = steam_id2;
		_tmp2_ = g_strconcat (_tmp1_, "0:", NULL);
		_g_free0 (steam_id2);
		steam_id2 = _tmp2_;
	} else {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = steam_id2;
		_tmp4_ = g_strconcat (_tmp3_, "1:", NULL);
		_g_free0 (steam_id2);
		steam_id2 = _tmp4_;
	}
	_tmp5_ = steam_id2;
	_tmp6_ = double_to_string (floor ((gdouble) (steam_id2_account / 2)));
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strconcat (_tmp5_, _tmp7_, NULL);
	_g_free0 (steam_id2);
	steam_id2 = _tmp8_;
	_g_free0 (_tmp7_);
	_tmp9_ = steam_id2;
	_tmp11_ = _tmp10_ = g_strsplit (_tmp9_, ":", 0);
	steam_id2_split = _tmp11_;
	steam_id2_split_length1 = _vala_array_length (_tmp10_);
	_steam_id2_split_size_ = steam_id2_split_length1;
	_tmp12_ = g_strdup ("[U:1:");
	steam_id3 = _tmp12_;
	_tmp13_ = steam_id2_split[1];
	y = atoi (_tmp13_);
	_tmp14_ = steam_id2_split[2];
	z = atoi (_tmp14_);
	account_id = (z * 2) + y;
	_tmp15_ = steam_id3;
	_tmp16_ = g_strdup_printf ("%i]", account_id);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strconcat (_tmp15_, _tmp17_, NULL);
	_g_free0 (steam_id3);
	steam_id3 = _tmp18_;
	_g_free0 (_tmp17_);
	_tmp19_ = g_strdup_printf ("%i", account_id);
	result = _tmp19_;
	_g_free0 (steam_id3);
	steam_id2_split = (_vala_array_free (steam_id2_split, steam_id2_split_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (steam_id2);
	return result;
}

GList*
proton_plus_models_steam_profile_get_profiles (ProtonPlusModelsLaunchersSteam* launcher)
{
	GList* profiles = NULL;
	gchar* path = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* content = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	ProtonPlusUtilsVDFVdfDocument* document = NULL;
	const gchar* _tmp7_;
	ProtonPlusUtilsVDFVdfDocument* _tmp8_;
	ProtonPlusUtilsVDFVdfDocument* _tmp9_;
	ProtonPlusUtilsVDFVdfEntry* users = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp10_;
	ProtonPlusUtilsVDFVdfEntry* _tmp11_;
	ProtonPlusUtilsVDFVdfEntry* _tmp12_;
	ProtonPlusUtilsVDFVdfEntry* _tmp13_;
	ProtonPlusUtilsVDFVdfEntry* _tmp14_;
	GHashTable* userdata_hashtable = NULL;
	GHashTable* _tmp15_;
	GList* result;
	g_return_val_if_fail (launcher != NULL, NULL);
	profiles = NULL;
	_tmp0_ = ((ProtonPlusModelsLauncher*) launcher)->directory;
	_tmp1_ = g_strdup_printf ("%s/config/loginusers.vdf", _tmp0_);
	path = _tmp1_;
	_tmp2_ = path;
	_tmp3_ = proton_plus_utils_filesystem_get_file_content (_tmp2_, FALSE);
	content = _tmp3_;
	_tmp4_ = content;
	_tmp5_ = strlen (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == 0) {
		result = profiles;
		_g_free0 (content);
		_g_free0 (path);
		return result;
	}
	_tmp7_ = content;
	_tmp8_ = proton_plus_utils_vdf_vdf_parser_parse_document (_tmp7_);
	document = _tmp8_;
	_tmp9_ = document;
	if (_tmp9_ == NULL) {
		result = profiles;
		_g_object_unref0 (document);
		_g_free0 (content);
		_g_free0 (path);
		return result;
	}
	_tmp10_ = document;
	_tmp11_ = proton_plus_utils_vdf_vdf_document_get_root (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp12_, "users");
	users = _tmp13_;
	_tmp14_ = users;
	if (_tmp14_ == NULL) {
		result = profiles;
		_g_object_unref0 (users);
		_g_object_unref0 (document);
		_g_free0 (content);
		_g_free0 (path);
		return result;
	}
	_tmp15_ = proton_plus_models_steam_profile_get_userdata_hashtable (launcher);
	userdata_hashtable = _tmp15_;
	{
		GeeArrayList* _user_list = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp16_;
		GeeArrayList* _tmp17_;
		GeeArrayList* _tmp18_;
		gint _user_size = 0;
		GeeArrayList* _tmp19_;
		gint _tmp20_;
		gint _tmp21_;
		gint _user_index = 0;
		_tmp16_ = users;
		_tmp17_ = proton_plus_utils_vdf_vdf_entry_get_children (_tmp16_);
		_tmp18_ = _tmp17_;
		_user_list = _tmp18_;
		_tmp19_ = _user_list;
		_tmp20_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp19_);
		_tmp21_ = _tmp20_;
		_user_size = _tmp21_;
		_user_index = -1;
		while (TRUE) {
			gint _tmp22_;
			gint _tmp23_;
			ProtonPlusUtilsVDFVdfEntry* user = NULL;
			GeeArrayList* _tmp24_;
			gpointer _tmp25_;
			ProtonPlusUtilsVDFVdfEntry* persona_name = NULL;
			ProtonPlusUtilsVDFVdfEntry* _tmp26_;
			ProtonPlusUtilsVDFVdfEntry* _tmp27_;
			gboolean _tmp28_ = FALSE;
			ProtonPlusUtilsVDFVdfEntry* _tmp29_;
			gchar* userdata_path = NULL;
			GHashTable* _tmp33_;
			ProtonPlusUtilsVDFVdfEntry* _tmp34_;
			const gchar* _tmp35_;
			const gchar* _tmp36_;
			gconstpointer _tmp37_;
			gchar* _tmp38_;
			const gchar* _tmp39_;
			ProtonPlusModelsSteamProfile* profile = NULL;
			ProtonPlusUtilsVDFVdfEntry* _tmp40_;
			const gchar* _tmp41_;
			const gchar* _tmp42_;
			ProtonPlusUtilsVDFVdfEntry* _tmp43_;
			const gchar* _tmp44_;
			const gchar* _tmp45_;
			const gchar* _tmp46_;
			ProtonPlusModelsSteamProfile* _tmp47_;
			ProtonPlusModelsSteamProfile* _tmp48_;
			ProtonPlusModelsSteamProfile* _tmp49_;
			_user_index = _user_index + 1;
			_tmp22_ = _user_index;
			_tmp23_ = _user_size;
			if (!(_tmp22_ < _tmp23_)) {
				break;
			}
			_tmp24_ = _user_list;
			_tmp25_ = gee_abstract_list_get ((GeeAbstractList*) _tmp24_, _user_index);
			user = (ProtonPlusUtilsVDFVdfEntry*) _tmp25_;
			_tmp26_ = user;
			_tmp27_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp26_, "PersonaName");
			persona_name = _tmp27_;
			_tmp29_ = persona_name;
			if (_tmp29_ == NULL) {
				_tmp28_ = TRUE;
			} else {
				ProtonPlusUtilsVDFVdfEntry* _tmp30_;
				const gchar* _tmp31_;
				const gchar* _tmp32_;
				_tmp30_ = persona_name;
				_tmp31_ = proton_plus_utils_vdf_vdf_entry_get_value (_tmp30_);
				_tmp32_ = _tmp31_;
				_tmp28_ = _tmp32_ == NULL;
			}
			if (_tmp28_) {
				_g_object_unref0 (persona_name);
				_g_object_unref0 (user);
				continue;
			}
			_tmp33_ = userdata_hashtable;
			_tmp34_ = user;
			_tmp35_ = proton_plus_utils_vdf_vdf_entry_get_key (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = g_hash_table_lookup (_tmp33_, _tmp36_);
			_tmp38_ = g_strdup ((const gchar*) _tmp37_);
			userdata_path = _tmp38_;
			_tmp39_ = userdata_path;
			if (_tmp39_ == NULL) {
				_g_free0 (userdata_path);
				_g_object_unref0 (persona_name);
				_g_object_unref0 (user);
				continue;
			}
			_tmp40_ = persona_name;
			_tmp41_ = proton_plus_utils_vdf_vdf_entry_get_value (_tmp40_);
			_tmp42_ = _tmp41_;
			_tmp43_ = user;
			_tmp44_ = proton_plus_utils_vdf_vdf_entry_get_key (_tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = userdata_path;
			_tmp47_ = proton_plus_models_steam_profile_new (launcher, _tmp42_, _tmp45_, _tmp46_);
			profile = _tmp47_;
			_tmp48_ = profile;
			_tmp49_ = _g_object_ref0 (_tmp48_);
			profiles = g_list_append (profiles, _tmp49_);
			_g_object_unref0 (profile);
			_g_free0 (userdata_path);
			_g_object_unref0 (persona_name);
			_g_object_unref0 (user);
		}
	}
	result = profiles;
	_g_hash_table_unref0 (userdata_hashtable);
	_g_object_unref0 (users);
	_g_object_unref0 (document);
	_g_free0 (content);
	_g_free0 (path);
	return result;
}

static gboolean
int64_try_parse (const gchar* str,
                 gint64* _result_,
                 const gchar** unparsed,
                 guint _base)
{
	gint64 _vala__result_ = 0LL;
	const gchar* _vala_unparsed = NULL;
	gchar* endptr = NULL;
	gchar* _tmp0_ = NULL;
	gint64 _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	errno = 0;
	_tmp1_ = g_ascii_strtoll (str, &_tmp0_, _base);
	endptr = _tmp0_;
	_vala__result_ = _tmp1_;
	_tmp2_ = endptr;
	_tmp3_ = strlen (str);
	_tmp4_ = _tmp3_;
	if (_tmp2_ == (((gchar*) str) + _tmp4_)) {
		gboolean _tmp5_ = FALSE;
		_vala_unparsed = "";
		if (errno != ERANGE) {
			_tmp5_ = errno != EINVAL;
		} else {
			_tmp5_ = FALSE;
		}
		result = _tmp5_;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	} else {
		gchar* _tmp6_;
		_tmp6_ = endptr;
		_vala_unparsed = (const gchar*) _tmp6_;
		result = FALSE;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	}
}

static GHashTable*
proton_plus_models_steam_profile_get_userdata_hashtable (ProtonPlusModelsLaunchersSteam* launcher)
{
	GHashTable* userdata_hashtable = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GError* _inner_error0_ = NULL;
	GHashTable* result;
	g_return_val_if_fail (launcher != NULL, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
	userdata_hashtable = _tmp2_;
	{
		gchar* userdata_path = NULL;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp3_ = ((ProtonPlusModelsLauncher*) launcher)->directory;
		_tmp4_ = g_strdup_printf ("%s/userdata", _tmp3_);
		userdata_path = _tmp4_;
		_tmp5_ = userdata_path;
		if (g_file_test (_tmp5_, G_FILE_TEST_IS_DIR)) {
			GDir* directory = NULL;
			const gchar* _tmp6_;
			GDir* _tmp7_;
			gchar* dir = NULL;
			_tmp6_ = userdata_path;
			_tmp7_ = g_dir_open (_tmp6_, (guint) 0, &_inner_error0_);
			directory = _tmp7_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (userdata_path);
				goto __catch0_g_error;
			}
			while (TRUE) {
				GDir* _tmp8_;
				const gchar* _tmp9_;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				gboolean _tmp12_ = FALSE;
				const gchar* _tmp13_;
				_tmp8_ = directory;
				_tmp9_ = g_dir_read_name (_tmp8_);
				_tmp10_ = g_strdup (_tmp9_);
				_g_free0 (dir);
				dir = _tmp10_;
				_tmp11_ = dir;
				if (!(_tmp11_ != NULL)) {
					break;
				}
				_tmp13_ = dir;
				if (g_strcmp0 (_tmp13_, ".") != 0) {
					const gchar* _tmp14_;
					_tmp14_ = dir;
					_tmp12_ = g_strcmp0 (_tmp14_, "..") != 0;
				} else {
					_tmp12_ = FALSE;
				}
				if (_tmp12_) {
					gint64 account_id = 0LL;
					gboolean _tmp15_ = FALSE;
					gboolean _tmp16_ = FALSE;
					const gchar* _tmp17_;
					gint64 _tmp18_ = 0LL;
					gboolean _tmp19_;
					GFile* file = NULL;
					const gchar* _tmp20_;
					gchar* _tmp21_;
					gchar* _tmp22_;
					const gchar* _tmp23_;
					gchar* _tmp24_;
					gchar* _tmp25_;
					GFile* _tmp26_;
					GFile* _tmp27_;
					GFile* _tmp28_;
					_tmp17_ = dir;
					_tmp19_ = int64_try_parse (_tmp17_, &_tmp18_, NULL, (guint) 0);
					account_id = _tmp18_;
					if (!_tmp19_) {
						_tmp16_ = TRUE;
					} else {
						_tmp16_ = account_id < ((gint64) 0);
					}
					if (_tmp16_) {
						_tmp15_ = TRUE;
					} else {
						_tmp15_ = account_id > (G_MAXINT64 - PROTON_PLUS_MODELS_STEAM_PROFILE_steamid64ident);
					}
					if (_tmp15_) {
						continue;
					}
					_tmp20_ = userdata_path;
					_tmp21_ = g_strconcat (_tmp20_, "/", NULL);
					_tmp22_ = _tmp21_;
					_tmp23_ = dir;
					_tmp24_ = g_strconcat (_tmp22_, _tmp23_, NULL);
					_tmp25_ = _tmp24_;
					_tmp26_ = g_file_new_for_path (_tmp25_);
					_tmp27_ = _tmp26_;
					_g_free0 (_tmp25_);
					_g_free0 (_tmp22_);
					file = _tmp27_;
					_tmp28_ = file;
					if (g_file_query_file_type (_tmp28_, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY) {
						GHashTable* _tmp29_;
						gchar* _tmp30_;
						GFile* _tmp31_;
						gchar* _tmp32_;
						_tmp29_ = userdata_hashtable;
						_tmp30_ = g_strdup_printf ("%" G_GINT64_FORMAT, account_id + PROTON_PLUS_MODELS_STEAM_PROFILE_steamid64ident);
						_tmp31_ = file;
						_tmp32_ = g_file_get_path (_tmp31_);
						g_hash_table_insert (_tmp29_, _tmp30_, _tmp32_);
					}
					_g_object_unref0 (file);
				}
			}
			_g_free0 (dir);
			_g_dir_close0 (directory);
		}
		_g_free0 (userdata_path);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp33_;
		const gchar* _tmp34_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp33_ = e;
		_tmp34_ = _tmp33_->message;
		g_warning ("steam-profile.vala:237: %s", _tmp34_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_hash_table_unref0 (userdata_hashtable);
		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;
	}
	result = userdata_hashtable;
	return result;
}

ProtonPlusModelsLaunchersSteam*
proton_plus_models_steam_profile_get_launcher (ProtonPlusModelsSteamProfile* self)
{
	ProtonPlusModelsLaunchersSteam* result;
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launcher;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_launcher (ProtonPlusModelsSteamProfile* self,
                                               ProtonPlusModelsLaunchersSteam* value)
{
	ProtonPlusModelsLaunchersSteam* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_launcher (self);
	if (old_value != value) {
		ProtonPlusModelsLaunchersSteam* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_launcher);
		self->priv->_launcher = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_LAUNCHER_PROPERTY]);
	}
}

const gchar*
proton_plus_models_steam_profile_get_userdata_path (ProtonPlusModelsSteamProfile* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_userdata_path;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_userdata_path (ProtonPlusModelsSteamProfile* self,
                                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_userdata_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_userdata_path);
		self->priv->_userdata_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_USERDATA_PATH_PROPERTY]);
	}
}

const gchar*
proton_plus_models_steam_profile_get_localconfig_path (ProtonPlusModelsSteamProfile* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_localconfig_path;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_localconfig_path (ProtonPlusModelsSteamProfile* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_localconfig_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_localconfig_path);
		self->priv->_localconfig_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_LOCALCONFIG_PATH_PROPERTY]);
	}
}

ProtonPlusUtilsVDFShortcuts*
proton_plus_models_steam_profile_get_shortcuts (ProtonPlusModelsSteamProfile* self)
{
	ProtonPlusUtilsVDFShortcuts* result;
	ProtonPlusUtilsVDFShortcuts* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_shortcuts;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_shortcuts (ProtonPlusModelsSteamProfile* self,
                                                ProtonPlusUtilsVDFShortcuts* value)
{
	ProtonPlusUtilsVDFShortcuts* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_shortcuts (self);
	if (old_value != value) {
		ProtonPlusUtilsVDFShortcuts* _tmp0_;
		_tmp0_ = _proton_plus_utils_vdf_binary_ref0 (value);
		_proton_plus_utils_vdf_binary_unref0 (self->priv->_shortcuts);
		self->priv->_shortcuts = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_SHORTCUTS_PROPERTY]);
	}
}

const gchar*
proton_plus_models_steam_profile_get_steam_id (ProtonPlusModelsSteamProfile* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_steam_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_steam_id (ProtonPlusModelsSteamProfile* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_steam_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_steam_id);
		self->priv->_steam_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_STEAM_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_models_steam_profile_get_account_id (ProtonPlusModelsSteamProfile* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_account_id (ProtonPlusModelsSteamProfile* self,
                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_account_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_account_id);
		self->priv->_account_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_ACCOUNT_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_models_steam_profile_get_username (ProtonPlusModelsSteamProfile* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_username;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_username (ProtonPlusModelsSteamProfile* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_username (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_username);
		self->priv->_username = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_USERNAME_PROPERTY]);
	}
}

const gchar*
proton_plus_models_steam_profile_get_image_path (ProtonPlusModelsSteamProfile* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_image_path;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_image_path (ProtonPlusModelsSteamProfile* self,
                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_image_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_image_path);
		self->priv->_image_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_IMAGE_PATH_PROPERTY]);
	}
}

const gchar*
proton_plus_models_steam_profile_get_default_compatibility_tool (ProtonPlusModelsSteamProfile* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_default_compatibility_tool;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_steam_profile_set_default_compatibility_tool (ProtonPlusModelsSteamProfile* self,
                                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_steam_profile_get_default_compatibility_tool (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_default_compatibility_tool);
		self->priv->_default_compatibility_tool = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_DEFAULT_COMPATIBILITY_TOOL_PROPERTY]);
	}
}

static void
proton_plus_models_steam_profile_class_init (ProtonPlusModelsSteamProfileClass * klass,
                                             gpointer klass_data)
{
	proton_plus_models_steam_profile_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsSteamProfile_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_steam_profile_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_steam_profile_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_models_steam_profile_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_LAUNCHER_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_LAUNCHER_PROPERTY] = g_param_spec_object ("launcher", "launcher", "launcher", PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_USERDATA_PATH_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_USERDATA_PATH_PROPERTY] = g_param_spec_string ("userdata-path", "userdata-path", "userdata-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_LOCALCONFIG_PATH_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_LOCALCONFIG_PATH_PROPERTY] = g_param_spec_string ("localconfig-path", "localconfig-path", "localconfig-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_SHORTCUTS_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_SHORTCUTS_PROPERTY] = proton_plus_utils_vdf_param_spec_binary ("shortcuts", "shortcuts", "shortcuts", PROTON_PLUS_UTILS_VDF_TYPE_SHORTCUTS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_STEAM_ID_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_STEAM_ID_PROPERTY] = g_param_spec_string ("steam-id", "steam-id", "steam-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_ACCOUNT_ID_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_ACCOUNT_ID_PROPERTY] = g_param_spec_string ("account-id", "account-id", "account-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_USERNAME_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_USERNAME_PROPERTY] = g_param_spec_string ("username", "username", "username", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_IMAGE_PATH_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_IMAGE_PATH_PROPERTY] = g_param_spec_string ("image-path", "image-path", "image-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_STEAM_PROFILE_DEFAULT_COMPATIBILITY_TOOL_PROPERTY, proton_plus_models_steam_profile_properties[PROTON_PLUS_MODELS_STEAM_PROFILE_DEFAULT_COMPATIBILITY_TOOL_PROPERTY] = g_param_spec_string ("default-compatibility-tool", "default-compatibility-tool", "default-compatibility-tool", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_models_steam_profile_instance_init (ProtonPlusModelsSteamProfile * self,
                                                gpointer klass)
{
	self->priv = proton_plus_models_steam_profile_get_instance_private (self);
}

static void
proton_plus_models_steam_profile_finalize (GObject * obj)
{
	ProtonPlusModelsSteamProfile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfile);
	_g_object_unref0 (self->priv->_launcher);
	_g_free0 (self->priv->_userdata_path);
	_g_free0 (self->priv->_localconfig_path);
	_proton_plus_utils_vdf_binary_unref0 (self->priv->_shortcuts);
	_g_free0 (self->priv->_steam_id);
	_g_free0 (self->priv->_account_id);
	_g_free0 (self->priv->_username);
	_g_free0 (self->priv->_image_path);
	_g_free0 (self->priv->_default_compatibility_tool);
	_g_hash_table_unref0 (self->launch_options_hashtable);
	(self->non_steam_games == NULL) ? NULL : (self->non_steam_games = (_g_list_free__g_object_unref0_ (self->non_steam_games), NULL));
	G_OBJECT_CLASS (proton_plus_models_steam_profile_parent_class)->finalize (obj);
}

static GType
proton_plus_models_steam_profile_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsSteamProfileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_steam_profile_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsSteamProfile), 0, (GInstanceInitFunc) proton_plus_models_steam_profile_instance_init, NULL };
	GType proton_plus_models_steam_profile_type_id;
	proton_plus_models_steam_profile_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusModelsSteamProfile", &g_define_type_info, 0);
	ProtonPlusModelsSteamProfile_private_offset = g_type_add_instance_private (proton_plus_models_steam_profile_type_id, sizeof (ProtonPlusModelsSteamProfilePrivate));
	return proton_plus_models_steam_profile_type_id;
}

GType
proton_plus_models_steam_profile_get_type (void)
{
	static volatile gsize proton_plus_models_steam_profile_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_steam_profile_type_id__once)) {
		GType proton_plus_models_steam_profile_type_id;
		proton_plus_models_steam_profile_type_id = proton_plus_models_steam_profile_get_type_once ();
		g_once_init_leave (&proton_plus_models_steam_profile_type_id__once, proton_plus_models_steam_profile_type_id);
	}
	return proton_plus_models_steam_profile_type_id__once;
}

static void
_vala_proton_plus_models_steam_profile_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	ProtonPlusModelsSteamProfile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfile);
	switch (property_id) {
		case PROTON_PLUS_MODELS_STEAM_PROFILE_LAUNCHER_PROPERTY:
		g_value_set_object (value, proton_plus_models_steam_profile_get_launcher (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_USERDATA_PATH_PROPERTY:
		g_value_set_string (value, proton_plus_models_steam_profile_get_userdata_path (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_LOCALCONFIG_PATH_PROPERTY:
		g_value_set_string (value, proton_plus_models_steam_profile_get_localconfig_path (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_SHORTCUTS_PROPERTY:
		proton_plus_utils_vdf_value_set_binary (value, proton_plus_models_steam_profile_get_shortcuts (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_STEAM_ID_PROPERTY:
		g_value_set_string (value, proton_plus_models_steam_profile_get_steam_id (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_ACCOUNT_ID_PROPERTY:
		g_value_set_string (value, proton_plus_models_steam_profile_get_account_id (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_USERNAME_PROPERTY:
		g_value_set_string (value, proton_plus_models_steam_profile_get_username (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_IMAGE_PATH_PROPERTY:
		g_value_set_string (value, proton_plus_models_steam_profile_get_image_path (self));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_DEFAULT_COMPATIBILITY_TOOL_PROPERTY:
		g_value_set_string (value, proton_plus_models_steam_profile_get_default_compatibility_tool (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_steam_profile_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	ProtonPlusModelsSteamProfile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfile);
	switch (property_id) {
		case PROTON_PLUS_MODELS_STEAM_PROFILE_LAUNCHER_PROPERTY:
		proton_plus_models_steam_profile_set_launcher (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_USERDATA_PATH_PROPERTY:
		proton_plus_models_steam_profile_set_userdata_path (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_LOCALCONFIG_PATH_PROPERTY:
		proton_plus_models_steam_profile_set_localconfig_path (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_SHORTCUTS_PROPERTY:
		proton_plus_models_steam_profile_set_shortcuts (self, proton_plus_utils_vdf_value_get_binary (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_STEAM_ID_PROPERTY:
		proton_plus_models_steam_profile_set_steam_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_ACCOUNT_ID_PROPERTY:
		proton_plus_models_steam_profile_set_account_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_USERNAME_PROPERTY:
		proton_plus_models_steam_profile_set_username (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_IMAGE_PATH_PROPERTY:
		proton_plus_models_steam_profile_set_image_path (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_STEAM_PROFILE_DEFAULT_COMPATIBILITY_TOOL_PROPERTY:
		proton_plus_models_steam_profile_set_default_compatibility_tool (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

